You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d23632
Browse filesBrowse the repository at this point in the historyBrowse files
feat(config): make Windows cache-dir DACL hardening configurable
Add an opt-out for the Windows cache-directory DACL hardening (upstream
#1624): CBM_SKIP_DACL_HARDENING=1 as an env kill switch effective from the
first run, plus a persisted windows-dacl-hardening config key (default true)
effective from the second run, with env taking precedence.
When disabled: the creation-time stamp keeps the exact-owner stamp but drops
the owner-only protected DACL; the runtime-directory walk skips the
re-protection and restores the parent-inherited DACL (SE_DACL_PROTECTED
cleared) on a directory hardened by a previous run, supplying a real ACL
rather than a NULL DACL; the validators accept the OS-default inherited DACL.
Owner validation stays active in every path, and the default behavior is
unchanged.
Docs updated (CONFIGURATION.md runtime settings + environment variables,
README env table) and three Windows-only unit tests added in
tests/test_daemon_ipc.c.
|`CBM_WORKERS`|*(detected)*| Override the parallel-indexing worker count returned by `cbm_default_worker_count`. Useful inside containers where `sysconf(_SC_NPROCESSORS_ONLN)` reports host CPUs rather than the cgroup's effective quota. Range 1–256; invalid values are ignored with a warning. |
683
683
|`CBM_MEM_BUDGET_MB`|*(detected)*| Override the in-memory graph budget with an explicit cap in MiB, taking precedence over the `ram_fraction × total_RAM` default. Useful on bare-metal hosts without a cgroup limit, or to pin a budget *below* the cgroup limit so headroom is left for sibling processes. Must be a positive integer; it is clamped to detected total RAM (logged as `mem.budget.clamped`), and non-numeric or non-positive values are ignored with a warning (`mem.budget.env.invalid`). |
684
684
|`CBM_DUMP_VERIFY_MIN_RATIO`|`0.5`| After indexing, compare persisted SQLite node count to the in-memory dump count. When persisted nodes fall below this fraction of committed nodes (and committed > 50), `index_repository` returns `status:"degraded"` instead of silent `indexed`. Range 0–1; set `0` to disable. Invalid values are ignored with a warning. |
685
+
|`CBM_SKIP_DACL_HARDENING`|*(unset)*| Windows only: set to `1` to disable cache-directory DACL hardening from the very first run (the `windows-dacl-hardening` config key applies from run 2, since `_config.db` lives inside the cache directory). Overrides the config key; owner validation stays active. Use on hosts where the protected DACL breaks index publication. |
685
686
686
687
Environment used by daemon-owned components—such as diagnostics, daemon logging, and process-wide indexing resource limits—is captured from the first daemon-backed session that starts the daemon. Later sessions join that process and cannot replace those values. To change them, close all daemon-backed sessions, update the relevant agent configurations consistently, and restart a session. `CBM_ALLOWED_ROOT` remains session-specific, a conflicting `CBM_CACHE_DIR` is rejected, and one-shot CLI commands read their own environment without starting the daemon.
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,9 @@ Current keys:
86
86
|---|---|---|
87
87
|`auto_index`|`false`| Automatically index new projects when an MCP session starts. |
88
88
|`auto_index_limit`|`50000`| Maximum file count allowed for automatic indexing of a new project. |
89
+
|`windows-dacl-hardening`|`true`| Windows only: keep the cache-directory DACL hardened (owner-only, inheritance disabled). Set `false` to opt out; owner validation stays active. |
90
+
91
+
`windows-dacl-hardening` is effective from the **second run**: the config store (`_config.db`) lives inside the cache directory, so it does not exist when the first run creates that directory. On the second run the directory is no longer re-protected, and a DACL hardened by the previous run has inheritance restored automatically. For an effect from the very first run, set `CBM_SKIP_DACL_HARDENING=1` instead (it overrides the config key). Disabling the hardening is intended for hosts where the protected DACL breaks index publication (`MoveFileExW` rename-replace fails with `ERROR_ACCESS_DENIED`, surfacing as the generic "Pipeline failed"); it is not recommended on multi-user or terminal-server hosts, where the owner-only DACL is the protection against other local accounts.
89
92
90
93
## 3. UI Settings
91
94
@@ -121,6 +124,7 @@ These environment variables affect runtime behavior:
121
124
|`CBM_DIAGNOSTICS`|`false`| Enable periodic `snapshot.json` and retained `trajectory.ndjson` below a fresh owner-private directory in the system temp directory. The daemon records the randomized paths in the `diagnostics.start` discovery record (a single JSON line) in `${CBM_CACHE_DIR}/logs/cbm-daemon.log`; that one record is emitted even when `CBM_LOG_LEVEL` suppresses ordinary logging, so the paths always remain discoverable. |
122
125
|`CBM_DOWNLOAD_URL`| GitHub releases | Override the update download URL. |
123
126
|`CBM_LOG_LEVEL`|`info`| Set the log level to `debug`, `info`, `warn`, `error`, or `none` (or `0`-`4`). Thin-frontend messages use that session's stderr; detached daemon events use `${CBM_CACHE_DIR}/logs/cbm-daemon.log`. |
127
+
|`CBM_SKIP_DACL_HARDENING`|*(unset)*| Windows only: set to `1` to disable cache-directory DACL hardening from the **very first run**, before any config store exists (the `windows-dacl-hardening` key only applies from run 2). Overrides the config key; owner validation of the cache directory stays active. Use it on hosts where the protected DACL breaks index publication. |
124
128
|`CBM_WORKERS`| auto-detected | Override the indexing worker count. |
125
129
126
130
Environment used by daemon-owned components—such as diagnostics, daemon logging, and process-wide indexing resource limits—is captured from the first daemon-backed session that starts the daemon. Later sessions join the existing process and cannot replace those values. To change them, close every daemon-backed session, update the relevant agent configurations consistently, and restart a session. `CBM_ALLOWED_ROOT` remains session-specific, a conflicting `CBM_CACHE_DIR` is rejected, and one-shot CLI commands use their own current environment without starting the daemon.
0 commit comments