...
 
Commits (2)
#!/usr/bin/python3
import os
import time
import requests
IWANTMYNAME_ENDPOINT = "https://iwantmyname.com/basicauth/ddns"
def main():
with open("/etc/letsencrypt/credentials") as handle:
user, password = handle.read().strip().split()
domain = os.environ["CERTBOT_DOMAIN"]
validation_token = os.environ["CERTBOT_VALIDATION"]
print("DEBUG", domain, validation_token)
if "*." in domain:
domain = domain.replace("*.", "")
subdomain = f"_acme-challenge.{domain}"
params = {
"hostname": subdomain,
"type": "txt",
"value": "delete"
}
req = requests.get(IWANTMYNAME_ENDPOINT, params=params,
auth=(user, password))
if __name__ == "__main__":
main()
#!/usr/bin/python3
import os
import time
import requests
IWANTMYNAME_ENDPOINT = "https://iwantmyname.com/basicauth/ddns"
def main():
with open("/etc/letsencrypt/credentials") as handle:
user, password = handle.read().strip().split()
domain = os.environ["CERTBOT_DOMAIN"]
validation_token = os.environ["CERTBOT_VALIDATION"]
print("DEBUG", domain, validation_token)
if "*." in domain:
domain = domain.replace("*.", "")
subdomain = f"_acme-challenge.{domain}"
params = {
"hostname": subdomain,
"type": "txt",
"value": validation_token
}
req = requests.get(IWANTMYNAME_ENDPOINT, params=params,
auth=(user, password))
time.sleep(30)
if __name__ == "__main__":
main()