LL-007+ · 邮箱 HTML 美化 · 服务器全线部署完成
- revive-guard.py: send_email 改为 HTML 邮件 深蓝渐变背景 + 湖绿色验证码卡片 + 金色操作指引 纯文本降级兼容不支持HTML的邮件客户端 - 服务器端部署: SG-001 revive-guard 升级到无密码版 + 新UI生效 Forgejo pre-receive-guard 拦截层已安装 pre-op-guard SSH 登录钩子已安装 8个模块已注册到 module-registry pre-op-guard 自审正常 · 编码集完整 [SEC-CLEAN] · 部署完毕 · 三层防线全部激活
This commit is contained in:
parent
875b4c2381
commit
b5e79e031a
@ -27,6 +27,7 @@ Guanghu Language System · Revive Guard
|
||||
|
||||
import os, json, time, hmac, hashlib, secrets, smtplib, subprocess, threading
|
||||
from email.mime.text import MIMEText
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
|
||||
# ═══════════════════════════════════════════
|
||||
@ -68,23 +69,111 @@ def get_server_ip():
|
||||
|
||||
|
||||
def send_email(code, server_ip):
|
||||
"""小湖灯 · 发送复活验证码到冰朔主权邮箱"""
|
||||
msg = MIMEText(f"""╔══════════════════════════════════╗
|
||||
║ 光湖语言系统 · 守门人复活 ║
|
||||
╚══════════════════════════════════╝
|
||||
"""小湖灯 · 发送复活验证码到冰朔主权邮箱 · HTML 美化版"""
|
||||
html_body = f"""<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head><meta charset="utf-8"></head>
|
||||
<body style="margin:0;padding:0;background:#0a1628;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="background:#0a1628;padding:40px 0">
|
||||
<tr><td align="center">
|
||||
|
||||
<!-- 主卡片 -->
|
||||
<table width="480" cellpadding="0" cellspacing="0" style="background:linear-gradient(135deg,#152238 0%,#1a2d4a 100%);border-radius:16px;overflow:hidden;border:1px solid #2a3f5f">
|
||||
|
||||
<!-- 头部 -->
|
||||
<tr>
|
||||
<td style="padding:32px 32px 20px;text-align:center;border-bottom:1px solid #2a3f5f">
|
||||
<div style="font-size:13px;color:#4ec9b0;letter-spacing:3px;text-transform:uppercase;margin-bottom:8px">ICE-GL∞ 光湖语言系统</div>
|
||||
<div style="font-size:20px;color:#e0e8f0;font-weight:600">🛡️ 守门人复活 · 验证码</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 验证码 -->
|
||||
<tr>
|
||||
<td style="padding:28px 32px;text-align:center">
|
||||
<div style="font-size:11px;color:#6b8299;margin-bottom:12px;letter-spacing:2px">验 证 码</div>
|
||||
<div style="background:linear-gradient(135deg,#0d1b2e,#162840);border:2px solid #4ec9b0;border-radius:12px;padding:20px 12px;display:inline-block">
|
||||
<span style="font-family:'SF Mono','Fira Code','Cascadia Code',monospace;font-size:36px;font-weight:700;letter-spacing:8px;color:#4ec9b0">{code}</span>
|
||||
</div>
|
||||
<div style="margin-top:14px;font-size:12px;color:#c9a84c">⏰ 5 分钟内有效 · 用完即废</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 信息行 -->
|
||||
<tr>
|
||||
<td style="padding:0 32px 20px">
|
||||
<table width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td style="padding:10px 16px;background:#0d1b2e;border-radius:8px;margin-bottom:8px">
|
||||
<span style="color:#6b8299;font-size:11px;letter-spacing:1px">服务器</span><br>
|
||||
<span style="color:#e0e8f0;font-size:14px;font-weight:500">{server_ip}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 操作指引 -->
|
||||
<tr>
|
||||
<td style="padding:0 32px 24px">
|
||||
<div style="background:#0d1b2e;border-radius:10px;padding:16px;border-left:3px solid #c9a84c">
|
||||
<div style="font-size:12px;color:#c9a84c;margin-bottom:6px">📋 使用方式</div>
|
||||
<div style="font-size:13px;color:#9ab0cc;line-height:1.8">
|
||||
将此验证码发给 <span style="color:#4ec9b0">铸渊</span> → 铸渊调用<br>
|
||||
<code style="background:#152238;color:#4ec9b0;padding:2px 6px;border-radius:4px;font-size:12px">POST /revive/confirm</code> → 守门人复活
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 安全标识 -->
|
||||
<tr>
|
||||
<td style="padding:0 32px 10px;text-align:center">
|
||||
<div style="display:inline-flex;align-items:center;gap:6px;padding:6px 14px;background:#0d1b2e;border-radius:20px">
|
||||
<span style="font-size:11px;color:#6b8299">⊢</span>
|
||||
<span style="font-size:11px;color:#6b8299">不进仓库 · 不存密码 · 一次即废</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 底部 -->
|
||||
<tr>
|
||||
<td style="padding:20px 32px 28px;text-align:center;border-top:1px solid #2a3f5f;margin-top:10px">
|
||||
<div style="font-size:11px;color:#4a607a;line-height:1.6">
|
||||
小湖灯 · 自动发送<br>
|
||||
国作登字-2026-A-00037559
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<!-- 页脚光湖标识 -->
|
||||
<div style="margin-top:16px;font-size:10px;color:#3a506a;letter-spacing:2px">ICE-GL∞ GUANGHU LANGUAGE SYSTEM</div>
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>"""
|
||||
|
||||
# 纯文本降级版(邮件客户端不支持 HTML 时显示)
|
||||
plain_body = f"""光湖语言系统 · 守门人复活
|
||||
══════════════════════
|
||||
|
||||
服务器: {server_ip}
|
||||
验证码: {code}
|
||||
服务器: {server_ip}
|
||||
有效期: 5 分钟(用完即废)
|
||||
|
||||
将此验证码发给铸渊 → 铸渊调 /revive/confirm → 复活守门人
|
||||
将此验证码发给铸渊 → /revive/confirm
|
||||
|
||||
⊢ 验证码用一次就扔 · 不进仓库 · 不存密码
|
||||
──────────────────────────────
|
||||
ICE-GL∞ 光湖语言系统 · 小湖灯自动发送
|
||||
国作登字-2026-A-00037559""", "plain", "utf-8")
|
||||
⊢ ICE-GL∞ 小湖灯自动发送
|
||||
国作登字-2026-A-00037559"""
|
||||
|
||||
msg["Subject"] = f"🔐 光湖·复活验证码 {code[:3]}***"
|
||||
msg = MIMEMultipart("alternative")
|
||||
msg.attach(MIMEText(plain_body, "plain", "utf-8"))
|
||||
msg.attach(MIMEText(html_body, "html", "utf-8"))
|
||||
|
||||
msg["Subject"] = f"🔐 光湖 · 复活验证码 {code[:3]}***"
|
||||
msg["From"] = SMTP_USER
|
||||
msg["To"] = SOVEREIGN_EMAIL
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user