diff --git a/1984DNS/README b/1984DNS/README index 06115cf..67c28e7 100644 --- a/1984DNS/README +++ b/1984DNS/README @@ -1,4 +1,4 @@ -Status : succeeded (as far as i know) +Status : succeeded (as of Jan 31 2022) This was my attempted to make automatic Certbot renewal script of 1984.is FreeDNS . diff --git a/1984DNS/after.py b/1984DNS/after.py index 4aa6157..ce98ed0 100644 --- a/1984DNS/after.py +++ b/1984DNS/after.py @@ -1,7 +1,6 @@ import sys import logging import re -from bs4 import BeautifulSoup from dotenv import load_dotenv from requests import Session import os @@ -41,13 +40,13 @@ payload = { "Cookie": "csrftoken="+csrftoken+"; sessionid="+sessionid } -file1 = open('entry.txt', 'r') -file = file1.read().split('\n') -for zone_id in file: - delete_response = session.post( +ZoneFile = open('entry.txt', 'r') +GetZone = ZoneFile.read().split('\n') +for zone_id in GetZone: + delete_zone = session.post( "https://umsjon.1984.is/domains/delentry/", data={ "entry": zone_id, }, headers=payload, ) -print(delete_response.text) \ No newline at end of file +print(delete_zone.text) \ No newline at end of file diff --git a/1984DNS/before.py b/1984DNS/before.py index cda817b..4e6a29b 100644 --- a/1984DNS/before.py +++ b/1984DNS/before.py @@ -6,7 +6,6 @@ from dotenv import load_dotenv from requests import Session import requests import os -from bs4 import BeautifulSoup LOGGER = logging.getLogger(__name__) @@ -17,7 +16,6 @@ CERTBOT_VALIDATION = '12345' CERTBOT_DOMAIN = sys.argv[1] CERTBOT_ZONE = sys.argv[2] CERTBOT_VALIDATION = sys.argv[3] -domain = CERTBOT_ZONE load_dotenv() auth_username = os.getenv('AUTH_USERNAME') auth_password = os.getenv('AUTH_PASSWORD') @@ -44,7 +42,6 @@ for token in cookie: sessionid = token.value CERTBOT_HOST="_acme-challenge."+CERTBOT_DOMAIN -name=CERTBOT_HOST rtype="txt" # Pull a list of records and check for ours @@ -63,10 +60,10 @@ data = { "priority": "", "rdata": CERTBOT_VALIDATION, } -risk = session.post("https://umsjon.1984.is/domains/entry/", data=data, headers=payload) -s = re.findall('"id": "..*\d"', risk.text) +PostRecord = session.post("https://umsjon.1984.is/domains/entry/", data=data, headers=payload) +s = re.findall('"id": "..*\d"', PostRecord.text) s = str(s) s = re.sub('(\[|\"|\'|:|]| |id)', "", s) -file1 = open('entry.txt', 'w') -file1.write(str(s)) +ZoneFile = open('entry.txt', 'w') +ZoneFile.write(str(s)) exit() \ No newline at end of file