certbot及插件安装
snap install --classic certbot
snap set certbot trust-plugin-with-root=ok
snap install certbot-dns-cloudflare
证书获取
certbot certonly -d *.solitud.es --dns-cloudflare --dns-cloudflare-credentials /opt/nginxconf/cf.ini --post-hook "service nginx reload" --non-interactive --agree-tos --email [email protected]
#记得修改cf.ini的权限
chmod 0600 cf.ini
自动续期
使用crontab
0 1 * * * certbot renew --quiet