Skip to content

feat(pods): SSH agent forwarding → git push from your pod with your key#53

Merged
ralyodio merged 1 commit into
mainfrom
feat/pod-agent-forward
Jun 23, 2026
Merged

feat(pods): SSH agent forwarding → git push from your pod with your key#53
ralyodio merged 1 commit into
mainfrom
feat/pod-agent-forward

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

Closes the loop on "all auth uses our SSH keys": code in your pod (Claude Code / Codex from #51) and push to git.profullstack.com using the same key you signed in with — nothing is copied into the pod.

When a member attaches with agent forwarding (ssh -A NAME@bbs.profullstack.com → Pod), agentbbs listens on a fresh unix socket in a per-user agent dir bind-mounted into the pod at /run/agentbbs-agent, proxies it back over the SSH session, and points the pod shell's SSH_AUTH_SOCK at it. The pod image's ssh_config routes git@git.profullstack.com to Forgejo's SSH server on :2222.

So inside the pod:

git clone git@git.profullstack.com:YOURNAME/repo.git
git push    # authenticated by your forwarded key

Changes

  • internal/pods/pods.goagentDir + startAgent (per-session socket, cleaned up on session exit); Attach injects SSH_AUTH_SOCK when ssh.AgentRequested; ensure() bind-mounts the agent dir and self-heals idle pods missing it. No main.go change — charmbracelet/ssh sets AgentRequested from the session request loop.
  • pods/Containerfile/etc/ssh/ssh_config.d/10-agentgit.conf (port 2222, user git, accept-new).
  • setup.sh — if a pod-image rebuild transient-fails but an image already exists, keep using it (so a flaky deploy never downgrades pods to the base image — which just happened on the feat(web): rich landing page — BBS history + all commands #52 deploy).

Verified

Build/vet/test/gofmt clean. Image rebuilt on the host; ssh -G git.profullstack.com inside it → port 2222 / user git. End-to-end push needs a live ssh -A session (a real client with a loaded agent) — validate after this deploys. Built on #50/#51 (already merged).

🤖 Generated with Claude Code

Code in your pod and push to git.profullstack.com using the SAME SSH key you
signed in with — nothing is copied into the pod. When a member attaches with
agent forwarding (ssh -A), agentbbs listens on a fresh unix socket in a
per-user agent dir bind-mounted at /run/agentbbs-agent and proxies it back over
the session; the pod shell gets SSH_AUTH_SOCK pointed at it. The pod image's
ssh_config sends git@git.profullstack.com to Forgejo's SSH server (:2222), so
`git clone git@git.profullstack.com:you/repo.git` just works.

- pods.go: agentDir + startAgent (per-session socket, cleaned up on exit);
  Attach injects SSH_AUTH_SOCK when ssh.AgentRequested; ensure() bind-mounts the
  agent dir and self-heals idle pods missing it. No main.go change needed —
  charmbracelet/ssh sets AgentRequested from the session request loop.
- pods/Containerfile: /etc/ssh/ssh_config.d entry (port 2222, user git,
  accept-new) so the conventional git@ URL reaches Forgejo.
- setup.sh: keep using an already-built pod image if a later rebuild
  transient-fails, so a flaky deploy never downgrades pods to the base image.

Build/vet/test/gofmt clean. Image rebuilt on the host; `ssh -G
git.profullstack.com` resolves to port 2222 / user git. End-to-end push needs a
live `ssh -A` session (validate after deploy).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit f5d3740 into main Jun 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant