Add personal API keys, superbrain-mcp, and fix Markdown prose styling

API keys & MCP (the mcpserver-link prerequisite from STRATEGY.md):
- ApiKey table (migration 017 + schema.sql): hash-only storage of personal
  "sb_..." Bearer credentials, unique keyHash, owner cascade.
- internal/auth/apikeys.go + AuthMiddleware fork: keys resolve before the
  assertion/cookie channels; gated on the mcp-core connector at issuance
  AND at every use (downgrade 403s); independent of tokenVersion so "sign
  out everywhere" never breaks a gateway link; view-as stays browser-only.
- /api/keys GET/POST/DELETE: plaintext shown exactly once, 10-key cap under
  the user lock, owner-scoped revocation; Settings -> API Keys tab.
- mcp/: superbrain-mcp, a pip-installable stdio MCP server (listmonk-mcp
  pattern) with bookmarks/tags/pages tools, version-safe updates; the
  federated gateway spawns it via config_mcpserver_superbrain() in
  deploy/federated/lib-superbrain.sh (mints the gateway key in-db, points
  it at http://superbrain-app:8080). STRATEGY.md records the remaining
  suite-side registry work.
- Tests: TestAPIKeys (plan gate, cap, revocation, tokenVersion semantics,
  downgrade-at-use); full DB-backed suite, db-converge, live MCP-client
  smoke all pass.

Markdown (Gitea issue #3): add @tailwindcss/typography and enable it in
tailwind.config.ts. The prose wrapper was a no-op without it, so Tailwind
Preflight flattened headings/blockquotes to body text while bold/italic
survived - exactly the reported symptom. Verified in the built CSS.

Gitea: #2 and #3 closed with reference notes; #1 stays open pending the
Superpanel core-AI walkthrough.
This commit is contained in:
Andrew S Erwin
2026-11-02 14:27:58 -06:00
parent febc7b2195
commit e6ab778bd5
20 changed files with 1283 additions and 14 deletions
+11
View File
@@ -391,6 +391,17 @@ Prerequisites: Authelia with the OIDC provider configured, shared
sender account). Full design record, IP plan, upgrade flow and incident
history: [deploy/federated/STRATEGY.md](deploy/federated/STRATEGY.md).
**MCP (AI tool access):** Superbrain links into the suite's `mcpserver`
MCP gateway like every other app —
`/federated/bin/installapp-mcpserver superbrain` mints a dedicated API key
for the admin account and points the gateway at the Go API
(`http://superbrain-app:8080`). The gateway spawns `superbrain-mcp` (the
pip-installable stdio MCP server in [`mcp/`](mcp/), configured entirely by
`SUPERBRAIN_API_URL`/`SUPERBRAIN_API_KEY`), exposing bookmarks, tags and
pages to `mcphub`, Hermes and any other MCP client. API keys are a core-plan
feature (`mcp-core` connector); users can also mint their own in
Settings → API Keys and attach clients directly.
**Updating** an installed core is the standard house flow — bump `VERSION`
in `/federated/services/superbrain/service` to the new release tag and run
`/federated/bin/upgrade superbrain` (the pre-hook backs up the database