Compare commits
No commits in common. "0b387a150fefeb5c555f5db3102f26b7203de3bc" and "9071b0c048645f859cb8bb470df2d5f1c50b4efd" have entirely different histories.
0b387a150f
...
9071b0c048
80
.gitignore
vendored
80
.gitignore
vendored
@ -1,78 +1,2 @@
|
|||||||
# ---> Node
|
node_modules
|
||||||
# Logs
|
package-lock.json
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
|
||||||
.cache
|
|
||||||
|
|
||||||
# next.js build output
|
|
||||||
.next
|
|
||||||
|
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
10
README.md
10
README.md
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
NameCheap DNS + Let's Encrypt
|
NameCheap DNS + Let's Encrypt
|
||||||
|
|
||||||
|
|
||||||
This handles ACME dns-01 challenges, compatible with ACME.js and Greenlock.js.
|
This handles ACME dns-01 challenges, compatible with ACME.js and Greenlock.js.
|
||||||
Passes [acme-dns-01-test](https://git.rootprojects.org/root/acme-dns-01-test.js).
|
Passes [acme-dns-01-test](https://git.rootprojects.org/root/acme-dns-01-test.js).
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ var dns01 = require('acme-dns-01-namecheap').create({
|
|||||||
apiKey : 'xxxx',
|
apiKey : 'xxxx',
|
||||||
clientIp:'public ip',
|
clientIp:'public ip',
|
||||||
username: 'api user',
|
username: 'api user',
|
||||||
baseUrl: 'sandbox or production' // default production
|
baseUrl: 'sandbox or production', // default production
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -62,10 +63,10 @@ dns01
|
|||||||
dnsAuthorization: 'xxx_secret_xxx'
|
dnsAuthorization: 'xxx_secret_xxx'
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
console.log('TXT record set');
|
console.log("TXT record set");
|
||||||
})
|
})
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
console.log('Failed to set TXT record');
|
console.log("Failed to set TXT record");
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -76,5 +77,6 @@ for more implementation details.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# node ./test.js domain-zone api-user api-key client-ip username [username is optional if similar to api-user]
|
# node ./test.js domain-zone api-user api-key client-ip username [username is optional if similar to api-user]
|
||||||
node ./test.js example.com demo d41474b94e7d4536baabb074a09c96bd 45.77.4.126
|
node ./test.js example.com demo 45.77.4.126 d41474b94e7d4536baabb074a09c96bd
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
ZONE=example.co.uk
|
|
||||||
|
|
||||||
API_USER=exampleuser
|
|
||||||
API_KEY=xxxxxxxxxxxxxxx
|
|
||||||
USERNAME=exampleuser
|
|
||||||
CLIENT_IP=121.22.123.22
|
|
111
lib/index.js
111
lib/index.js
@ -5,9 +5,11 @@ var request; // = require('@root/request');
|
|||||||
var parseString = require('xml2js').parseString;
|
var parseString = require('xml2js').parseString;
|
||||||
parseString = util.promisify(parseString);
|
parseString = util.promisify(parseString);
|
||||||
|
|
||||||
|
|
||||||
const SANDBOX_URL = 'https://api.sandbox.namecheap.com/xml.response';
|
const SANDBOX_URL = 'https://api.sandbox.namecheap.com/xml.response';
|
||||||
const PRODUCTION_URL = 'https://api.namecheap.com/xml.response';
|
const PRODUCTION_URL = 'https://api.namecheap.com/xml.response';
|
||||||
|
|
||||||
|
|
||||||
var defaults = {
|
var defaults = {
|
||||||
baseUrl: SANDBOX_URL
|
baseUrl: SANDBOX_URL
|
||||||
};
|
};
|
||||||
@ -23,19 +25,13 @@ function extend(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function assign(obj1,obj2) {
|
function assign(obj1,obj2) {
|
||||||
for (var attrname in obj2) {
|
for (var attrname in obj2) { obj1[attrname] = obj2[attrname]; }
|
||||||
obj1[attrname] = obj2[attrname];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function requestUrl(baseUrl, params) {
|
function requestUrl(baseUrl, params) {
|
||||||
var queryString = Object.keys(params)
|
var queryString = Object.keys(params).map(function (key) {
|
||||||
.map(function(key) {
|
return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
|
||||||
return (
|
}).join('&');
|
||||||
encodeURIComponent(key) + '=' + encodeURIComponent(params[key])
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.join('&');
|
|
||||||
// console.debug(queryString);
|
// console.debug(queryString);
|
||||||
return baseUrl + '?' + queryString;
|
return baseUrl + '?' + queryString;
|
||||||
}
|
}
|
||||||
@ -58,39 +54,23 @@ module.exports.create = function(config) {
|
|||||||
|
|
||||||
var url = requestUrl(baseUrl, requestParams);
|
var url = requestUrl(baseUrl, requestParams);
|
||||||
console.log('DEBUG >>> url: ' + url);
|
console.log('DEBUG >>> url: ' + url);
|
||||||
console.log(
|
console.log('DEBUG >>> requestParams: ' + JSON.stringify(requestParams, null, 2));
|
||||||
'DEBUG >>> requestParams: ' + JSON.stringify(requestParams, null, 2)
|
|
||||||
);
|
|
||||||
|
|
||||||
return request({
|
return request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: url
|
url: url,
|
||||||
}).then(function (response) {
|
}).then(function (response) {
|
||||||
var responseBody = response.body;
|
var responseBody = response.body;
|
||||||
// console.log(responseBody);
|
// console.log(responseBody);
|
||||||
return parseString(responseBody).then(function (result) {
|
return parseString(responseBody).then(function (result) {
|
||||||
// check response status
|
// check response status
|
||||||
if (result['ApiResponse']['$']['Status'] === 'ERROR') {
|
if (result['ApiResponse']['$']['Status'] === 'ERROR') {
|
||||||
for (
|
for (let i = 0; i < result['ApiResponse']['Errors'].length; i++) {
|
||||||
let i = 0;
|
console.log('DEBUG >>> error: ' + JSON.stringify(result['ApiResponse']['Errors'][i]['Error'][0], null, 2));
|
||||||
i < result['ApiResponse']['Errors'].length;
|
|
||||||
i++
|
|
||||||
) {
|
|
||||||
console.log(
|
|
||||||
'DEBUG >>> error: ' +
|
|
||||||
JSON.stringify(
|
|
||||||
result['ApiResponse']['Errors'][i][
|
|
||||||
'Error'
|
|
||||||
][0],
|
|
||||||
null,
|
|
||||||
2
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
throw new Error('API Error');
|
throw new Error('API Error');
|
||||||
} else {
|
} else { // Status="OK"
|
||||||
// Status="OK"
|
return result['ApiResponse']['CommandResponse'][0]
|
||||||
return result['ApiResponse']['CommandResponse'][0];
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -103,14 +83,13 @@ module.exports.create = function(config) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
zones: function(data) {
|
zones: function(data) {
|
||||||
return api('namecheap.domains.getList', {}).then(function(
|
return api('namecheap.domains.getList',{}).then(function (zonesResponse) {
|
||||||
zonesResponse
|
|
||||||
) {
|
|
||||||
// console.log('zones');
|
// console.log('zones');
|
||||||
// console.log(zonesResponse);
|
// console.log(zonesResponse);
|
||||||
return zonesResponse['DomainGetListResult'].map(function (x) {
|
return zonesResponse['DomainGetListResult'].map(function (x) {
|
||||||
return x['Domain'][0]['$']['Name'];
|
return x['Domain'][0]['$']['Name'];
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -142,18 +121,12 @@ module.exports.create = function(config) {
|
|||||||
// setting a host record overwrites all existing,
|
// setting a host record overwrites all existing,
|
||||||
// adding a new records means you've have to send back all previous records too
|
// adding a new records means you've have to send back all previous records too
|
||||||
|
|
||||||
return api('namecheap.domains.dns.getHosts', params).then(function(
|
return api('namecheap.domains.dns.getHosts',params).then(function (hostsResponse) {
|
||||||
hostsResponse
|
var currentHostRecordsCount = hostsResponse['DomainDNSGetHostsResult'][0]['host'].length;
|
||||||
) {
|
|
||||||
var currentHostRecordsCount =
|
|
||||||
hostsResponse['DomainDNSGetHostsResult'][0]['host'].length;
|
|
||||||
|
|
||||||
for (var i = 0; i < currentHostRecordsCount; i++) {
|
for (var i = 0; i < currentHostRecordsCount; i++) {
|
||||||
// console.log(hostsResponse['DomainDNSGetHostsResult'][i]['host'][0]);
|
// console.log(hostsResponse['DomainDNSGetHostsResult'][i]['host'][0]);
|
||||||
var currentEntry =
|
var currentEntry = hostsResponse['DomainDNSGetHostsResult'][0]['host'][i]['$'];
|
||||||
hostsResponse['DomainDNSGetHostsResult'][0]['host'][i][
|
|
||||||
'$'
|
|
||||||
];
|
|
||||||
|
|
||||||
params['HostName'+(i+1)] = currentEntry['Name'];
|
params['HostName'+(i+1)] = currentEntry['Name'];
|
||||||
params['RecordType'+(i+1)] = currentEntry['Type'];
|
params['RecordType'+(i+1)] = currentEntry['Type'];
|
||||||
@ -161,26 +134,22 @@ module.exports.create = function(config) {
|
|||||||
params['TTL'+(i+1)] = currentEntry['TTL'];
|
params['TTL'+(i+1)] = currentEntry['TTL'];
|
||||||
}
|
}
|
||||||
|
|
||||||
params['HostName' + (currentHostRecordsCount + 1)] =
|
params['HostName'+(currentHostRecordsCount+1)] = ch.dnsPrefix;
|
||||||
ch.dnsPrefix;
|
|
||||||
params['RecordType'+(currentHostRecordsCount+1)] = 'TXT';
|
params['RecordType'+(currentHostRecordsCount+1)] = 'TXT';
|
||||||
params['Address'+(currentHostRecordsCount+1)] = txt;
|
params['Address'+(currentHostRecordsCount+1)] = txt;
|
||||||
params['TTL'+(currentHostRecordsCount+1)] = 100; // in minutes
|
params['TTL'+(currentHostRecordsCount+1)] = 100; // in minutes
|
||||||
|
|
||||||
// console.log(params);
|
// console.log(params);
|
||||||
|
|
||||||
return api('namecheap.domains.dns.setHosts', params)
|
return api('namecheap.domains.dns.setHosts',params).then(function (setHostResponse) {
|
||||||
.then(function(setHostResponse) {
|
|
||||||
// console.log('setHost');
|
// console.log('setHost');
|
||||||
// console.log(setHostResponse);
|
// console.log(setHostResponse);
|
||||||
return true;
|
return true
|
||||||
})
|
}).catch(function (err) {
|
||||||
.catch(function(err) {
|
throw new Error('record did not set. check subdomain, api key, etc');
|
||||||
throw new Error(
|
|
||||||
'record did not set. check subdomain, api key, etc'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
remove: function (data) {
|
remove: function (data) {
|
||||||
var ch = data.challenge;
|
var ch = data.challenge;
|
||||||
@ -195,18 +164,12 @@ module.exports.create = function(config) {
|
|||||||
// setting a host record overwrites all existing,
|
// setting a host record overwrites all existing,
|
||||||
// removing a new records means you've have to send back all previous records without removed
|
// removing a new records means you've have to send back all previous records without removed
|
||||||
|
|
||||||
return api('namecheap.domains.dns.getHosts', params).then(function(
|
return api('namecheap.domains.dns.getHosts',params).then(function (hostsResponse) {
|
||||||
hostsResponse
|
var currentHostRecordsCount = hostsResponse['DomainDNSGetHostsResult'][0]['host'].length;
|
||||||
) {
|
|
||||||
var currentHostRecordsCount =
|
|
||||||
hostsResponse['DomainDNSGetHostsResult'][0]['host'].length;
|
|
||||||
|
|
||||||
for (var i = 0; i < currentHostRecordsCount; i++) {
|
for (var i = 0; i < currentHostRecordsCount; i++) {
|
||||||
// console.log(hostsResponse['DomainDNSGetHostsResult'][i]['host'][0]);
|
// console.log(hostsResponse['DomainDNSGetHostsResult'][i]['host'][0]);
|
||||||
var currentEntry =
|
var currentEntry = hostsResponse['DomainDNSGetHostsResult'][0]['host'][i]['$'];
|
||||||
hostsResponse['DomainDNSGetHostsResult'][0]['host'][i][
|
|
||||||
'$'
|
|
||||||
];
|
|
||||||
if(currentEntry['Address'] != ch.dnsAuthorization){
|
if(currentEntry['Address'] != ch.dnsAuthorization){
|
||||||
params['HostName'+(i+1)] = currentEntry['Name'];
|
params['HostName'+(i+1)] = currentEntry['Name'];
|
||||||
params['RecordType'+(i+1)] = currentEntry['Type'];
|
params['RecordType'+(i+1)] = currentEntry['Type'];
|
||||||
@ -215,18 +178,15 @@ module.exports.create = function(config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return api('namecheap.domains.dns.setHosts', params)
|
return api('namecheap.domains.dns.setHosts',params).then(function (setHostResponse) {
|
||||||
.then(function(setHostResponse) {
|
|
||||||
// console.log('setHost');
|
// console.log('setHost');
|
||||||
// console.log(setHostResponse);
|
// console.log(setHostResponse);
|
||||||
return true;
|
return true
|
||||||
})
|
}).catch(function (err) {
|
||||||
.catch(function(err) {
|
throw new Error('record did not remove. check subdomain, api key, etc');
|
||||||
throw new Error(
|
|
||||||
'record did not remove. check subdomain, api key, etc'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
get: function (data) {
|
get: function (data) {
|
||||||
var ch = data.challenge;
|
var ch = data.challenge;
|
||||||
@ -238,13 +198,10 @@ module.exports.create = function(config) {
|
|||||||
params['TLD'] = domains[domains.length - 1];
|
params['TLD'] = domains[domains.length - 1];
|
||||||
params['SLD'] = domains[domains.length - 2];
|
params['SLD'] = domains[domains.length - 2];
|
||||||
|
|
||||||
return api('namecheap.domains.dns.getHosts', params).then(function(
|
return api('namecheap.domains.dns.getHosts',params).then(function (hostsResponse) {
|
||||||
hostsResponse
|
|
||||||
) {
|
|
||||||
// console.log('hosts');
|
// console.log('hosts');
|
||||||
// console.log(hostsResponse);
|
// console.log(hostsResponse);
|
||||||
var currentHostRecords =
|
var currentHostRecords = hostsResponse['DomainDNSGetHostsResult'][0]['host'];
|
||||||
hostsResponse['DomainDNSGetHostsResult'][0]['host'];
|
|
||||||
|
|
||||||
var entries = currentHostRecords.filter(function (x) {
|
var entries = currentHostRecords.filter(function (x) {
|
||||||
return x['$']['Type'] === 'TXT';
|
return x['$']['Type'] === 'TXT';
|
||||||
@ -261,7 +218,9 @@ module.exports.create = function(config) {
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
49
package-lock.json
generated
49
package-lock.json
generated
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "acme-dns-01-namecheap",
|
|
||||||
"version": "3.0.0",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@root/request": {
|
|
||||||
"version": "1.3.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.3.11.tgz",
|
|
||||||
"integrity": "sha512-3a4Eeghcjsfe6zh7EJ+ni1l8OK9Fz2wL1OjP4UCa0YdvtH39kdXB9RGWuzyNv7dZi0+Ffkc83KfH0WbPMiuJFw=="
|
|
||||||
},
|
|
||||||
"acme-challenge-test": {
|
|
||||||
"version": "3.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/acme-challenge-test/-/acme-challenge-test-3.3.2.tgz",
|
|
||||||
"integrity": "sha512-0AbMcaON20wpI5vzFDAqwcv2VerY4xIlNCqX0w1xEJUIu/EQtQNmkje+rKNuy2TUl2KBMdIaR6YBbJUdaEiC4w==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@root/request": "^1.3.11"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@root/request": {
|
|
||||||
"version": "1.3.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.3.11.tgz",
|
|
||||||
"integrity": "sha512-3a4Eeghcjsfe6zh7EJ+ni1l8OK9Fz2wL1OjP4UCa0YdvtH39kdXB9RGWuzyNv7dZi0+Ffkc83KfH0WbPMiuJFw==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sax": {
|
|
||||||
"version": "1.2.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
|
||||||
},
|
|
||||||
"xml2js": {
|
|
||||||
"version": "0.4.19",
|
|
||||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
|
|
||||||
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
|
|
||||||
"requires": {
|
|
||||||
"sax": ">=0.6.0",
|
|
||||||
"xmlbuilder": "~9.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"xmlbuilder": {
|
|
||||||
"version": "9.0.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
|
||||||
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,10 +3,6 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"description": "Namecheap DNS for Let's Encrypt / ACME dns-01 challenges with ACME.js and Greenlock.js",
|
"description": "Namecheap DNS for Let's Encrypt / ACME dns-01 challenges with ACME.js and Greenlock.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"files": [
|
|
||||||
"lib",
|
|
||||||
"test.js"
|
|
||||||
],
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node ./test.js"
|
"test": "node ./test.js"
|
||||||
},
|
},
|
||||||
@ -34,6 +30,6 @@
|
|||||||
"xml2js": "^0.4.19"
|
"xml2js": "^0.4.19"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"acme-challenge-test": "^3.3.2"
|
"acme-dns-01-test": "^3.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
test.js
17
test.js
@ -3,22 +3,18 @@
|
|||||||
|
|
||||||
// https://git.rootprojects.org/root/acme-dns-01-test.js
|
// https://git.rootprojects.org/root/acme-dns-01-test.js
|
||||||
var tester = require('acme-challenge-test');
|
var tester = require('acme-challenge-test');
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
// Usage: node ./test.js example.com xxxxxxxxx
|
// Usage: node ./test.js example.com xxxxxxxxx
|
||||||
var zone = process.argv[2] || process.env.ZONE;
|
var zone = process.argv[2];
|
||||||
|
|
||||||
var challenger = require('./index.js').create({
|
var challenger = require('./index.js').create({
|
||||||
apiUser: process.argv[3] || process.env.API_USER,
|
apiUser:process.argv[3],
|
||||||
apiKey: process.argv[4] || process.env.API_KEY || process.env.TOKEN,
|
apiKey : process.argv[4],
|
||||||
clientIp: process.argv[5] || process.env.CLIENT_IP,
|
clientIp:process.argv[5],
|
||||||
username:
|
username: process.argv[6] || process.argv[3]
|
||||||
process.argv[6] ||
|
|
||||||
process.env.USERNAME ||
|
|
||||||
process.argv[3] ||
|
|
||||||
process.env.API_USER
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// The dry-run tests can pass on, literally, 'example.com'
|
// The dry-run tests can pass on, literally, 'example.com'
|
||||||
// but the integration tests require that you have control over the domain
|
// but the integration tests require that you have control over the domain
|
||||||
tester
|
tester
|
||||||
@ -31,3 +27,4 @@ tester
|
|||||||
console.error(e.message);
|
console.error(e.message);
|
||||||
console.error(e.stack);
|
console.error(e.stack);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user