roster-server 2.1.26 → 2.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
- package/vendor/acme-dns-01-cli-wrapper.js +14 -8
package/index.js
CHANGED
|
@@ -392,7 +392,7 @@ class Roster {
|
|
|
392
392
|
};
|
|
393
393
|
if (shouldCombineWildcard) {
|
|
394
394
|
const dns01 = { ...this.dnsChallenge };
|
|
395
|
-
if (dns01.propagationDelay === undefined) dns01.propagationDelay =
|
|
395
|
+
if (dns01.propagationDelay === undefined) dns01.propagationDelay = 60000;
|
|
396
396
|
if (dns01.autoContinue === undefined) dns01.autoContinue = false;
|
|
397
397
|
if (dns01.dryRunDelay === undefined) dns01.dryRunDelay = dns01.propagationDelay;
|
|
398
398
|
primarySite.challenges = { 'dns-01': dns01 };
|
|
@@ -408,7 +408,7 @@ class Roster {
|
|
|
408
408
|
const wildcardSubject = `*.${domain}`;
|
|
409
409
|
const dns01 = { ...this.dnsChallenge };
|
|
410
410
|
if (dns01.propagationDelay === undefined) {
|
|
411
|
-
dns01.propagationDelay =
|
|
411
|
+
dns01.propagationDelay = 60000; // 120s default for manual DNS (acme-dns-01-cli)
|
|
412
412
|
}
|
|
413
413
|
if (dns01.autoContinue === undefined) {
|
|
414
414
|
dns01.autoContinue = false;
|
package/package.json
CHANGED
|
@@ -44,7 +44,7 @@ module.exports.create = function create(config = {}) {
|
|
|
44
44
|
const challenger = legacyCli.create(config);
|
|
45
45
|
const propagationDelay = Number.isFinite(config.propagationDelay)
|
|
46
46
|
? config.propagationDelay
|
|
47
|
-
:
|
|
47
|
+
: 60000;
|
|
48
48
|
const envAutoContinue = process.env.ROSTER_DNS_AUTO_CONTINUE;
|
|
49
49
|
const parseAutoContinue = (value, fallback) => {
|
|
50
50
|
if (value === undefined || value === null || value === '') return fallback;
|
|
@@ -81,6 +81,11 @@ module.exports.create = function create(config = {}) {
|
|
|
81
81
|
: Number.isFinite(Number(process.env.ROSTER_DNS_POLL_TIMEOUT_MS))
|
|
82
82
|
? Number(process.env.ROSTER_DNS_POLL_TIMEOUT_MS)
|
|
83
83
|
: null;
|
|
84
|
+
const dryRunPollTimeoutMs = Number.isFinite(config.dryRunPollTimeoutMs)
|
|
85
|
+
? config.dryRunPollTimeoutMs
|
|
86
|
+
: Number.isFinite(Number(process.env.ROSTER_DNS_DRYRUN_POLL_TIMEOUT_MS))
|
|
87
|
+
? Number(process.env.ROSTER_DNS_DRYRUN_POLL_TIMEOUT_MS)
|
|
88
|
+
: null;
|
|
84
89
|
|
|
85
90
|
function sleep(ms) {
|
|
86
91
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -111,10 +116,9 @@ module.exports.create = function create(config = {}) {
|
|
|
111
116
|
|
|
112
117
|
async function waitForDnsTxtPropagation(dnsHost, expectedToken, timeoutMs) {
|
|
113
118
|
const started = Date.now();
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
while ((Date.now() - started) <= maxWait) {
|
|
119
|
+
const hasFiniteTimeout = Number.isFinite(timeoutMs) && timeoutMs >= 0;
|
|
120
|
+
const maxWait = hasFiniteTimeout ? timeoutMs : null;
|
|
121
|
+
while (maxWait === null || (Date.now() - started) <= maxWait) {
|
|
118
122
|
if (await hasDnsTxtToken(dnsHost, expectedToken)) return true;
|
|
119
123
|
await sleep(Math.max(1000, dnsPollIntervalMs));
|
|
120
124
|
}
|
|
@@ -142,7 +146,9 @@ module.exports.create = function create(config = {}) {
|
|
|
142
146
|
const effectiveDelay = isDryRunChallenge
|
|
143
147
|
? Math.max(0, dryRunDelay)
|
|
144
148
|
: propagationDelay;
|
|
145
|
-
const effectiveTimeoutMs =
|
|
149
|
+
const effectiveTimeoutMs = isDryRunChallenge
|
|
150
|
+
? dryRunPollTimeoutMs
|
|
151
|
+
: (dnsPollTimeoutMs === null ? effectiveDelay : dnsPollTimeoutMs);
|
|
146
152
|
const expectedToken = resolveExpectedToken(opts, ch);
|
|
147
153
|
|
|
148
154
|
log.info('DNS-01 ' + altname);
|
|
@@ -152,7 +158,7 @@ module.exports.create = function create(config = {}) {
|
|
|
152
158
|
'DNS verification enabled. Continuing automatically when TXT appears at ' +
|
|
153
159
|
dnsHost +
|
|
154
160
|
' (timeout ' +
|
|
155
|
-
effectiveTimeoutMs +
|
|
161
|
+
(effectiveTimeoutMs === null ? 'infinite' : effectiveTimeoutMs) +
|
|
156
162
|
'ms, poll ' +
|
|
157
163
|
dnsPollIntervalMs +
|
|
158
164
|
'ms).'
|
|
@@ -163,7 +169,7 @@ module.exports.create = function create(config = {}) {
|
|
|
163
169
|
return null;
|
|
164
170
|
}
|
|
165
171
|
log.warn(
|
|
166
|
-
`DNS TXT not detected for ${dnsHost} within ${effectiveTimeoutMs}
|
|
172
|
+
`DNS TXT not detected for ${dnsHost} within ${effectiveTimeoutMs}; ` +
|
|
167
173
|
'continuing anyway (ACME preflight may still fail).'
|
|
168
174
|
);
|
|
169
175
|
return null;
|