Skip to content

Instantly share code, notes, and snippets.

@davidbalbert
Created December 20, 2020 05:15
Show Gist options
  • Save davidbalbert/a6db84e357931a16835c40128979a9dc to your computer and use it in GitHub Desktop.
Save davidbalbert/a6db84e357931a16835c40128979a9dc to your computer and use it in GitHub Desktop.
UniFi Certificate - acme.sh + Route 53
# Run this once in your shell. All access keys and all settings will be saved by acme.sh
DOMAIN=unifi.example.com
AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar acme.sh \
--issue -d $DOMAIN \
--dns dns_aws \
--fullchain-file /tmp/$DOMAIN.crt \
--key-file /tmp/$DOMAIN.key \
--reloadcmd /path/to/unifi-import-certificate.sh
#!/bin/sh
set -e
DOMAIN=unifi.example.com
UNIFI_HOME=/usr/lib/unifi
sudo java -jar $UNIFI_HOME/lib/ace.jar import_key_cert /tmp/$DOMAIN.key /tmp/$DOMAIN.crt
sudo service unifi restart
rm -f /tmp/$DOMAIN.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment