Skip to content

Commit

Permalink
Use python3 instead of python2 and install certbot from apt
Browse files Browse the repository at this point in the history
  • Loading branch information
putsi authored and Jarmo Puttonen committed Jul 15, 2020
1 parent f48fc0e commit 52ace4a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dnshook.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

python /usr/local/lib/python2.7/dist-packages/dnslib/fixedresolver.py -r "_acme-challenge.$CERTBOT_DOMAIN. 10 IN TXT \"$CERTBOT_VALIDATION\"" -a $1 &>/dev/null &disown
python3 /usr/local/lib/python3.8/dist-packages/dnslib/fixedresolver.py -r "_acme-challenge.$CERTBOT_DOMAIN. 10 IN TXT \"$CERTBOT_VALIDATION\"" -a $1 &>/dev/null &disown
sleep 5
7 changes: 3 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ 0 -eq $? ]; then
fi
fi;

apt update -y && apt install -y python-pip && pip install dnslib
apt update -y && apt install -y python3 python3-pip certbot && pip3 install dnslib
mkdir -p /usr/local/collaborator/
cp dnshook.sh /usr/local/collaborator/
cp cleanup.sh /usr/local/collaborator/
Expand All @@ -43,7 +43,6 @@ cp startcollab.sh /usr/local/collaborator/
cp renewcert.sh /etc/cron.daily/

cd /usr/local/collaborator/
wget -O certbot-auto https://dl.eff.org/certbot-auto
chmod +x /usr/local/collaborator/*

systemctl disable systemd-resolved.service
Expand All @@ -60,8 +59,8 @@ echo ""
read -p "Press enter to continue"

rm -rf /usr/local/collaborator/keys
./certbot-auto certonly --manual-auth-hook "/usr/local/collaborator/dnshook.sh $MYPRIVATEIP" --manual-cleanup-hook /usr/local/collaborator/cleanup.sh \
-d "*.$DOMAIN" \
certbot certonly --manual-auth-hook "/usr/local/collaborator/dnshook.sh $MYPRIVATEIP" --manual-cleanup-hook /usr/local/collaborator/cleanup.sh \
-d "*.$DOMAIN, $DOMAIN" \
--server https://acme-v02.api.letsencrypt.org/directory \
--manual --agree-tos --no-eff-email --manual-public-ip-logging-ok --preferred-challenges dns-01

Expand Down
2 changes: 1 addition & 1 deletion renewcert.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

certbot-auto renew
/usr/bin/certbot renew

0 comments on commit 52ace4a

Please sign in to comment.