Skip to content

feat(agentgit): SSH-key auth for git.profullstack.com + push#50

Merged
ralyodio merged 1 commit into
mainfrom
feat/agentgit-ssh-keys
Jun 23, 2026
Merged

feat(agentgit): SSH-key auth for git.profullstack.com + push#50
ralyodio merged 1 commit into
mainfrom
feat/agentgit-ssh-keys

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

Turns git.profullstack.com into a working, SSH-key-authenticated git host for every BBS member — "all permissions and auth use our SSH keys."

Why it was broken

  • The Forgejo admin token was minted with only write:admin, but userExists calls /users/{name} which needs read:user — so provisioning failed on the first call and no members ever got accounts.
  • EnsureUser created accounts but never registered the member's SSH key, and Forgejo had SSH disabled — so there was no way to push.
  • REQUIRE_SIGNIN_VIEW=true hid member profiles from anonymous visitors.

Changes

  • forgejo.EnsureKey — idempotently register a member's SSH public key on their Forgejo account (compares key material, ignoring the comment). New tests.
  • provisionGit(u, pubKey) — ensure account and register the session's SSH key; now also called on every member login (goroutine, off the hot path) to backfill members who predate AgentGit.
  • setup.sh
    • token scopes → write:admin,read:user,write:user
    • REQUIRE_SIGNIN_VIEW=false (public profiles + public repos; private stay private; accounts only created by agentbbs)
    • enable Forgejo built-in SSH server: port 2222, BUILTIN_SSH_SERVER_USER=git, ufw allow 2222

Verified live on bbs.profullstack.com

  • All 7 members provisioned; git.profullstack.com/chovy serves the profile (HTTP 200).
  • git push ssh://git@host:2222/chovy/repo.git with a registered key succeeds (* [new branch] main -> main). Test artifacts cleaned up.

Follow-up (separate PR)

Pod image with Node + Claude Code + Codex, and seamless pod→git push using the member's key (so they can code in the pod and push). Tracked next.

🤖 Generated with Claude Code

Make git.profullstack.com a real, key-authenticated git host for every BBS
member ("BBS membership is the git account", SSH-key auth end to end):

- forgejo.EnsureKey: register a member's SSH public key on their Forgejo
  account (idempotent, ignores the key comment). So the key they sign in to
  the BBS with is also their git push key.
- provisionGit now takes the session public key and registers it after
  ensuring the account; called on email verification AND (newly) on every
  member login, so members who predate AgentGit — or whose key wasn't
  registered yet — are backfilled automatically and off the hot path.
- setup.sh:
  - admin token scopes write:admin,read:user,write:user (the old write:admin
    alone failed userExists' /users lookup, so provisioning never worked).
  - REQUIRE_SIGNIN_VIEW=false so member profiles + public repos are viewable
    at git.profullstack.com/<name> (private repos stay private; accounts are
    still created only by agentbbs).
  - Enable Forgejo's built-in SSH server (port 2222, BUILTIN_SSH_SERVER_USER=git)
    and open the firewall, so members push to git@git.profullstack.com:2222.

Verified live: all members provisioned, git.profullstack.com/chovy serves the
profile, and a push over ssh://git@host:2222 with a registered key succeeds.

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 3c3b1b1 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