@@ -19,7 +19,7 @@ function getDomainsList(filesPath) {
19
19
}
20
20
21
21
var domains = getDomainsList ( "./domains" ) ;
22
- var zone = [ ] ;
22
+ var records = [ ] ;
23
23
24
24
for ( var subdomain in domains ) {
25
25
var subdomainName = domains [ subdomain ] . name ;
@@ -29,35 +29,35 @@ for (var subdomain in domains) {
29
29
// Handle A records
30
30
if ( data . records . A ) {
31
31
for ( var a in data . records . A ) {
32
- zone . push ( A ( subdomainName , IP ( data . records . A [ a ] ) , proxyState ) ) ;
32
+ records . push ( A ( subdomainName , IP ( data . records . A [ a ] ) , proxyState ) ) ;
33
33
}
34
34
}
35
35
36
36
// Handle AAAA records
37
37
if ( data . records . AAAA ) {
38
38
for ( var aaaa in data . records . AAAA ) {
39
- zone . push ( AAAA ( subdomainName , data . records . AAAA [ aaaa ] , proxyState ) ) ;
39
+ records . push ( AAAA ( subdomainName , data . records . AAAA [ aaaa ] , proxyState ) ) ;
40
40
}
41
41
}
42
42
43
43
// Handle CAA records
44
44
if ( data . records . CAA ) {
45
45
for ( var caa in data . records . CAA ) {
46
46
var caaRecord = data . records . CAA [ caa ] ;
47
- zone . push ( CAA ( subdomainName , caaRecord . tag , caaRecord . value ) ) ;
47
+ records . push ( CAA ( subdomainName , caaRecord . tag , caaRecord . value ) ) ;
48
48
}
49
49
}
50
50
51
51
// Handle CNAME records
52
52
if ( data . records . CNAME ) {
53
- zone . push ( ALIAS ( subdomainName , data . records . CNAME + "." , proxyState ) ) ;
53
+ records . push ( ALIAS ( subdomainName , data . records . CNAME + "." , proxyState ) ) ;
54
54
}
55
55
56
56
// Handle DS records
57
57
if ( data . records . DS ) {
58
58
for ( var ds in data . records . DS ) {
59
59
var dsRecord = data . records . DS [ ds ] ;
60
- zone . push (
60
+ records . push (
61
61
DS ( subdomainName , dsRecord . key_tag , dsRecord . algorithm , dsRecord . digest_type , dsRecord . digest )
62
62
) ;
63
63
}
@@ -69,11 +69,11 @@ for (var subdomain in domains) {
69
69
var mxRecord = data . records . MX [ mx ] ;
70
70
71
71
if ( typeof mxRecord === "string" ) {
72
- zone . push (
72
+ records . push (
73
73
MX ( subdomainName , 10 + parseInt ( mx ) , data . records . MX [ mx ] + "." )
74
74
) ;
75
75
} else {
76
- zone . push (
76
+ records . push (
77
77
MX (
78
78
subdomainName ,
79
79
parseInt ( mxRecord . priority ) ,
@@ -87,15 +87,15 @@ for (var subdomain in domains) {
87
87
// Handle NS records
88
88
if ( data . records . NS ) {
89
89
for ( var ns in data . records . NS ) {
90
- zone . push ( NS ( subdomainName , data . records . NS [ ns ] + "." ) ) ;
90
+ records . push ( NS ( subdomainName , data . records . NS [ ns ] + "." ) ) ;
91
91
}
92
92
}
93
93
94
94
// Handle SRV records
95
95
if ( data . records . SRV ) {
96
96
for ( var srv in data . records . SRV ) {
97
97
var srvRecord = data . records . SRV [ srv ] ;
98
- zone . push (
98
+ records . push (
99
99
SRV ( subdomainName , srvRecord . priority , srvRecord . weight , srvRecord . port , srvRecord . target + "." )
100
100
) ;
101
101
}
@@ -106,7 +106,7 @@ for (var subdomain in domains) {
106
106
for ( var tlsa in data . records . TLSA ) {
107
107
var tlsaRecord = data . records . TLSA [ tlsa ] ;
108
108
109
- zone . push (
109
+ records . push (
110
110
TLSA (
111
111
subdomainName ,
112
112
tlsaRecord . usage ,
@@ -122,16 +122,16 @@ for (var subdomain in domains) {
122
122
if ( data . records . TXT ) {
123
123
if ( Array . isArray ( data . records . TXT ) ) {
124
124
for ( var txt in data . records . TXT ) {
125
- zone . push ( TXT ( subdomainName , data . records . TXT [ txt ] . length <= 255 ? "\"" + data . records . TXT [ txt ] + "\"" : data . records . TXT [ txt ] ) ) ;
125
+ records . push ( TXT ( subdomainName , data . records . TXT [ txt ] . length <= 255 ? "\"" + data . records . TXT [ txt ] + "\"" : data . records . TXT [ txt ] ) ) ;
126
126
}
127
127
} else {
128
- zone . push ( TXT ( subdomainName , data . records . TXT . length <= 255 ? "\"" + data . records . TXT + "\"" : data . records . TXT ) ) ;
128
+ records . push ( TXT ( subdomainName , data . records . TXT . length <= 255 ? "\"" + data . records . TXT + "\"" : data . records . TXT ) ) ;
129
129
}
130
130
}
131
131
132
132
// Handle URL records
133
133
if ( data . records . URL ) {
134
- zone . push ( A ( subdomainName , IP ( "192.0.2.1" ) , CF_PROXY_ON ) ) ;
134
+ records . push ( A ( subdomainName , IP ( "192.0.2.1" ) , CF_PROXY_ON ) ) ;
135
135
}
136
136
}
137
137
@@ -149,7 +149,7 @@ for (var i = 0; i < reserved.length; i++) {
149
149
subdomainName !== "ns4" &&
150
150
subdomainName !== "www"
151
151
) {
152
- zone . push ( A ( subdomainName , IP ( "192.0.2.1" ) , CF_PROXY_ON ) ) ;
152
+ records . push ( A ( subdomainName , IP ( "192.0.2.1" ) , CF_PROXY_ON ) ) ;
153
153
}
154
154
}
155
155
@@ -176,6 +176,6 @@ var ignored = [
176
176
] ;
177
177
178
178
// Push TXT record of when the zone was last updated
179
- zone . push ( TXT ( "_zone-updated" , "\"" + Date . now ( ) . toString ( ) + "\"" ) ) ;
179
+ records . push ( TXT ( "_zone-updated" , "\"" + Date . now ( ) . toString ( ) + "\"" ) ) ;
180
180
181
181
D ( domainName , registrar , dnsProvider , options , ignored , records ) ;
0 commit comments