refactor(dotfiles-sync): make SSH key file sync opt-in, drop redundant path-fixing - #76
Merged
Merged
Conversation
…dant path-fixing Two changes, same underlying cause: helpers4-common's new git-config-self-heal.sh (postAttachCommand) now fixes host-specific .gitconfig paths for every consumer automatically, regardless of whether dotfiles-sync is even in use — this feature no longer needs to solve that problem itself, and syncing the actual key file this feature's own signingkey rewrite existed to support is no longer the only way to get a working signing key either. - SSH private/public key file copying is now gated behind a new syncSshKeys option, default false. ~/.ssh/config and known_hosts still sync unconditionally — agent forwarding doesn't provide either of those — but actual key files no longer land on the container's filesystem unless explicitly requested. Normal SSH auth (git clone/push over SSH, ssh to a remote host) already works through the client's own forwarded ssh-agent with no local key file needed at all; copying them by default put private key material on the container's disk for no benefit in the common case, directly against what setups relying purely on agent forwarding deliberately avoid. - Removed this feature's own .gitconfig path-rewriting and verification (path-keys.sh, REHOMEABLE_PATH_KEYS/ VERIFY_ONLY_PATH_KEYS) — helpers4-common's self-heal actively fixes the same class of problem (and more: it also handles credential.helper/gpg.program pointing at a moved binary, which this feature's own version only ever warned about, never fixed), for every consumer, not just this feature's own users. Keeping both would mean two copies of the same "is this host path still valid" logic to maintain. - Now depends on helpers4-common (shares its h4_detect_cloud_env instead of an inline duplicate of the same Codespaces/Gitpod/ DevPod/WSL detection). Verified end-to-end in real Docker containers: default config skips key files while still merging config/known_hosts; enabling syncSshKeys places the key files, and helpers4-common's self-heal correctly finds the locally-synced .pub by basename to repair a still-host-shaped signingkey path. Version bumped to 1.1.0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tch in Test 8b The default "username" option (node) doesn't necessarily match the base image's actual default process user (e.g. "vscode" on an mcr.microsoft.com/devcontainers/base image) when a CI matrix entry doesn't override it — test.sh itself then can't write into TARGET_HOME, unrelated to anything the test is actually checking. Skip the write-dependent assertions with a WARN in that case instead of hard-failing, matching the tolerant style Test 8 already uses for the same class of test-environment limitation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
✅ PR Validation Passed
📋 Pipeline Status
🤖 Generated by @helpers4 CI • 2026-09-06 |
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second of two PRs split from the original combined #74 (see #75, merged and released —
helpers4-common:1.1.0is confirmed live on GHCR,docker manifest inspect ghcr.io/helpers4/devcontainer/helpers4-common:1now returns1.1.0). This one isdotfiles-synconly, built on top of that release.Changes (1.0.8 → 1.1.0)
Two changes, same underlying cause:
helpers4-common's newgit-config-self-heal.sh(postAttachCommand) now fixes host-specific.gitconfigpaths for every consumer automatically, regardless of whetherdotfiles-syncis even in use — this feature no longer needs to solve that problem itself.syncSshKeys, defaultfalse).~/.ssh/configandknown_hostsstill sync unconditionally — agent forwarding doesn't provide either of those. Normal SSH auth (git clone/pushover SSH,sshto a remote host) already works through the client's own forwardedssh-agentwith no local key file needed at all; copying them by default put private key material on the container's disk for no benefit in the common case, directly against what setups relying purely on agent forwarding deliberately avoid..gitconfigpath-rewriting and verification (path-keys.sh,REHOMEABLE_PATH_KEYS/VERIFY_ONLY_PATH_KEYS) —helpers4-common's self-heal actively fixes the same class of problem (and more: it also handlescredential.helper/gpg.programpointing at a moved binary, which this feature's own version only ever warned about, never fixed), for every consumer, not just this feature's own users.dependsOn: helpers4-common— shares itsh4_detect_cloud_envinstead of an inline duplicate of the same Codespaces/Gitpod/DevPod/WSL detection.usernameoption's default and the base image's actual default process user, which showed up as a false failure in CI (unrelated to the actual feature behavior) once this branch first ran against a real matrix entry.Why this had to wait for #75 to merge and release
devcontainer features test --features dotfiles-sync .resolvesdependsOn: ghcr.io/helpers4/devcontainer/helpers4-common:1from the published GHCR registry, not this repo's localsrc/tree — only the feature passed directly via--featuresgets freshly-built local content. Before #75 merged, this branch's CI failed withh4_detect_cloud_env: command not foundbecause GHCR still only had the old1.0.1helpers4-common. Documented inAGENTS.md.Test plan
bash -n/jq emptyon all changed scripts and manifestsconfig/known_hosts; enablingsyncSshKeysplaces the key files, andhelpers4-common's self-heal correctly finds the locally-synced.pubby basename to repair a still-host-shapedsigningkeypathdevcontainer features testtooling (not a manual simulation) now thathelpers4-common:1.1.0is genuinely on GHCR — the staged dependency content now includesgit-config-self-heal.shandh4_detect_cloud_env, and runningtest.shagainst the actually-built image passes cleanly (environment detected: local,known_hosts still synced regardless of syncSshKeys) — the exact assertion that failed against the pre-release registry state now succeeds🤖 Generated with Claude Code