@askalf/dario 5.4.21 → 5.4.22

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.
@@ -341,10 +341,20 @@ function quarantineCorruptCache(reason) {
341
341
  * other's partial writes. Exposed for tests via `_atomicWriteJsonForTest`.
342
342
  */
343
343
  function atomicWriteJson(targetPath, data) {
344
- mkdirSync(dirname(targetPath), { recursive: true });
344
+ // 0700: whichever code path creates ~/.dario first decides that directory's
345
+ // permissions, and this one runs at startup, before any credential write.
346
+ // Without a mode it lands 755 on Linux, which makes every non-0600 file inside
347
+ // world-readable. The credential paths already create their dirs 0700; this was
348
+ // the one that could get there first and did not.
349
+ mkdirSync(dirname(targetPath), { recursive: true, mode: 0o700 });
345
350
  const tmp = `${targetPath}.${process.pid}.tmp`;
346
351
  try {
347
- writeFileSync(tmp, JSON.stringify(data, null, 2));
352
+ // 0600: this file holds the UNSCRUBBED live capture. Verified on the Linux
353
+ // deployment to contain `# Environment` (cwd, OS, platform) and `gitStatus:`
354
+ // (branch, modified files, recent commits); structurally it can also carry
355
+ // `# claudeMd`, `# userEmail` and `# auto memory` — the scrub list exists
356
+ // because CC emits them. Credentials beside it are 0600; this was 0644.
357
+ writeFileSync(tmp, JSON.stringify(data, null, 2), { mode: 0o600 });
348
358
  renameSync(tmp, targetPath);
349
359
  }
350
360
  catch (err) {
package/dist/proxy.js CHANGED
@@ -1088,7 +1088,13 @@ export async function startProxy(opts = {}) {
1088
1088
  let logFileStream = null;
1089
1089
  if (logFilePath) {
1090
1090
  try {
1091
- logFileStream = createWriteStream(logFilePath, { flags: 'a' });
1091
+ // 0600 to match everything else dario writes. Records are redacted metadata
1092
+ // rather than bodies (writeLogLine runs redactSecrets; -vv bodies go to
1093
+ // stdout), so this is defence-in-depth — but it still shows which account
1094
+ // served which request and when, and 0644 contradicted the convention every
1095
+ // credential path here follows. Mode applies to CREATION only, so an
1096
+ // existing log keeps its own mode, which is right for append.
1097
+ logFileStream = createWriteStream(logFilePath, { flags: 'a', mode: 0o600 });
1092
1098
  logFileStream.on('error', (err) => {
1093
1099
  console.error(`[dario] log-file write error: ${err.message} (logging disabled)`);
1094
1100
  logFileStream = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "5.4.21",
3
+ "version": "5.4.22",
4
4
  "description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
5
5
  "type": "module",
6
6
  "bin": {