前言
频繁的注册各种系统账号需要用到邮箱,现在国内的邮箱需要绑定手机号。实在没有那么多手机号可用。就想着部署一个临时邮箱系统,生成邮箱账号,用完即扔。美滋滋。
参考: Forsaken-Mail
部署
准备资源
配置域名解析
Type | Name | Priority | Value | TTL |
---|---|---|---|---|
MX | @ | 10 | stmp.webzhan.xyz | 600 |
A | stmp | 8.213.xxx.xxx | 600 | |
A | @ | 8.213.xxx.xxx | 600 |
VPS 初始化
参考文章: docker和docker-compose一键安装脚本
docker-compose.yml
version: '3.5'
services:
caddy:
image: caddy:latest
restart: always
ports:
- "80:80"
- "443:443"
environment:
- 'SET_CONTAINER_TIMEZONE=true'
- 'TZ=Asia/Shanghai'
volumes:
- ./app/caddy:/etc/caddy
- /var/log/tempmail/caddy:/opt/logs
networks:
- mail
fmail:
image: denghongcai/forsaken-mail
restart: always
ports:
- "25:25"
volumes:
- ./app/forsaken-mail:/forsaken-mail:rw
networks:
- mail
networks:
mail:
Caddy配置
webzhan.xyz {
tls admin@webzhan.xyz
encode gzip
log {
output file /opt/log/access.log
}
header / {
Strict-Transport-Security "max-age=31536000;includeSubdomains;preload"
}
## HTTP 代理配置
reverse_proxy fmail:3000
}
启动并使用
docker-compose up -d
https://webzhan.xyz/
FAQ
服务端打印日志
// 自定义日志打印
const fs = require('fs');
const output = fs.createWriteStream('./logs/stdout.log');
const errorOutput = fs.createWriteStream('./logs/stderr.log');
var logger = new console.Console(output, errorOutput);
//需要输出日志的位置
logger.log(JSON.stringify(data, null, 2));
启动抱错: Not Found
//app.use(function(req, res, next) {
// let err = new Error('Not Found');
// err.status = 404;
// next(err);
//});
//
//app.use(err => debug(err));
评论 (0)