@decentnetwork/beagle 0.1.50 → 0.1.51
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/dist/desktop/app.js +1 -1
- package/dist/server.js +16 -1
- package/package.json +2 -2
package/dist/desktop/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__DK_UI_VERSION="0.1.
|
|
1
|
+
window.__DK_UI_VERSION="0.1.51";
|
|
2
2
|
const ICON_PATHS = {
|
|
3
3
|
// ---- tab bar (the four must feel like one set) ----
|
|
4
4
|
users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
|
package/dist/server.js
CHANGED
|
@@ -355,6 +355,21 @@ async function pickWritableSaveDir(downloadsDir) {
|
|
|
355
355
|
return alt;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Turn a bare permission error into the one command that fixes it.
|
|
360
|
+
*
|
|
361
|
+
* The daemon runs as root and the files it leaves under ~/.agentnet are
|
|
362
|
+
* root-owned, so this unprivileged process cannot write them — and "EACCES:
|
|
363
|
+
* permission denied, open '/Users/x/.agentnet/downloads/a.jpg'" tells the user
|
|
364
|
+
* nothing about what to do. Daemons from lan 0.1.278 repair this themselves at
|
|
365
|
+
* startup; older ones need the sweep run once by hand.
|
|
366
|
+
*/
|
|
367
|
+
function permissionHint(err) {
|
|
368
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
369
|
+
if (!/EACCES|EPERM|permission denied/i.test(msg))
|
|
370
|
+
return msg;
|
|
371
|
+
return `${msg}\n\nThis is the root-owned ~/.agentnet problem. Fix it once with:\n sudo agentnet fix-perms`;
|
|
372
|
+
}
|
|
358
373
|
/** Resolve a saved file by name across downloads/ and sent/, with a
|
|
359
374
|
* path-traversal guard. Returns null when absent from both. */
|
|
360
375
|
function findSavedFile(downloadsDir, name) {
|
|
@@ -1071,7 +1086,7 @@ export function startBeagleServer(opts) {
|
|
|
1071
1086
|
sendJson(res, 200, { ok: true, ...(r.data ?? {}) });
|
|
1072
1087
|
}
|
|
1073
1088
|
catch (e) {
|
|
1074
|
-
sendJson(res, 500, { ok: false, error:
|
|
1089
|
+
sendJson(res, 500, { ok: false, error: permissionHint(e) });
|
|
1075
1090
|
}
|
|
1076
1091
|
finally {
|
|
1077
1092
|
if (!keep)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/beagle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@decentnetwork/chat-components": "^0.1.3",
|
|
29
|
-
"@decentnetwork/lan": "^0.1.
|
|
29
|
+
"@decentnetwork/lan": "^0.1.278",
|
|
30
30
|
"@decentnetwork/peer": "^0.1.139",
|
|
31
31
|
"@decentnetwork/peer-webrtc": "^0.2.16",
|
|
32
32
|
"js-yaml": "^4.1.0",
|