Skip to content

Instantly share code, notes, and snippets.

@Himura2la
Last active June 6, 2023 10:24
Show Gist options
  • Save Himura2la/f8e6e2f51b1728a1b354ac163d4010ab to your computer and use it in GitHub Desktop.
Save Himura2la/f8e6e2f51b1728a1b354ac163d4010ab to your computer and use it in GitHub Desktop.
Renew a wildcard certificate using certbot
#!/bin/bash
set -xe
export domain='change.me'
certbot --config ./cli-certbot.ini certonly -d "*.$domain"
# Follow the instructions.
ansible-vault encrypt "./tmp/config/live/$domain/privkey.pem" --output "./${domain}_privkey.pem.vault"
cat "./tmp/config/live/$domain/fullchain.pem" > "./${domain}_fullchain.pem"
find ./tmp -type f -name '*key*' -exec chmod -v u+w '{}' \; -exec shred -v '{}' \; && rm -r ./tmp
# deploy the certificate all over your infrastructure
email = change@me.please
config-dir=./tmp/config
work-dir=./tmp/work
logs-dir=./tmp/logs
no-eff-email = true
agree-tos = true
manual = true
preferred-challenges = dns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment