@xdarkicex/openclaw-memory-libravdb 1.6.6 → 1.6.7
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/identity.js +10 -0
- package/dist/index.js +10 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/identity.js
CHANGED
|
@@ -2,6 +2,7 @@ import { userInfo, hostname } from "node:os";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync, } from "node:fs";
|
|
4
4
|
import { join, dirname } from "node:path";
|
|
5
|
+
import { execSync } from "node:child_process";
|
|
5
6
|
/**
|
|
6
7
|
* Resolves the identity file path, respecting OpenClaw's state directory conventions.
|
|
7
8
|
*
|
|
@@ -58,6 +59,15 @@ function writeIdentityFile(path, userId, parts) {
|
|
|
58
59
|
const tmp = `${path}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
|
|
59
60
|
writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n", { mode: 0o600 });
|
|
60
61
|
renameSync(tmp, path);
|
|
62
|
+
// POSIX mode bits are advisory on Windows — enforce owner-only access via ACLs.
|
|
63
|
+
if (process.platform === "win32") {
|
|
64
|
+
try {
|
|
65
|
+
execSync(`icacls "${path}" /inheritance:r /grant:r "%USERNAME%:(R,W)"`, { stdio: "ignore", timeout: 5000 });
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// best-effort; the file is already written with 0o600
|
|
69
|
+
}
|
|
70
|
+
}
|
|
61
71
|
}
|
|
62
72
|
export function resolveIdentity(params) {
|
|
63
73
|
// 1. Plugin config override (highest priority)
|
package/dist/index.js
CHANGED
|
@@ -24994,6 +24994,7 @@ import {
|
|
|
24994
24994
|
mkdirSync
|
|
24995
24995
|
} from "node:fs";
|
|
24996
24996
|
import { join, dirname } from "node:path";
|
|
24997
|
+
import { execSync } from "node:child_process";
|
|
24997
24998
|
function resolveIdentityPath(configuredPath) {
|
|
24998
24999
|
if (configuredPath) return configuredPath;
|
|
24999
25000
|
const stateDir = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
@@ -25035,6 +25036,15 @@ function writeIdentityFile(path4, userId, parts) {
|
|
|
25035
25036
|
const tmp = `${path4}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
|
|
25036
25037
|
writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n", { mode: 384 });
|
|
25037
25038
|
renameSync(tmp, path4);
|
|
25039
|
+
if (process.platform === "win32") {
|
|
25040
|
+
try {
|
|
25041
|
+
execSync(
|
|
25042
|
+
`icacls "${path4}" /inheritance:r /grant:r "%USERNAME%:(R,W)"`,
|
|
25043
|
+
{ stdio: "ignore", timeout: 5e3 }
|
|
25044
|
+
);
|
|
25045
|
+
} catch {
|
|
25046
|
+
}
|
|
25047
|
+
}
|
|
25038
25048
|
}
|
|
25039
25049
|
function resolveIdentity(params) {
|
|
25040
25050
|
const configUserId = params.configUserId?.trim();
|
package/openclaw.plugin.json
CHANGED