diff --git a/static/src/output.css b/static/src/output.css index 9a4b429..35e298d 100644 --- a/static/src/output.css +++ b/static/src/output.css @@ -771,6 +771,11 @@ video { font-weight: 600; } +.text-blue-600 { + --tw-text-opacity: 1; + color: rgb(37 99 235 / var(--tw-text-opacity)); +} + .text-gray-500 { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); @@ -932,6 +937,11 @@ video { background-color: rgb(17 24 39 / var(--tw-bg-opacity)); } + .dark\:text-blue-500 { + --tw-text-opacity: 1; + color: rgb(59 130 246 / var(--tw-text-opacity)); + } + .dark\:text-gray-400 { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); diff --git a/staticfiles/CACHE/css/output.184c6e037351.css b/staticfiles/CACHE/css/output.184c6e037351.css new file mode 100644 index 0000000..3793f55 --- /dev/null +++ b/staticfiles/CACHE/css/output.184c6e037351.css @@ -0,0 +1 @@ +*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}::before,::after{--tw-content:''}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type='search']{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role="button"]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x:;--tw-pan-y:;--tw-pinch-zoom:;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position:;--tw-gradient-via-position:;--tw-gradient-to-position:;--tw-ordinal:;--tw-slashed-zero:;--tw-numeric-figure:;--tw-numeric-spacing:;--tw-numeric-fraction:;--tw-ring-inset:;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur:;--tw-brightness:;--tw-contrast:;--tw-grayscale:;--tw-hue-rotate:;--tw-invert:;--tw-saturate:;--tw-sepia:;--tw-drop-shadow:;--tw-backdrop-blur:;--tw-backdrop-brightness:;--tw-backdrop-contrast:;--tw-backdrop-grayscale:;--tw-backdrop-hue-rotate:;--tw-backdrop-invert:;--tw-backdrop-opacity:;--tw-backdrop-saturate:;--tw-backdrop-sepia:}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x:;--tw-pan-y:;--tw-pinch-zoom:;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position:;--tw-gradient-via-position:;--tw-gradient-to-position:;--tw-ordinal:;--tw-slashed-zero:;--tw-numeric-figure:;--tw-numeric-spacing:;--tw-numeric-fraction:;--tw-ring-inset:;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur:;--tw-brightness:;--tw-contrast:;--tw-grayscale:;--tw-hue-rotate:;--tw-invert:;--tw-saturate:;--tw-sepia:;--tw-drop-shadow:;--tw-backdrop-blur:;--tw-backdrop-brightness:;--tw-backdrop-contrast:;--tw-backdrop-grayscale:;--tw-backdrop-hue-rotate:;--tw-backdrop-invert:;--tw-backdrop-opacity:;--tw-backdrop-saturate:;--tw-backdrop-sepia:}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.static{position:static}.row-start-2{grid-row-start:2}.m-4{margin:1rem}.mx-auto{margin-left:auto;margin-right:auto}.me-4{margin-inline-end:1rem}.mt-3{margin-top:0.75rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-5{height:1.25rem}.h-8{height:2rem}.w-10{width:2.5rem}.w-5{width:1.25rem}.w-full{width:100%}.max-w-screen-xl{max-width:1280px}.table-auto{table-layout:auto}.border-separate{border-collapse:separate}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.space-x-3>:not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem * var(--tw-space-x-reverse));margin-left:calc(0.75rem * calc(1 - var(--tw-space-x-reverse)))}.self-center{align-self:center}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:0.25rem}.rounded-lg{border-radius:0.5rem}.border{border-width:1px}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-slate-500{--tw-border-opacity:1;border-color:rgb(100 116 139 / var(--tw-border-opacity))}.border-slate-600{--tw-border-opacity:1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}.border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85 / var(--tw-border-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-2{padding:0.5rem}.p-4{padding:1rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28 / var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1),0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-gray-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(229 231 235 / var(--tw-ring-opacity))}@media (min-width:640px){.sm\:mt-0{margin-top:0px}.sm\:text-center{text-align:center}}@media (min-width:768px){.md\:me-6{margin-inline-end:1.5rem}.md\:mt-0{margin-top:0px}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-auto{width:auto}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:space-x-8>:not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.md\:border-0{border-width:0px}.md\:bg-transparent{background-color:transparent}.md\:bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.md\:p-0{padding:0px}.md\:text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity))}.md\:hover\:bg-transparent:hover{background-color:transparent}.md\:hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity))}}.rtl\:space-x-reverse:where([dir="rtl"],[dir="rtl"] *)>:not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:1}@media (prefers-color-scheme:dark){.dark\:border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\:bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity))}.dark\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:hover\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:focus\:ring-gray-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99 / var(--tw-ring-opacity))}}@media (min-width:768px){@media (prefers-color-scheme:dark){.md\:dark\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.md\:dark\:text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity))}.md\:dark\:hover\:bg-transparent:hover{background-color:transparent}.md\:dark\:hover\:text-blue-500:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity))}}} \ No newline at end of file diff --git a/staticfiles/src/output.css b/staticfiles/src/output.css index 9a4b429..35e298d 100644 --- a/staticfiles/src/output.css +++ b/staticfiles/src/output.css @@ -771,6 +771,11 @@ video { font-weight: 600; } +.text-blue-600 { + --tw-text-opacity: 1; + color: rgb(37 99 235 / var(--tw-text-opacity)); +} + .text-gray-500 { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); @@ -932,6 +937,11 @@ video { background-color: rgb(17 24 39 / var(--tw-bg-opacity)); } + .dark\:text-blue-500 { + --tw-text-opacity: 1; + color: rgb(59 130 246 / var(--tw-text-opacity)); + } + .dark\:text-gray-400 { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); diff --git a/tldtest/templates/home.html b/tldtest/templates/home.html index b2c476d..139a848 100644 --- a/tldtest/templates/home.html +++ b/tldtest/templates/home.html @@ -12,6 +12,7 @@ IPv6 Strongest DNSSEC algo # DNSSEC keys + RDAP Organisation @@ -22,9 +23,17 @@ {{ TLD.nsamount }} {{ TLD.v4nsamount }} {{ TLD.v6nsamount }} - {% if TLD.dnssec != 400 %} Algo {{ TLD.dnssec }} {{ TLD.get_dnssec_display }} {% else %} {{ TLD.get_dnssec_display }} {% endif %} + {% if TLD.dnssec != 400 %} Algo {{ TLD.dnssec }} + {{ TLD.get_dnssec_display }} {% else %} {{ TLD.get_dnssec_display }} {% endif %} {{ TLD.amountofkeys }} - {{ TLD.organisation }} + {% if TLD.rdap == "Yes" %} + {{ TLD.rdap }} + {% else %} + {{ TLD.rdap }} + {% endif %} + {{ TLD.organisation }} + {% endfor %} diff --git a/tldtester/models.py b/tldtester/models.py index 796d1fd..7c759b1 100644 --- a/tldtester/models.py +++ b/tldtester/models.py @@ -37,6 +37,8 @@ class TLD(models.Model): amountofkeys = models.IntegerField(default=0) lastEdition = models.DateTimeField(auto_now=True) organisation = models.CharField(max_length=100) + rdap = models.CharField(max_length=10, default="No") + link = models.CharField(max_length=800, default="https://tldtest.net/") def __str__(self): return self.tld diff --git a/tldtester/sorter.py b/tldtester/sorter.py index 3a5c8a3..2a4457f 100644 --- a/tldtester/sorter.py +++ b/tldtester/sorter.py @@ -3,6 +3,7 @@ Link to IANA website : https://www.internic.net/domain/root.zone """ import json +import config import urllib.request from tldtester.models import TLD, RootZone from django.core.exceptions import MultipleObjectsReturned @@ -44,6 +45,8 @@ def zonesorter(zonefile): Takes the zonefile as an input and writes the records to the database """ for line in zonefile: + if config.DEBUG is True: + print(line) value = "" record = line.split() if len(record) >= 5: @@ -56,6 +59,8 @@ def zonesorter(zonefile): value = value + record[i + 4] + " " towrite = {"name": name, "type": recordtype, "value": value} zonedbwriter(towrite) + if config.DEBUG is True: + print("Done Parsing the Zones") def zonedbwriter(recs): @@ -85,20 +90,25 @@ def tlddbwriter(recs): db.dnssec = recs["algo"] db.amountofkeys = recs["amountofkeys"] db.organisation = recs["organisation"] + db.link = recs["link"] + db.rdap = recs["rdap"] db.save() -def grabber(data): +def grabber(data, rdaptlds): """ This function takes the TLD's and makes querrys to the DNS. It looks up how many authoritative DNS's there are and analyses the v4, v6 and DNSSEC. Returns a list of dictionaries with all the vallues to write in the database """ for tld in data: + if config.DEBUG is True: + print("starting with " + tld) nsservers = [] dnsseckeys = [] Arecords = 0 AAAArecords = 0 amountofkeys = 0 + link = "https://tldtest.net" nses = RootZone.objects.all().filter(name=tld + ".", rectype="NS") for ns in nses: nsservers.append(ns.value) @@ -154,23 +164,54 @@ def grabber(data): organisation = entity["vcardArray"][1][2][3] except: organisation = "Reserved" + try: + link = data["links"][2]["href"] + except Exception as e: + print("link not found for " + tld) + print(e) + if tld in rdaptlds: + rdap = "Yes" + else: + rdap = "No" results = {"tld": tld, "unicodeTld": unicodetld, "nsserveramount": int(len((nsservers))), "organisation": organisation, "v4resolvers": Arecords, "v6resolvers": AAAArecords, "algo": algo, - "amountofkeys": amountofkeys} + "amountofkeys": amountofkeys, "link": link, "rdap": rdap} + if config.DEBUG is True: + print(results) tlddbwriter(results) +def rdaper(): + """ + Downloads the RDAP link database from IANA and creates a list of all the tlds that currently support it. + returns either a full or an empty list. + """ + rdaptlds = [] + url = urllib.request.urlopen("https://data.iana.org/rdap/dns.json") + if url.getcode() == 200: + raw = url.read() + raw = raw.decode("utf-8") + else: + raw = None + data = json.loads(raw) + for i in data["services"]: + for j in i[0]: + rdaptlds.append(j) + return rdaptlds + + def main(): try: zonefile = zonedownloader().splitlines(True) + rdaptlds = rdaper() if zonefile is not None: # First delete the entire zone database if file polling is successful and re write RootZone.objects.all().delete() zonesorter(zonefile) tlds = tlddownloader() if tlds is not None: - grabber(tlds) + grabber(tlds, rdaptlds) except Exception as e: print(e)