1
0
Fork 0

Restructure directory layout

To make this better than the unorganized mess it used to be.
This commit is contained in:
Luca Beltrame 2021-01-03 15:26:29 +01:00
parent 58a36ed632
commit c4f7279f2e
Signed by: einar
GPG key ID: 4707F46E9EC72DEC
25 changed files with 0 additions and 727 deletions

View file

@ -0,0 +1,43 @@
#!/usr/bin/python3
# SPDX-FileCopyrightText: 2021 Luca Beltrame <lbeltrame@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
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(60)
if __name__ == "__main__":
main()