diff --git a/agents.md b/agents.md index db9f5fe..10aafc8 100644 --- a/agents.md +++ b/agents.md @@ -115,3 +115,9 @@ This file is the single source of truth for codebase obstacles, oddities, and th **Obstacle:** Theme switching and persisted localStorage theme state conflicted with the current Firebreak brand pass, especially on the cinematic landing page. **Solution/Workaround:** Force the root document to use the `.dark` token set and remove the theme toggle UI/scripts. **Preference:** Keep semantic dark tokens; only reintroduce theme switching after the dark Firebreak identity is stable. + +### Forgejo repository check accepted empty accounts +**Area:** cli/src/utils/forgejo-checks.ts +**Obstacle:** `checkRepoAccess` treated any parsed user object as success, even when Forgejo reported zero accessible repositories. +**Solution/Workaround:** Require `totalRepos > 0` before returning the existing success result; preserve the existing zero-repository failure. +**Preference:** A valid token alone is insufficient for repository-access verification. diff --git a/cli/src/utils/forgejo-checks.ts b/cli/src/utils/forgejo-checks.ts index 95cca86..11dd998 100644 --- a/cli/src/utils/forgejo-checks.ts +++ b/cli/src/utils/forgejo-checks.ts @@ -101,7 +101,7 @@ export async function checkRepoAccess( reposResponse.headers.get("x-total-count") ?? "0", ); - if (user) { + if (user && totalRepos > 0) { return createCheckResult( "Forgejo", true, diff --git a/docs/plans/auth-deployment-design.md b/docs/plans/auth-deployment-design.md index c478c12..e787567 100644 --- a/docs/plans/auth-deployment-design.md +++ b/docs/plans/auth-deployment-design.md @@ -173,7 +173,7 @@ For Dokploy users, deploying Firebreak is similar to deploying any other contain Firebreak uses its own Postgres database on the same DB server as Forgejo: -- Separate databases (e.g., `forgejo` and `firebreak`) +- Separate databases (e.g., `forgejo` and `firebreak_db`) - NOT shared tables or schemas - Operators can run both on a small VPS efficiently - Independent backups and migrations @@ -204,7 +204,7 @@ The CLI is the primary way to configure and validate Firebreak against an existi - prompt for the Forgejo base URL, for example `https://git.example.com` - collect the dedicated Forgejo username Firebreak should use for API access, for example `firebreak-bot` - collect a user-created Forgejo PAT for that dedicated Forgejo user -- collect Firebreak Postgres connection details, for example `postgresql://firebreak:password@db.example.com:5432/firebreak` +- collect Firebreak Postgres connection details, for example `postgresql://firebreak:password@db.example.com:5432/firebreak_db` - generate a grant token secret by default unless the operator pastes one - generate all Firebreak-owned config files needed for deployment in Phase 1 - write `.env` @@ -219,7 +219,7 @@ Suggested `init` prompt guidance: - Public viewer URL: "What public URL should viewers use for shared links?" Example: `https://share.example.com` - Private admin URL: "What private URL should operators use for the Firebreak admin UI?" Example: `https://admin.example.com` - Forgejo base URL: "What is the base URL of your existing Forgejo instance?" Example: `https://git.example.com` -- Firebreak database URL: "What Postgres connection string should Firebreak use?" Example: `postgresql://firebreak:password@db.example.com:5432/firebreak` +- Firebreak database URL: "What Postgres connection string should Firebreak use?" Example: `postgresql://firebreak:password@db.example.com:5432/firebreak_db` - Dedicated Forgejo username: "What Forgejo username should Firebreak use for API access?" Example: `firebreak-bot` - Forgejo PAT: "Paste the Forgejo personal access token for that dedicated Forgejo user" Example: `fgp_...` - Grant token secret: "Paste a grant token secret, or press enter to generate one automatically" diff --git a/docs/plans/phase-1-design.md b/docs/plans/phase-1-design.md index 3a8d443..f64eb00 100644 --- a/docs/plans/phase-1-design.md +++ b/docs/plans/phase-1-design.md @@ -114,7 +114,7 @@ Only repo owners can create view links for their repos. - public viewer URL, for example `https://share.example.com` - private admin URL, for example `https://admin.example.com` or `https://firebreak-admin.tailnet.ts.net` - Forgejo base URL, for example `https://git.example.com` -- Firebreak Postgres URL, for example `postgresql://firebreak:password@db.example.com:5432/firebreak` +- Firebreak Postgres URL, for example `postgresql://firebreak:password@db.example.com:5432/firebreak_db` - Forgejo bot username, for example `firebreak-bot` - Forgejo PAT for that dedicated Forgejo user - grant token secret, with secure auto-generation as the default @@ -164,7 +164,7 @@ For Dokploy users, deploying Firebreak is similar to deploying any other contain Firebreak uses its own Postgres database on the same DB server as Forgejo: - separate databases (not shared tables with Forgejo) -- recommended: same PostgreSQL instance with `forgejo` and `firebreak` databases +- recommended: same PostgreSQL instance with `forgejo` and `firebreak_db` databases - clean schema separation prevents coupling to Forgejo's database schema - independent backups and migrations - operators can run both databases on a small VPS efficiently