Skip to content

Instantly share code, notes, and snippets.

@dvalfrid
Last active January 8, 2021 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvalfrid/d9fb84e00c8ecfcff5bbd1efbb966af2 to your computer and use it in GitHub Desktop.
Save dvalfrid/d9fb84e00c8ecfcff5bbd1efbb966af2 to your computer and use it in GitHub Desktop.

Let's Encrypt for UniFi Cloud Key G2+

Install acme

  • curl https://get.acme.sh | sh

  • acme.sh --upgrade --auto-upgrade --accountemail "your@email.com"

Configure acme Let's Encrypt

Put following in your.bashrc file

export JOKER_USERNAME="userName"
export JOKER_PASSWORD="password"

Configure acme

acme.sh --force --issue --dns dns_joker -d unifi.valfridsson.org --pre-hook "tar -zcvf /root/.acme.sh/CloudKeySSL_`date +%Y-%m-%d_%H.%M.%S`.tgz /data/unifi-core/config/unifi-core.*" --fullchainpath /data/unifi-core/config/unifi-core.crt --keypath /data/unifi-core/config/unifi-core.key --reloadcmd "systemctl restart unifi-core.service"
  • Adjust controller’s hostname

Let acme renew the certs

crontab -e

0 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh/" >> /var/log/letsencrypt.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment