From 638dcce40267bd0290b6bafeb837f82f7dde5341 Mon Sep 17 00:00:00 2001 From: Nei-Xin <128169338+Nei-Xin@users.noreply.github.com> Date: Sat, 22 Nov 2025 13:47:54 +0800 Subject: [PATCH] update --- Dockerfile | 3 + internal/httpapi/http.go | 1417 ++++++++++++++------------------------ static/favicon.svg | 1 + 3 files changed, 528 insertions(+), 893 deletions(-) create mode 100644 static/favicon.svg diff --git a/Dockerfile b/Dockerfile index 07c51d8..45c4243 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,9 @@ WORKDIR /app # 从构建阶段复制二进制文件 COPY --from=builder /build/temp-mail /app/temp-mail +# 复制静态文件 +COPY --from=builder /build/static /app/static + # 设置文件权限 RUN chmod +x /app/temp-mail diff --git a/internal/httpapi/http.go b/internal/httpapi/http.go index 9d3870b..e9b59ca 100644 --- a/internal/httpapi/http.go +++ b/internal/httpapi/http.go @@ -18,6 +18,10 @@ import ( func NewMux(store storage.Store, domain string, smtpClient *smtpclient.Client) http.Handler { mux := http.NewServeMux() + + // Static files + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) + // API mux.HandleFunc("/api/address", func(w http.ResponseWriter, r *http.Request) { switch r.Method { @@ -254,8 +258,8 @@ func renderMessageDetailPage(msg storage.Message, local, domain string) string { timeStr, bodyHTML, local, - local, msg.ID, + local, ) } @@ -437,452 +441,344 @@ const indexHTML = ` - - 临时邮箱 - Temp Mail + + AlienMail | Interstellar Uplink + - +
-

📬 临时邮箱

-

快速创建临时邮箱,接收验证邮件

+

ALIEN MAIL

+

SECURE / ANONYMOUS / EPHEMERAL

-
+
- +
- +
-
-
当前邮箱地址
-
(尚未创建)
+
+
ACTIVE FREQUENCY
+
WAITING FOR INPUT...
- +
- - -
- -
- - + +
+
+
+ + +
-
-
-
-
✨
-

开始使用

-

创建邮箱地址后,邮件将自动出现在这里

+
+
+
+
👾
+

SYSTEM READY

+

Scanning for incoming signals...

+
-
-
-
- - - 使用当前创建的邮箱地址 -
- -
- - - 多个收件人用逗号分隔 -
- -
- - -
- -
- - -
- -
- - +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- -
-
` @@ -1335,235 +1048,153 @@ const messageDetailTemplate = ` - %s - 邮件详情 + %s - DECODED MESSAGE + - + +
- ← 返回收件箱 +
+ ← RETURN TO BRIDGE +
SECURE CHANNEL ESTABLISHED
+
-
diff --git a/static/favicon.svg b/static/favicon.svg new file mode 100644 index 0000000..b251669 --- /dev/null +++ b/static/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file