roster-server 2.1.27 → 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 +3 -3
- package/package.json +1 -1
- package/vendor/acme-dns-01-cli-wrapper.js +13 -7
package/index.js
CHANGED
|
@@ -258,7 +258,7 @@ class Roster {
|
|
|
258
258
|
provided.module = defaultDnsChallengeModule;
|
|
259
259
|
}
|
|
260
260
|
if (provided.propagationDelay === undefined) {
|
|
261
|
-
provided.propagationDelay =
|
|
261
|
+
provided.propagationDelay = 120000;
|
|
262
262
|
}
|
|
263
263
|
if (provided.autoContinue === undefined) {
|
|
264
264
|
provided.autoContinue = false;
|
|
@@ -270,9 +270,9 @@ class Roster {
|
|
|
270
270
|
} else {
|
|
271
271
|
this.dnsChallenge = {
|
|
272
272
|
module: defaultDnsChallengeModule,
|
|
273
|
-
propagationDelay:
|
|
273
|
+
propagationDelay: 120000,
|
|
274
274
|
autoContinue: false,
|
|
275
|
-
dryRunDelay:
|
|
275
|
+
dryRunDelay: 120000
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
278
|
}
|
package/package.json
CHANGED
|
@@ -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;
|