群晖安装Let’s Encrypt SSL证书

方法一

  1. 获取代码
    git clone https://github.com/Neilpang/acme.sh.git
  2. 安装脚本
    cd acme.sh
    ./acme.sh –install –force
  3. 进入目录:
    cd ~/.acme.sh/
  4. 设置变量:
    export CX_Key=”替换为CloudXNS的key”
    export CX_Secret=”替换为CloudXNS的secrcet”
  5. 申请证书:
    ./acme.sh –issue –dns dns_cx -d mydomain.site -d *.mydomain.site
  6. 备注,90天以后更新证书时的命令为:
    ./acme.sh –renew -d mydomain.site -d *.mydomain.site

方法二:

1.安装 acme.sh

1.安装 acme.sh

wget https://github.com/Neilpang/acme.sh/archive/master.tar.gz

tar xvf master.tar.gz

cd acme.sh-master/

chmod a+x acme.sh

复制代码我是安装到/volume1/web/challenges/acme.sh目录

./acme.sh –install –nocron –home “/volume1/web/challenges/acme.sh”

复制代码运行测试看看是否正常

cd /volume1/web/challenges/acme.sh

/volume1/web/challenges/acme.sh/acme.sh –home “/volume1/web/challenges/acme.sh”

复制代码如果没有错误表示ok了

2.自动续期

自动续签证书,创建一个.txt文件,内容如下,重命名为renew_ssl.sh,上传到DSM

/volume1/web/challenges/acme.sh/acme.sh –home “/volume1/web/challenges” –renew –force -d example.com -d www.example.com

自动安装证书,创建一个.txt文件,内容如下,重命名为install_ssl.sh,上传到DSM

/volume1/web/challenges/acme.sh/acme.sh –home /volume1/web/challenges –installcert -d aichh.com –certpath /usr/syno/etc/certificate/_archive/proxYn/cert.pem –keypath /usr/syno/etc/certificate/_archive/proxYn/privkey.pem –fullchainpath /usr/syno/etc/certificate/_archive/proxYn/fullchain.pem –capath /usr/syno/etc/certificate/_archive/proxYn/chain.pem –reloadcmd

rsync -avzh /usr/syno/etc/certificate/_archive/proxYn/ /usr/syno/etc/certificate/system/default/

/usr/syno/etc/rc.sysv/nginx.sh reload

到DSM计划任务里新增两个自定义脚本任务,任务设置里把上面的脚本完整路径填上
设置为每月执行一次,renew_ssl.sh要先于install_ssl.sh,两个脚本最好有10分钟以上时间差。

Namesilo注意

You’ll need to generate an API key at https://www.namesilo.com/account_api.php Optionally you may restrict the access to an IP range there.

export Namesilo_Key="xxxxxxxxxxxxxxxxxxxxxxxx"

And now you can issue certs with:

acme.sh --issue --dns dns_namesilo --dnssleep 900 -d example.com -d www.example.com