Skip to content

Commit f283d05

Browse files
committed
fix(container): add git safe.directory to setup.sh
Bind-mounted /workspaces may have a different uid than the container user, causing Git to refuse all operations with "dubious ownership" errors (CVE-2022-24765). Runs on every container start before any setup stages.
1 parent 360e113 commit f283d05

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

container/.devcontainer/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Security
6+
7+
- **Git safe.directory configured on container start** — bind-mounted `/workspaces` may have a different uid than the container user, causing Git to refuse all operations with "dubious ownership" errors (CVE-2022-24765). `setup.sh` now runs `git config --global safe.directory` using `$WORKSPACE_ROOT` on every start.
8+
59
### Hermes Agent
610

711
- **New feature: `hermes-agent`** — installs [Nous Research's Hermes Agent](https://hermes-agent.nousresearch.com/) CLI via the upstream `curl | bash` installer with `--skip-setup`. Hermes uses the plain `anthropic` / `openai` Python SDKs directly and supports any compatible provider (Anthropic, OpenAI, MiniMax, local models). Enabled by default; set `"version": "none"` in `devcontainer.json` to disable.

container/.devcontainer/scripts/setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ if ! sudo chown "$(id -un):$(id -gn)" "$HOME/.claude" 2>/dev/null; then
7575
echo "[setup] WARNING: Could not fix volume ownership on $HOME/.claude — subsequent scripts may fail"
7676
fi
7777

78+
# Mark workspace as safe for Git — bind-mounted workspace may have
79+
# different uid than container user, causing "dubious ownership"
80+
# errors (CVE-2022-24765)
81+
git config --global safe.directory "${WORKSPACE_ROOT:-/workspaces}"
82+
7883
SETUP_START=$(date +%s)
7984
SETUP_RESULTS=()
8085

0 commit comments

Comments
 (0)