Last active
July 19, 2023 10:38
-
-
Save TehPeGaSuS/557d7a2672580a2254eddb9273b09109 to your computer and use it in GitHub Desktop.
Certificate renewal automation for Ergo IRCd
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 sh | |
# What's your irc subdomain? | |
ergoDomain=irc.domain.tld | |
# What is the shell user running the ircd? | |
ergoUser=ircd | |
# What is the shell group of the user running the ircd? | |
# Usually it's the same as the above `user` value | |
ergoGroup=ircd | |
# Path to the ircd tls folder | |
ergoTLS=/home/ircd/ergo | |
# DON'T EDIT ANYTHING BELOW UNLESS YOU KNOW EXACTLY WHAT YOU'RE DOING! | |
# If you touch the code below and then complain the script "suddenly stopped working", I'll touch you at night. | |
case $RENEWED_LINEAGE in | |
*/"$ergoDomain") | |
cp -f -- "$RENEWED_LINEAGE"/fullchain.pem "$RENEWED_LINEAGE"/privkey.pem "$ergoTLS" && | |
chown -- "$ergoUser":"$ergoGroup" "$ergoTLS"/fullchain.pem "$ergoTLS"/privkey.pem && | |
/usr/bin/systemctl reload ergo.service | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use?
scripts
inside/etc/letsencrypt
where we will put all the files for automation with Let's Encrypt with:mkdir -p /etc/letsencrypt/scripts
/etc/letsencrypt/scripts
folder with:wget https://gist.github.com/PeGaSuS-Coder/557d7a2672580a2254eddb9273b09109/raw/587d15b8556d5f323febb11aa8106abcbdcb858a/ergo.sh -O /etc/letsencrypt/scripts/ergo.sh
chmod +x /etc/letsencrypt/scripts/ergo.sh
certbot -d ergo.domain.tld --deploy-hook /etc/letsencrypt/scripts/ergo.sh