Dead: provision SSH config for bottles #150
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
git.remotes.*.ExtraHostscurrently behaves like a hosts override for git-gate reachability. That is reasonable for cases where the gate itself needs/etc/hostsstyle resolution for an upstream.However, the Gitea remote case needs a different capability: the bottle should be able to carry operator-approved SSH client config into the agent/git environment, so SSH host aliases work the same way they do on the host without changing hosts/DNS behavior for the sidecar, egress route, or shell/API traffic.
Today
claude-dev.mduses this shape:That makes git work, but it also means the extra host mapping can affect non-git traffic. In a bottle shell, Gitea API access can be blocked because
gitea.dideric.isresolves to the internal IP:Requested Feature
Add top-level bottle SSH config support, separate from
git.remotes, so the agent/git environment can use explicit SSH host stanzas without forcing those host mappings into egress DNS or hosts config.Example intended shape:
IdentityFilevalues are host-side paths. bot-bottle should stage or mount the referenced key material using its existing key-handling path, then render generated SSH config with the corresponding in-bottle path. The private key contents must not be duplicated or inlined into the manifest or generated logs.Expected Behavior
ExtraHostsas the explicit hosts override mechanism for git-gate reachability.ssh.configas a top-level bottle capability for SSH client stanzas.git@gitea:didericis/bot-bottle.git, work inside the bottle because SSH sees the provisionedHost giteastanza.extra_hosts, sidecar hosts config, agent hosts config, or egress route DNS.Acceptance Criteria
ssh.configentries with at leastHost,Hostname,Port,User, andIdentityFile.IdentityFileto the staged in-bottle key path.ssh.configentries are not emitted into Dockerextra_hosts, sidecar hosts config, agent hosts config, or egress route config.ssh.configchanges generated SSH config and enables alias-style git remotes without changing hosts config.ssh.config, gitinsteadOfrewrites, andExtraHosts.Correction/reference from local SSH config:
The desired alias source is not
~/.gitconfig; it is the host SSH config. Locally there are SSH stanzas for bothgiteaandgitea.dideric.isthat resolve to the same upstream endpoint:So the useful gitconfig-only alias is the alternate SSH remote spelling that relies on that host alias, for example:
Those aliases should become additional
insteadOfentries only. They should not create/etc/hosts, Dockerextra_hosts, sidecar hosts, agent hosts, or egress DNS changes.Ok, actually I think this direction is wrong... I think we just want to be able to specify an ssh config to give the agent. Let's update the issue to reflect that.
Agreed. Revised direction: this should not be a gitconfig
Aliasesfeature. The real need is to let a bottle provide SSH config entries to the agent/git-gate environment, so ordinary SSH remote spellings likegit@gitea:didericis/bot-bottle.gitresolve the same way they do on the host.That means the issue should be reframed around an agent-provisioned SSH config, for example a manifest key that can declare stanzas equivalent to:
Acceptance criteria should move away from gitconfig alias generation and instead cover:
giteawork inside the bottle;insteadOf, andExtraHosts.ExtraHostscan stay as the explicit hosts override mechanism. This feature is about carrying the operator-approved SSH host config into the bottle so git remotes do not need a fake gitconfig-only alias layer.Requested Feature: provision SSH config when a remote has an SSH key
When a git remote declares an SSH identity/key, bot-bottle should be able to provision the matching SSH client config for that remote instead of relying on gitconfig-only aliases.
Example shape, naming TBD:
The provisioned SSH config should reference the already-staged remote key material, not duplicate or inline private key contents. In other words, the manifest points to the host
IdentityFile, bot-bottle stages it as it already does for git-gate, and generated SSH config uses the staged path inside the bottle/gate environment.This gives git/SSH the same host alias behavior as local
~/.ssh/configwhile keeping HTTP/API egress resolution independent.ExtraHostsremains available for the separate case where a container genuinely needs a hosts-file override.No, think it should be like this:
Yes, this is the cleaner shape. SSH config should be a top-level bottle capability, not nested under a specific git remote.
That gives us a clearer split:
Implementation implications:
git.remotescontinues to describe repositories and git-gate rewrites.ssh.configdescribes SSH client behavior available inside the bottle.IdentityFilevalues are host-side paths that bot-bottle stages/mounts safely, then rewrites to the in-bottle path in generated SSH config.extra_hosts, sidecar hosts config, or HTTP/API resolution.git@gitea:didericis/bot-bottle.git, should work because SSH sees the provisionedHost giteastanza.This also scales beyond git: if a future workflow needs SSH config for another tool, it does not have to pretend that config belongs to one git remote.
feat: add gitconfig-only aliases for git remotesto feat: provision SSH config for bottlesClosed, see here #151 (comment) and here #152
feat: provision SSH config for bottlesto Dead: provision SSH config for bottles