make python3.4 compatible
This commit is contained in:
parent
474ada35e8
commit
1867401b35
3 changed files with 12 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
||||||
# NameSilo Let's Encrypt
|
# NameSilo Let's Encrypt
|
||||||
|
|
||||||
[](http://opensource.org/licenses/BSD-3-Clause)
|
[](http://opensource.org/licenses/BSD-3-Clause)
|
||||||
[](https://www.python.org/)
|
[](https://www.python.org/)
|
||||||
|
|
||||||
Python scripts (hook) to automate obtaining [Let's Encrypt](https://letsencrypt.org/) certificates,
|
Python scripts (hook) to automate obtaining [Let's Encrypt](https://letsencrypt.org/) certificates,
|
||||||
using [Certbot](https://certbot.eff.org/) DNS-01 challenge validation for domains DNS hosted on
|
using [Certbot](https://certbot.eff.org/) DNS-01 challenge validation for domains DNS hosted on
|
||||||
|
|
11
authenticator.py
Normal file → Executable file
11
authenticator.py
Normal file → Executable file
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3.8
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# authenticator.py
|
# authenticator.py
|
||||||
#
|
#
|
||||||
|
@ -51,14 +51,15 @@ def sleep(minutes):
|
||||||
|
|
||||||
domain = os.environ['CERTBOT_DOMAIN']
|
domain = os.environ['CERTBOT_DOMAIN']
|
||||||
validation = os.environ['CERTBOT_VALIDATION']
|
validation = os.environ['CERTBOT_VALIDATION']
|
||||||
tmpdir = os.path.join(tempfile.gettempdir(), f"CERTBOT_{domain}")
|
tmpdir = os.path.join(tempfile.gettempdir(), "CERTBOT_"+domain)
|
||||||
|
|
||||||
if "NAMESILO_API" in os.environ:
|
if "NAMESILO_API" in os.environ:
|
||||||
apikey = os.environ['NAMESILO_API']
|
apikey = os.environ['NAMESILO_API']
|
||||||
|
|
||||||
url = f"https://www.namesilo.com/api/dnsAddRecord?\
|
|
||||||
version=1&type=xml&key={apikey}&domain={domain}&rrtype=TXT\
|
url = "https://www.namesilo.com/api/dnsAddRecord?\
|
||||||
&rrhost=_acme-challenge&rrvalue={validation}&rrttl=3600"
|
version=1&type=xml&key="+apikey+"&domain="+domain+"&rrtype=TXT\
|
||||||
|
&rrhost=_acme-challenge&rrvalue="+validation+"&rrttl=3600"
|
||||||
|
|
||||||
req = urllib.request.Request(
|
req = urllib.request.Request(
|
||||||
url,
|
url,
|
||||||
|
|
9
cleanup.py
Normal file → Executable file
9
cleanup.py
Normal file → Executable file
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3.8
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# cleanup.py
|
# cleanup.py
|
||||||
#
|
#
|
||||||
|
@ -41,13 +41,14 @@ import untangle
|
||||||
from config import apikey
|
from config import apikey
|
||||||
|
|
||||||
domain = os.environ['CERTBOT_DOMAIN']
|
domain = os.environ['CERTBOT_DOMAIN']
|
||||||
tmpdir = os.path.join(tempfile.gettempdir(), f"CERTBOT_{domain}")
|
tmpdir = os.path.join(tempfile.gettempdir(), "CERTBOT_"+domain)
|
||||||
|
|
||||||
|
|
||||||
if "NAMESILO_API" in os.environ:
|
if "NAMESILO_API" in os.environ:
|
||||||
apikey = os.environ['NAMESILO_API']
|
apikey = os.environ['NAMESILO_API']
|
||||||
|
|
||||||
url = f"https://www.namesilo.com/api/dnsDeleteRecord\
|
url = "https://www.namesilo.com/api/dnsDeleteRecord\
|
||||||
?version=1&type=xml&key={apikey}&domain={domain}&rrid="
|
?version=1&type=xml&key="+apikey+"&domain="+domain+"&rrid="
|
||||||
|
|
||||||
|
|
||||||
def getrequest(record_id):
|
def getrequest(record_id):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue