diff --git a/00-overview/postgres-migration-roadmap.md b/00-overview/postgres-migration-roadmap.md index 0d10bad..3343f94 100644 --- a/00-overview/postgres-migration-roadmap.md +++ b/00-overview/postgres-migration-roadmap.md @@ -505,11 +505,12 @@ | 2026-11-19 | Phase 8: health/monitoring | Healthcheck script, public `/health` contract, Synapse alert plumbing; hard-panel registration and Synapse source remain owner actions | | 2026-11-19 | Phase 8: deploy/docs | `deploy.sh` applies migrations and refreshes units; operations and decommission runbooks; service page updated | | 2026-11-19 | Phase 8: decommission | Blocked on production cutover and owner sign-off; file backend retained for rollback | -| 2026-11-20 | Data ownership | `documents.owner_user_id` and `inventory_items.owner_user_id`; `assign-owner`/`ownership` CLI; current 76 documents and 120 inventory items assigned to the bootstrap administrator; production owner transfer pending the real gnexus-auth `sub`; historical import authorship preserved | -| 2026-11-20 | Production cutover | gnbook runs `GNEXUS_BOOK_STORAGE_BACKEND=db`: 76 documents, 120 inventory items, 78 document versions; `/health` reports `storage: db`, `checks.db: ok` | -| 2026-11-20 | History published | `master` consolidated and pushed; `origin/master` matches gnbook HEAD `68a010a`; `deployed-2026-11-20` tag retains the deployment commit | +| 2026-11-20 | Data ownership | `documents.owner_user_id` and `inventory_items.owner_user_id`; current 76 documents and 120 inventory items assigned to the real production owner `sub=1`; historical import authorship preserved | +| 2026-11-20 | Production cutover | gnbook runs `GNEXUS_BOOK_STORAGE_BACKEND=db`: 76 documents, 120 inventory items, 85 document versions, 10 changesets; `/health` reports `storage: db`, `checks.db: ok` | +| 2026-11-20 | History published | `master` consolidated and pushed; `origin/master` matches gnbook HEAD `4bcd269` at the time of the auth switch; `deployed-2026-11-20` tag retains the deployment commit | | 2026-11-20 | Operations hardening | Healthcheck timer every five minutes, backup-disk warning/critical checks, forced backup and restore drill (76/120, validation ok), legacy pending-change archive, file write freeze | -| 2026-11-20 | Production blockers | Production gnexus-auth/real owner `sub`, public DNS/HTTPS for `book.gnexus.space`, and Synapse alert credentials remain owner actions | +| 2026-11-20 | Production auth | Client `gnexus-book` registered in `https://auth.gnexus.space`; redirect `http://192.168.1.170/auth/callback`; webhook configured; owner `sub=1`; local test user removed; active MCP keys 0 | +| 2026-11-20 | Remaining blockers | Public DNS/HTTPS for `book.gnexus.space`, Synapse alert credentials, and finer service-side roles (`editor`, `docs.write`, `inventory.write`) | Notes: @@ -521,13 +522,16 @@ index is a later optimization, not a correctness requirement. - The date-dependent freshness test still fails because many documents are past their review interval. This is the recorded baseline, not a regression. -- Phase 4 is scaffolded without production credentials. Real login needs an OAuth - client registered by the owner in gnexus-auth (`client_id`, `client_secret`, - redirect URI) and its webhook secret, all supplied through `.env`/gnexus-creds. +- Production authentication is configured against `https://auth.gnexus.space` with + the owner-registered `gnexus-book` client, LAN redirect and webhook. The owner + `sub=1` matches the existing data ownership; an interactive owner sign-in remains + the final browser-level check. - Role-specific publish policy remains open; the current rule is "authenticated and - not blocked may write". MCP keys carry `read`/`write` scopes. + not blocked may write". MCP keys carry `read`/`write` scopes; the production client + currently exposes only the default `User` role. - The Vue UI now covers the current functionality, the auth gate, i18n and the MCP - keys page. Real gnexus-auth credentials are still required to exercise live login. + keys page. The production auth gate redirects to `auth.gnexus.space`; the owner + completes one interactive login to establish the browser session. - Phase 7 tooling, the rehearsal and the production cutover are complete. PostgreSQL is canonical on gnbook; the code default remains `file` for tests and local development. Set `GNEXUS_BOOK_STORAGE_BACKEND=db` and the database URL in @@ -539,10 +543,9 @@ - The retained cutover evidence is the migration report under `~/backup/gnexus-book/`, the 2026-11-20 off-host dumps, the restore-drill output and the legacy pending-change archive on NetTera8. -- The local gnexus-auth instance is connected and verified end to end through the - owner-provided client and a signed webhook delivery. Production authentication still - needs an owner-registered client with HTTPS URLs, a narrower access mode and defined - client permissions; role-specific publish policy is still open. +- Production gnexus-auth is connected through the owner-registered `gnexus-book` + client with a signed webhook subscription. The local gnexus-auth instance remains + development-only; the gnbook deployment no longer points at it. - Production MCP allowlists include `book.gnexus.space`, its HTTPS origin and the LAN address with a port wildcard. LAN `initialize`/`tools/list` with a personal key returns 200; public HTTPS is blocked until DNS and the front end exist. @@ -557,10 +560,9 @@ and the file backend remains a read-only rollback source. Code removal is still pending the stability window and owner sign-off [decommission-file-backend.md](../30-runbooks/decommission-file-backend.md). -- Current data ownership is 76 documents and 120 inventory items assigned to the - bootstrap administrator, 0 unowned in the database. Transfer to the real owner must - wait for the production `sub` and a fresh dump; keep `owner.json` outside the - repository. +- Current data ownership is 76 documents and 120 inventory items assigned to the real + production owner `sub=1`, 0 unowned. The local user mirror was updated and the local + test user removed; keep `owner.json` outside the repository. - Production rollout is complete on gnbook (192.168.1.170). Remaining blockers are - production authentication/owner identity, public DNS/HTTPS for `book.gnexus.space`, - and Synapse alert credentials. + public DNS/HTTPS for `book.gnexus.space`, Synapse alert credentials, and finer + service-side roles. diff --git a/10-systems/applications/gnexus-book.md b/10-systems/applications/gnexus-book.md index 1bf5881..db4209a 100644 --- a/10-systems/applications/gnexus-book.md +++ b/10-systems/applications/gnexus-book.md @@ -14,9 +14,10 @@ ## Access -- UI and REST: gnexus-auth SSO. The gnbook deployment is currently wired to the - local gnexus-auth test instance; production authentication and owner transfer are - still pending. +- UI and REST: gnexus-auth SSO at `https://auth.gnexus.space`. The production client + `gnexus-book` is registered with the LAN redirect + `http://192.168.1.170/auth/callback` until public HTTPS is available; cookie secure + is false for that redirect. - Agents: personal `mcp_*` keys over streamable HTTP at `/mcp-protocol/`. - MCP transport: streamable HTTP only. The legacy SSE endpoint is not served; `GNEXUS_BOOK_MCP_TOKEN` is a break-glass token, not the normal agent credential. @@ -46,8 +47,11 @@ - PostgreSQL database `gnexus_book` is the canonical store, with immutable document and inventory versions grouped into changesets. - Documents and inventory items carry `owner_user_id`. Current rows are assigned to - the bootstrap administrator; transfer to the real owner is pending production - authentication. Historical import authorship remains `system`/`importer`. + the real production owner, `sub=1` (gnexus-auth superadmin). Historical import + authorship remains `system`/`importer`. +- The production client currently exposes the default `User` role. Book authorization + is still "authenticated and non-blocked may write"; finer service-side roles are + not enforced yet. - The file backend (Markdown/YAML + Git) is frozen for writes and remains readable only for rollback and tests until the decommission runbook is executed. @@ -120,12 +124,12 @@ ## Current blockers (2026-11-20) -- Production authentication and the real owner `sub` are not configured; data is still - owned by the bootstrap administrator. - `book.gnexus.space` does not resolve and public HTTPS is not configured. The MCP - allowlist already contains the public host and origin. + allowlist already contains the public host and origin; the auth client uses the LAN + callback until the public site exists. - Synapse alert credentials are absent, so backup/health alerts are not delivered. -- Ownership counts must be rechecked after the real owner is established. +- Finer service-side roles (`editor`, `docs.write`, `inventory.write`) are not created + or enforced yet; the client has the default `User` role. ## Maintenance model diff --git a/30-runbooks/local-auth-testing.md b/30-runbooks/local-auth-testing.md index 22ab069..94681b1 100644 --- a/30-runbooks/local-auth-testing.md +++ b/30-runbooks/local-auth-testing.md @@ -10,9 +10,9 @@ # Local gnexus-auth testing **Local development only.** This runbook describes the local gnexus-auth instance used -for development. The gnbook deployment currently points at this local instance as a -pre-production stopgap; it is not production authentication. Do not assign book -ownership to a local test identity. +for development. The gnbook deployment now uses the production instance at +`https://auth.gnexus.space`; this local instance is not the production auth source. Do +not assign book ownership to a local test identity. How the local Gnexus Book instance is connected to the local gnexus-auth, which runs the same code as production. diff --git a/30-runbooks/postgres-operations.md b/30-runbooks/postgres-operations.md index 3be11e1..c735add 100644 --- a/30-runbooks/postgres-operations.md +++ b/30-runbooks/postgres-operations.md @@ -79,8 +79,13 @@ ## Data ownership -Current rows are assigned to the bootstrap administrator. After the real owner signs in -through production gnexus-auth, record the real `sub` and transfer ownership: +Current rows are assigned to the real production owner, `sub=1` (gnexus-auth +superadmin): 76/76 documents and 120/120 inventory items owned, 0 unowned. The local +user mirror was updated from the production profile and the local test user was +removed. + +Keep `owner.json` outside the repository (`~/.config/gnexus-book/owner.json`, +`chmod 600`). For a future ownership transfer or rebuild: ```bash set -a; . server/.env; set +a @@ -89,12 +94,10 @@ .venv/bin/python -m app.storage.cli ownership ``` -Keep `owner.json` outside the repository (`~/.config/gnexus-book/owner.json`, -`chmod 600`). The owner JSON contains `sub`, `email`, `system_role`, `status` and -`profile` (display name, locale, timezone, avatar URL). The command creates or updates -the local user mirror, assigns only rows with no owner by default, and writes an -`ownership.assigned` audit record. `--all` transfers every document and inventory item -to the new owner. +The owner JSON contains `sub`, `email`, `system_role`, `status` and `profile` (display +name, locale, timezone, avatar URL). The command creates or updates the local user +mirror, assigns only rows with no owner by default, and writes an `ownership.assigned` +audit record. `--all` transfers every document and inventory item to the new owner. Ownership is separate from historical authorship: imported versions and the import changeset retain their `system`/`importer` authorship, while `owner_user_id` records