roster-server 2.3.2 → 2.3.6
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: oyzcq7vmk6
|
|
3
|
+
type: work-log
|
|
4
|
+
title: Committed and pushed greenlock notify fix
|
|
5
|
+
created: '2026-03-16 15:55:18'
|
|
6
|
+
---
|
|
7
|
+
Created commit bfdb456 on master and pushed to origin/master. Changes: improved notify() detail-to-message normalization in index.js to handle Error objects, undefined/non-serializable inputs, and fallback to `[event] (no details)`; bumped package version to 2.3.4; added docs/generated/greenlock-notify-empty-details.md.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: blpic0aj8a
|
|
3
|
+
type: bugfix
|
|
4
|
+
title: 'Bugfix: Include domain in Greenlock notify logs'
|
|
5
|
+
created: '2026-03-16 16:25:57'
|
|
6
|
+
---
|
|
7
|
+
# Bug: Greenlock notify errors lacked domain context
|
|
8
|
+
|
|
9
|
+
**Symptom**: Timeout/certificate errors in `notify` logs did not clearly indicate which domain triggered the failure.
|
|
10
|
+
**Root cause**: `notify` logged only the normalized message and omitted available domain fields from Greenlock/ACME details.
|
|
11
|
+
**Solution**: Added domain extraction in `notify` from `subject`, `servername`, `domain`, `hostname`, `host`, `altnames`, `domains`, and `identifier.value`; prepends `[domain:<value>]` to log messages.
|
|
12
|
+
**Location**: index.js Greenlock `notify` callback.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: zskjlbshg2
|
|
3
|
+
type: bugfix
|
|
4
|
+
title: 'Bugfix: Harden Greenlock notify logging fallback'
|
|
5
|
+
created: '2026-03-16 15:54:09'
|
|
6
|
+
---
|
|
7
|
+
# Bug: Greenlock notify emitted unhelpful error logs
|
|
8
|
+
|
|
9
|
+
**Symptom**: Log lines such as `roster:error ----` appeared, indicating error events with missing/invalid details.
|
|
10
|
+
**Root cause**: `notify` used `details?.message ?? JSON.stringify(details)`, which could produce `undefined` (or throw on non-serializable data), resulting in low-signal logger output.
|
|
11
|
+
**Solution**: Added robust message normalization in `notify` to handle strings, `Error` instances, plain objects, and serialization failures, then fallback to `[{event}] (no details)` when empty.
|
|
12
|
+
**Location**: index.js notify callback inside Greenlock options.
|
package/index.js
CHANGED
|
@@ -736,7 +736,51 @@ class Roster {
|
|
|
736
736
|
cluster: this.cluster,
|
|
737
737
|
staging: this.staging,
|
|
738
738
|
notify: (event, details) => {
|
|
739
|
-
const
|
|
739
|
+
const eventDomain = (() => {
|
|
740
|
+
if (!details || typeof details !== 'object') return null;
|
|
741
|
+
|
|
742
|
+
const directKeys = ['subject', 'servername', 'domain', 'hostname', 'host'];
|
|
743
|
+
for (const key of directKeys) {
|
|
744
|
+
if (typeof details[key] === 'string' && details[key].trim()) {
|
|
745
|
+
return details[key].trim().toLowerCase();
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
if (Array.isArray(details.altnames) && details.altnames.length > 0) {
|
|
750
|
+
const alt = details.altnames.find(name => typeof name === 'string' && name.trim());
|
|
751
|
+
if (alt) return alt.trim().toLowerCase();
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
if (Array.isArray(details.domains) && details.domains.length > 0) {
|
|
755
|
+
const domain = details.domains.find(name => typeof name === 'string' && name.trim());
|
|
756
|
+
if (domain) return domain.trim().toLowerCase();
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
if (details.identifier && typeof details.identifier.value === 'string' && details.identifier.value.trim()) {
|
|
760
|
+
return details.identifier.value.trim().toLowerCase();
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
return null;
|
|
764
|
+
})();
|
|
765
|
+
|
|
766
|
+
let msg;
|
|
767
|
+
if (typeof details === 'string') {
|
|
768
|
+
msg = details;
|
|
769
|
+
} else if (details instanceof Error) {
|
|
770
|
+
msg = details.stack || details.message;
|
|
771
|
+
} else if (details && typeof details === 'object' && typeof details.message === 'string') {
|
|
772
|
+
msg = details.message;
|
|
773
|
+
} else {
|
|
774
|
+
try {
|
|
775
|
+
msg = JSON.stringify(details);
|
|
776
|
+
} catch {
|
|
777
|
+
msg = String(details);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
if (!msg || msg === 'undefined') msg = `[${event}] (no details)`;
|
|
781
|
+
if (eventDomain && !msg.includes(`[domain:${eventDomain}]`)) {
|
|
782
|
+
msg = `[domain:${eventDomain}] ${msg}`;
|
|
783
|
+
}
|
|
740
784
|
// Suppress known benign warnings from ACME when using acme-dns-01-cli
|
|
741
785
|
if (event === 'warning' && typeof msg === 'string') {
|
|
742
786
|
if (/acme-dns-01-cli.*(incorrect function signatures|deprecated use of callbacks)/i.test(msg)) return;
|