Cleanup.
This commit is contained in:
parent
e0fc2e71fa
commit
94caed2d98
3 changed files with 13 additions and 17 deletions
|
@ -9,12 +9,10 @@ using [Certbot](https://certbot.eff.org/) DNS-01 challenge validation for domain
|
|||
|
||||
## Setup
|
||||
|
||||
The scripts use the [untangle](https://untangle.readthedocs.io/en/latest/) and tldextract libraries, if not already installed on your system:
|
||||
The scripts use the [tldextract](https://github.com/john-kurkowski/tldextract) and [untangle](https://untangle.readthedocs.io/en/latest/) libraries, if not already installed on your system:
|
||||
|
||||
```
|
||||
pip install untangle
|
||||
|
||||
pip install tldextract
|
||||
pip install tldextract untangle
|
||||
```
|
||||
|
||||
Download the [latest release](https://github.com/ethauvin/namesilo-letsencrypt/releases) archive and expand it in the desired directory.
|
||||
|
@ -46,4 +44,3 @@ certbot certonly --manual --email you@example.com \
|
|||
</pre>
|
||||
|
||||
Please note that NameSilo DNS propagation takes up to **15 minutes**. The scripts will wait **20 minutes** before completing, just to be safe.
|
||||
q
|
||||
|
|
|
@ -52,29 +52,28 @@ def sleep(minutes):
|
|||
|
||||
domain = os.environ['CERTBOT_DOMAIN']
|
||||
validation = os.environ['CERTBOT_VALIDATION']
|
||||
tmpdir = os.path.join(tempfile.gettempdir(), "CERTBOT_"+domain)
|
||||
tmpdir = os.path.join(tempfile.gettempdir(), "CERTBOT_" + domain)
|
||||
rrhost = "_acme-challenge"
|
||||
|
||||
if "NAMESILO_API" in os.environ:
|
||||
apikey = os.environ['NAMESILO_API']
|
||||
|
||||
|
||||
tld = tldextract.extract(domain)
|
||||
nsdomain = tld.domain+"."+tld.suffix
|
||||
nsdomain = tld.domain + "." + tld.suffix
|
||||
if tld.subdomain:
|
||||
rrhost += "."+tld.subdomain
|
||||
rrhost += "." + tld.subdomain
|
||||
|
||||
url = "https://www.namesilo.com/api/dnsAddRecord?\
|
||||
version=1&type=xml&key="+apikey+"&domain="+nsdomain+"&rrtype=TXT\
|
||||
&rrhost="+rrhost+"&rrvalue="+validation+"&rrttl=3600"
|
||||
version=1&type=xml&key=" + apikey + "&domain=" + nsdomain + "&rrtype=TXT\
|
||||
&rrhost=" + rrhost + "&rrvalue=" + validation + "&rrttl=3600"
|
||||
|
||||
req = urllib.request.Request(
|
||||
url,
|
||||
data=None,
|
||||
headers={
|
||||
'User-Agent': ('Mozilla/5.0 (X11; CrOS x86_64 11647.154.0) '
|
||||
'User-Agent': ('Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
|
||||
'AppleWebKit/537.36 (KHTML, like Gecko) '
|
||||
'Chrome/73.0.3683.114 Safari/537.36')
|
||||
'Chrome/80.0.3987.163 Safari/537.36')
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@ import untangle
|
|||
from config import apikey
|
||||
|
||||
domain = os.environ['CERTBOT_DOMAIN']
|
||||
tmpdir = os.path.join(tempfile.gettempdir(), "CERTBOT_"+domain)
|
||||
|
||||
tmpdir = os.path.join(tempfile.gettempdir(), "CERTBOT_" + domain)
|
||||
|
||||
if "NAMESILO_API" in os.environ:
|
||||
apikey = os.environ['NAMESILO_API']
|
||||
|
||||
tld = tldextract.extract(domain)
|
||||
nsdomain = tld.domain+"."+tld.suffix
|
||||
nsdomain = tld.domain + "." + tld.suffix
|
||||
|
||||
url = "https://www.namesilo.com/api/dnsDeleteRecord\
|
||||
?version=1&type=xml&key="+apikey+"&domain="+nsdomain+"&rrid="
|
||||
?version=1&type=xml&key=" + apikey + "&domain=" + nsdomain + "&rrid="
|
||||
|
||||
|
||||
def getrequest(record_id):
|
||||
return urllib.request.Request(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue