0%

DDNS和证书配置

DDNS

项目地址:https://github.com/rehiy/dnspod-shell

一、编辑配置文件

vim ddnspod.sh

1
2
3
4
5
6
7
8
9
. /root/dnspod-shell/ardnspod

arToken="xx,xx"

# IPv4:
arDdnsCheck "xx.cf" "@"
arDdnsCheck "xx.cf" "*"
arDdnsCheck "xx.ml" "@"
arDdnsCheck "xx.ml" "*"

二 添加定时任务,每小时1次

crontab -e

1
0 * * * * /root/dnspod-shell/ddnspod.sh > /root/dnspod-shell/ddnspod.log

acme

项目地址:https://github.com/acmesh-official/acme.sh

一、安装并重载环境变量

1
2
3
4
curl https://get.acme.sh | sh -s email=xxx@qq.com
source ~/.bashrc
# 自动更新
acme.sh --upgrade --auto-upgrade

二、设置DNS KEY

1
2
export DP_Id="xxx"
export DP_Key="xxx"

三、生成域名与泛域名证书

1
2
acme.sh --issue --dns dns_dp -d xx.cf -d *.xx.cf
acme.sh --issue --dns dns_dp -d xx.ml -d *.xx.ml

合成带 fullchain 的cer文件

1
cat xxx.cf.cer fullchain.cer >> xxx.cf.pem