更新系统 / 安装工具
apt update && apt upgrade -y && apt install -y curl ca-certificates cron unattended-upgrades打开自动安全更新
dpkg-reconfigure -plow unattended-upgrades配置证书
申请证书:
DOMAIN=节点域名
curl https://get.acme.sh | sh
read -rsp 'CF_Token: ' CF_Token; echo; export CF_Token
export CF_Zone_ID="4ea28d39714d41627d86541e8dfc3211"
~/.acme.sh/acme.sh --issue --dns dns_cf -d "$DOMAIN" --server letsencrypt将证书放到固定位置:
mkdir -p /root/cert/$DOMAIN
~/.acme.sh/acme.sh --install-cert -d "$DOMAIN" --ecc \
--fullchain-file /root/cert/$DOMAIN/fullchain.pem \
--key-file /root/cert/$DOMAIN/privkey.pem \
--reloadcmd "systemctl restart x-ui"