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 = `
- -快速创建临时邮箱,接收验证邮件
+SECURE / ANONYMOUS / EPHEMERAL