1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

moving a bunch of packages under pkg (#124)

* moving a bunch of packages under pkg

* fix gen

* fix tst

* oops

* fix test fo real

* parse mx/a
This commit is contained in:
Craig Peterson
2017-05-25 14:25:39 -04:00
committed by GitHub
parent 01a242480c
commit 42ef9f4b9e
49 changed files with 140 additions and 49 deletions

View File

@@ -0,0 +1,6 @@
var REG = NewRegistrar("Third-Party","NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
D("foo.com",REG,DnsProvider(CF),
A("@","1.2.3.4")
);

View File

@@ -0,0 +1,30 @@
{
"registrars": [
{
"name": "Third-Party",
"type": "NONE"
}
],
"dns_providers": [
{
"name": "Cloudflare",
"type": "CLOUDFLAREAPI"
}
],
"domains": [
{
"name": "foo.com",
"registrar": "Third-Party",
"dnsProviders": {
"Cloudflare":-1
},
"records": [
{
"type": "A",
"name": "@",
"target": "1.2.3.4"
}
]
}
]
}

View File

@@ -0,0 +1,5 @@
var REG = NewRegistrar("Third-Party","NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
D("foo.com",REG,DnsProvider(CF),
A("@","1.2.3.4",TTL(42))
);

View File

@@ -0,0 +1,31 @@
{
"registrars": [
{
"name": "Third-Party",
"type": "NONE"
}
],
"dns_providers": [
{
"name": "Cloudflare",
"type": "CLOUDFLAREAPI"
}
],
"domains": [
{
"name": "foo.com",
"registrar": "Third-Party",
"dnsProviders": {
"Cloudflare":-1
},
"records": [
{
"type": "A",
"name": "@",
"target": "1.2.3.4",
"ttl": 42
}
]
}
]
}

View File

@@ -0,0 +1,5 @@
var CLOUDFLARE = NewRegistrar("Cloudflare","CLOUDFLAREAPI");
D("foo.com",CLOUDFLARE,
A("@","1.2.3.4",{"cloudflare_proxy":"ON"})
);

View File

@@ -0,0 +1,26 @@
{
"registrars": [
{
"name": "Cloudflare",
"type": "CLOUDFLAREAPI"
}
],
"dns_providers": [],
"domains": [
{
"name": "foo.com",
"registrar": "Cloudflare",
"dnsProviders": {},
"records": [
{
"type": "A",
"name": "@",
"target": "1.2.3.4",
"meta": {
"cloudflare_proxy": "ON"
}
}
]
}
]
}

View File

@@ -0,0 +1,10 @@
var REG = NewRegistrar("Third-Party","NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
var BASE = IP("1.2.3.4")
D("foo.com",REG,DnsProvider(CF,0),
A("@",BASE),
A("p1",BASE+1),
A("p255", BASE+255)
);

View File

@@ -0,0 +1,28 @@
{
"registrars": [
{
"name": "Third-Party",
"type": "NONE"
}
],
"dns_providers": [
{
"name": "Cloudflare",
"type": "CLOUDFLAREAPI"
}
],
"domains": [
{
"name": "foo.com",
"registrar": "Third-Party",
"dnsProviders": {
"Cloudflare":0
},
"records": [
{ "type": "A","name": "@","target": "1.2.3.4"},
{ "type": "A","name": "p1","target": "1.2.3.5"},
{ "type": "A","name": "p255","target": "1.2.4.3"}
]
}
]
}

View File

@@ -0,0 +1,7 @@
var REG = NewRegistrar("Third-Party","NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
D("foo.com",REG,DnsProvider(CF,2),
A("@","1.2.3.4")
);
D("foo.com",REG);

View File

@@ -0,0 +1,35 @@
{ "registrars": [
{
"name": "Third-Party",
"type": "NONE"
}
],
"dns_providers": [
{
"name": "Cloudflare",
"type": "CLOUDFLAREAPI"
}
],
"domains": [
{
"name": "foo.com",
"registrar": "Third-Party",
"dnsProviders": {
"Cloudflare":2
},
"records": [
{
"type": "A",
"name": "@",
"target": "1.2.3.4"
}
]
},
{
"name": "foo.com",
"registrar": "Third-Party",
"dnsProviders": {},
"records": []
}
]
}

View File

@@ -0,0 +1,12 @@
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")]}
]
D("foo.com",REG,DnsProvider(CF),
A("@","1.2.3.4",{transform: TRANSFORM_INT})
);

View File

@@ -0,0 +1,34 @@
{
"registrars": [
{
"name": "Third-Party",
"type": "NONE"
}
],
"dns_providers": [
{
"name": "Cloudflare",
"type": "CLOUDFLAREAPI"
}
],
"domains": [
{
"name": "foo.com",
"registrar": "Third-Party",
"dnsProviders": {
"Cloudflare":-1
},
"records": [
{
"type": "A",
"name": "@",
"target": "1.2.3.4",
"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"
}
}
],
"keepunknown": false
}
]
}

View File

@@ -0,0 +1,4 @@
var TRANSFORM_INT = [
{low: "0.0.0.0", high: "1.1.1.1", newBase: "2.2.2.2" }
]
D("foo.com","reg",IMPORT_TRANSFORM(TRANSFORM_INT,"foo2.com",60))

View File

@@ -0,0 +1,23 @@
{
"registrars": [],
"dns_providers": [],
"domains": [
{
"name": "foo.com",
"registrar": "reg",
"dnsProviders": {},
"records": [
{
"type": "IMPORT_TRANSFORM",
"name": "@",
"target": "foo2.com",
"ttl": 60,
"meta": {
"transform_table": "0.0.0.0 ~ 1.1.1.1 ~ 2.2.2.2 ~ "
}
}
],
"keepunknown": false
}
]
}

View File

@@ -0,0 +1,2 @@
require("pkg/js/parse_tests/import.js")

View File

@@ -0,0 +1,19 @@
{
"registrars": [],
"dns_providers": [],
"domains": [
{
"name": "foo.com",
"registrar": "none",
"dnsProviders": {},
"records": [
{
"type": "A",
"name": "@",
"target": "1.2.3.4"
}
],
"keepunknown": false
}
]
}

View File

@@ -0,0 +1,3 @@
D("foo.com","none",
ALIAS("@","foo.com.")
);

View File

@@ -0,0 +1,19 @@
{
"registrars": [],
"dns_providers": [],
"domains": [
{
"name": "foo.com",
"registrar": "none",
"dnsProviders": {},
"records": [
{
"type": "ALIAS",
"name": "@",
"target": "foo.com."
}
],
"keepunknown": false
}
]
}

View File

@@ -0,0 +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")
);

View File

@@ -0,0 +1,24 @@
{
"registrars": [],
"dns_providers": [],
"domains": [
{
"name": "foo.com",
"registrar": "none",
"dnsProviders": {},
"records": [
{
"type": "CF_REDIRECT",
"name": "@",
"target": "test.foo.com,https://goo.com/$1"
},
{
"type": "CF_TEMP_REDIRECT",
"name": "@",
"target": "test.foo.com,https://goo.com/$1"
}
],
"keepunknown": false
}
]
}

View File

@@ -0,0 +1,3 @@
D("foo.com","none",
A("@","1.2.3.4")
);