derper的acme证书有效期60天,每次过期了要手动更新,很麻烦。看到了https://v2ex.com/t/1071515 帖子自动管理证书,下面试试
目录:


1. 首先用systemd管理derper服务:

[Unit]
Description=Derper Service
After=network.target

[Service]
ExecStart=/root/go/bin/derper --hostname=derper.chajiuqqq.cn -a=:7000 -certmode=manual -http-port=-1 --certdir=/root/.cache/tailscale/derper-certs
Group=root
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Exec命令中

/root/go/bin/derper --hostname=xxx.xxx.cn -a=:7000 -certmode=manual -http-port=-1 --certdir=/root/.cache/tailscale/derper-certs

--hostname指定了xxx.xxx.cn为域名,监听地址为:7000 ,证书使用手动指定方式,证书在/root/.cache/tailscale/derper-certs下. -http-port=-1表示不监听80端口。

2. 使用https://github.com/usual2970/certimate 自动管理证书

3. 效果,显示到期时间以及到期后自动部署:

image
image