wiki-plugin-lucille 0.0.2 → 0.0.3
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/package.json +1 -1
- package/server/server.js +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wiki-plugin-lucille",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Federated Wiki plugin — P2P video hosting via Lucille (WebTorrent + DO Spaces)",
|
|
5
5
|
"keywords": ["wiki", "plugin", "video", "webtorrent", "planet-nine"],
|
|
6
6
|
"author": "Planet Nine",
|
package/server/server.js
CHANGED
|
@@ -90,7 +90,8 @@ async function addieCreateUser(addieUrl, addieKeys) {
|
|
|
90
90
|
const resp = await fetch(`${addieUrl}/user/create`, {
|
|
91
91
|
method: 'PUT',
|
|
92
92
|
headers: { 'Content-Type': 'application/json' },
|
|
93
|
-
body: JSON.stringify({ timestamp, pubKey: addieKeys.pubKey, signature })
|
|
93
|
+
body: JSON.stringify({ timestamp, pubKey: addieKeys.pubKey, signature }),
|
|
94
|
+
signal: AbortSignal.timeout(8000)
|
|
94
95
|
});
|
|
95
96
|
if (!resp.ok) throw new Error(`Addie create failed: ${resp.status}`);
|
|
96
97
|
return resp.json();
|
|
@@ -736,18 +737,18 @@ async function startServer(params) {
|
|
|
736
737
|
|
|
737
738
|
saveConfig(newConfig);
|
|
738
739
|
|
|
739
|
-
// Auto-create server Addie user if allyabaseUrl was just set
|
|
740
|
+
// Auto-create server Addie user if allyabaseUrl was just set (fire-and-forget — don't block response)
|
|
740
741
|
if (allyabaseUrl && !newConfig.serverAddie) {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
console.warn('[wiki-plugin-lucille] Could not create server Addie user:', err.message);
|
|
745
|
-
}
|
|
742
|
+
ensureServerAddieUser().catch(err =>
|
|
743
|
+
console.warn('[wiki-plugin-lucille] Could not create server Addie user:', err.message)
|
|
744
|
+
);
|
|
746
745
|
}
|
|
747
746
|
|
|
748
|
-
// Restart lucille with new config
|
|
749
|
-
if (lucilleProcess)
|
|
750
|
-
|
|
747
|
+
// Restart lucille with new config (only if it was already running)
|
|
748
|
+
if (lucilleProcess) {
|
|
749
|
+
shutdownLucille();
|
|
750
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
751
|
+
}
|
|
751
752
|
|
|
752
753
|
if (isConfigured(newConfig)) {
|
|
753
754
|
try {
|