diff --git a/package-lock.json b/package-lock.json index cdf9bbec9f..8a77b3f1cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,32 +1,26 @@ { - "dependencies": { - "prettier": { - "integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz", - "version": "2.8.1" - } - }, - "lockfileVersion": 2, + "lockfileVersion": 3, "name": "dnscontrol", "packages": { "": { "dependencies": { - "prettier": "^2.8.1" + "prettier": "^3.4.2" } }, "node_modules/prettier": { "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" }, - "integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz", - "version": "2.8.1" + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "license": "MIT", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "version": "3.4.2" } }, "requires": true diff --git a/pkg/js/README-parse_tests.md b/pkg/js/README-parse_tests.md new file mode 100644 index 0000000000..0db9c1b7a7 --- /dev/null +++ b/pkg/js/README-parse_tests.md @@ -0,0 +1,42 @@ + +# Parse Tests + +The `parse_tests` directory contains test cases for `js_test.go`. `js_test.go` +scans for files named `DDD-*.js` where `DDD` is a three-digit number. + +* `parse_tests/001-basic.js` -- The dnsconfig.js file. +* `parse_tests/001-basic.json` -- The EXPECTED output of "print-ir" for the `.js` file. +* `parse_tests/001-basic.json.ACTUAL` -- The ACTUAL output of "print-ir" for the `.js` file (not saved in git) +* `parse_tests/001-basic/foo.com.zone` -- Zonefiles from the domains mentioned in dnsconfig.js + +NOTE: The zonefiles are only tested if a matching `DDD-name/DOMAINNAME.zone` file exists. + +Any files committed to Git should be in standard format. + +# Fix formatting + +Fix the `.js` formatting: + +``` +cd parse_tests +for i in *.js ; do echo ========== $i ; dnscontrol fmt -i $i -o $i ; done +``` + +Fix the `.json` formatting: + +``` +cd parse_tests +fmtjson *.json *.json.ACTUAL +``` + +# Copy actuals to expected. + +Back-port the ACTUAL results to the expected results: + +(This is dangerous. You may be committing buggy results to the "expected" files. Carefully inspect the resulting PR.) + +``` +cd parse_tests +fmtjson *.json *.json.ACTUAL +for i in *.ACTUAL ; do f=$(basename $i .ACTUAL) ; cp $i $f ; done +``` diff --git a/pkg/js/js_test.go b/pkg/js/js_test.go index 0bd35a11be..5ff379b47c 100644 --- a/pkg/js/js_test.go +++ b/pkg/js/js_test.go @@ -9,6 +9,7 @@ import ( "testing" "unicode" + "github.com/StackExchange/dnscontrol/v4/models" "github.com/StackExchange/dnscontrol/v4/pkg/normalize" "github.com/StackExchange/dnscontrol/v4/pkg/prettyzone" "github.com/StackExchange/dnscontrol/v4/providers" @@ -49,6 +50,21 @@ func TestParsedFiles(t *testing.T) { // normalize.UpdateNameSplitHorizon(dc) // } + errs := normalize.ValidateAndNormalizeConfig(conf) + if len(errs) != 0 { + t.Fatal(errs[0]) + } + + for _, dc := range conf.Domains { + //fmt.Printf("DEBUG: PrettySort: domain=%q #rec=%d\n", dc.Name, len(dc.Records)) + //fmt.Printf("DEBUG: records = %d %v\n", len(dc.Records), dc.Records) + ps := prettyzone.PrettySort(dc.Records, dc.Name, 0, nil) + dc.Records = ps.Records + if len(dc.Records) == 0 { + dc.Records = models.Records{} + } + } + // Initialize any DNS providers mentioned. for _, dProv := range conf.DNSProviders { var pcfg = map[string]string{} @@ -91,11 +107,6 @@ func TestParsedFiles(t *testing.T) { // For each domain, if there is a zone file, test against it: - errs := normalize.ValidateAndNormalizeConfig(conf) - if len(errs) != 0 { - t.Fatal(errs[0]) - } - var dCount int for _, dc := range conf.Domains { zoneFile := filepath.Join(testDir, testName, dc.Name+".zone") diff --git a/pkg/js/parse_tests/001-basic.js b/pkg/js/parse_tests/001-basic.js index fd14395310..97febff45b 100644 --- a/pkg/js/parse_tests/001-basic.js +++ b/pkg/js/parse_tests/001-basic.js @@ -1,7 +1,6 @@ - -var REG = NewRegistrar("Third-Party","NONE"); +var REG = NewRegistrar("Third-Party", "NONE"); var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); -D("foo.com",REG,DnsProvider(CF), - A("@","1.2.3.4") -); \ No newline at end of file +D("foo.com", REG, DnsProvider(CF), + A("@", "1.2.3.4") +); diff --git a/pkg/js/parse_tests/001-basic.json b/pkg/js/parse_tests/001-basic.json index 2c51187e4d..22fa87c255 100644 --- a/pkg/js/parse_tests/001-basic.json +++ b/pkg/js/parse_tests/001-basic.json @@ -10,11 +10,16 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/002-ttl.js b/pkg/js/parse_tests/002-ttl.js index c96ab60e63..159f5341ed 100644 --- a/pkg/js/parse_tests/002-ttl.js +++ b/pkg/js/parse_tests/002-ttl.js @@ -1,5 +1,6 @@ -var REG = NewRegistrar("Third-Party","NONE"); -var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI") -D("foo.com",REG,DnsProvider(CF), - A("@","1.2.3.4",TTL(42)) -); \ No newline at end of file +var REG = NewRegistrar("Third-Party", "NONE"); +var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); + +D("foo.com", REG, DnsProvider(CF), + A("@", "1.2.3.4", TTL(42)), +); diff --git a/pkg/js/parse_tests/002-ttl.json b/pkg/js/parse_tests/002-ttl.json index 9345073c28..893f51f267 100644 --- a/pkg/js/parse_tests/002-ttl.json +++ b/pkg/js/parse_tests/002-ttl.json @@ -10,6 +10,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { diff --git a/pkg/js/parse_tests/003-meta.js b/pkg/js/parse_tests/003-meta.js index 679a971250..4b3b5e5111 100644 --- a/pkg/js/parse_tests/003-meta.js +++ b/pkg/js/parse_tests/003-meta.js @@ -1,5 +1,7 @@ +var CLOUDFLARE = NewRegistrar("Cloudflare", "CLOUDFLAREAPI"); -var CLOUDFLARE = NewRegistrar("Cloudflare","CLOUDFLAREAPI"); -D("foo.com",CLOUDFLARE, - A("@","1.2.3.4",{"cloudflare_proxy":"ON"}) -); \ No newline at end of file +D("foo.com", CLOUDFLARE, + A("@", "1.2.3.4", { + "cloudflare_proxy": "ON" + }), +); diff --git a/pkg/js/parse_tests/003-meta.json b/pkg/js/parse_tests/003-meta.json index 19d058f6a1..c739737870 100644 --- a/pkg/js/parse_tests/003-meta.json +++ b/pkg/js/parse_tests/003-meta.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { @@ -11,6 +15,7 @@ }, "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/004-ips.js b/pkg/js/parse_tests/004-ips.js index 01405eefa1..31928185db 100644 --- a/pkg/js/parse_tests/004-ips.js +++ b/pkg/js/parse_tests/004-ips.js @@ -1,10 +1,10 @@ -var REG = NewRegistrar("Third-Party","NONE"); -var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI") +var REG = NewRegistrar("Third-Party", "NONE"); +var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); -var BASE = IP("1.2.3.4") +var BASE = IP("1.2.3.4"); -D("foo.com",REG,DnsProvider(CF,0), - A("@",BASE), - A("p1",BASE+1), - A("p255", BASE+255) -); \ No newline at end of file +D("foo.com", REG, DnsProvider(CF, 0), + A("@", BASE), + A("p1", BASE + 1), + A("p255", BASE + 255), +); diff --git a/pkg/js/parse_tests/004-ips.json b/pkg/js/parse_tests/004-ips.json index edfb91364b..48aa032784 100644 --- a/pkg/js/parse_tests/004-ips.json +++ b/pkg/js/parse_tests/004-ips.json @@ -10,21 +10,28 @@ "dnsProviders": { "Cloudflare": 0 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" }, { "name": "p1", "target": "1.2.3.5", + "ttl": 300, "type": "A" }, { "name": "p255", "target": "1.2.4.3", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/005-ignored-records.js b/pkg/js/parse_tests/005-ignored-records.js old mode 100644 new mode 100755 index f389c92d69..f6dcc7eceb --- a/pkg/js/parse_tests/005-ignored-records.js +++ b/pkg/js/parse_tests/005-ignored-records.js @@ -1,23 +1,24 @@ -D("foo.com", "none" - , IGNORE_NAME("testignore") - , IGNORE_NAME("testignore2", "A") - , IGNORE_NAME("testignore3", "A, CNAME, TXT") - , IGNORE_NAME("testignore4", "*") - , IGNORE_TARGET("testtarget", "CNAME") - , IGNORE("legacyignore") - , IGNORE_NAME("@") - , IGNORE_TARGET("@", "CNAME") +D("foo.com", "none", + IGNORE_NAME("testignore"), + IGNORE_NAME("testignore2", "A"), + IGNORE_NAME("testignore3", "A, CNAME, TXT"), + IGNORE_NAME("testignore4", "*"), + IGNORE_TARGET("testtarget", "CNAME"), + IGNORE("legacyignore"), + IGNORE_NAME("@"), + IGNORE_TARGET("@", "CNAME"), ); -D("diff2.com", "none" - , IGNORE("mylabel") - , IGNORE("mylabel2", "") - , IGNORE("mylabel3", "", "") - , IGNORE("", "A") - , IGNORE("", "A,AAAA") - , IGNORE("", "", "mytarget") - , IGNORE("labelc", "CNAME", "targetc") - // Compatibility mode: - , IGNORE_NAME("nametest") - , IGNORE_TARGET("targettest1") - , IGNORE_TARGET("targettest2", "A") + +D("diff2.com", "none", + IGNORE("mylabel"), + IGNORE("mylabel2", ""), + IGNORE("mylabel3", "", ""), + IGNORE("", "A"), + IGNORE("", "A,AAAA"), + IGNORE("", "", "mytarget"), + IGNORE("labelc", "CNAME", "targetc"), + // Compatibility mode: + IGNORE_NAME("nametest"), + IGNORE_TARGET("targettest1"), + IGNORE_TARGET("targettest2", "A"), ); diff --git a/pkg/js/parse_tests/005-ignored-records.json b/pkg/js/parse_tests/005-ignored-records.json index 6ed0aeb781..0bb768053a 100644 --- a/pkg/js/parse_tests/005-ignored-records.json +++ b/pkg/js/parse_tests/005-ignored-records.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [], "registrar": "none", @@ -51,6 +55,10 @@ }, { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "diff2.com" + }, "name": "diff2.com", "records": [], "registrar": "none", diff --git a/pkg/js/parse_tests/006-transforms.js b/pkg/js/parse_tests/006-transforms.js index 7e834c0188..ce8e410240 100644 --- a/pkg/js/parse_tests/006-transforms.js +++ b/pkg/js/parse_tests/006-transforms.js @@ -1,12 +1,21 @@ -var REG = NewRegistrar("Third-Party","NONE"); -var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI") +var REG = NewRegistrar("Third-Party", "NONE"); +var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); -var TRANSFORM_INT = [ - {low: "0.0.0.0", high: "1.1.1.1", newBase: "2.2.2.2" }, - {low: "1.1.1.1", high: IP("2.2.2.2"), newBase: ["3.3.3.3","4.4.4.4",IP("5.5.5.5")]} , - {low: "1.1.1.1", high: IP("2.2.2.2"), newIP: ["3.3.3.3","4.4.4.4",IP("5.5.5.5")]} -] +// This is a cloudflare-specific transform. It is no longer used because +// IMPORT_TRANSFORM works for all providers. -D("foo.com",REG,DnsProvider(CF), - A("@","1.2.3.4",{transform: TRANSFORM_INT}) -); \ No newline at end of file +var TRANSFORM_INT = [{ + low: "0.0.0.0", + high: "1.1.1.0", + newBase: "2.2.2.2" +}, { + low: "1.1.1.1", + high: IP("2.2.2.2"), + newIP: ["3.3.3.3", "4.4.4.4", IP("5.5.5.5")] +}]; + +D("foo.com", REG, DnsProvider(CF), + A("@", "1.2.3.4", { + transform: TRANSFORM_INT + }), +); diff --git a/pkg/js/parse_tests/006-transforms.json b/pkg/js/parse_tests/006-transforms.json index 324ef94d6f..53fb9081d0 100644 --- a/pkg/js/parse_tests/006-transforms.json +++ b/pkg/js/parse_tests/006-transforms.json @@ -10,14 +10,37 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "meta": { - "transform": "0.0.0.0 ~ 1.1.1.1 ~ 2.2.2.2 ~ ; 1.1.1.1 ~ 2.2.2.2 ~ 3.3.3.3,4.4.4.4,5.5.5.5 ~ ; 1.1.1.1 ~ 2.2.2.2 ~ ~ 3.3.3.3,4.4.4.4,5.5.5.5" + "transform": "0.0.0.0 ~ 1.1.1.0 ~ 2.2.2.2 ~ ; 1.1.1.1 ~ 2.2.2.2 ~ ~ 3.3.3.3,4.4.4.4,5.5.5.5" + }, + "name": "@", + "target": "3.3.3.3", + "ttl": 300, + "type": "A" + }, + { + "meta": { + "transform": "0.0.0.0 ~ 1.1.1.0 ~ 2.2.2.2 ~ ; 1.1.1.1 ~ 2.2.2.2 ~ ~ 3.3.3.3,4.4.4.4,5.5.5.5" + }, + "name": "@", + "target": "4.4.4.4", + "ttl": 300, + "type": "A" + }, + { + "meta": { + "transform": "0.0.0.0 ~ 1.1.1.0 ~ 2.2.2.2 ~ ; 1.1.1.1 ~ 2.2.2.2 ~ ~ 3.3.3.3,4.4.4.4,5.5.5.5" }, "name": "@", - "target": "1.2.3.4", + "target": "5.5.5.5", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/006-transforms/foo.com.zone b/pkg/js/parse_tests/006-transforms/foo.com.zone index c684fee4f8..a797c245d1 100644 --- a/pkg/js/parse_tests/006-transforms/foo.com.zone +++ b/pkg/js/parse_tests/006-transforms/foo.com.zone @@ -1,4 +1,4 @@ $TTL 300 -@ IN A 3.4.5.6 - IN A 4.5.6.7 - IN A 5.6.7.8 +@ IN A 3.3.3.3 + IN A 4.4.4.4 + IN A 5.5.5.5 diff --git a/pkg/js/parse_tests/007-importTransformTTL.js b/pkg/js/parse_tests/007-importTransformTTL.js index 0919db1595..35a719f7fb 100755 --- a/pkg/js/parse_tests/007-importTransformTTL.js +++ b/pkg/js/parse_tests/007-importTransformTTL.js @@ -1,25 +1,28 @@ -var TRANSFORM_NEWIP = [{ - low: "0.0.0.0", - high: "1.1.1.1", - newIP: "2.2.2.2" -}]; +D("foo1.com", "reg", + A("bar", "1.1.1.1"), + A("foo", "5.5.5.5"), +); + var TRANSFORM_BASE = [{ - low: "0.0.0.0", - high: "1.1.1.1", - newBase: "4.4.4.4" + low: "1.1.1.0", + high: "1.1.1.100", + newBase: "4.4.4.100" }, { - low: "7.7.7.7", - high: "8.8.8.8", - newBase: "9.9.9.9" -}, -]; + low: "5.5.5.2", + high: "5.5.5.100", + newBase: "6.6.6.0" +}, ]; -D("foo1.com", "reg"); - -D("foo2.com", "reg", - IMPORT_TRANSFORM(TRANSFORM_BASE, "foo1.com", 60) +D("inny", "reg", + IMPORT_TRANSFORM(TRANSFORM_BASE, "foo1.com", 60), ); -D("foo3.com", "reg", - IMPORT_TRANSFORM_STRIP(TRANSFORM_NEWIP, "foo1.com", 99, ".com") +var TRANSFORM_NEWIP = [{ + low: "5.5.5.0", + high: "6.0.0.0", + newIP: "7.7.7.7" +}]; + +D("com.inny", "reg", + IMPORT_TRANSFORM_STRIP(TRANSFORM_NEWIP, "foo1.com", 99, "com"), ); diff --git a/pkg/js/parse_tests/007-importTransformTTL.json b/pkg/js/parse_tests/007-importTransformTTL.json index 67aade4653..273f922941 100644 --- a/pkg/js/parse_tests/007-importTransformTTL.json +++ b/pkg/js/parse_tests/007-importTransformTTL.json @@ -3,39 +3,69 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo1.com" + }, "name": "foo1.com", - "records": [], + "records": [ + { + "name": "bar", + "target": "1.1.1.1", + "ttl": 300, + "type": "A" + }, + { + "name": "foo", + "target": "5.5.5.5", + "ttl": 300, + "type": "A" + } + ], "registrar": "reg" }, { "dnsProviders": {}, - "name": "foo2.com", + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "inny" + }, + "name": "inny", "records": [ { - "meta": { - "transform_table": "0.0.0.0 ~ 1.1.1.1 ~ 4.4.4.4 ~ ; 7.7.7.7 ~ 8.8.8.8 ~ 9.9.9.9 ~ " - }, - "name": "@", - "target": "foo1.com", + "name": "bar.foo1.com", + "target": "4.4.4.101", "ttl": 60, - "type": "IMPORT_TRANSFORM" + "type": "A" + }, + { + "name": "foo.foo1.com", + "target": "6.6.6.3", + "ttl": 60, + "type": "A" } ], "registrar": "reg" }, { "dnsProviders": {}, - "name": "foo3.com", + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "com.inny" + }, + "name": "com.inny", "records": [ { - "meta": { - "transform_suffixstrip": ".com", - "transform_table": "0.0.0.0 ~ 1.1.1.1 ~ ~ 2.2.2.2" - }, - "name": "@", - "target": "foo1.com", + "name": "bar.foo1", + "target": "1.1.1.1", + "ttl": 99, + "type": "A" + }, + { + "name": "foo.foo1", + "target": "7.7.7.7", "ttl": 99, - "type": "IMPORT_TRANSFORM" + "type": "A" } ], "registrar": "reg" diff --git a/pkg/js/parse_tests/008-import.js b/pkg/js/parse_tests/008-import.js index 5ffd406ecf..15cc29cb1e 100644 --- a/pkg/js/parse_tests/008-import.js +++ b/pkg/js/parse_tests/008-import.js @@ -1,2 +1 @@ - -require("./import.js") +require("./import.js"); diff --git a/pkg/js/parse_tests/008-import.json b/pkg/js/parse_tests/008-import.json index b1b4fb02fe..b9ff68b241 100644 --- a/pkg/js/parse_tests/008-import.json +++ b/pkg/js/parse_tests/008-import.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/009-reverse.js b/pkg/js/parse_tests/009-reverse.js index 8f4261afdc..bc09c60a39 100644 --- a/pkg/js/parse_tests/009-reverse.js +++ b/pkg/js/parse_tests/009-reverse.js @@ -1 +1 @@ -D(REV("1.2.0.0/16"),"none"); +D(REV("1.2.0.0/16"), "none"); diff --git a/pkg/js/parse_tests/009-reverse.json b/pkg/js/parse_tests/009-reverse.json index f1b895339f..96ec46cf59 100644 --- a/pkg/js/parse_tests/009-reverse.json +++ b/pkg/js/parse_tests/009-reverse.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "2.1.in-addr.arpa" + }, "name": "2.1.in-addr.arpa", "records": [], "registrar": "none" diff --git a/pkg/js/parse_tests/010-alias.js b/pkg/js/parse_tests/010-alias.js index e9a27ab4fd..1959848a01 100644 --- a/pkg/js/parse_tests/010-alias.js +++ b/pkg/js/parse_tests/010-alias.js @@ -1,3 +1,3 @@ -D("foo.com","none", - ALIAS("@","foo.com.") -); \ No newline at end of file +D("foo.com", "none", + ALIAS("@", "foo.com."), +); diff --git a/pkg/js/parse_tests/010-alias.json b/pkg/js/parse_tests/010-alias.json index c4985bfe0c..512c9b59aa 100644 --- a/pkg/js/parse_tests/010-alias.json +++ b/pkg/js/parse_tests/010-alias.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "foo.com.", + "ttl": 300, "type": "ALIAS" } ], diff --git a/pkg/js/parse_tests/011-cfRedirect.js b/pkg/js/parse_tests/011-cfRedirect.js index 9c9dad9390..d649afbf3b 100644 --- a/pkg/js/parse_tests/011-cfRedirect.js +++ b/pkg/js/parse_tests/011-cfRedirect.js @@ -1,4 +1,4 @@ -D("foo.com","none", - CF_REDIRECT("test.foo.com","https://goo.com/$1"), - CF_TEMP_REDIRECT("test.foo.com","https://goo.com/$1") -); \ No newline at end of file +D("foo.com", "none", + CF_REDIRECT("test.foo.com", "https://goo.com/$1"), + CF_TEMP_REDIRECT("test.foo.com", "https://goo.com/$1"), +); diff --git a/pkg/js/parse_tests/011-cfRedirect.json b/pkg/js/parse_tests/011-cfRedirect.json index b360053694..5eb92fb955 100644 --- a/pkg/js/parse_tests/011-cfRedirect.json +++ b/pkg/js/parse_tests/011-cfRedirect.json @@ -3,16 +3,28 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { + "meta": { + "orig_custom_type": "CF_REDIRECT" + }, "name": "@", "target": "test.foo.com,https://goo.com/$1", + "ttl": 300, "type": "CF_REDIRECT" }, { + "meta": { + "orig_custom_type": "CF_TEMP_REDIRECT" + }, "name": "@", "target": "test.foo.com,https://goo.com/$1", + "ttl": 300, "type": "CF_TEMP_REDIRECT" } ], diff --git a/pkg/js/parse_tests/012-duration.js b/pkg/js/parse_tests/012-duration.js index 69c2a64e91..4940d1161a 100644 --- a/pkg/js/parse_tests/012-duration.js +++ b/pkg/js/parse_tests/012-duration.js @@ -1,7 +1,7 @@ -D("foo.com","none", - A("@","1.2.3.4", TTL("300s")), - A("a","1.2.3.5", TTL("300")), - A("b","1.2.3.6", TTL("3m")), - A("c","1.2.3.7", TTL("3h")), - A("d","1.2.3.8", TTL("3d")) +D("foo.com", "none", + A("@", "1.2.3.4", TTL("300s")), + A("a", "1.2.3.5", TTL("300")), + A("b", "1.2.3.6", TTL("3m")), + A("c", "1.2.3.7", TTL("3h")), + A("d", "1.2.3.8", TTL("3d")), ); diff --git a/pkg/js/parse_tests/012-duration.json b/pkg/js/parse_tests/012-duration.json index be8642ae74..b766781d6e 100644 --- a/pkg/js/parse_tests/012-duration.json +++ b/pkg/js/parse_tests/012-duration.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { diff --git a/pkg/js/parse_tests/013-mx.js b/pkg/js/parse_tests/013-mx.js index ba37be2a7d..61f0c677cb 100644 --- a/pkg/js/parse_tests/013-mx.js +++ b/pkg/js/parse_tests/013-mx.js @@ -1,3 +1,3 @@ -D("foo.com","none", - MX("@",15,"foo.com.") +D("foo.com", "none", + MX("@", 15, "foo.com."), ); diff --git a/pkg/js/parse_tests/013-mx.json b/pkg/js/parse_tests/013-mx.json index d1476069cb..3bc140d773 100644 --- a/pkg/js/parse_tests/013-mx.json +++ b/pkg/js/parse_tests/013-mx.json @@ -3,12 +3,17 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "mxpreference": 15, "name": "@", "target": "foo.com.", + "ttl": 300, "type": "MX" } ], diff --git a/pkg/js/parse_tests/014-caa.js b/pkg/js/parse_tests/014-caa.js index c755ee4baa..edfc161244 100644 --- a/pkg/js/parse_tests/014-caa.js +++ b/pkg/js/parse_tests/014-caa.js @@ -1,13 +1,13 @@ -D("foo.com","none", +D("foo.com", "none", // Allow letsencrypt to issue certificate for this domain - CAA("@","issue","letsencrypt.org"), + CAA("@", "issue", "letsencrypt.org"), // Allow no CA to issue wildcard certificate for this domain - CAA("@","issuewild",";"), + CAA("@", "issuewild", ";"), // Report all violation to test@example.com. If CA does not support // this record then refuse to issue any certificate CAA("@", "iodef", "mailto:test@example.com", CAA_CRITICAL), // Optionally report violation to http://example.com CAA("@", "iodef", "http://example.com"), // Report violation to https://example.com - CAA("@", "iodef", "https://example.com", CAA_CRITICAL) + CAA("@", "iodef", "https://example.com", CAA_CRITICAL), ); diff --git a/pkg/js/parse_tests/014-caa.json b/pkg/js/parse_tests/014-caa.json index bc6bc125d0..9fc8b53196 100644 --- a/pkg/js/parse_tests/014-caa.json +++ b/pkg/js/parse_tests/014-caa.json @@ -3,18 +3,18 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { - "caatag": "issue", - "name": "@", - "target": "letsencrypt.org", - "type": "CAA" - }, - { - "caatag": "issuewild", + "caaflag": 128, + "caatag": "iodef", "name": "@", - "target": ";", + "target": "https://example.com", + "ttl": 300, "type": "CAA" }, { @@ -22,19 +22,28 @@ "caatag": "iodef", "name": "@", "target": "mailto:test@example.com", + "ttl": 300, "type": "CAA" }, { "caatag": "iodef", "name": "@", "target": "http://example.com", + "ttl": 300, "type": "CAA" }, { - "caaflag": 128, - "caatag": "iodef", + "caatag": "issue", "name": "@", - "target": "https://example.com", + "target": "letsencrypt.org", + "ttl": 300, + "type": "CAA" + }, + { + "caatag": "issuewild", + "name": "@", + "target": ";", + "ttl": 300, "type": "CAA" } ], diff --git a/pkg/js/parse_tests/015-tlsa.js b/pkg/js/parse_tests/015-tlsa.js index df1b52ab32..89b086bd47 100644 --- a/pkg/js/parse_tests/015-tlsa.js +++ b/pkg/js/parse_tests/015-tlsa.js @@ -1,3 +1,3 @@ -D("foo.com","none", - TLSA("_443._tcp",3,1,1,"MDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiAgLQo=") +D("foo.com", "none", + TLSA("_443._tcp", 3, 1, 1, "MDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiAgLQo="), ); diff --git a/pkg/js/parse_tests/015-tlsa.json b/pkg/js/parse_tests/015-tlsa.json index 0306453af4..9675537e6d 100644 --- a/pkg/js/parse_tests/015-tlsa.json +++ b/pkg/js/parse_tests/015-tlsa.json @@ -3,14 +3,19 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "_443._tcp", - "target": "MDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiAgLQo=", + "target": "mdfiytq3mtljodbinmzlotexyja5mwe3yza1mti0yjy0zwvly2u5njrlmdljmdu4zwy4zjk4mdvkywnhntq2yiaglqo=", "tlsamatchingtype": 1, "tlsaselector": 1, "tlsausage": 3, + "ttl": 300, "type": "TLSA" } ], diff --git a/pkg/js/parse_tests/017-txt.js b/pkg/js/parse_tests/017-txt.js index abc4a818a6..cd80b50b1d 100644 --- a/pkg/js/parse_tests/017-txt.js +++ b/pkg/js/parse_tests/017-txt.js @@ -1,7 +1,7 @@ -D("foo.com","none" - , TXT("a","simple") - , TXT("b","ws at end ") - , TXT("c",["one"]) - , TXT("d",["bonie", "clyde"]) - , TXT("e",["straw", "wood", "brick"]) +D("foo.com", "none", + TXT("a", "simple"), + TXT("b", "ws at end "), + TXT("c", ["one"]), + TXT("d", ["bonie", "clyde"]), + TXT("e", ["straw", "wood", "brick"]), ); diff --git a/pkg/js/parse_tests/017-txt.json b/pkg/js/parse_tests/017-txt.json index 98adb4bbdf..b340fd6273 100644 --- a/pkg/js/parse_tests/017-txt.json +++ b/pkg/js/parse_tests/017-txt.json @@ -3,31 +3,40 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "a", "target": "simple", + "ttl": 300, "type": "TXT" }, { "name": "b", "target": "ws at end ", + "ttl": 300, "type": "TXT" }, { "name": "c", "target": "one", + "ttl": 300, "type": "TXT" }, { "name": "d", "target": "bonieclyde", + "ttl": 300, "type": "TXT" }, { "name": "e", "target": "strawwoodbrick", + "ttl": 300, "type": "TXT" } ], diff --git a/pkg/js/parse_tests/018-dkim.js b/pkg/js/parse_tests/018-dkim.js index d08543e7a7..70c75ae671 100644 --- a/pkg/js/parse_tests/018-dkim.js +++ b/pkg/js/parse_tests/018-dkim.js @@ -1,3 +1,5 @@ -D("foo.com","none" - , TXT("dkimtest2",DKIM("this string is 255 bytes long.hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKZogtjOlHoeY8iZ5o5brlPOsj/a2Q9Bopu1kHxlxrdw7tZVL9FzUMngiIYGrl8dbP7Rvk7TLMoxHxVkRZPBtIpsKIab/gOUoPLQVYbrAmzyguHYBwAApi3H/pvjUsK8+XF0dKY17AR96lokAPqvfBaUb+DSx8zNw2hrYWYVqvCtnxHUGEUhT1bTlEZBptH3jthis is the remainder. it is 156 bytes long.mOhl2JmbsFKy+RoMTwbkk0/meRvcEFWLHkr4MSgbnie6OpQvM4Y51+kO6DUVr3rwjrdVO9wpFt+n/hdQ92TNif17RMJtE5AGaQ6BN3yJQIDAQAB;")) +D("foo.com", "none", + TXT("dkimtest2", + DKIM("this string is 255 bytes long.hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKZogtjOlHoeY8iZ5o5brlPOsj/a2Q9Bopu1kHxlxrdw7tZVL9FzUMngiIYGrl8dbP7Rvk7TLMoxHxVkRZPBtIpsKIab/gOUoPLQVYbrAmzyguHYBwAApi3H/pvjUsK8+XF0dKY17AR96lokAPqvfBaUb+DSx8zNw2hrYWYVqvCtnxHUGEUhT1bTlEZBptH3jthis is the remainder. it is 156 bytes long.mOhl2JmbsFKy+RoMTwbkk0/meRvcEFWLHkr4MSgbnie6OpQvM4Y51+kO6DUVr3rwjrdVO9wpFt+n/hdQ92TNif17RMJtE5AGaQ6BN3yJQIDAQAB;"), + ), ); diff --git a/pkg/js/parse_tests/018-dkim.json b/pkg/js/parse_tests/018-dkim.json index e0a99d4524..8a8675eee8 100644 --- a/pkg/js/parse_tests/018-dkim.json +++ b/pkg/js/parse_tests/018-dkim.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "dkimtest2", "target": "this string is 255 bytes long.hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKZogtjOlHoeY8iZ5o5brlPOsj/a2Q9Bopu1kHxlxrdw7tZVL9FzUMngiIYGrl8dbP7Rvk7TLMoxHxVkRZPBtIpsKIab/gOUoPLQVYbrAmzyguHYBwAApi3H/pvjUsK8+XF0dKY17AR96lokAPqvfBaUb+DSx8zNw2hrYWYVqvCtnxHUGEUhT1bTlEZBptH3jthis is the remainder. it is 156 bytes long.mOhl2JmbsFKy+RoMTwbkk0/meRvcEFWLHkr4MSgbnie6OpQvM4Y51+kO6DUVr3rwjrdVO9wpFt+n/hdQ92TNif17RMJtE5AGaQ6BN3yJQIDAQAB;", + "ttl": 300, "type": "TXT" } ], diff --git a/pkg/js/parse_tests/019-r53-alias.js b/pkg/js/parse_tests/019-r53-alias.js index 6c3f55a5e1..62fba1ea4d 100644 --- a/pkg/js/parse_tests/019-r53-alias.js +++ b/pkg/js/parse_tests/019-r53-alias.js @@ -1,15 +1,15 @@ D("foo.com", "none", - R53_ALIAS("mxtest", "MX", "foo.com."), - R53_ALIAS("atest", "A", "foo.com."), - R53_ALIAS("atest", "A", "foo.com.", R53_ZONE("Z2FTEDLFRTF")), - R53_ALIAS("aevaltargethealthtest", "A", "foo.com.", R53_EVALUATE_TARGET_HEALTH(true)), - R53_ALIAS("aaaatest", "AAAA", "foo.com."), - R53_ALIAS("aaaatest", "AAAA", "foo.com.", R53_ZONE("ERERTFGFGF")), - R53_ALIAS("cnametest", "CNAME", "foo.com."), - R53_ALIAS("ptrtest", "PTR", "foo.com."), - R53_ALIAS("txttest", "TXT", "foo.com."), - R53_ALIAS("srvtest", "SRV", "foo.com."), - R53_ALIAS("spftest", "SPF", "foo.com."), - R53_ALIAS("caatest", "CAA", "foo.com."), - R53_ALIAS("naptrtest", "NAPTR", "foo.com.") -); \ No newline at end of file + R53_ALIAS("mxtest", "MX", "foo.com."), + R53_ALIAS("atest", "A", "foo.com."), + R53_ALIAS("atest", "A", "foo.com.", R53_ZONE("Z2FTEDLFRTF")), + R53_ALIAS("aevaltargethealthtest", "A", "foo.com.", R53_EVALUATE_TARGET_HEALTH(true)), + R53_ALIAS("aaaatest", "AAAA", "foo.com."), + R53_ALIAS("aaaatest", "AAAA", "foo.com.", R53_ZONE("ERERTFGFGF")), + R53_ALIAS("cnametest", "CNAME", "foo.com."), + R53_ALIAS("ptrtest", "PTR", "foo.com."), + R53_ALIAS("txttest", "TXT", "foo.com."), + R53_ALIAS("srvtest", "SRV", "foo.com."), + R53_ALIAS("spftest", "SPF", "foo.com."), + R53_ALIAS("caatest", "CAA", "foo.com."), + R53_ALIAS("naptrtest", "NAPTR", "foo.com.") +); diff --git a/pkg/js/parse_tests/019-r53-alias.json b/pkg/js/parse_tests/019-r53-alias.json index 44343da1d0..dc9fb3a4cf 100644 --- a/pkg/js/parse_tests/019-r53-alias.json +++ b/pkg/js/parse_tests/019-r53-alias.json @@ -3,125 +3,181 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { - "name": "mxtest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "aaaatest", "r53_alias": { "evaluate_target_health": "false", - "type": "MX" + "type": "AAAA" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "atest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "aaaatest", "r53_alias": { "evaluate_target_health": "false", - "type": "A" + "type": "AAAA", + "zone_id": "ERERTFGFGF" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "atest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "aevaltargethealthtest", "r53_alias": { - "evaluate_target_health": "false", - "type": "A", - "zone_id": "Z2FTEDLFRTF" + "evaluate_target_health": "true", + "type": "A" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "aevaltargethealthtest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "atest", "r53_alias": { - "evaluate_target_health": "true", + "evaluate_target_health": "false", "type": "A" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "aaaatest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "atest", "r53_alias": { "evaluate_target_health": "false", - "type": "AAAA" + "type": "A", + "zone_id": "Z2FTEDLFRTF" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "aaaatest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "caatest", "r53_alias": { "evaluate_target_health": "false", - "type": "AAAA", - "zone_id": "ERERTFGFGF" + "type": "CAA" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { + "meta": { + "orig_custom_type": "R53_ALIAS" + }, "name": "cnametest", "r53_alias": { "evaluate_target_health": "false", "type": "CNAME" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "ptrtest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "mxtest", "r53_alias": { "evaluate_target_health": "false", - "type": "PTR" + "type": "MX" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "txttest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "naptrtest", "r53_alias": { "evaluate_target_health": "false", - "type": "TXT" + "type": "NAPTR" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "srvtest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "ptrtest", "r53_alias": { "evaluate_target_health": "false", - "type": "SRV" + "type": "PTR" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { + "meta": { + "orig_custom_type": "R53_ALIAS" + }, "name": "spftest", "r53_alias": { "evaluate_target_health": "false", "type": "SPF" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "caatest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "srvtest", "r53_alias": { "evaluate_target_health": "false", - "type": "CAA" + "type": "SRV" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" }, { - "name": "naptrtest", + "meta": { + "orig_custom_type": "R53_ALIAS" + }, + "name": "txttest", "r53_alias": { "evaluate_target_health": "false", - "type": "NAPTR" + "type": "TXT" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" } ], diff --git a/pkg/js/parse_tests/020-complexRequire.js b/pkg/js/parse_tests/020-complexRequire.js index 6c8d1148b7..3fd7ad25e2 100644 --- a/pkg/js/parse_tests/020-complexRequire.js +++ b/pkg/js/parse_tests/020-complexRequire.js @@ -1 +1 @@ -require('./complexImports/base.js'); \ No newline at end of file +require('./complexImports/base.js'); diff --git a/pkg/js/parse_tests/020-complexRequire.json b/pkg/js/parse_tests/020-complexRequire.json index 3615543a29..77b6e5a395 100644 --- a/pkg/js/parse_tests/020-complexRequire.json +++ b/pkg/js/parse_tests/020-complexRequire.json @@ -3,31 +3,40 @@ "domains": [ { "dnsProviders": {}, - "name": "foo.com", + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "sortfoo.com" + }, + "name": "sortfoo.com", "records": [ { "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" }, { - "name": "A", + "name": "a", "target": "foo.com.", + "ttl": 300, "type": "CNAME" }, { - "name": "C", + "name": "b", "target": "foo.com.", + "ttl": 300, "type": "CNAME" }, { - "name": "D", + "name": "c", "target": "foo.com.", + "ttl": 300, "type": "CNAME" }, { - "name": "B", + "name": "d", "target": "foo.com.", + "ttl": 300, "type": "CNAME" } ], diff --git a/pkg/js/parse_tests/021-srv.js b/pkg/js/parse_tests/021-srv.js index a7cf7d0371..0daeba0d9f 100644 --- a/pkg/js/parse_tests/021-srv.js +++ b/pkg/js/parse_tests/021-srv.js @@ -1,7 +1,7 @@ -D("foo.com","none" - , SRV('_ntp._udp', 1, 100, 123, 'one.foo.com.') - , SRV('_ntp._udp', 2, 100, 123, 'two') - , SRV('_ntp._udp', 3, 100, 123, 'localhost') - , SRV('_ntp._udp', 4, 100, 123, 'three.example.com.') - , SRV('_ntp._udp', 0, 0, 1, 'zeros') +D("foo.com", "none", + SRV('_ntp._udp', 1, 100, 123, 'one.foo.com.'), + SRV('_ntp._udp', 2, 100, 123, 'two'), + SRV('_ntp._udp', 3, 100, 123, 'localhost'), + SRV('_ntp._udp', 4, 100, 123, 'three.example.com.'), + SRV('_ntp._udp', 0, 0, 1, 'zeros'), ); diff --git a/pkg/js/parse_tests/021-srv.json b/pkg/js/parse_tests/021-srv.json index 4dce2e09a2..8203442ff5 100644 --- a/pkg/js/parse_tests/021-srv.json +++ b/pkg/js/parse_tests/021-srv.json @@ -3,14 +3,26 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ + { + "name": "_ntp._udp", + "srvport": 1, + "target": "zeros.foo.com.", + "ttl": 300, + "type": "SRV" + }, { "name": "_ntp._udp", "srvport": 123, "srvpriority": 1, "srvweight": 100, "target": "one.foo.com.", + "ttl": 300, "type": "SRV" }, { @@ -18,7 +30,8 @@ "srvport": 123, "srvpriority": 2, "srvweight": 100, - "target": "two", + "target": "two.foo.com.", + "ttl": 300, "type": "SRV" }, { @@ -26,7 +39,8 @@ "srvport": 123, "srvpriority": 3, "srvweight": 100, - "target": "localhost", + "target": "localhost.foo.com.", + "ttl": 300, "type": "SRV" }, { @@ -35,12 +49,7 @@ "srvpriority": 4, "srvweight": 100, "target": "three.example.com.", - "type": "SRV" - }, - { - "name": "_ntp._udp", - "srvport": 1, - "target": "zeros", + "ttl": 300, "type": "SRV" } ], diff --git a/pkg/js/parse_tests/022-sshfp.js b/pkg/js/parse_tests/022-sshfp.js index 146c92c80b..aab92b0e71 100644 --- a/pkg/js/parse_tests/022-sshfp.js +++ b/pkg/js/parse_tests/022-sshfp.js @@ -1,10 +1,10 @@ -D("foo.com","none", - SSHFP("@",1,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",1,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), - SSHFP("@",2,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",2,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), - SSHFP("@",3,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",3,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), - SSHFP("@",4,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",4,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc") +D("foo.com", "none", + SSHFP("@", 1, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@", 1, 2, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), + SSHFP("@", 2, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@", 2, 2, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), + SSHFP("@", 3, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@", 3, 2, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), + SSHFP("@", 4, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@", 4, 2, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), ); diff --git a/pkg/js/parse_tests/022-sshfp.json b/pkg/js/parse_tests/022-sshfp.json index 713939dfde..56cfee5a51 100644 --- a/pkg/js/parse_tests/022-sshfp.json +++ b/pkg/js/parse_tests/022-sshfp.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { @@ -10,6 +14,7 @@ "sshfpalgorithm": 1, "sshfpfingerprint": 1, "target": "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c", + "ttl": 300, "type": "SSHFP" }, { @@ -17,6 +22,7 @@ "sshfpalgorithm": 1, "sshfpfingerprint": 2, "target": "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc", + "ttl": 300, "type": "SSHFP" }, { @@ -24,6 +30,7 @@ "sshfpalgorithm": 2, "sshfpfingerprint": 1, "target": "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c", + "ttl": 300, "type": "SSHFP" }, { @@ -31,6 +38,7 @@ "sshfpalgorithm": 2, "sshfpfingerprint": 2, "target": "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc", + "ttl": 300, "type": "SSHFP" }, { @@ -38,6 +46,7 @@ "sshfpalgorithm": 3, "sshfpfingerprint": 1, "target": "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c", + "ttl": 300, "type": "SSHFP" }, { @@ -45,6 +54,7 @@ "sshfpalgorithm": 3, "sshfpfingerprint": 2, "target": "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc", + "ttl": 300, "type": "SSHFP" }, { @@ -52,6 +62,7 @@ "sshfpalgorithm": 4, "sshfpfingerprint": 1, "target": "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c", + "ttl": 300, "type": "SSHFP" }, { @@ -59,6 +70,7 @@ "sshfpalgorithm": 4, "sshfpfingerprint": 2, "target": "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc", + "ttl": 300, "type": "SSHFP" } ], diff --git a/pkg/js/parse_tests/023-ignored-glob-records.js b/pkg/js/parse_tests/023-ignored-glob-records.js index 51c7076a78..46cb1386b5 100644 --- a/pkg/js/parse_tests/023-ignored-glob-records.js +++ b/pkg/js/parse_tests/023-ignored-glob-records.js @@ -1,3 +1,3 @@ -D("foo.com", "none" - , IGNORE("\\*.testignore") +D("foo.com", "none", + IGNORE("\\*.testignore"), ); diff --git a/pkg/js/parse_tests/023-ignored-glob-records.json b/pkg/js/parse_tests/023-ignored-glob-records.json index 696594ccfc..fdacff7274 100644 --- a/pkg/js/parse_tests/023-ignored-glob-records.json +++ b/pkg/js/parse_tests/023-ignored-glob-records.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [], "registrar": "none", diff --git a/pkg/js/parse_tests/024-json-import.js b/pkg/js/parse_tests/024-json-import.js index 26e9690883..f2ec593d33 100644 --- a/pkg/js/parse_tests/024-json-import.js +++ b/pkg/js/parse_tests/024-json-import.js @@ -1,8 +1,8 @@ -var domains = require('./domain-ip-map.json') +var domains = require('./domain-ip-map.json'); -var domain = "foo.com" -var ip = domains["foo.com"] +var domain = "foo.com"; +var ip = domains["foo.com"]; -D(domain,"none", - A("@",ip) +D(domain, "none", + A("@", ip), ); diff --git a/pkg/js/parse_tests/024-json-import.json b/pkg/js/parse_tests/024-json-import.json index 0b8d34272d..357220364b 100644 --- a/pkg/js/parse_tests/024-json-import.json +++ b/pkg/js/parse_tests/024-json-import.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "1.1.1.1", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/025-autodnssec.js b/pkg/js/parse_tests/025-autodnssec.js index 68184a5185..6df1f80459 100644 --- a/pkg/js/parse_tests/025-autodnssec.js +++ b/pkg/js/parse_tests/025-autodnssec.js @@ -1,8 +1,7 @@ -D("nothing.com","none" +D("nothing.com", "none"); +D("with.com", "none", + AUTODNSSEC_ON ); -D("with.com","none", - AUTODNSSEC_ON -); -D("without.com","none", - AUTODNSSEC_OFF +D("without.com", "none", + AUTODNSSEC_OFF, ); diff --git a/pkg/js/parse_tests/025-autodnssec.json b/pkg/js/parse_tests/025-autodnssec.json index 260885838c..587dfe1d7e 100644 --- a/pkg/js/parse_tests/025-autodnssec.json +++ b/pkg/js/parse_tests/025-autodnssec.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "nothing.com" + }, "name": "nothing.com", "records": [], "registrar": "none" @@ -10,6 +14,10 @@ { "auto_dnssec": "on", "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "with.com" + }, "name": "with.com", "records": [], "registrar": "none" @@ -17,6 +25,10 @@ { "auto_dnssec": "off", "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "without.com" + }, "name": "without.com", "records": [], "registrar": "none" diff --git a/pkg/js/parse_tests/026-azure-alias.js b/pkg/js/parse_tests/026-azure-alias.js index 06ea367d53..81cb94e40f 100644 --- a/pkg/js/parse_tests/026-azure-alias.js +++ b/pkg/js/parse_tests/026-azure-alias.js @@ -1,5 +1,5 @@ D("foo.com", "none", - AZURE_ALIAS("atest", "A", "foo.com."), - AZURE_ALIAS("aaaatest", "AAAA", "foo.com."), - AZURE_ALIAS("cnametest", "CNAME", "foo.com.") -); \ No newline at end of file + AZURE_ALIAS("atest", "A", "foo.com."), + AZURE_ALIAS("aaaatest", "AAAA", "foo.com."), + AZURE_ALIAS("cnametest", "CNAME", "foo.com."), +); diff --git a/pkg/js/parse_tests/026-azure-alias.json b/pkg/js/parse_tests/026-azure-alias.json index 64d740fb7a..3428526edc 100644 --- a/pkg/js/parse_tests/026-azure-alias.json +++ b/pkg/js/parse_tests/026-azure-alias.json @@ -3,30 +3,46 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "azure_alias": { - "type": "A" + "type": "AAAA" }, - "name": "atest", + "meta": { + "orig_custom_type": "AZURE_ALIAS" + }, + "name": "aaaatest", "target": "foo.com.", + "ttl": 300, "type": "AZURE_ALIAS" }, { "azure_alias": { - "type": "AAAA" + "type": "A" }, - "name": "aaaatest", + "meta": { + "orig_custom_type": "AZURE_ALIAS" + }, + "name": "atest", "target": "foo.com.", + "ttl": 300, "type": "AZURE_ALIAS" }, { "azure_alias": { "type": "CNAME" }, + "meta": { + "orig_custom_type": "AZURE_ALIAS" + }, "name": "cnametest", "target": "foo.com.", + "ttl": 300, "type": "AZURE_ALIAS" } ], diff --git a/pkg/js/parse_tests/027-ds.js b/pkg/js/parse_tests/027-ds.js index 4eccc76a8a..05bffb8d93 100644 --- a/pkg/js/parse_tests/027-ds.js +++ b/pkg/js/parse_tests/027-ds.js @@ -1,4 +1,4 @@ -D("foo.com","none", +D("foo.com", "none", DS("@", 1000, 13, 2, "AABBCCDDEEFF"), - DS("@", 1, 1, 1, "FFFF") + DS("@", 1, 1, 1, "FFFF"), ); diff --git a/pkg/js/parse_tests/027-ds.json b/pkg/js/parse_tests/027-ds.json index b68e658728..5aec91cbc5 100644 --- a/pkg/js/parse_tests/027-ds.json +++ b/pkg/js/parse_tests/027-ds.json @@ -3,24 +3,30 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { - "dsalgorithm": 13, - "dsdigest": "AABBCCDDEEFF", - "dsdigesttype": 2, - "dskeytag": 1000, + "dsalgorithm": 1, + "dsdigest": "FFFF", + "dsdigesttype": 1, + "dskeytag": 1, "name": "@", "target": "", + "ttl": 300, "type": "DS" }, { - "dsalgorithm": 1, - "dsdigest": "FFFF", - "dsdigesttype": 1, - "dskeytag": 1, + "dsalgorithm": 13, + "dsdigest": "AABBCCDDEEFF", + "dsdigesttype": 2, + "dskeytag": 1000, "name": "@", "target": "", + "ttl": 300, "type": "DS" } ], diff --git a/pkg/js/parse_tests/028-dextend.js b/pkg/js/parse_tests/028-dextend.js index 7504ce12e9..ec37a29616 100644 --- a/pkg/js/parse_tests/028-dextend.js +++ b/pkg/js/parse_tests/028-dextend.js @@ -3,20 +3,20 @@ var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); // Zone and subdomain Zone: D("foo.com", REG, DnsProvider(CF), - A("@", "10.1.1.1"), - A("www", "10.2.2.2") + A("@", "10.1.1.1"), + A("www", "10.2.2.2"), ); D("bar.foo.com", REG, DnsProvider(CF), - A("@", "10.3.3.3"), - A("www", "10.4.4.4") + A("@", "10.3.3.3"), + A("www", "10.4.4.4"), ); // Zone that gets extended D("foo.edu", REG, DnsProvider(CF), - A("@", "10.5.5.5"), - A("www", "10.6.6.6") + A("@", "10.5.5.5"), + A("www", "10.6.6.6"), ); D_EXTEND("foo.edu", - A("more1", "10.7.7.7"), - A("more2", "10.8.8.8") + A("more1", "10.7.7.7"), + A("more2", "10.8.8.8"), ); diff --git a/pkg/js/parse_tests/028-dextend.json b/pkg/js/parse_tests/028-dextend.json index 85ee867a5a..cd5666d632 100644 --- a/pkg/js/parse_tests/028-dextend.json +++ b/pkg/js/parse_tests/028-dextend.json @@ -10,16 +10,22 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "10.1.1.1", + "ttl": 300, "type": "A" }, { "name": "www", "target": "10.2.2.2", + "ttl": 300, "type": "A" } ], @@ -29,16 +35,22 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "bar.foo.com" + }, "name": "bar.foo.com", "records": [ { "name": "@", "target": "10.3.3.3", + "ttl": 300, "type": "A" }, { "name": "www", "target": "10.4.4.4", + "ttl": 300, "type": "A" } ], @@ -48,26 +60,34 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.edu" + }, "name": "foo.edu", "records": [ { "name": "@", "target": "10.5.5.5", - "type": "A" - }, - { - "name": "www", - "target": "10.6.6.6", + "ttl": 300, "type": "A" }, { "name": "more1", "target": "10.7.7.7", + "ttl": 300, "type": "A" }, { "name": "more2", "target": "10.8.8.8", + "ttl": 300, + "type": "A" + }, + { + "name": "www", + "target": "10.6.6.6", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/029-dextendsub.js b/pkg/js/parse_tests/029-dextendsub.js index 2cf856ecc3..701d6bbb1d 100644 --- a/pkg/js/parse_tests/029-dextendsub.js +++ b/pkg/js/parse_tests/029-dextendsub.js @@ -3,133 +3,133 @@ var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); // Zone that gets extended by subdomain D("foo.net", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "10.1.1.1"), - A("www", "10.2.2.2") + DefaultTTL(300), + A("@", "10.1.1.1"), + A("www", "10.2.2.2"), ); D_EXTEND("bar.foo.net", - A("@", "10.3.3.3"), - A("www", "10.4.4.4") + A("@", "10.3.3.3"), + A("www", "10.4.4.4"), ); // Zone and subdomain zone, each get extended. D("foo.tld", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "20.5.5.5"), - A("www", "20.6.6.6") + DefaultTTL(300), + A("@", "20.5.5.5"), + A("www", "20.6.6.6"), ); D("bar.foo.tld", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "30.7.7.7"), - A("www", "30.8.8.8") + DefaultTTL(300), + A("@", "30.7.7.7"), + A("www", "30.8.8.8"), ); D_EXTEND("bar.foo.tld", - A("a", "30.9.9.9") + A("a", "30.9.9.9"), ); D_EXTEND("foo.tld", - A("a", "20.10.10.10") + A("a", "20.10.10.10"), ); // Zone and subdomain zone, each get extended by a subdomain. D("foo.help", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "40.12.12.12"), - A("www", "40.12.12.12") + DefaultTTL(300), + A("@", "40.12.12.12"), + A("www", "40.12.12.12"), ); D("bar.foo.help", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "50.13.13.13"), - A("www", "50.14.14.14") + DefaultTTL(300), + A("@", "50.13.13.13"), + A("www", "50.14.14.14"), ); D_EXTEND("zip.bar.foo.help", - A("@", "50.15.15.15"), - A("www", "50.16.16.16") + A("@", "50.15.15.15"), + A("www", "50.16.16.16"), ); D_EXTEND("morty.foo.help", - A("@", "40.17.17.17"), - A("www", "40.18.18.18") + A("@", "40.17.17.17"), + A("www", "40.18.18.18"), ); // Zone extended by a subdomain and sub-subdomain. D("foo.here", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "60.19.19.19"), - A("www", "60.20.20.20") + DefaultTTL(300), + A("@", "60.19.19.19"), + A("www", "60.20.20.20"), ); D_EXTEND("bar.foo.here", - A("@", "60.21.21.21"), - A("www", "60.22.22.22") + A("@", "60.21.21.21"), + A("www", "60.22.22.22"), ); D_EXTEND("baz.bar.foo.here", - A("@", "60.23.23.23"), - A("www", "60.24.24.24") + A("@", "60.23.23.23"), + A("www", "60.24.24.24"), ); // Zone extended by a sub-subdomain. D_EXTEND("a.long.path.of.sub.domains.foo.net", - A("@", "10.25.25.25"), - A("www", "10.26.26.26") + A("@", "10.25.25.25"), + A("www", "10.26.26.26"), ); // ASCII zone D("example.com", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "10.0.0.1"), - A("www", "10.0.0.2") + DefaultTTL(300), + A("@", "10.0.0.1"), + A("www", "10.0.0.2"), ); // … extended by an IDN subdomain D_EXTEND("düsseldorf.example.com", - A("@", "10.0.0.3"), - A("www", "10.0.0.4") + A("@", "10.0.0.3"), + A("www", "10.0.0.4"), ); // … extended by a one-character IDN subdomain D_EXTEND("ü.example.com", - A("@", "10.0.0.5"), - A("www", "10.0.0.6") + A("@", "10.0.0.5"), + A("www", "10.0.0.6"), ); // IDN zone D("düsseldorf.example.net", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "10.0.0.7"), - A("www", "10.0.0.8") + DefaultTTL(300), + A("@", "10.0.0.7"), + A("www", "10.0.0.8"), ); // … extended by an ASCII subdomain D_EXTEND("subdomain.düsseldorf.example.net", - A("@", "10.0.0.9"), - A("www", "10.0.0.10") + A("@", "10.0.0.9"), + A("www", "10.0.0.10"), ); // … extended by an IDN subdomain D_EXTEND("düsseltal.düsseldorf.example.net", - A("@", "10.0.0.11"), - A("www", "10.0.0.12") + A("@", "10.0.0.11"), + A("www", "10.0.0.12"), ); // … extended by a one-character IDN subdomain D_EXTEND("ü.düsseldorf.example.net", - A("@", "10.0.0.13"), - A("www", "10.0.0.14") + A("@", "10.0.0.13"), + A("www", "10.0.0.14"), ); // One-character IDN zone D("ü.example.net", REG, DnsProvider(CF), - DefaultTTL(300), - A("@", "10.0.0.15"), - A("www", "10.0.0.16") + DefaultTTL(300), + A("@", "10.0.0.15"), + A("www", "10.0.0.16"), ); // … extended by an ASCII subdomain D_EXTEND("subdomain.ü.example.net", - A("@", "10.0.0.17"), - A("www", "10.0.0.18") + A("@", "10.0.0.17"), + A("www", "10.0.0.18"), ); // … extended by an IDN subdomain D_EXTEND("düsseldorf.ü.example.net", - A("@", "10.0.0.19"), - A("www", "10.0.0.20") + A("@", "10.0.0.19"), + A("www", "10.0.0.20"), ); // … extended by a one-character IDN subdomain D_EXTEND("ü.ü.example.net", - A("@", "10.0.0.21"), - A("www", "10.0.0.22") + A("@", "10.0.0.21"), + A("www", "10.0.0.22"), ); // Zone extended by a subdomain, with absolute and relative CNAME targets @@ -139,7 +139,7 @@ D_EXTEND("sub.example.tld", CNAME("b", "@"), // a.sub.example.tld -> sub.example.tld CNAME("c", "sub.example.tld."), // a.sub.example.tld -> sub.example.tld //CNAME("d", "x.y"), // Error. Contains dot but doesn't end with dot. - CNAME("e", "otherdomain.tld.") // a.sub.example.tld -> otherdomain.tld + CNAME("e", "otherdomain.tld."), // a.sub.example.tld -> otherdomain.tld // Also test for MX, NS, ANAME, SRV. // Not sure if PTR needs any special treatment. Haven't thought about it much. ); diff --git a/pkg/js/parse_tests/029-dextendsub.json b/pkg/js/parse_tests/029-dextendsub.json index dfc8752106..fb2a89a5bc 100644 --- a/pkg/js/parse_tests/029-dextendsub.json +++ b/pkg/js/parse_tests/029-dextendsub.json @@ -10,6 +10,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.net" + }, "name": "foo.net", "records": [ { @@ -18,12 +22,6 @@ "ttl": 300, "type": "A" }, - { - "name": "www", - "target": "10.2.2.2", - "ttl": 300, - "type": "A" - }, { "name": "bar", "subdomain": "bar", @@ -51,6 +49,12 @@ "target": "10.26.26.26", "ttl": 300, "type": "A" + }, + { + "name": "www", + "target": "10.2.2.2", + "ttl": 300, + "type": "A" } ], "registrar": "Third-Party" @@ -59,6 +63,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.tld" + }, "name": "foo.tld", "records": [ { @@ -68,14 +76,14 @@ "type": "A" }, { - "name": "www", - "target": "20.6.6.6", + "name": "a", + "target": "20.10.10.10", "ttl": 300, "type": "A" }, { - "name": "a", - "target": "20.10.10.10", + "name": "www", + "target": "20.6.6.6", "ttl": 300, "type": "A" } @@ -86,6 +94,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "bar.foo.tld" + }, "name": "bar.foo.tld", "records": [ { @@ -95,14 +107,14 @@ "type": "A" }, { - "name": "www", - "target": "30.8.8.8", + "name": "a", + "target": "30.9.9.9", "ttl": 300, "type": "A" }, { - "name": "a", - "target": "30.9.9.9", + "name": "www", + "target": "30.8.8.8", "ttl": 300, "type": "A" } @@ -113,6 +125,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.help" + }, "name": "foo.help", "records": [ { @@ -121,12 +137,6 @@ "ttl": 300, "type": "A" }, - { - "name": "www", - "target": "40.12.12.12", - "ttl": 300, - "type": "A" - }, { "name": "morty", "subdomain": "morty", @@ -140,6 +150,12 @@ "target": "40.18.18.18", "ttl": 300, "type": "A" + }, + { + "name": "www", + "target": "40.12.12.12", + "ttl": 300, + "type": "A" } ], "registrar": "Third-Party" @@ -148,6 +164,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "bar.foo.help" + }, "name": "bar.foo.help", "records": [ { @@ -183,6 +203,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.here" + }, "name": "foo.here", "records": [ { @@ -191,12 +215,6 @@ "ttl": 300, "type": "A" }, - { - "name": "www", - "target": "60.20.20.20", - "ttl": 300, - "type": "A" - }, { "name": "bar", "subdomain": "bar", @@ -204,13 +222,6 @@ "ttl": 300, "type": "A" }, - { - "name": "www.bar", - "subdomain": "bar", - "target": "60.22.22.22", - "ttl": 300, - "type": "A" - }, { "name": "baz.bar", "subdomain": "baz.bar", @@ -224,6 +235,19 @@ "target": "60.24.24.24", "ttl": 300, "type": "A" + }, + { + "name": "www.bar", + "subdomain": "bar", + "target": "60.22.22.22", + "ttl": 300, + "type": "A" + }, + { + "name": "www", + "target": "60.20.20.20", + "ttl": 300, + "type": "A" } ], "registrar": "Third-Party" @@ -232,6 +256,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "example.com" + }, "name": "example.com", "records": [ { @@ -240,12 +268,6 @@ "ttl": 300, "type": "A" }, - { - "name": "www", - "target": "10.0.0.2", - "ttl": 300, - "type": "A" - }, { "name": "d\u00fcsseldorf", "subdomain": "d\u00fcsseldorf", @@ -260,6 +282,12 @@ "ttl": 300, "type": "A" }, + { + "name": "www", + "target": "10.0.0.2", + "ttl": 300, + "type": "A" + }, { "name": "\u00fc", "subdomain": "\u00fc", @@ -281,6 +309,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "d\u00fcsseldorf.example.net" + }, "name": "d\u00fcsseldorf.example.net", "records": [ { @@ -290,8 +322,16 @@ "type": "A" }, { - "name": "www", - "target": "10.0.0.8", + "name": "d\u00fcsseltal", + "subdomain": "d\u00fcsseltal", + "target": "10.0.0.11", + "ttl": 300, + "type": "A" + }, + { + "name": "www.d\u00fcsseltal", + "subdomain": "d\u00fcsseltal", + "target": "10.0.0.12", "ttl": 300, "type": "A" }, @@ -310,16 +350,8 @@ "type": "A" }, { - "name": "d\u00fcsseltal", - "subdomain": "d\u00fcsseltal", - "target": "10.0.0.11", - "ttl": 300, - "type": "A" - }, - { - "name": "www.d\u00fcsseltal", - "subdomain": "d\u00fcsseltal", - "target": "10.0.0.12", + "name": "www", + "target": "10.0.0.8", "ttl": 300, "type": "A" }, @@ -344,6 +376,10 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "\u00fc.example.net" + }, "name": "\u00fc.example.net", "records": [ { @@ -353,8 +389,16 @@ "type": "A" }, { - "name": "www", - "target": "10.0.0.16", + "name": "d\u00fcsseldorf", + "subdomain": "d\u00fcsseldorf", + "target": "10.0.0.19", + "ttl": 300, + "type": "A" + }, + { + "name": "www.d\u00fcsseldorf", + "subdomain": "d\u00fcsseldorf", + "target": "10.0.0.20", "ttl": 300, "type": "A" }, @@ -373,16 +417,8 @@ "type": "A" }, { - "name": "d\u00fcsseldorf", - "subdomain": "d\u00fcsseldorf", - "target": "10.0.0.19", - "ttl": 300, - "type": "A" - }, - { - "name": "www.d\u00fcsseldorf", - "subdomain": "d\u00fcsseldorf", - "target": "10.0.0.20", + "name": "www", + "target": "10.0.0.16", "ttl": 300, "type": "A" }, @@ -407,19 +443,23 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "example.tld" + }, "name": "example.tld", "records": [ { "name": "a.sub", "subdomain": "sub", - "target": "b", + "target": "b.sub.example.tld.", "ttl": 300, "type": "CNAME" }, { "name": "b.sub", "subdomain": "sub", - "target": "@", + "target": "sub.example.tld.", "ttl": 300, "type": "CNAME" }, diff --git a/pkg/js/parse_tests/030-dextenddoc.js b/pkg/js/parse_tests/030-dextenddoc.js index 56f43e4cd6..cc82e384fc 100644 --- a/pkg/js/parse_tests/030-dextenddoc.js +++ b/pkg/js/parse_tests/030-dextenddoc.js @@ -4,24 +4,24 @@ var DNS = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); // The example from documentation/language-reference/top-level-functions/D_EXTEND.md D("domain.tld", REG, DnsProvider(DNS), - A("@", "127.0.0.1"), // domain.tld - A("www", "127.0.0.2"), // www.domain.tld - CNAME("a", "b") // a.domain.tld -> b.domain.tld + A("@", "127.0.0.1"), // domain.tld + A("www", "127.0.0.2"), // www.domain.tld + CNAME("a", "b"), // a.domain.tld -> b.domain.tld ); D_EXTEND("domain.tld", - A("aaa", "127.0.0.3"), // aaa.domain.tld - CNAME("c", "d") // c.domain.tld -> d.domain.tld + A("aaa", "127.0.0.3"), // aaa.domain.tld + CNAME("c", "d"), // c.domain.tld -> d.domain.tld ); D_EXTEND("sub.domain.tld", - A("bbb", "127.0.0.4"), // bbb.sub.domain.tld - A("ccc", "127.0.0.5"), // ccc.sub.domain.tld - CNAME("e", "f") // e.sub.domain.tld -> f.sub.domain.tld + A("bbb", "127.0.0.4"), // bbb.sub.domain.tld + A("ccc", "127.0.0.5"), // ccc.sub.domain.tld + CNAME("e", "f"), // e.sub.domain.tld -> f.sub.domain.tld ); D_EXTEND("sub.sub.domain.tld", - A("ddd", "127.0.0.6"), // ddd.sub.sub.domain.tld - CNAME("g", "h") // g.sub.domain.tld -> h.sub.domain.tld + A("ddd", "127.0.0.6"), // ddd.sub.sub.domain.tld + CNAME("g", "h"), // g.sub.domain.tld -> h.sub.domain.tld ); D_EXTEND("sub.domain.tld", - A("@", "127.0.0.7"), // sub.domain.tld - CNAME("i", "j") // i.sub.domain.tld -> j.sub.domain.tld + A("@", "127.0.0.7"), // sub.domain.tld + CNAME("i", "j"), // i.sub.domain.tld -> j.sub.domain.tld ); diff --git a/pkg/js/parse_tests/030-dextenddoc.json b/pkg/js/parse_tests/030-dextenddoc.json index c505edf901..411b27e21a 100644 --- a/pkg/js/parse_tests/030-dextenddoc.json +++ b/pkg/js/parse_tests/030-dextenddoc.json @@ -10,74 +10,90 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "domain.tld" + }, "name": "domain.tld", "records": [ { "name": "@", "target": "127.0.0.1", - "type": "A" - }, - { - "name": "www", - "target": "127.0.0.2", + "ttl": 300, "type": "A" }, { "name": "a", - "target": "b", + "target": "b.domain.tld.", + "ttl": 300, "type": "CNAME" }, { "name": "aaa", "target": "127.0.0.3", + "ttl": 300, "type": "A" }, { "name": "c", - "target": "d", + "target": "d.domain.tld.", + "ttl": 300, "type": "CNAME" }, + { + "name": "sub", + "subdomain": "sub", + "target": "127.0.0.7", + "ttl": 300, + "type": "A" + }, { "name": "bbb.sub", "subdomain": "sub", "target": "127.0.0.4", + "ttl": 300, "type": "A" }, { "name": "ccc.sub", "subdomain": "sub", "target": "127.0.0.5", + "ttl": 300, "type": "A" }, { "name": "e.sub", "subdomain": "sub", - "target": "f", + "target": "f.sub.domain.tld.", + "ttl": 300, + "type": "CNAME" + }, + { + "name": "i.sub", + "subdomain": "sub", + "target": "j.sub.domain.tld.", + "ttl": 300, "type": "CNAME" }, { "name": "ddd.sub.sub", "subdomain": "sub.sub", "target": "127.0.0.6", + "ttl": 300, "type": "A" }, { "name": "g.sub.sub", "subdomain": "sub.sub", - "target": "h", + "target": "h.sub.sub.domain.tld.", + "ttl": 300, "type": "CNAME" }, { - "name": "sub", - "subdomain": "sub", - "target": "127.0.0.7", + "name": "www", + "target": "127.0.0.2", + "ttl": 300, "type": "A" - }, - { - "name": "i.sub", - "subdomain": "sub", - "target": "j", - "type": "CNAME" } ], "registrar": "Third-Party" diff --git a/pkg/js/parse_tests/031-dextendnames.js b/pkg/js/parse_tests/031-dextendnames.js index 731ab7ee0b..fa5160d5da 100644 --- a/pkg/js/parse_tests/031-dextendnames.js +++ b/pkg/js/parse_tests/031-dextendnames.js @@ -4,42 +4,42 @@ var DNS = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); // Test the name matching algorithm D("domain.tld", REG, DnsProvider(DNS), - A("@", "127.0.0.1"), - A("a", "127.0.0.2"), - CNAME("b", "c") + A("@", "127.0.0.1"), + A("a", "127.0.0.2"), + CNAME("b", "c"), ); D("sub.domain.tld", REG, DnsProvider(DNS), - A("@", "127.0.1.1"), - A("aa", "127.0.1.2"), - CNAME("bb", "cc") + A("@", "127.0.1.1"), + A("aa", "127.0.1.2"), + CNAME("bb", "cc"), ); // Should match domain.tld D_EXTEND("domain.tld", - A("@", "127.0.0.3"), - A("d", "127.0.0.4"), - CNAME("e", "f") + A("@", "127.0.0.3"), + A("d", "127.0.0.4"), + CNAME("e", "f"), ); // Should match domain.tld D_EXTEND("ub.domain.tld", - A("@", "127.0.0.5"), - A("g", "127.0.0.6"), - CNAME("h", "i") + A("@", "127.0.0.5"), + A("g", "127.0.0.6"), + CNAME("h", "i"), ); // Should match sub.domain.tld D_EXTEND("sub.domain.tld", - A("@", "127.0.1.3"), - A("dd", "127.0.1.4"), - CNAME("ee", "ff") + A("@", "127.0.1.3"), + A("dd", "127.0.1.4"), + CNAME("ee", "ff"), ); // Should match domain.tld D_EXTEND("ssub.domain.tld", - A("@", "127.0.0.7"), - A("j", "127.0.0.8"), - CNAME("k", "l") + A("@", "127.0.0.7"), + A("j", "127.0.0.8"), + CNAME("k", "l"), ); diff --git a/pkg/js/parse_tests/031-dextendnames.json b/pkg/js/parse_tests/031-dextendnames.json index 7ab1dee1b7..484f33660a 100644 --- a/pkg/js/parse_tests/031-dextendnames.json +++ b/pkg/js/parse_tests/031-dextendnames.json @@ -10,72 +10,88 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "domain.tld" + }, "name": "domain.tld", "records": [ { "name": "@", "target": "127.0.0.1", + "ttl": 300, + "type": "A" + }, + { + "name": "@", + "target": "127.0.0.3", + "ttl": 300, "type": "A" }, { "name": "a", "target": "127.0.0.2", + "ttl": 300, "type": "A" }, { "name": "b", - "target": "c", + "target": "c.domain.tld.", + "ttl": 300, "type": "CNAME" }, - { - "name": "@", - "target": "127.0.0.3", - "type": "A" - }, { "name": "d", "target": "127.0.0.4", + "ttl": 300, "type": "A" }, { "name": "e", - "target": "f", + "target": "f.domain.tld.", + "ttl": 300, "type": "CNAME" }, { - "name": "ub", - "subdomain": "ub", - "target": "127.0.0.5", + "name": "ssub", + "subdomain": "ssub", + "target": "127.0.0.7", + "ttl": 300, "type": "A" }, { - "name": "g.ub", - "subdomain": "ub", - "target": "127.0.0.6", + "name": "j.ssub", + "subdomain": "ssub", + "target": "127.0.0.8", + "ttl": 300, "type": "A" }, { - "name": "h.ub", - "subdomain": "ub", - "target": "i", + "name": "k.ssub", + "subdomain": "ssub", + "target": "l.ssub.domain.tld.", + "ttl": 300, "type": "CNAME" }, { - "name": "ssub", - "subdomain": "ssub", - "target": "127.0.0.7", + "name": "ub", + "subdomain": "ub", + "target": "127.0.0.5", + "ttl": 300, "type": "A" }, { - "name": "j.ssub", - "subdomain": "ssub", - "target": "127.0.0.8", + "name": "g.ub", + "subdomain": "ub", + "target": "127.0.0.6", + "ttl": 300, "type": "A" }, { - "name": "k.ssub", - "subdomain": "ssub", - "target": "l", + "name": "h.ub", + "subdomain": "ub", + "target": "i.ub.domain.tld.", + "ttl": 300, "type": "CNAME" } ], @@ -85,36 +101,46 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "sub.domain.tld" + }, "name": "sub.domain.tld", "records": [ { "name": "@", "target": "127.0.1.1", + "ttl": 300, + "type": "A" + }, + { + "name": "@", + "target": "127.0.1.3", + "ttl": 300, "type": "A" }, { "name": "aa", "target": "127.0.1.2", + "ttl": 300, "type": "A" }, { "name": "bb", - "target": "cc", + "target": "cc.sub.domain.tld.", + "ttl": 300, "type": "CNAME" }, - { - "name": "@", - "target": "127.0.1.3", - "type": "A" - }, { "name": "dd", "target": "127.0.1.4", + "ttl": 300, "type": "A" }, { "name": "ee", - "target": "ff", + "target": "ff.sub.domain.tld.", + "ttl": 300, "type": "CNAME" } ], diff --git a/pkg/js/parse_tests/032-reverseip.js b/pkg/js/parse_tests/032-reverseip.js index f8f274459c..89358aedb7 100644 --- a/pkg/js/parse_tests/032-reverseip.js +++ b/pkg/js/parse_tests/032-reverseip.js @@ -1,15 +1,31 @@ -var REGISTRAR = NewRegistrar('none', 'NONE'); // No registrar. +var REGISTRAR = NewRegistrar('none', 'NONE'); // No registrar. var BIND = NewDnsProvider('bind', 'BIND'); D(REV('1.2.3.0/24'), REGISTRAR, DnsProvider(BIND), - PTR("1", 'foo.example.com.'), - PTR("1.2.3.2", 'bar.example.com.'), - PTR(REV("1.2.3.3"), 'baz.example.com.', {skip_fqdn_check:"true"}) + PTR("1", 'foo.example.com.'), + PTR("1.2.3.2", 'bar.example.com.'), + PTR(REV("1.2.3.3"), 'baz.example.com.', { + skip_fqdn_check: "true" + }), +); +D_EXTEND(REV("1.2.3.4"), + PTR("4", "silly.example.com."), +); +D_EXTEND(REV("1.2.3.5"), + PTR("1.2.3.5", "willy.example.com."), +); +D_EXTEND(REV("1.2.3.6"), + PTR(REV("1.2.3.6"), "billy.example.com."), ); -D_EXTEND(REV("1.2.3.4"), PTR("4", "silly.example.com.")) -D_EXTEND(REV("1.2.3.5"), PTR("1.2.3.5", "willy.example.com.")) -D_EXTEND(REV("1.2.3.6"), PTR(REV("1.2.3.6"), "billy.example.com.")) -D_EXTEND(REV("1.2.3.0/24"), PTR("7", "my.example.com.")) -D_EXTEND(REV("1.2.3.0/24"), PTR("1.2.3.8", "fair.example.com.")) -D_EXTEND(REV("1.2.3.0/24"), PTR(REV("1.2.3.9/32"), "lady.example.com.", {skip_fqdn_check:"true"})) +D_EXTEND(REV("1.2.3.0/24"), + PTR("7", "my.example.com."), +); +D_EXTEND(REV("1.2.3.0/24"), + PTR("1.2.3.8", "fair.example.com."), +); +D_EXTEND(REV("1.2.3.0/24"), + PTR(REV("1.2.3.9/32"), "lady.example.com.", { + skip_fqdn_check: "true" + }), +); diff --git a/pkg/js/parse_tests/032-reverseip.json b/pkg/js/parse_tests/032-reverseip.json index 6c7c12c694..9f78573bcc 100644 --- a/pkg/js/parse_tests/032-reverseip.json +++ b/pkg/js/parse_tests/032-reverseip.json @@ -10,60 +10,73 @@ "dnsProviders": { "bind": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "3.2.1.in-addr.arpa" + }, "name": "3.2.1.in-addr.arpa", "records": [ { "name": "1", "target": "foo.example.com.", + "ttl": 300, "type": "PTR" }, { - "name": "1.2.3.2", + "name": "2", "target": "bar.example.com.", + "ttl": 300, "type": "PTR" }, { "meta": { "skip_fqdn_check": "true" }, - "name": "3.3.2.1.in-addr.arpa", + "name": "3", "target": "baz.example.com.", + "ttl": 300, "type": "PTR" }, { "name": "4", "subdomain": "4", "target": "silly.example.com.", + "ttl": 300, "type": "PTR" }, { - "name": "1.2.3.5", + "name": "5", "subdomain": "5", "target": "willy.example.com.", + "ttl": 300, "type": "PTR" }, { - "name": "6.3.2.1.in-addr.arpa", + "name": "6", "subdomain": "6", "target": "billy.example.com.", + "ttl": 300, "type": "PTR" }, { "name": "7", "target": "my.example.com.", + "ttl": 300, "type": "PTR" }, { - "name": "1.2.3.8", + "name": "8", "target": "fair.example.com.", + "ttl": 300, "type": "PTR" }, { "meta": { "skip_fqdn_check": "true" }, - "name": "9.3.2.1.in-addr.arpa", + "name": "9", "target": "lady.example.com.", + "ttl": 300, "type": "PTR" } ], diff --git a/pkg/js/parse_tests/033-revextend.js b/pkg/js/parse_tests/033-revextend.js index 2bcab1a98a..4c73f71fbd 100644 --- a/pkg/js/parse_tests/033-revextend.js +++ b/pkg/js/parse_tests/033-revextend.js @@ -1,8 +1,11 @@ -var REGISTRAR = NewRegistrar('none', 'NONE'); // No registrar. +var REGISTRAR = NewRegistrar('none', 'NONE'); // No registrar. var BIND = NewDnsProvider('bind', 'BIND'); // Delegating reverse zones -D(REV('1.3.0.0/16'), REGISTRAR, DnsProvider(BIND), - NS(REV('1.3.1.0/24'), "ns1.example.com.") +D(REV('1.3.0.0/16'), REGISTRAR, + DnsProvider(BIND), + NS(REV('1.3.1.0/24'), "ns1.example.com."), +); +D_EXTEND(REV("1.3.2.0/24"), + NS(REV("1.3.2.0/24"), "ns2.example.org."), ); -D_EXTEND(REV("1.3.2.0/24"), NS(REV("1.3.2.0/24"), "ns2.example.org.")) diff --git a/pkg/js/parse_tests/033-revextend.json b/pkg/js/parse_tests/033-revextend.json index 80855c26a9..a9886f0ba2 100644 --- a/pkg/js/parse_tests/033-revextend.json +++ b/pkg/js/parse_tests/033-revextend.json @@ -10,17 +10,23 @@ "dnsProviders": { "bind": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "3.1.in-addr.arpa" + }, "name": "3.1.in-addr.arpa", "records": [ { - "name": "1.3.1.in-addr.arpa", + "name": "1", "target": "ns1.example.com.", + "ttl": 300, "type": "NS" }, { - "name": "2.3.1.in-addr.arpa", + "name": "2", "subdomain": "2", "target": "ns2.example.org.", + "ttl": 300, "type": "NS" } ], diff --git a/pkg/js/parse_tests/034-nameserver-ttl.json b/pkg/js/parse_tests/034-nameserver-ttl.json index 9672e2cf42..52b412f1e7 100644 --- a/pkg/js/parse_tests/034-nameserver-ttl.json +++ b/pkg/js/parse_tests/034-nameserver-ttl.json @@ -4,6 +4,8 @@ { "dnsProviders": {}, "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com", "ns_ttl": "86400" }, "name": "foo.com", @@ -13,6 +15,8 @@ { "dnsProviders": {}, "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "bar.com", "ns_ttl": "300" }, "name": "bar.com", diff --git a/pkg/js/parse_tests/035-naptr.js b/pkg/js/parse_tests/035-naptr.js index a44181f557..ac6c4d885a 100644 --- a/pkg/js/parse_tests/035-naptr.js +++ b/pkg/js/parse_tests/035-naptr.js @@ -1,6 +1,6 @@ -D("foo.com","none", - NAPTR("@",100,10,"U","E2U+sip","!^.*$!sip:customer-service@example.com!","example"), - NAPTR("@",102,10,"U","E2U+email","!^.*$!mailto:information@example.com!","example"), - NAPTR("@",103,10,"U","E2U+email","!^.*$!mailto:information@example.com!",""), - NAPTR("@",104,10,"U","E2U+email","!^.*$!mailto:information@example.com!",".") +D("foo.com", "none", + NAPTR("@", 100, 10, "U", "E2U+sip", "!^.*$!sip:customer-service@example.com!", "example"), + NAPTR("@", 102, 10, "U", "E2U+email", "!^.*$!mailto:information@example.com!", "example"), + NAPTR("@", 103, 10, "U", "E2U+email", "!^.*$!mailto:information@example.com!", ""), + NAPTR("@", 104, 10, "U", "E2U+email", "!^.*$!mailto:information@example.com!", "."), ); diff --git a/pkg/js/parse_tests/035-naptr.json b/pkg/js/parse_tests/035-naptr.json index dc84f0d583..1fb21eea3c 100644 --- a/pkg/js/parse_tests/035-naptr.json +++ b/pkg/js/parse_tests/035-naptr.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { @@ -13,6 +17,7 @@ "naptrregexp": "!^.*$!sip:customer-service@example.com!", "naptrservice": "E2U+sip", "target": "example", + "ttl": 300, "type": "NAPTR" }, { @@ -23,6 +28,7 @@ "naptrregexp": "!^.*$!mailto:information@example.com!", "naptrservice": "E2U+email", "target": "example", + "ttl": 300, "type": "NAPTR" }, { @@ -32,7 +38,8 @@ "naptrpreference": 10, "naptrregexp": "!^.*$!mailto:information@example.com!", "naptrservice": "E2U+email", - "target": "", + "target": ".", + "ttl": 300, "type": "NAPTR" }, { @@ -43,6 +50,7 @@ "naptrregexp": "!^.*$!mailto:information@example.com!", "naptrservice": "E2U+email", "target": ".", + "ttl": 300, "type": "NAPTR" } ], diff --git a/pkg/js/parse_tests/036-dextendcf.js b/pkg/js/parse_tests/036-dextendcf.js index 844404b968..856bcbec80 100644 --- a/pkg/js/parse_tests/036-dextendcf.js +++ b/pkg/js/parse_tests/036-dextendcf.js @@ -3,10 +3,10 @@ var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); D("foo.com", REG, DnsProvider(CF)); D_EXTEND("sub.foo.com", - A("test1.foo.com","10.2.3.1"), - A("test2.foo.com","10.2.3.2"), - A("test3.foo.com","10.2.3.3"), - CF_REDIRECT("test1.foo.com","https://goo.com/$1"), - CF_TEMP_REDIRECT("test2.foo.com","https://goo.com/$1"), - CF_WORKER_ROUTE("test3.foo.com","test-worker") + A("test1.foo.com", "10.2.3.1"), + A("test2.foo.com", "10.2.3.2"), + A("test3.foo.com", "10.2.3.3"), + CF_REDIRECT("test1.foo.com", "https://goo.com/$1"), + CF_TEMP_REDIRECT("test2.foo.com", "https://goo.com/$1"), + CF_WORKER_ROUTE("test3.foo.com", "test-worker"), ); diff --git a/pkg/js/parse_tests/036-dextendcf.json b/pkg/js/parse_tests/036-dextendcf.json index 1275fab9f6..296ce36503 100644 --- a/pkg/js/parse_tests/036-dextendcf.json +++ b/pkg/js/parse_tests/036-dextendcf.json @@ -10,40 +10,59 @@ "dnsProviders": { "Cloudflare": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ + { + "meta": { + "orig_custom_type": "CF_REDIRECT" + }, + "name": "@", + "target": "test1.foo.com,https://goo.com/$1", + "ttl": 300, + "type": "CF_REDIRECT" + }, + { + "meta": { + "orig_custom_type": "CF_TEMP_REDIRECT" + }, + "name": "@", + "target": "test2.foo.com,https://goo.com/$1", + "ttl": 300, + "type": "CF_TEMP_REDIRECT" + }, + { + "meta": { + "orig_custom_type": "CF_WORKER_ROUTE" + }, + "name": "@", + "target": "test3.foo.com,test-worker", + "ttl": 300, + "type": "CF_WORKER_ROUTE" + }, { "name": "test1.foo.com.sub", "subdomain": "sub", "target": "10.2.3.1", + "ttl": 300, "type": "A" }, { "name": "test2.foo.com.sub", "subdomain": "sub", "target": "10.2.3.2", + "ttl": 300, "type": "A" }, { "name": "test3.foo.com.sub", "subdomain": "sub", "target": "10.2.3.3", + "ttl": 300, "type": "A" - }, - { - "name": "@", - "target": "test1.foo.com,https://goo.com/$1", - "type": "CF_REDIRECT" - }, - { - "name": "@", - "target": "test2.foo.com,https://goo.com/$1", - "type": "CF_TEMP_REDIRECT" - }, - { - "name": "@", - "target": "test3.foo.com,test-worker", - "type": "CF_WORKER_ROUTE" } ], "registrar": "Third-Party" diff --git a/pkg/js/parse_tests/037-splithor.js b/pkg/js/parse_tests/037-splithor.js index 649598b79c..e3b99bf69c 100644 --- a/pkg/js/parse_tests/037-splithor.js +++ b/pkg/js/parse_tests/037-splithor.js @@ -4,21 +4,21 @@ var DNS_INSIDE = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); var DNS_OUTSIDE = NewDnsProvider("bind", "BIND"); D("example.com", REG, DnsProvider(DNS_MAIN), - A("main", "3.3.3.3") + A("main", "3.3.3.3"), ); D("example.com!inside", REG, DnsProvider(DNS_INSIDE), - A("main", "1.1.1.1") + A("main", "1.1.1.1"), ); D("example.com!outside", REG, DnsProvider(DNS_OUTSIDE), - A("main", "8.8.8.8") + A("main", "8.8.8.8"), ); D_EXTEND("example.com", - A("www", "33.33.33.33") + A("www", "33.33.33.33"), ); D_EXTEND("example.com!inside", - A("main", "11.11.11.11") + A("main", "11.11.11.11"), ); diff --git a/pkg/js/parse_tests/037-splithor.json b/pkg/js/parse_tests/037-splithor.json index 497802e59b..fb2f06a645 100644 --- a/pkg/js/parse_tests/037-splithor.json +++ b/pkg/js/parse_tests/037-splithor.json @@ -18,16 +18,22 @@ "dnsProviders": { "otherconfig": -1 }, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "example.com" + }, "name": "example.com", "records": [ { "name": "main", "target": "3.3.3.3", + "ttl": 300, "type": "A" }, { "name": "www", "target": "33.33.33.33", + "ttl": 300, "type": "A" } ], @@ -37,16 +43,22 @@ "dnsProviders": { "Cloudflare": -1 }, - "name": "example.com!inside", + "meta": { + "dnscontrol_tag": "inside", + "dnscontrol_uniquename": "example.com!inside" + }, + "name": "example.com", "records": [ { "name": "main", "target": "1.1.1.1", + "ttl": 300, "type": "A" }, { "name": "main", "target": "11.11.11.11", + "ttl": 300, "type": "A" } ], @@ -56,11 +68,16 @@ "dnsProviders": { "bind": -1 }, - "name": "example.com!outside", + "meta": { + "dnscontrol_tag": "outside", + "dnscontrol_uniquename": "example.com!outside" + }, + "name": "example.com", "records": [ { "name": "main", "target": "8.8.8.8", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/038-soa.js b/pkg/js/parse_tests/038-soa.js index 5f94375046..973bf5ed9e 100644 --- a/pkg/js/parse_tests/038-soa.js +++ b/pkg/js/parse_tests/038-soa.js @@ -1,3 +1,3 @@ -D("foo.com","none", - SOA('@', 'ns1.foo.com.', 'admin.foo.com', 3600, 900, 604800, 86400) +D("foo.com", "none", + SOA('@', 'ns1.foo.com.', 'admin.foo.com', 3600, 900, 604800, 86400), ); diff --git a/pkg/js/parse_tests/038-soa.json b/pkg/js/parse_tests/038-soa.json index 53430c2fbe..41919f55ae 100644 --- a/pkg/js/parse_tests/038-soa.json +++ b/pkg/js/parse_tests/038-soa.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { @@ -13,6 +17,7 @@ "soarefresh": 3600, "soaretry": 900, "target": "ns1.foo.com.", + "ttl": 300, "type": "SOA" } ], diff --git a/pkg/js/parse_tests/039-include.js b/pkg/js/parse_tests/039-include.js index 3d75ffbc56..e87d985cef 100644 --- a/pkg/js/parse_tests/039-include.js +++ b/pkg/js/parse_tests/039-include.js @@ -1,12 +1,11 @@ - -var REG = NewRegistrar("Third-Party","NONE"); +var REG = NewRegistrar("Third-Party", "NONE"); var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI"); -D("foo.com!external",REG,DnsProvider(CF), - A("@","1.2.3.4") +D("foo.com!external", REG, DnsProvider(CF), + A("@", "1.2.3.4"), ); -D("foo.com!internal",REG,DnsProvider(CF), - INCLUDE("foo.com!external"), - A("local","127.0.0.1") +D("foo.com!internal", REG, DnsProvider(CF), + INCLUDE("foo.com!external"), + A("local", "127.0.0.1"), ); diff --git a/pkg/js/parse_tests/039-include.json b/pkg/js/parse_tests/039-include.json index ad72227f22..2251c36deb 100644 --- a/pkg/js/parse_tests/039-include.json +++ b/pkg/js/parse_tests/039-include.json @@ -10,11 +10,16 @@ "dnsProviders": { "Cloudflare": -1 }, - "name": "foo.com!external", + "meta": { + "dnscontrol_tag": "external", + "dnscontrol_uniquename": "foo.com!external" + }, + "name": "foo.com", "records": [ { "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" } ], @@ -24,16 +29,22 @@ "dnsProviders": { "Cloudflare": -1 }, - "name": "foo.com!internal", + "meta": { + "dnscontrol_tag": "internal", + "dnscontrol_uniquename": "foo.com!internal" + }, + "name": "foo.com", "records": [ { "name": "@", "target": "1.2.3.4", + "ttl": 300, "type": "A" }, { "name": "local", "target": "127.0.0.1", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/040-cfWorkerRoute.js b/pkg/js/parse_tests/040-cfWorkerRoute.js index e8b3d31efc..29fc3eae8d 100644 --- a/pkg/js/parse_tests/040-cfWorkerRoute.js +++ b/pkg/js/parse_tests/040-cfWorkerRoute.js @@ -1,3 +1,3 @@ -D("foo.com","none", - CF_WORKER_ROUTE("test.foo.com","test-worker") -); \ No newline at end of file +D("foo.com", "none", + CF_WORKER_ROUTE("test.foo.com", "test-worker") +); diff --git a/pkg/js/parse_tests/040-cfWorkerRoute.json b/pkg/js/parse_tests/040-cfWorkerRoute.json index 4de5d55772..72914ad726 100644 --- a/pkg/js/parse_tests/040-cfWorkerRoute.json +++ b/pkg/js/parse_tests/040-cfWorkerRoute.json @@ -3,11 +3,19 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { + "meta": { + "orig_custom_type": "CF_WORKER_ROUTE" + }, "name": "@", "target": "test.foo.com,test-worker", + "ttl": 300, "type": "CF_WORKER_ROUTE" } ], diff --git a/pkg/js/parse_tests/040-r53-zone.json b/pkg/js/parse_tests/040-r53-zone.json index 783ee6dee5..4a6a359a1b 100644 --- a/pkg/js/parse_tests/040-r53-zone.json +++ b/pkg/js/parse_tests/040-r53-zone.json @@ -4,6 +4,8 @@ { "dnsProviders": {}, "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com", "zone_id": "Z2FTEDLFRTZ" }, "name": "foo.com", @@ -13,11 +15,16 @@ { "dnsProviders": {}, "meta": { + "dnscontrol_tag": "internal", + "dnscontrol_uniquename": "foo.com!internal", "zone_id": "Z2FTEDLFRTF" }, - "name": "foo.com!internal", + "name": "foo.com", "records": [ { + "meta": { + "orig_custom_type": "R53_ALIAS" + }, "name": "atest", "r53_alias": { "evaluate_target_health": "false", @@ -25,6 +32,7 @@ "zone_id": "Z2FTEDLFRTZ" }, "target": "foo.com.", + "ttl": 300, "type": "R53_ALIAS" } ], diff --git a/pkg/js/parse_tests/043-safety.js b/pkg/js/parse_tests/043-safety.js index 6affbdc448..c239b176bc 100644 --- a/pkg/js/parse_tests/043-safety.js +++ b/pkg/js/parse_tests/043-safety.js @@ -1,5 +1,2 @@ -D("unsafe.com", "none" - , DISABLE_IGNORE_SAFETY_CHECK -); -D("safe.com", "none" -); +D("unsafe.com", "none", DISABLE_IGNORE_SAFETY_CHECK); +D("safe.com", "none"); diff --git a/pkg/js/parse_tests/043-safety.json b/pkg/js/parse_tests/043-safety.json index 7fcfd70ddf..a6ee5a4f5f 100644 --- a/pkg/js/parse_tests/043-safety.json +++ b/pkg/js/parse_tests/043-safety.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "unsafe.com" + }, "name": "unsafe.com", "records": [], "registrar": "none", @@ -10,6 +14,10 @@ }, { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "safe.com" + }, "name": "safe.com", "records": [], "registrar": "none" diff --git a/pkg/js/parse_tests/044-ensureabsent.js b/pkg/js/parse_tests/044-ensureabsent.js index 85a0f961ea..ffd773a008 100644 --- a/pkg/js/parse_tests/044-ensureabsent.js +++ b/pkg/js/parse_tests/044-ensureabsent.js @@ -1,5 +1,5 @@ D("example.com", "none", - A("normal", "1.1.1.1"), - A("helper", "2.2.2.2", ENSURE_ABSENT_REC()), - //ENSURE_ABSENT(A("wrapped", "3.3.3.3")), - {}); + A("normal", "1.1.1.1"), + A("helper", "2.2.2.2", ENSURE_ABSENT_REC()), + //ENSURE_ABSENT(A("wrapped", "3.3.3.3")), +); diff --git a/pkg/js/parse_tests/044-ensureabsent.json b/pkg/js/parse_tests/044-ensureabsent.json index fbdfcf2260..d30ac8ca15 100644 --- a/pkg/js/parse_tests/044-ensureabsent.json +++ b/pkg/js/parse_tests/044-ensureabsent.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "example.com" + }, "name": "example.com", "records": [ { "name": "normal", "target": "1.1.1.1", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/045-loc.js b/pkg/js/parse_tests/045-loc.js index 579ef1416f..2c5f5f7afc 100644 --- a/pkg/js/parse_tests/045-loc.js +++ b/pkg/js/parse_tests/045-loc.js @@ -1,92 +1,90 @@ -D("foo.com","none" - // LOC "subdomain", d1, m1, s1, "[NnSs]", d2, m2, s2, "[EeWw]", alt, siz, hp, vp) - , LOC("@", 42, 21, 54, "N", 71, 6, 18, "W", -24, 30, 0, 0) //42 21 54 N 71 06 18 W -24m 30m - , LOC("a", 42, 21, 43.952, "N", 71, 5, 6.344, "W", -24.01, 1, 200, 10) //42 21 43.952 N 71 5 6.344 W -24.01m 1m 200m - , LOC("b", 52, 14, 5, "N", 0, 8, 50, "E", 10.33, 0, 0, 0) //52 14 05 N 00 08 50 E 10.33m - , LOC("c", 32, 7, 19, "S",116, 2, 25, "E", 10, 0, 0, 0) //32 7 19 S 116 2 25 E 10m - , LOC("d", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -44, 2000, 0, 0) //42 21 28.764 N 71 00 51.617 W -44m 2000m - , LOC("d-alt-highest", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 42849672.95, 2000, 0, 0) //42 21 28.764 N 71 00 51.617 W 42849672.95m 2000m - , LOC("d-alt-lowest", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -100000.00, 2000, 0, 0) //42 21 28.764 N 71 00 51.617 W -100000.00m 2000m - , LOC("d-alt-toohigh", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 42849672.96, 2000, 0, 0) //42 21 28.764 N 71 00 51.617 W 42849672.95m 2000m - , LOC("d-alt-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -100000.01, 2000, 0, 0) //42 21 28.764 N 71 00 51.617 W -100000m 2000m - , LOC("d-horizprecision-hi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 90000000, 0) //42 21 28.764 N 71 00 51.617 W 0m 1m 90000000m 0.00m - , LOC("d-horizprecision-toohi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 98765432, 0) //42 21 28.764 N 71 00 51.617 W 0m 1m 90000000m 0.00m - , LOC("d-horizprecision-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, -1, 0) //42 21 28.764 N 71 00 51.617 W 0m 1m 0m 0.00m - , LOC("d-size-toohi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 98765432, 0, 0) //42 21 28.764 N 71 00 51.617 W -44m 2000m - , LOC("d-size-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, -1, 0, 0) //42 21 28.764 N 71 00 51.617 W -44m 0m - , LOC("d-size-hi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 90000000, 0, 0) //42 21 28.764 N 71 00 51.617 W -44m 90000000m - , LOC("d-vertprecision-hi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 0, 90000000) //42 21 28.764 N 71 00 51.617 W 0m 1m 0.00m 90000000m - , LOC("d-vertprecision-toohi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 0, 98765432) //42 21 28.764 N 71 00 51.617 W 0m 1m 0.00m 90000000m - , LOC("d-vertprecision-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 0, -1) //42 21 28.764 N 71 00 51.617 W 0m 1m 0.00m 0m +D("foo.com", "none", + // LOC "subdomain", d1, m1, s1, "[NnSs]", d2, m2, s2, "[EeWw]", alt, siz, hp, vp) + LOC("@", 42, 21, 54, "N", 71, 6, 18, "W", -24, 30, 0, 0), //42 21 54 N 71 06 18 W -24m 30m + LOC("a", 42, 21, 43.952, "N", 71, 5, 6.344, "W", -24.01, 1, 200, 10), //42 21 43.952 N 71 5 6.344 W -24.01m 1m 200m + LOC("b", 52, 14, 5, "N", 0, 8, 50, "E", 10.33, 0, 0, 0), //52 14 05 N 00 08 50 E 10.33m + LOC("c", 32, 7, 19, "S", 116, 2, 25, "E", 10, 0, 0, 0), //32 7 19 S 116 2 25 E 10m + LOC("d", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -44, 2000, 0, 0), //42 21 28.764 N 71 00 51.617 W -44m 2000m + LOC("d-alt-highest", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 42849672.95, 2000, 0, 0), //42 21 28.764 N 71 00 51.617 W 42849672.95m 2000m + LOC("d-alt-lowest", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -100000.00, 2000, 0, 0), //42 21 28.764 N 71 00 51.617 W -100000.00m 2000m + LOC("d-alt-toohigh", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 42849672.96, 2000, 0, 0), //42 21 28.764 N 71 00 51.617 W 42849672.95m 2000m + LOC("d-alt-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -100000.01, 2000, 0, 0), //42 21 28.764 N 71 00 51.617 W -100000m 2000m + LOC("d-horizprecision-hi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 90000000, 0), //42 21 28.764 N 71 00 51.617 W 0m 1m 90000000m 0.00m + LOC("d-horizprecision-toohi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 98765432, 0), //42 21 28.764 N 71 00 51.617 W 0m 1m 90000000m 0.00m + LOC("d-horizprecision-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, -1, 0), //42 21 28.764 N 71 00 51.617 W 0m 1m 0m 0.00m + LOC("d-size-toohi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 98765432, 0, 0), //42 21 28.764 N 71 00 51.617 W -44m 2000m + LOC("d-size-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, -1, 0, 0), //42 21 28.764 N 71 00 51.617 W -44m 0m + LOC("d-size-hi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 90000000, 0, 0), //42 21 28.764 N 71 00 51.617 W -44m 90000000m + LOC("d-vertprecision-hi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 0, 90000000), //42 21 28.764 N 71 00 51.617 W 0m 1m 0.00m 90000000m + LOC("d-vertprecision-toohi", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 0, 98765432), //42 21 28.764 N 71 00 51.617 W 0m 1m 0.00m 90000000m + LOC("d-vertprecision-toolow", 42, 21, 28.764, "N", 71, 0, 51.617, "W", 0, 1, 0, -1), //42 21 28.764 N 71 00 51.617 W 0m 1m 0.00m 0m - // via the Decimal degrees to LOC builder. - , LOC_BUILDER_DD({ - label: "big-ben", - x: 51.50084265331501, - y: -0.12462541415599787, - alt: 6, - }) - , LOC_BUILDER_DD({ - label: "white-house", - x: 38.89775977858357, - y: -77.03655125982903, - alt: 19, - ttl: "5m", - }) - , LOC_BUILDER_DMS_STR({ - label: "opera-house", - str: '33°51′31″S 151°12′51″E', - alt: 4, - ttl: "5m", - }) - , LOC_BUILDER_DMS_STR({ - label: "opera-house2", - str: '33°51\'31"S 151°12\'51"E', - alt: 4, - ttl: "5m", - }) - , LOC_BUILDER_DMS_STR({ - label: "opera-house3", - str: '33d51m31sS 151d12m51sE', - alt: 4, - ttl: "5m", - }) - , LOC_BUILDER_DMS_STR({ - label: "opera-house4", - str: '33d51m31s S 151d12m51s E', - alt: 4, - ttl: "5m", - }) - , LOC_BUILDER_DMM_STR({ - label: "fraser-island", - str: '25.24°S 153.15°E', - alt: 3, - }) - , LOC_BUILDER_STR({ - label: "tasmania", - str: '42°S 147°E', - alt: 3, - }) - , LOC_BUILDER_STR({ - label: "hawaii", - str: '21.5°N 158.0°W', - alt: 920, - }) - , LOC_BUILDER_STR({ - label: "old-faithful", - str: '44.46046°N 110.82815°W', - alt: 2240, - }) - , LOC_BUILDER_STR({ - label: "ribblehead-viaduct", - str: '54.210436°N 2.370231°W', - alt: 300, - }) - , LOC_BUILDER_STR({ - label: "guinness-brewery", - str: '53°20′40″N 6°17′20″W', - alt: 300, - }) + // via the Decimal degrees to LOC builder. + LOC_BUILDER_DD({ + label: "big-ben", + x: 51.50084265331501, + y: -0.12462541415599787, + alt: 6, + }), + LOC_BUILDER_DD({ + label: "white-house", + x: 38.89775977858357, + y: -77.03655125982903, + alt: 19, + ttl: "5m", + }), + LOC_BUILDER_DMS_STR({ + label: "opera-house", + str: '33°51′31″S 151°12′51″E', + alt: 4, + ttl: "5m", + }), + LOC_BUILDER_DMS_STR({ + label: "opera-house2", + str: '33°51\'31"S 151°12\'51"E', + alt: 4, + ttl: "5m", + }), + LOC_BUILDER_DMS_STR({ + label: "opera-house3", + str: '33d51m31sS 151d12m51sE', + alt: 4, + ttl: "5m", + }), + LOC_BUILDER_DMS_STR({ + label: "opera-house4", + str: '33d51m31s S 151d12m51s E', + alt: 4, + ttl: "5m", + }), + LOC_BUILDER_DMM_STR({ + label: "fraser-island", + str: '25.24°S 153.15°E', + alt: 3, + }), + LOC_BUILDER_STR({ + label: "tasmania", + str: '42°S 147°E', + alt: 3, + }), + LOC_BUILDER_STR({ + label: "hawaii", + str: '21.5°N 158.0°W', + alt: 920, + }), + LOC_BUILDER_STR({ + label: "old-faithful", + str: '44.46046°N 110.82815°W', + alt: 2240, + }), + LOC_BUILDER_STR({ + label: "ribblehead-viaduct", + str: '54.210436°N 2.370231°W', + alt: 300, + }), + LOC_BUILDER_STR({ + label: "guinness-brewery", + str: '53°20′40″N 6°17′20″W', + alt: 300, + }), ); - - diff --git a/pkg/js/parse_tests/045-loc.json b/pkg/js/parse_tests/045-loc.json index 14f4a8969b..bc69b86ccf 100644 --- a/pkg/js/parse_tests/045-loc.json +++ b/pkg/js/parse_tests/045-loc.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { @@ -12,6 +16,7 @@ "locsize": 51, "name": "@", "target": "42 21 54 N 71 6 18 W -24m 30m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -23,6 +28,7 @@ "locvertpre": 19, "name": "a", "target": "42 21 43.952 N 71 5 6.344 W -24.01m 1m 200m 10m", + "ttl": 300, "type": "LOC" }, { @@ -31,6 +37,16 @@ "loclongitude": 2148013648, "name": "b", "target": "52 14 5 N 0 8 50 E 10.33m 0m 0m 0m", + "ttl": 300, + "type": "LOC" + }, + { + "localtitude": 10000600, + "loclatitude": 2332886681, + "loclongitude": 2147034997, + "name": "big-ben", + "target": "51 30 3.033 N 0 7 28.651 W 6m 0m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -39,6 +55,7 @@ "loclongitude": 2565228648, "name": "c", "target": "32 7 19 S 116 2 25 E 10m 0m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -48,6 +65,7 @@ "locsize": 37, "name": "d", "target": "42 21 28.764 N 71 0 51.617 W -44m 2000m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -57,6 +75,7 @@ "locsize": 37, "name": "d-alt-highest", "target": "42 21 28.764 N 71 0 51.617 W 42849672.95m 2000m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -65,6 +84,7 @@ "locsize": 37, "name": "d-alt-lowest", "target": "42 21 28.764 N 71 0 51.617 W -100000m 2000m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -74,6 +94,7 @@ "locsize": 37, "name": "d-alt-toohigh", "target": "42 21 28.764 N 71 0 51.617 W 42849672.95m 2000m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -82,6 +103,7 @@ "locsize": 37, "name": "d-alt-toolow", "target": "42 21 28.764 N 71 0 51.617 W -100000m 2000m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -92,6 +114,7 @@ "locsize": 18, "name": "d-horizprecision-hi", "target": "42 21 28.764 N 71 0 51.617 W 0m 1m 90000000m 0m", + "ttl": 300, "type": "LOC" }, { @@ -102,6 +125,7 @@ "locsize": 18, "name": "d-horizprecision-toohi", "target": "42 21 28.764 N 71 0 51.617 W 0m 1m 90000000m 0m", + "ttl": 300, "type": "LOC" }, { @@ -111,6 +135,7 @@ "locsize": 18, "name": "d-horizprecision-toolow", "target": "42 21 28.764 N 71 0 51.617 W 0m 1m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -118,25 +143,28 @@ "loclatitude": 2299972412, "loclongitude": 1891832031, "locsize": 153, - "name": "d-size-toohi", + "name": "d-size-hi", "target": "42 21 28.764 N 71 0 51.617 W 0m 90000000m 0m 0m", + "ttl": 300, "type": "LOC" }, { "localtitude": 10000000, "loclatitude": 2299972412, "loclongitude": 1891832031, - "name": "d-size-toolow", - "target": "42 21 28.764 N 71 0 51.617 W 0m 0m 0m 0m", + "locsize": 153, + "name": "d-size-toohi", + "target": "42 21 28.764 N 71 0 51.617 W 0m 90000000m 0m 0m", + "ttl": 300, "type": "LOC" }, { "localtitude": 10000000, "loclatitude": 2299972412, "loclongitude": 1891832031, - "locsize": 153, - "name": "d-size-hi", - "target": "42 21 28.764 N 71 0 51.617 W 0m 90000000m 0m 0m", + "name": "d-size-toolow", + "target": "42 21 28.764 N 71 0 51.617 W 0m 0m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -147,6 +175,7 @@ "locvertpre": 153, "name": "d-vertprecision-hi", "target": "42 21 28.764 N 71 0 51.617 W 0m 1m 0m 90000000m", + "ttl": 300, "type": "LOC" }, { @@ -157,6 +186,7 @@ "locvertpre": 153, "name": "d-vertprecision-toohi", "target": "42 21 28.764 N 71 0 51.617 W 0m 1m 0m 90000000m", + "ttl": 300, "type": "LOC" }, { @@ -166,22 +196,42 @@ "locsize": 18, "name": "d-vertprecision-toolow", "target": "42 21 28.764 N 71 0 51.617 W 0m 1m 0m 0m", + "ttl": 300, "type": "LOC" }, { - "localtitude": 10000600, - "loclatitude": 2332886681, - "loclongitude": 2147034997, - "name": "big-ben", - "target": "51 30 3.033 N 0 7 28.651 W 6m 0m 0m 0m", + "localtitude": 10000300, + "loclatitude": 2056619648, + "loclongitude": 2698823648, + "name": "fraser-island", + "target": "25 14 24 S 153 9 0 E 3m 0m 0m 0m", + "ttl": 300, "type": "LOC" }, { - "localtitude": 10001900, - "loclatitude": 2287515583, - "loclongitude": 1870152064, - "name": "white-house", - "target": "38 53 51.935 N 77 2 11.584 W 19m 0m 0m 0m", + "localtitude": 10030000, + "loclatitude": 2339523648, + "loclongitude": 2124843648, + "name": "guinness-brewery", + "target": "53 20 40 N 6 17 20 W 300m 0m 0m 0m", + "ttl": 300, + "type": "LOC" + }, + { + "localtitude": 10092000, + "loclatitude": 2224883648, + "loclongitude": 1578683648, + "name": "hawaii", + "target": "21 30 0 N 158 0 0 W 920m 0m 0m 0m", + "ttl": 300, + "type": "LOC" + }, + { + "localtitude": 10224000, + "loclatitude": 2307541648, + "loclongitude": 1748502648, + "name": "old-faithful", + "target": "44 27 38 N 110 49 41 W 2240m 0m 0m 0m", "ttl": 300, "type": "LOC" }, @@ -222,11 +272,12 @@ "type": "LOC" }, { - "localtitude": 10000300, - "loclatitude": 2056619648, - "loclongitude": 2698823648, - "name": "fraser-island", - "target": "25 14 24 S 153 9 0 E 3m 0m 0m 0m", + "localtitude": 10030000, + "loclatitude": 2342641648, + "loclongitude": 2138950648, + "name": "ribblehead-viaduct", + "target": "54 12 38 N 2 22 13 W 300m 0m 0m 0m", + "ttl": 300, "type": "LOC" }, { @@ -235,38 +286,16 @@ "loclongitude": 2676683648, "name": "tasmania", "target": "42 0 0 S 147 0 0 E 3m 0m 0m 0m", + "ttl": 300, "type": "LOC" }, { - "localtitude": 10092000, - "loclatitude": 2224883648, - "loclongitude": 1578683648, - "name": "hawaii", - "target": "21 30 0 N 158 0 0 W 920m 0m 0m 0m", - "type": "LOC" - }, - { - "localtitude": 10224000, - "loclatitude": 2307541648, - "loclongitude": 1748502648, - "name": "old-faithful", - "target": "44 27 38 N 110 49 41 W 2240m 0m 0m 0m", - "type": "LOC" - }, - { - "localtitude": 10030000, - "loclatitude": 2342641648, - "loclongitude": 2138950648, - "name": "ribblehead-viaduct", - "target": "54 12 38 N 2 22 13 W 300m 0m 0m 0m", - "type": "LOC" - }, - { - "localtitude": 10030000, - "loclatitude": 2339523648, - "loclongitude": 2124843648, - "name": "guinness-brewery", - "target": "53 20 40 N 6 17 20 W 300m 0m 0m 0m", + "localtitude": 10001900, + "loclatitude": 2287515583, + "loclongitude": 1870152064, + "name": "white-house", + "target": "38 53 51.935 N 77 2 11.584 W 19m 0m 0m 0m", + "ttl": 300, "type": "LOC" } ], diff --git a/pkg/js/parse_tests/046-DHCID.js b/pkg/js/parse_tests/046-DHCID.js index 8847c54ff8..5b7cf3dffc 100644 --- a/pkg/js/parse_tests/046-DHCID.js +++ b/pkg/js/parse_tests/046-DHCID.js @@ -1,3 +1,3 @@ -D("foo.com","none", +D("foo.com", "none", DHCID("@", "Test") ); diff --git a/pkg/js/parse_tests/046-DHCID.json b/pkg/js/parse_tests/046-DHCID.json index 0ca9c0c8d1..b06657278e 100644 --- a/pkg/js/parse_tests/046-DHCID.json +++ b/pkg/js/parse_tests/046-DHCID.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "Test", + "ttl": 300, "type": "DHCID" } ], diff --git a/pkg/js/parse_tests/047-DNAME.js b/pkg/js/parse_tests/047-DNAME.js index d7d3841908..d3502e5ae9 100644 --- a/pkg/js/parse_tests/047-DNAME.js +++ b/pkg/js/parse_tests/047-DNAME.js @@ -1,3 +1,3 @@ -D("foo.com","none", - DNAME("@", "bar.com.") +D("foo.com", "none", + DNAME("@", "bar.com."), ); diff --git a/pkg/js/parse_tests/047-DNAME.json b/pkg/js/parse_tests/047-DNAME.json index 993b977d8b..96d437b86f 100644 --- a/pkg/js/parse_tests/047-DNAME.json +++ b/pkg/js/parse_tests/047-DNAME.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "bar.com.", + "ttl": 300, "type": "DNAME" } ], diff --git a/pkg/js/parse_tests/047-SVCB.js b/pkg/js/parse_tests/047-SVCB.js index 1a69a5de08..d96121b052 100644 --- a/pkg/js/parse_tests/047-SVCB.js +++ b/pkg/js/parse_tests/047-SVCB.js @@ -1,4 +1,4 @@ -D("foo.com","none", +D("foo.com", "none", SVCB("@", 1, ".", ""), - HTTPS("@", 2, ".", 'alpn="h3,h2" port=443 ipv4hint=123.123.123.123 ipv6hint=dead::beaf') + HTTPS("@", 2, ".", 'alpn="h3,h2" port=443 ipv4hint=123.123.123.123 ipv6hint=dead::beaf'), ); diff --git a/pkg/js/parse_tests/047-SVCB.json b/pkg/js/parse_tests/047-SVCB.json index 021362c126..8d42ddd9fc 100644 --- a/pkg/js/parse_tests/047-SVCB.json +++ b/pkg/js/parse_tests/047-SVCB.json @@ -3,20 +3,26 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", - "svcpriority": 1, + "svcparams": "alpn=\"h3,h2\" port=443 ipv4hint=123.123.123.123 ipv6hint=dead::beaf", + "svcpriority": 2, "target": ".", - "type": "SVCB" + "ttl": 300, + "type": "HTTPS" }, { "name": "@", - "svcparams": "alpn=\"h3,h2\" port=443 ipv4hint=123.123.123.123 ipv6hint=dead::beaf", - "svcpriority": 2, + "svcpriority": 1, "target": ".", - "type": "HTTPS" + "ttl": 300, + "type": "SVCB" } ], "registrar": "none" diff --git a/pkg/js/parse_tests/048-DNSKEY.js b/pkg/js/parse_tests/048-DNSKEY.js index 0f066011ae..2210589408 100644 --- a/pkg/js/parse_tests/048-DNSKEY.js +++ b/pkg/js/parse_tests/048-DNSKEY.js @@ -1,3 +1,3 @@ -D("foo.com","none", - DNSKEY("@", 257, 3, 13, "AABBCCDD") +D("foo.com", "none", + DNSKEY("@", 257, 3, 13, "AABBCCDD"), ); diff --git a/pkg/js/parse_tests/048-DNSKEY.json b/pkg/js/parse_tests/048-DNSKEY.json index 4f913d47f9..e94e9ab28c 100644 --- a/pkg/js/parse_tests/048-DNSKEY.json +++ b/pkg/js/parse_tests/048-DNSKEY.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { @@ -12,6 +16,7 @@ "dnskeypublickey": "AABBCCDD", "name": "@", "target": "", + "ttl": 300, "type": "DNSKEY" } ], diff --git a/pkg/js/parse_tests/049-json5-require.js b/pkg/js/parse_tests/049-json5-require.js index 0c672f2ce0..ee664c60d2 100644 --- a/pkg/js/parse_tests/049-json5-require.js +++ b/pkg/js/parse_tests/049-json5-require.js @@ -1,8 +1,8 @@ -var domains = require('./domain-ip-map.json5') +var domains = require('./domain-ip-map.json5'); -var domain = "foo.com" -var ip = domains["foo.com"] +var domain = "foo.com"; +var ip = domains["foo.com"]; -D(domain,"none", - A("@",ip) +D(domain, "none", + A("@", ip), ); diff --git a/pkg/js/parse_tests/049-json5-require.json b/pkg/js/parse_tests/049-json5-require.json index 0b8d34272d..357220364b 100644 --- a/pkg/js/parse_tests/049-json5-require.json +++ b/pkg/js/parse_tests/049-json5-require.json @@ -3,11 +3,16 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "records": [ { "name": "@", "target": "1.1.1.1", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/050-cfSingleRedirect.js b/pkg/js/parse_tests/050-cfSingleRedirect.js index 6f221b66ac..74456d6c81 100644 --- a/pkg/js/parse_tests/050-cfSingleRedirect.js +++ b/pkg/js/parse_tests/050-cfSingleRedirect.js @@ -1,8 +1,14 @@ -D("foo.com","none", - A("name1", "1.2.3.4", { meta: "value" } ), +D("foo.com", "none", + A("name1", "1.2.3.4", { + meta: "value" + }), CF_SINGLE_REDIRECT("name1", 301, "when1", "then1"), CF_SINGLE_REDIRECT("name2", 302, "when2", "then2"), CF_SINGLE_REDIRECT("name3", "301", "when3", "then3"), CF_SINGLE_REDIRECT("namettl", 302, "whenttl", "thenttl", TTL(999)), - CF_SINGLE_REDIRECT("namemeta", 302, "whenmeta", "thenmeta", { metastr: "stringy"}, { metanum: 22 } ) + CF_SINGLE_REDIRECT("namemeta", 302, "whenmeta", "thenmeta", { + metastr: "stringy" + }, { + metanum: 22 + }), ); diff --git a/pkg/js/parse_tests/050-cfSingleRedirect.json b/pkg/js/parse_tests/050-cfSingleRedirect.json index e775721f3c..d3372b1dde 100644 --- a/pkg/js/parse_tests/050-cfSingleRedirect.json +++ b/pkg/js/parse_tests/050-cfSingleRedirect.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "foo.com" + }, "name": "foo.com", "rawrecords": [ { @@ -67,6 +71,7 @@ }, "name": "name1", "target": "1.2.3.4", + "ttl": 300, "type": "A" } ], diff --git a/pkg/js/parse_tests/051-HASH.js b/pkg/js/parse_tests/051-HASH.js index cb75995a58..0679ca2aec 100644 --- a/pkg/js/parse_tests/051-HASH.js +++ b/pkg/js/parse_tests/051-HASH.js @@ -1 +1 @@ -D(HASH("SHA1", "abc"), "reg") +D(HASH("SHA1", "abc"), "reg"); diff --git a/pkg/js/parse_tests/051-HASH.json b/pkg/js/parse_tests/051-HASH.json index 070c49a3b1..b58f325ce2 100644 --- a/pkg/js/parse_tests/051-HASH.json +++ b/pkg/js/parse_tests/051-HASH.json @@ -3,6 +3,10 @@ "domains": [ { "dnsProviders": {}, + "meta": { + "dnscontrol_tag": "", + "dnscontrol_uniquename": "a9993e364706816aba3e25717850c26c9cd0d89d" + }, "name": "a9993e364706816aba3e25717850c26c9cd0d89d", "records": [], "registrar": "reg" diff --git a/pkg/js/parse_tests/complexImports/base.js b/pkg/js/parse_tests/complexImports/base.js index b985c7527b..3746afb195 100644 --- a/pkg/js/parse_tests/complexImports/base.js +++ b/pkg/js/parse_tests/complexImports/base.js @@ -1,8 +1,8 @@ require('./a/c/c.js'); require('./b/b.js'); -D("foo.com","none", - A("@","1.2.3.4"), +D("sortfoo.com", "none", + A("@", "1.2.3.4"), c(), b() ); diff --git a/pkg/js/parse_tests/import.js b/pkg/js/parse_tests/import.js index f598ccae87..8b9f84eb66 100644 --- a/pkg/js/parse_tests/import.js +++ b/pkg/js/parse_tests/import.js @@ -1,3 +1,3 @@ -D("foo.com","none", - A("@","1.2.3.4") -); \ No newline at end of file +D("foo.com", "none", + A("@", "1.2.3.4"), +); diff --git a/pkg/prettyzone/sorting.go b/pkg/prettyzone/sorting.go index 6ae20f0711..ff214bd92a 100644 --- a/pkg/prettyzone/sorting.go +++ b/pkg/prettyzone/sorting.go @@ -29,6 +29,7 @@ func (z *ZoneGenData) Less(i, j int) bool { // If we are at the apex, use "@" in the sorting. compA, compB := a.NameFQDN, b.NameFQDN + //fmt.Printf("DEBUG: LabelLess(%q, %q) = %v %q %q\n", compA, compB, LabelLess(compA, compB), a.Name, b.Name) if compA != compB { if a.Name == "@" { compA = "@" @@ -122,6 +123,7 @@ func (z *ZoneGenData) Less(i, j int) bool { default: // pass through. String comparison is sufficient. } + //fmt.Printf("DEBUG: Less %q < %q == %v\n", a.String(), b.String(), a.String() < b.String()) return a.String() < b.String() }