roster-server 2.1.16 → 2.1.20
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 +14 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -234,10 +234,9 @@ class Roster {
|
|
|
234
234
|
this.disableWildcard = options.disableWildcard !== undefined
|
|
235
235
|
? parseBooleanFlag(options.disableWildcard, false)
|
|
236
236
|
: parseBooleanFlag(process.env.ROSTER_DISABLE_WILDCARD, false);
|
|
237
|
-
const isBunRuntime = typeof Bun !== 'undefined' || process.release?.name === 'bun';
|
|
238
237
|
this.combineWildcardCerts = options.combineWildcardCerts !== undefined
|
|
239
238
|
? parseBooleanFlag(options.combineWildcardCerts, false)
|
|
240
|
-
: parseBooleanFlag(process.env.ROSTER_COMBINE_WILDCARD_CERTS,
|
|
239
|
+
: parseBooleanFlag(process.env.ROSTER_COMBINE_WILDCARD_CERTS, false);
|
|
241
240
|
|
|
242
241
|
const port = options.port === undefined ? 443 : options.port;
|
|
243
242
|
if (port === 80 && !this.local) {
|
|
@@ -776,6 +775,19 @@ class Roster {
|
|
|
776
775
|
}
|
|
777
776
|
}
|
|
778
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
|
+
|
|
779
791
|
// Create dispatcher for each port
|
|
780
792
|
const createDispatcher = (portData) => {
|
|
781
793
|
return (req, res) => {
|
|
@@ -924,7 +936,6 @@ class Roster {
|
|
|
924
936
|
if (portNum === this.defaultPort) {
|
|
925
937
|
// Bun has known gaps around SNICallback compatibility.
|
|
926
938
|
// Fallback to static cert loading for the primary domain on default HTTPS port.
|
|
927
|
-
const isBunRuntime = typeof Bun !== 'undefined' || process.release?.name === 'bun';
|
|
928
939
|
const tlsOpts = { minVersion: this.tlsMinVersion, maxVersion: this.tlsMaxVersion };
|
|
929
940
|
let httpsServer;
|
|
930
941
|
|