fix: Update to use absolute names in cert hooks to allow renewals from crontab
All checks were successful
Build Docker / Build_Docker (push) Successful in 1m11s
All checks were successful
Build Docker / Build_Docker (push) Successful in 1m11s
This commit is contained in:
parent
9baefbf6e7
commit
004e7fcd9f
4
cert.py
4
cert.py
@ -7,11 +7,11 @@ import time
|
|||||||
|
|
||||||
AUTH = ""
|
AUTH = ""
|
||||||
# Check if token file exists
|
# Check if token file exists
|
||||||
if os.path.isfile("token"):
|
if os.path.isfile("/root/hns_doh_loadbalancer/token"):
|
||||||
print("ERROR: Token file not found")
|
print("ERROR: Token file not found")
|
||||||
|
|
||||||
# Read token from file
|
# Read token from file
|
||||||
with open("token", "r") as fh:
|
with open("/root/hns_doh_loadbalancer/token", "r") as fh:
|
||||||
AUTH = fh.read().strip()
|
AUTH = fh.read().strip()
|
||||||
|
|
||||||
# Check if token is empty
|
# Check if token is empty
|
||||||
|
1
cert.sh
1
cert.sh
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Tell dnsdist to reload the config
|
# Tell dnsdist to reload the config
|
||||||
dnsdist -c -e 'reloadAllCertificates()'
|
dnsdist -c -e 'reloadAllCertificates()'
|
||||||
|
systemctl restart caddy
|
||||||
|
|
||||||
# Save last run time
|
# Save last run time
|
||||||
date +%s > last_cert_reload.txt
|
date +%s > last_cert_reload.txt
|
@ -19,7 +19,7 @@ sudo apt-get install -y dnsdist
|
|||||||
sudo apt install snapd -y
|
sudo apt install snapd -y
|
||||||
sudo snap install --classic certbot
|
sudo snap install --classic certbot
|
||||||
sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
||||||
sudo certbot certonly --manual --manual-auth-hook ./cert.py --preferred-challenges dns -d hnsdoh.com --deploy-hook ./cert.sh
|
sudo certbot certonly --manual --manual-auth-hook /root/hns_doh_loadbalancer/cert.py --preferred-challenges dns -d hnsdoh.com --deploy-hook /root/hns_doh_loadbalancer/cert.sh
|
||||||
sudo cp ./resolved.conf /etc/systemd/resolved.conf
|
sudo cp ./resolved.conf /etc/systemd/resolved.conf
|
||||||
sudo systemctl restart systemd-resolved
|
sudo systemctl restart systemd-resolved
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user