roster-server 2.1.18 → 2.1.22
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 +13 -1
- package/package.json +1 -1
- package/vendor/acme-dns-01-cli-wrapper.js +16 -2
package/index.js
CHANGED
|
@@ -775,6 +775,19 @@ class Roster {
|
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
|
|
778
|
+
const isBunRuntime = typeof Bun !== 'undefined' || process.release?.name === 'bun';
|
|
779
|
+
if (isBunRuntime && this.wildcardZones.size > 0) {
|
|
780
|
+
for (const zone of this.wildcardZones) {
|
|
781
|
+
const bootstrapHost = `bun-bootstrap.${zone}`;
|
|
782
|
+
try {
|
|
783
|
+
log.warn(`⚠️ Bun runtime detected: prewarming wildcard certificate via ${bootstrapHost}`);
|
|
784
|
+
await greenlockRuntime.get({ servername: bootstrapHost });
|
|
785
|
+
} catch (error) {
|
|
786
|
+
log.warn(`⚠️ Bun wildcard prewarm failed for ${zone}: ${error?.message || error}`);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
778
791
|
// Create dispatcher for each port
|
|
779
792
|
const createDispatcher = (portData) => {
|
|
780
793
|
return (req, res) => {
|
|
@@ -923,7 +936,6 @@ class Roster {
|
|
|
923
936
|
if (portNum === this.defaultPort) {
|
|
924
937
|
// Bun has known gaps around SNICallback compatibility.
|
|
925
938
|
// Fallback to static cert loading for the primary domain on default HTTPS port.
|
|
926
|
-
const isBunRuntime = typeof Bun !== 'undefined' || process.release?.name === 'bun';
|
|
927
939
|
const tlsOpts = { minVersion: this.tlsMinVersion, maxVersion: this.tlsMaxVersion };
|
|
928
940
|
let httpsServer;
|
|
929
941
|
|
package/package.json
CHANGED
|
@@ -66,6 +66,7 @@ module.exports.create = function create(config = {}) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const presentedByHost = new Map();
|
|
69
|
+
const presentedByAltname = new Map();
|
|
69
70
|
|
|
70
71
|
async function setChallenge(opts) {
|
|
71
72
|
const isInteractive = Boolean(process.stdin && process.stdin.isTTY);
|
|
@@ -83,6 +84,10 @@ module.exports.create = function create(config = {}) {
|
|
|
83
84
|
if (dnsHost && dnsAuth) {
|
|
84
85
|
presentedByHost.set(dnsHost, dnsAuth);
|
|
85
86
|
}
|
|
87
|
+
const altname = String(ch.altname || opts?.altname || '');
|
|
88
|
+
if (altname && dnsAuth) {
|
|
89
|
+
presentedByAltname.set(altname, { dnsHost, dnsAuthorization: dnsAuth });
|
|
90
|
+
}
|
|
86
91
|
const isDryRunChallenge = dnsHost.includes('_greenlock-dryrun-');
|
|
87
92
|
const effectiveDelay = isDryRunChallenge
|
|
88
93
|
? Math.max(0, dryRunDelay)
|
|
@@ -108,11 +113,18 @@ module.exports.create = function create(config = {}) {
|
|
|
108
113
|
|
|
109
114
|
async function getChallenge(opts) {
|
|
110
115
|
const ch = opts?.challenge || {};
|
|
111
|
-
const
|
|
116
|
+
const altname = String(ch.altname || opts?.altname || '');
|
|
117
|
+
const wildcardZone = altname.startsWith('*.') ? altname.slice(2) : '';
|
|
118
|
+
const dnsHostFromAltname = wildcardZone ? `_acme-challenge.${wildcardZone}` : '';
|
|
119
|
+
const dnsHost = String(ch.dnsHost || opts?.dnsHost || dnsHostFromAltname || '');
|
|
120
|
+
|
|
121
|
+
const byAltname = altname ? presentedByAltname.get(altname) : null;
|
|
112
122
|
const dnsAuthorization =
|
|
113
123
|
ch.dnsAuthorization ||
|
|
114
124
|
opts?.dnsAuthorization ||
|
|
115
|
-
(dnsHost ? presentedByHost.get(dnsHost) : null)
|
|
125
|
+
(dnsHost ? presentedByHost.get(dnsHost) : null) ||
|
|
126
|
+
byAltname?.dnsAuthorization ||
|
|
127
|
+
null;
|
|
116
128
|
|
|
117
129
|
if (!dnsAuthorization) {
|
|
118
130
|
return null;
|
|
@@ -120,6 +132,8 @@ module.exports.create = function create(config = {}) {
|
|
|
120
132
|
|
|
121
133
|
return {
|
|
122
134
|
...(typeof ch === 'object' ? ch : {}),
|
|
135
|
+
...(altname ? { altname } : {}),
|
|
136
|
+
...(dnsHost ? { dnsHost } : {}),
|
|
123
137
|
dnsAuthorization
|
|
124
138
|
};
|
|
125
139
|
}
|