从自己的github上自动获取证书并部署到本地

之前在github 下用两个库实现了自动更新 地址 :https://dev.leiyanhui.com/web/auto-get-ssl

这里记录下 使用的时候自动部署的方法 以alpine下为例

1
2
3
4
5
apk add nano wget p7zip
rc-update add crond boot
service crond start
cd /root
nano auto-updatessl-form-github.sh 

内容

1
2
3
4
5
cd /root
wget https://github.com/joyanhui/ssl/raw/main/ssl.zip
rm -rf ssl
7z x ssl.zip  -p密码  #密码和p之间不能有空格
nginx -s reload

添加计划任务 crontab -e 每天7点50

1
50 7 * * * sh /root/auto-updatessl-form-github.sh
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计