caelum0x 6d221169e8 feat(ritgram): Move from GitHub — no-OAuth repo import via Gitea migrate API
GitHub OAuth app approval is blocked, so this ships the next-best onboarding
path: paste a GitHub username (public repos, no token) or an optional
fine-grained read token (private repos), tick repos, and Rithub mirrors each
one with Gitea's built-in /repos/migrate, streamed as live per-repo progress
over SSE, landing on the new Ritgram profile when done.

- GiteaForgeAdapter.migrateRepo(): calls the real Gitea migrate API, treats
  409 as "already there", and self-heals a false failure (proxy timeout or
  a post-clone step erroring after the repo already landed — both observed
  live against git.ereboslab.com) by re-checking existence with backoff
  before reporting a real failure.
- New public POST /api/v1/github-import/preview and auth'd
  POST /api/v1/github-import/start (requires an existing Rithub/Gitea
  connection); the GitHub token, when provided, is used once in-memory for
  that request and is never stored or logged. Both routes are rate limited.
- New /import-from-github page (public route) with username/token form,
  a tickable repo list, and a live per-repo progress list fed by SSE.

Verified end to end against the live git.ereboslab.com instance: created a
disposable Gitea test account, ran preview + start through the real HTTP
routes against real octocat.github.com repos, confirmed migrated repos
landing on Gitea, then deleted the test repos, the test Gitea account, and
the matching Ritgram test user + DB rows. Found and noted a real, unrelated
blocker: railyard-box is at 99% disk (for reference, this backend's dev/db
config lives in apps/ritgram/backend/.env, pointed at the project's Neon
dev DB; no change needed here).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 02:49:02 +03:00
..