Created
October 9, 2023 23:00
-
-
Save lzlrd/01e30cc2fecde39a9ab966cc7856833c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
domainArg="" | |
for domain in "${@}"; do | |
[[ $domainArg != "" ]] && domainArg+=" " | |
domainArg+="-d $domain" | |
done | |
if [[ $domainArg != "" ]]; then | |
podman run -i --network "host2certbot" --rm -t \ | |
-v certbot:/var/lib/letsencrypt \ | |
-v /etc/letsencrypt:/etc/letsencrypt \ | |
-v /root/.secrets/certbot/cloudflare.ini:/root/.secrets/certbot/cloudflare.ini:ro \ | |
--uidmap "0:$(stat -c '%u' "$(podman mount "certbot")"):60000" \ | |
--gidmap "0:$(stat -c '%u' "$(podman mount "certbot")"):60000" \ | |
certbot/dns-cloudflare:latest certonly \ | |
--dns-cloudflare \ | |
--dns-cloudflare-credentials "/root/.secrets/certbot/cloudflare.ini" \ | |
--dns-cloudflare-propagation-seconds 60 \ | |
"$domainArg" | |
fi | |
chmod 755 "/etc/letsencrypt/"{"archive","live"} | |
chmod 644 "/etc/letsencrypt/archive/"*"/"*".pem" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment