Skip to content

Instantly share code, notes, and snippets.

@deverton
Last active June 30, 2017 11:05
Show Gist options
  • Save deverton/3559b0849e4025cbec0f026a5bc4ea29 to your computer and use it in GitHub Desktop.
Save deverton/3559b0849e4025cbec0f026a5bc4ea29 to your computer and use it in GitHub Desktop.
Installing acme.sh on Synology using Cloudflare DNS API

This works on DSM 6.1 with a custom TLD for NAS (split-horizon DNS), e.g. nas.example.com.

ssh [email protected]
sudo -i
git clone https://github.com/Neilpang/acme.sh
cd acme.sh
./acme.sh  --install --nocron --home /usr/local/acme.sh --accountemail [email protected]
cd /usr/local/acme.sh
export CF_Key="examplekey"
export CF_Email="[email protected]"
./acme.sh \
  --issue \
  -d nas.example.com \
  --dns dns_cf \
  --certpath /usr/syno/etc/certificate/system/FQDN/cert.pem \
  --keypath /usr/syno/etc/certificate/system/FQDN/privkey.pem \
  --fullchainpath /usr/syno/etc/certificate/system/FQDN/fullchain.pem \
  --reloadcmd "/usr/syno/etc/rc.sysv/nginx.sh reload" \
  --dnssleep 10

Then create a scheduled task in the management console with this script:

/usr/local/acme.sh/acme.sh --cron --home /usr/local/acme.sh
/usr/syno/etc/rc.sysv/nginx.sh reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment