Skip to content

Commit 047d832

Browse files
authored
Merge pull request #80 from AnExiledDev/fix/git-safe-directory
fix(container): add git safe.directory to setup.sh
2 parents 0cd2973 + 0fc0fae commit 047d832

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

container/.devcontainer/CHANGELOG.md

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

77
- **Shell terminal keybinds hardened** — disabled `Ctrl+Z` (suspend, which closes Docker-attached panes), `Ctrl+S/Q` (flow control freeze), and `Ctrl+W` (conflicts with Windows Terminal close-tab). Rebound `Ctrl+\` (SIGQUIT) to `Ctrl+]` and `Ctrl+D` (EOF) to `Ctrl+^` as emergency-only alternatives. Also unbound zsh's `Alt+W` (copy-region-as-kill) and `Alt+Q` (push-line) to free those keys for terminal use.
88

9+
### Security
10+
11+
- **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.
12+
913
### Hermes Agent
1014

1115
- **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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ 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+
if ! git config --global --add safe.directory "${WORKSPACE_ROOT:-/workspaces}" 2>/dev/null; then
82+
echo "[setup] WARNING: Could not configure git safe.directory — git operations may show 'dubious ownership' errors"
83+
fi
84+
7885
SETUP_START=$(date +%s)
7986
SETUP_RESULTS=()
8087

0 commit comments

Comments
 (0)