feat(fg): fix SSH push + Forgejo token minting + reliable key sync #13

Merged
gmackie merged 1 commit from feat/forgejo-keys-tokens into main 2026-06-08 12:20:56 +00:00
Owner

Fixes people being unable to push via SSH, and adds Forgejo API token minting to the CLI.

Root causes found:

  • fg clone generated ssh://git@host:2222/... but Forgejo SSH is on port 22 (2222 is the agent gitssh, which rejects keys). Now uses the scp-style git@host:owner/repo.git.
  • The ssh-keys endpoint only synced to Forgejo when forgejoUserId was already set. Now calls ensureForgejoUser first, so keys reliably reach Forgejo.
  • HTTPS push needs a Forgejo token, which had no way to obtain.

New:

  • createForgejoToken (forgejo-api): admin password-reset → basic-auth → mint (validated against live Forgejo; admin+Sudo is rejected by Forgejo).
  • POST /api/fg/forgejo-token (provisions the Forgejo user, mints, returns the token once).
  • fg forgejo-token: mints, stores in fg credentials, and registers with git credential store for HTTPS push.

Full typecheck 9/9, agent build + tests pass.

Fixes people being unable to push via SSH, and adds Forgejo API token minting to the CLI. **Root causes found:** - `fg clone` generated `ssh://git@host:2222/...` but Forgejo SSH is on **port 22** (2222 is the agent gitssh, which rejects keys). Now uses the scp-style `git@host:owner/repo.git`. - The ssh-keys endpoint only synced to Forgejo when `forgejoUserId` was already set. Now calls `ensureForgejoUser` first, so keys reliably reach Forgejo. - HTTPS push needs a Forgejo token, which had no way to obtain. **New:** - `createForgejoToken` (forgejo-api): admin password-reset → basic-auth → mint (validated against live Forgejo; admin+Sudo is rejected by Forgejo). - `POST /api/fg/forgejo-token` (provisions the Forgejo user, mints, returns the token once). - `fg forgejo-token`: mints, stores in fg credentials, and registers with git credential store for HTTPS push. Full typecheck 9/9, agent build + tests pass.
feat(fg): Forgejo token minting + reliable SSH key sync + Forgejo SSH push URL
Some checks failed
AI Code Review / review (pull_request) Failing after 8s
CI / ci (pull_request) Successful in 14m1s
97fd8d1c8c
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/ForgeGraph!13
No description provided.