Skip to content

Instantly share code, notes, and snippets.

@Tangent128
Created March 18, 2018 04:21
Show Gist options
  • Save Tangent128/4719377de387aed2760ef08c241750fd to your computer and use it in GitHub Desktop.
Save Tangent128/4719377de387aed2760ef08c241750fd to your computer and use it in GitHub Desktop.
Let's Encrypt metaautomation to setup acme.sh for appropriate servers
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 subdomain.domain.tld"
exit 1
fi
/root/acme/acme.sh --issue -d "$1" --stateless
/root/acme/acme.sh --install-cert -d "$1" \
--cert-file "/etc/nginx/certs/$1/cert.pem" \
--key-file "/etc/nginx/certs/$1/key.pem" \
--fullchain-file "/etc/nginx/certs/$1/fullchain.pem" \
--reloadcmd "systemctl reload nginx.service"
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 subdomain.domain.tld"
exit 1
fi
/root/acme/acme.sh --issue -d "$1" --stateless
# ensure key file has right perms for prosody to read
# /certs/ is not world-readable so this is fine;
# a default ACL on /certs/ is likely better though
touch "/etc/prosody/certs/$1.key"
chmod 644 "/etc/prosody/certs/$1.key"
/root/acme/acme.sh --install-cert -d "$1" \
--fullchain-file "/etc/prosody/certs/$1.crt" \
--key-file "/etc/prosody/certs/$1.key" \
--reloadcmd "systemctl reload prosody.service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment