diff --git a/Dockerfile b/Dockerfile index 57259fe..5710946 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,17 +7,16 @@ RUN yarn && yarn build FROM golang:alpine as serverbuild - +ARG VERSION WORKDIR /work -COPY server . COPY --from=febuild /work/dist /work/http_server/dist RUN apk update && apk add git -RUN go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go -RUN cd /work/hooks/telegram_push && go build -ldflags "-s -w" -o output/telegram_push main.go -RUN cd /work/hooks/web_push && go build -ldflags "-s -w" -o output/web_push main.go -RUN cd /work/hooks/wechat_push && go build -ldflags "-s -w" -o output/wechat_push main.go +RUN go build -ldflags "-s -w -X 'main.version=${VERSION}' -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go +RUN cd /work/hooks/telegram_push && go build -ldflags "-s -w" -o output/telegram_push telegram_push.go +RUN cd /work/hooks/web_push && go build -ldflags "-s -w" -o output/web_push web_push.go +RUN cd /work/hooks/wechat_push && go build -ldflags "-s -w" -o output/wechat_push wechat_push.go FROM alpine @@ -33,8 +32,8 @@ RUN apk add --no-cache tzdata \ COPY --from=serverbuild /work/pmail . -COPY --from=serverbuild /work/hooks/telegram_push/output/* ./plugin/ -COPY --from=serverbuild /work/hooks/web_push/output/* ./plugin/ -COPY --from=serverbuild /work/hooks/wechat_push/output/* ./plugin/ +COPY --from=serverbuild /work/hooks/telegram_push/output/* ./plugins/ +COPY --from=serverbuild /work/hooks/web_push/output/* ./plugins/ +COPY --from=serverbuild /work/hooks/wechat_push/output/* ./plugins/ CMD /work/pmail diff --git a/README.md b/README.md index e0c4110..2786466 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,7 @@ beautiful and cute Logo for this project! * Support pop3, smtp protocol, you can use any mail client you like. -## Disadvantages -* At present, only the core function of sending and receiving emails has been completed. Basically, it can only be used - by a single person, and does not deal with issues related to permission management in the process of multiple users. -* The UI is ugly # How to run @@ -111,7 +107,11 @@ SMTP Port: 25/465(SSL) [Web Push](server/hooks/wechat_push/README.md) +## Plugin Install +> [!IMPORTANT] +> Plugins run on your server as independent processes, please review the security of third-party plugins on your own.PMail currently only maintains the three plugins mentioned above. +Copy plugin binary file to `/plugins` # For Developer @@ -127,9 +127,9 @@ The code is in `server` folder. ## Api Documentation -[go to wiki](https://github.com/Jinnrry/PMail/wiki) +[go to wiki](https://github.com/Jinnrry/PMail/wiki/%E5%90%8E%E7%AB%AF%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3) ## Plugin Development -Reference this file. `server/hooks/wechat_push/wechat_push.go` +[go to wiki](https://github.com/Jinnrry/PMail/wiki/%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91%E8%AF%B4%E6%98%8E) diff --git a/README_CN.md b/README_CN.md index 6621618..8333a5b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -39,13 +39,6 @@ PMail是一个追求极简部署流程、极致资源占用的个人域名邮箱 只要支持pop3、smtp协议的邮件客户端均可使用 -## 其他 - -### 不足 - -1、目前只完成了最核心的收发邮件功能。基本上仅针对单人使用,没有处理多人使用、权限管理相关问题。 - -2、前端UI交互较差 # 如何部署 @@ -117,6 +110,12 @@ SMTP端口: 25/465(SSL) [WebHook推送](server/hooks/wechat_push/README.md) +## 插件安装 +> [!IMPORTANT] +> 插件已独立进程的方式运行在你的服务器上,请自行审查第三方插件的安全性。PMail目前仅维护上述三款插件 + +将插件二进制文件放到`plugins`文件夹中即可 + # 参与开发 ## 项目架构 @@ -131,8 +130,10 @@ SMTP端口: 25/465(SSL) ## 后端接口文档 -[参见Wiki](https://github.com/Jinnrry/PMail/wiki) +[go to wiki](https://github.com/Jinnrry/PMail/wiki/%E5%90%8E%E7%AB%AF%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3) ## 插件开发 -参考微信推送插件 `server/hooks/wechat_push/wechat_push.go` +[go to wiki](https://github.com/Jinnrry/PMail/wiki/%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91%E8%AF%B4%E6%98%8E) + +