Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
misc:scripts:letsencrypt-bookmyname-dnschallenge [2020/12/14 15:47] – jaxx | misc:scripts:letsencrypt-bookmyname-dnschallenge [2020/12/14 16:30] – jaxx | ||
---|---|---|---|
Line 1: | Line 1: | ||
=== BookMyName hooks for LE-Certbot === | === BookMyName hooks for LE-Certbot === | ||
- | The following scripts can be used as hooks to authenticate domains hosted by [[https:// | + | The following |
< | < | ||
- | certbot certonly --manual --preferred-challenges=dns --manual-auth-hook / | + | certbot certonly --manual --preferred-challenges=dns --manual-auth-hook / |
</ | </ | ||
- | BMN has a pseudo API, though it's slow as hell | + | BMN has a pseudo API, though it's slow as hell to update (~15/20 minutes) |
- | <file bash bmn-ABXXXX-auth.sh> | + | Obviously: place files where only your certbot runs, lock them down to be read only by whatever user runs your certonly/ |
+ | |||
+ | Feel free to have the cleanup script loop through a '' | ||
+ | |||
+ | <file bash bmn-JXXXXX-auth.sh> | ||
#!/bin/bash | #!/bin/bash | ||
- | BMN_USER=" | + | BMN_USER=" |
BMN_PASS=" | BMN_PASS=" | ||
DOMAIN=$(expr match " | DOMAIN=$(expr match " | ||
+ | # Bare TLD gets written off | ||
if [[ $DOMAIN == "" | if [[ $DOMAIN == "" | ||
then | then | ||
Line 26: | Line 31: | ||
echo " | echo " | ||
- | curl -u $BMN_USER: | + | curl -s -u $BMN_USER: |
loopcount=0 | loopcount=0 | ||
Line 45: | Line 50: | ||
echo " | echo " | ||
sleep 10s | sleep 10s | ||
- | | + | |
else | else | ||
echo " | echo " | ||
Line 53: | Line 58: | ||
</ | </ | ||
- | <file bash bmn-ABXXXX-cleanup.sh> | + | <file bash bmn-JXXXXX-cleanup.sh> |
#!/bin/bash | #!/bin/bash | ||
- | BMN_USER=" | + | BMN_USER=" |
BMN_PASS=" | BMN_PASS=" | ||
Line 67: | Line 72: | ||
echo Domain: $DOMAIN | echo Domain: $DOMAIN | ||
- | curl -u $BMN_USER: | + | curl -s -u $BMN_USER: |
+ | exit 0 | ||
</ | </ |