49 Commits
Author SHA1 Message Date
Andrew S Erwin c04be7529a release 0.3.7: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 5m34s
release / smoke (push) Successful in 10m20s
release / publish (push) Failing after 9m57s
2026-11-24 16:04:08 -06:00
Andrew S Erwin ae7d3852e2 release 0.3.6: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 5m33s
release / smoke (push) Successful in 10m36s
release / publish (push) Failing after 9m57s
2026-11-24 11:35:20 -06:00
Andrew S Erwin dbf4a896c3 release 0.3.5: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 5m43s
release / smoke (push) Successful in 10m28s
release / publish (push) Failing after 9m54s
2026-11-24 11:13:38 -06:00
Andrew S Erwin ec78b2cf7f release 0.3.4: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 5m49s
release / smoke (push) Successful in 10m28s
release / publish (push) Failing after 9m50s
2026-11-23 14:20:35 -06:00
Andrew S Erwin 6e8525014d release 0.3.3: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 5m45s
release / smoke (push) Successful in 10m32s
release / publish (push) Failing after 9m54s
2026-11-23 13:08:00 -06:00
Andrew S Erwin 6bb68ef323 release 0.3.2: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m36s
release / smoke (push) Successful in 10m21s
release / publish (push) Failing after 9m51s
2026-11-22 02:47:03 -06:00
Andrew S Erwin 2dc128a215 release 0.3.1: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m30s
release / smoke (push) Successful in 10m18s
release / publish (push) Failing after 9m51s
2026-11-21 23:54:41 -06:00
Andrew S Erwin a402e4f2e7 release 0.2.17: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m32s
release / smoke (push) Successful in 10m43s
release / publish (push) Failing after 9m51s
2026-11-20 17:10:07 -06:00
Andrew S Erwin 7f64cbae0b release 0.2.16: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m52s
release / smoke (push) Successful in 10m41s
release / publish (push) Failing after 9m51s
2026-11-18 14:23:53 -06:00
Andrew S Erwin e3d765e97b release 0.2.15: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m55s
release / smoke (push) Successful in 10m30s
release / publish (push) Failing after 9m49s
2026-11-17 11:08:33 -06:00
Andrew S Erwin ceb4973359 Reset version scheme to 0.x (pre-beta); release 0.2.14
release gate / check (push) Failing after 6m46s
release / smoke (push) Successful in 10m40s
release / publish (push) Failing after 9m59s
Superbrain is not yet beta, so the release line moves from 1.2.x to 0.2.x.
0.2.14 is the same code as 1.2.14 (the Nextcloud DAV connection fix) under
the new number; future releases continue from 0.2.15. Existing 1.2.x tags
and images stay published and untouched; CHANGELOG keeps the 1.2.x entries
as history and notes the reset.

Bumps in lockstep: federated service VERSION, installer
SUPERBRAIN_IMAGE_VERSION, superbrain-mcp package version (pyproject +
__init__). Also fixes the outbound MCP client implementation string, which
still reported a stale hardcoded 1.2.7, to the release version. README
release examples updated to the new scheme.

The house upgrade flow compares version tags by string equality, so the
1.2.14 -> 0.2.14 transition deploys through the standard update.sh path
(no downgrade special-casing needed).
2026-11-16 21:51:02 -06:00
Andrew S Erwin 200013960b release 1.2.14: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m32s
release / smoke (push) Successful in 10m23s
release / publish (push) Failing after 9m56s
2026-11-16 21:38:51 -06:00
Andrew S Erwin 298cc4efd6 Fix Nextcloud DAV connections on Core: public-IP pin + username-composed prefills
Two bugs made the suggested Nextcloud shares fail on Core:

1. Reachability: nextcloud.$DOMAIN is split-horizon DNS — inside the core
   network it answers the Nextcloud container's private IP, where nothing
   listens on 443 (traefik holds TLS on the public address), and netguard
   refuses private dials anyway. Verified from the core network: the private
   route refuses connections; the public route answers PROPFIND with 401
   (correct credentials-required). The installer's rendered compose now pins
   nextcloud.$DOMAIN to EXTERNALIP via extra_hosts on the APP service — the
   exact house pattern the web service already uses for authelia. DNS inside
   the app container resolves the public address, the dial goes through
   traefik like any external client, and netguard stays fully strict (no
   guard relaxation, no trusted-host change). update.sh re-renders compose
   from the shipped lib, so running cores pick this up on upgrade.

2. Wrong endpoint: Nextcloud's DAV roots are per-user
   (/remote.php/dav/files/<username>/, /calendars/<username>/), but the
   WebDAV and CalDAV suggestion prefills handed over the bare /files/ and
   /calendars/ homes — one level above any valid endpoint. Both now compose
   the viewer's username into the URL (the URL shown is the URL saved),
   matching the CardDAV prefill.

Dry-rendered the updated compose template and validated it with docker
compose config. Regressions updated to assert the composed per-user URLs
are what gets POSTed (20/20 PASS incl. the mobile suite); real-stack e2e
all PASS; lint/SSR-lint/build clean. API.md and the local AGENTS invariant
document the pin and the composition.
2026-11-16 21:38:28 -06:00
Andrew S Erwin 35c0f5f6a3 release 1.2.13: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 7m13s
release / smoke (push) Successful in 10m42s
release / publish (push) Failing after 10m0s
2026-11-16 21:06:05 -06:00
Andrew S Erwin 9ddbd10933 release 1.2.12: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m26s
release / smoke (push) Successful in 10m17s
release / publish (push) Failing after 10m2s
2026-11-16 03:48:09 -06:00
Andrew S Erwin 4f919033d1 CardDAV address books: each server book a Collection, each contact a URL bookmark
Settings -> CardDAV connects an external CardDAV endpoint (any RFC 6352
service; on Core the deployment's NEXTCLOUD_URL adds a Nextcloud-contacts
one-click prefill, composed visibly with the username so the URL shown is
the URL saved). Each server address book materializes as its own Collection
and every contact becomes a Bookmark carrying the card's DAV .vcf URL — FN
as title, email/phone in the description as display sugar set once.

internal/carddav mirrors the WebDAV/CalDAV siblings:
- client.go — discovery accepts a single book or a home (resourcetype
  <card:addressbook/>), addressbook-query REPORT bounded at 50 books /
  2000 cards, netguard-pinned, Basic auth in the header only, redirects
  refused, folded-vCard parser;
- sync.go — RunLoop/RunOnce under a dedicated carddav-tick advisory lease;
  full ledger discipline: idempotent re-runs, etag refreshes never touch
  user-edited bookmark fields, vanished cards detach membership but keep
  the bookmark, user-deleted bookmarks are tombstones that never
  resurrect, a re-deleted Collection is re-created and re-linked, a
  truncated listing never reconciles deletions, one unreadable book does
  not abort the rest.

CardDAV dials pin to 443 only and require https — CardDAV ships
Basic-auth credentials, and the Contacts sync's review rulings (M-3/CR-01)
stand; the INTEGRATIONS_ALLOW_PRIVATE escape hatch keeps loopback fakes
working. This surface is deliberately separate from the single-config
Contacts sync (Contact rows powering contact-linking): same transport,
different product model, stated in API.md and the UI copy.

Three tables (CardDavConnection/CardDavAddressbook/CardDavItem) via
migration 022 + schema.sql. Handlers expose /api/carddav/connections CRUD
+ /test + /sync with the house credential (encrypted, masked, write-only),
version (409 on stale) and AllowConnector("carddav") plan gate on creation
AND every sync; cap 10; wired as the sixth background loop.

Settings -> CardDAV tab (web/components/carddav-settings.tsx): masked
write-only password, version on PATCH, per-row address-book list,
verbatim test/sync results, Core suggestion prefill, allowed flag drives
the plan notice.

Verification: full Go integration suite green incl. TestCardDavLifecycle
(materialize/URL+title checks, idempotency, etag refresh, detach-but-
survive, tombstone, version contract, 502+lastError, owner scoping) and
TestCardDavSuggestion; carddav unit tests on httptest fakes;
make db-converge passes; browser regressions all 19 PASS incl. the new
CardDAV walkthrough (and a deterministic Sonner-toast drain before the
sign-out assertion, which the added toasts had made racy); web lint/SSR-
lint/build clean. API.md contract section, AGENTS invariant, env docs and
the Core installer wording updated for the three-way DAV prefill.
2026-11-16 03:47:51 -06:00
Andrew S Erwin 47ade10e4a release 1.2.11: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m50s
release / smoke (push) Successful in 10m37s
release / publish (push) Failing after 9m56s
2026-11-15 09:34:51 -06:00
Andrew S Erwin a8bd0ab876 CalDAV calendars: each server calendar a Collection, each event a URL bookmark
Settings -> CalDAV connects an external CalDAV endpoint (any RFC 4791
service; on Core the deployment's NEXTCLOUD_URL adds a Nextcloud-calendars
one-click prefill alongside the existing files one). Each server calendar
materializes as its own Collection and every in-window event becomes a
Bookmark carrying the event's DAV .ics URL.

internal/caldav mirrors internal/webdav:
- client.go — PROPFIND discovery (accepts a calendar home via
  calendar-home-set or a single calendar), REPORT calendar-query over a
  rolling window (last 30d .. next 180d), netguard-pinned 80/443, Basic
  auth in the header only, redirects refused, bounded (50 calendars /
  500 events);
- ics.go — RFC 5545 unfolding + first-VEVENT parse (UID/SUMMARY/DTSTART);
- sync.go — RunLoop/RunOnce under a dedicated advisory lease, reconciling
  each calendar to a Collection and each event to a bookmark via the
  CalDavEvent ledger. Same tombstone/detach discipline as WebDAV: a
  vanished OR out-of-window event detaches membership but keeps the
  bookmark; a user-deleted event never resurrects; a re-deleted collection
  is recreated and re-linked; a truncated window never reconciles
  deletions; one unreadable calendar does not abort the rest.

Three tables (CalDavConnection/CalDavCalendar/CalDavEvent) via migration 021
+ schema.sql. Handlers expose /api/caldav/connections CRUD + /test + /sync
with the house credential (encrypted, masked, write-only), version (409 on
stale), and AllowConnector("caldav") plan gate on creation AND every sync.
Wired as the fifth background loop in main.go.

Settings -> CalDAV tab (web/components/caldav-settings.tsx): masked
write-only password, version on PATCH, per-row calendar list, verbatim
test/sync results, Core suggestion prefill with the viewer's email
local-part, allowed flag drives the plan notice.

Verification: full Go integration suite green incl. four TestCalDav*
(lifecycle, collection-recreation, plan gate + suggestion) on an httptest
fake CalDAV server; make db-converge passes; browser regressions all 18
PASS incl. the new CalDAV settings walkthrough; web lint/SSR-lint/build
clean. API.md, README, .env.example, Core installer and local AGENTS
documents updated.
2026-11-15 09:34:33 -06:00
Andrew S Erwin 520fff725f release 1.2.10: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m32s
release / smoke (push) Successful in 10m20s
release / publish (push) Failing after 9m57s
2026-11-13 08:23:23 -06:00
Andrew S Erwin 564bdc87b6 WebDAV file shares: connect any RFC 4918 service as a Collection of per-file bookmark URLs
Settings -> WebDAV: a user connects an external WebDAV share (any service;
on Core the deployment's NEXTCLOUD_URL offers Nextcloud as a one-click
prefill - DATA, never a TIER code fork). The share materializes as a
Collection and every file becomes a Bookmark carrying the file's DAV URL,
reconciled by the WebDavItem path ledger (migration 020 + schema.sql,
db-converge proven):

- idempotent syncs; etag changes refresh the ledger only, never user-edited
  title/notes/tags; same-URL bookmarks are reused (URL-identity invariant);
- vanished files detach membership but keep the bookmark (sync never
  destroys user data); a user-deleted bookmark is a tombstone that is never
  resurrected; a user-removed membership stays removed - unless the whole
  collection was deleted, when the next sync re-links every live row;
- bounded walks (200 dirs / 1000 files / depth 12) and a truncated listing
  never reconciles deletions;
- netguard-pinned dials (80/443, no trusted exemption for user hosts),
  Basic auth in a header only, redirects refused outright;
- the webdav connector entitlement gates creation AND every sync; a
  downgrade suppresses instead of deleting;
- engine tick per notify/agent discipline (jitter, advisory lease, budget,
  log-not-fatal); /test proves PROPFIND, /sync reconciles on demand;
  passwords write-only + masked, PATCH carries version (409 on stale), cap
  10 per user.

internal/webdav (client+engine), handlers/webdav.go + routes, main.go 4th
loop, config.NextcloudSuggestion, Settings tab + webdav-settings.tsx,
API.md contract section, env docs, Core installer writes NEXTCLOUD_URL.
Client unit tests on an httptest fake DAV server; four integration tests
cover lifecycle, recreation, plan gate and suggestion; regressions drive
the Settings UI end-to-end (masked rows, prefill, connect/sync/test, no
secret echo). All suites green.
2026-11-13 08:23:09 -06:00
Andrew S Erwin 549c8108ea release 1.2.9: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m35s
release / smoke (push) Successful in 10m41s
release / publish (push) Failing after 10m0s
2026-11-11 15:05:28 -06:00
Andrew S Erwin 66d3464f3b release 1.2.8: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Canceled after 1m21s
release / smoke (push) Successful in 10m37s
release / publish (push) Failing after 9m56s
2026-11-09 17:42:38 -06:00
Andrew S Erwin c2e2f54fbc STRATEGY: core-AI ops caveat — per-egress model rot + missing Superpanel store on erwin
release gate / check (push) Failing after 6m59s
2026-11-09 15:09:01 -06:00
Andrew S Erwin b6e9faccb8 release 1.2.7: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 7m31s
release / smoke (push) Successful in 10m51s
release / publish (push) Failing after 10m5s
2026-11-09 11:26:48 -06:00
Andrew S Erwin 1ef11f32a8 release 1.2.6: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m49s
release / smoke (push) Successful in 10m23s
release / publish (push) Failing after 9m49s
2026-11-07 15:14:59 -06:00
Andrew S Erwin 42376476a0 Record ops scope: erwin (.ai) only; .computer core owned by another operator
release gate / check (push) Failing after 6m24s
2026-11-06 10:39:27 -06:00
Andrew S Erwin 6e8b89ab57 Ship the updater-fix patcher as a repo artifact
release gate / check (push) Failing after 6m18s
Idempotent, anchor-asserted patcher for the Core suite's lib/functions.sh:
registers superbrain in EXTRA_APPS and makes upgrade_app verify the
post-redeploy start (alert + return 1 instead of printing Done over a dead
stack). Same change as core-fix-upgrade-superbrain.patch, applicable on any
core without git access to the Core repo:
  python3 deploy/federated/apply-updater-fix.py
(also bundled in migrate images at /deploy/ since 1.2.4)
2026-11-06 09:45:33 -06:00
Andrew S Erwin 696fc929c6 release 1.2.5: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m41s
release / smoke (push) Successful in 10m43s
release / publish (push) Failing after 9m51s
2026-11-06 09:21:58 -06:00
Andrew S Erwin 0824700e4e Add the derived gateway image Dockerfile (referenced by STRATEGY; upstream-retirement TODO)
release gate / check (push) Failing after 6m52s
2026-11-05 15:31:38 -06:00
Andrew S Erwin d08cc9b543 STRATEGY: record the erwin MCP attach (1.2.4) and the interim gateway image
release gate / check (push) Failing after 6m15s
2026-11-05 15:06:20 -06:00
Andrew S Erwin 3816155b91 release 1.2.4: fix unescaped backticks in the compose render heredoc
release gate / check (push) Failing after 6m28s
release / smoke (push) Successful in 10m31s
release / publish (push) Failing after 9m57s
The unquoted heredoc in render_superbrain_compose turned the comment's
backticked 'docker container inspect superbrain' into command substitution;
re-rendering while the stack runs injected inspect JSON into the compose
file and update.sh's parse guard aborted (2026-11-05, core). Reworded;
1.2.3's /deploy remains defective for updates, use 1.2.4+.
2026-11-05 14:16:53 -06:00
Andrew S Erwin aefc84441c STRATEGY: record the 1.2.3 manual publish and the CI-secrets gap
release gate / check (push) Failing after 6m30s
2026-11-05 14:10:06 -06:00
Andrew S Erwin 2e95190cac Record the 2026-11-03 auto-upgrader outage and the fix layers
release gate / check (push) Failing after 6m28s
upgrade-federated.timer redeployed superbrain and left it down: superbrain
is absent from EXTRA_APPS in the Core repo's lib/functions.sh, so
bin/start fell through to usage/exit 2 and upgrade_app printed Done over a
dead stack (traefik default 404 for the hostname). Carries the Core-repo
fix as a format-patch (no push access to Core from here), documents the
IMAGE_VERSION_HOLD pin and the erwin-local commit, and the migrate-ledger
aggravator (DB at 017 vs .env pinned 1.0.1).
2026-11-04 09:43:33 -06:00
Andrew S Erwin 9a6fbe0d3f release 1.2.3: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m55s
release / smoke (push) Successful in 10m24s
release / publish (push) Failing after 9m49s
2026-11-02 22:14:19 -06:00
Andrew S Erwin ad9c351649 release 1.2.2: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m49s
release / smoke (push) Successful in 10m36s
release / publish (push) Failing after 9m54s
2026-11-02 21:56:51 -06:00
Andrew S Erwin 6fbe5f23bf STRATEGY: copy-paste-ready suite-side snippets for the mcpserver link
release gate / check (push) Failing after 6m45s
Also records the product framing: the MCP attach is how the core's
already-configured AI (Superpanel -> Hermes) reaches Superbrain data with
zero per-app LLM config - apps expose tools, the house agent owns the LLM.
Superbrain's own AI features (automations/assistant) keep resolving BYO
first, then the plan-gated AI_* server env key.
2026-11-02 21:07:48 -06:00
Andrew S Erwin 9a9c3bb80d release 1.2.1: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m43s
release / smoke (push) Successful in 10m28s
release / publish (push) Failing after 10m0s
2026-11-02 14:49:57 -06:00
Andrew S Erwin 9990c33712 release 1.2.0: bump federated service VERSION
release gate / check (push) Failing after 7m30s
release / smoke (push) Successful in 10m42s
release / publish (push) Failing after 9m51s
2026-11-02 14:28:21 -06:00
Andrew S Erwin e6ab778bd5 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.
2026-11-02 14:27:58 -06:00
Andrew S Erwin febc7b2195 release 1.1.1: bump federated service VERSION (BYO AI instructions)
release gate / check (push) Failing after 6m21s
release / smoke (push) Successful in 10m17s
release / publish (push) Failing after 9m54s
2026-11-01 12:46:15 -06:00
carly 1dfd41986c Ship install/update scripts in the migrate image; no repo clone on hosts
release gate / check (push) Failing after 6m45s
release / smoke (push) Successful in 10m18s
release / publish (push) Failing after 9m55s
2026-10-30 12:03:07 -06:00
Andrew S Erwin d914a87e98 update.sh: migrate source-mode installs to registry mode
release gate / check (push) Failing after 6m19s
Interim installs carry IMAGE_VERSION=local + IMAGE_VERSION_HOLD=1: the
hold makes upgrade_app skip the app, and the re-rendered registry compose
would pull a nonexistent :local tag. update.sh now detects the hold, drops
it, and pins IMAGE_VERSION to the service file's VERSION before invoking
the house upgrade flow.
2026-10-29 10:25:16 -05:00
Andrew S Erwin 341cdce026 Registry mode: publish app/web/migrate images, drop source builds on hosts
release gate / check (push) Canceled after 4m3s
release / smoke (push) Successful in 10m13s
release / publish (push) Failing after 12m48s
The federated suite now installs Superbrain like every other house app:
pull images, run installapp, no source tree on the host.

Images (Docker Hub, federatedcomputer namespace, one shared tag per
release + :latest, linux/amd64 + linux/arm64):
  superbrain-app      Go API (scratch)
  superbrain-web      Next.js standalone
  superbrain-migrate  NEW self-contained db image: db/ baked in, entrypoint
                      db/bootstrap.sh waits for postgres, applies
                      schema.sql AS DB_USER on an empty database (object
                      ownership — migrations must be able to ALTER), then
                      always runs the checksummed ledger. Fresh install and
                      upgrade become the same command. The dev compose runs
                      the same bootstrap.sh (verified: non-empty DB skips
                      schema, applies pending migrations).

Release CI (.github/workflows/release.yml): semver tags without v prefix
(the suite's VERSION_RX); a smoke job bootstraps a throwaway PostgreSQL
with the migrate image (fresh schema + complete ledger + idempotent re-run)
and runs Go build/vet/unit BEFORE the publish job pushes — a broken db/
can never reach a tag the upgrade flow will pull. Requires
DOCKERHUB_USERNAME/DOCKERHUB_TOKEN secrets. Dockerfile stays legacy-
builder compatible (no BUILDPLATFORM cross-compile): dev hosts build
locally; CI builds each arch natively under qemu.

Federated integration:
- lib-superbrain.sh: compose pulls federatedcomputer/superbrain-*:
  ${IMAGE_VERSION} (bookstack quoting), no build: keys, no
  IMAGE_VERSION_HOLD; compose generation extracted into
  render_superbrain_compose (install + update share it); schema.sql
  pre-apply and host image builds removed; IMAGE_VERSION is the only
  VERSION= line in the generated .env (upgrade_app's sed matches every
  occurrence — the file says so in words that don't contain the pattern).
- service file: CONTAINER=federatedcomputer/superbrain-app (must equal the
  first image: repository — upgrade_app compares it), VERSION=1.0.0.
- services/superbrain/upgrade/pre hook (listmonk pattern): pre-upgrade
  pg_dump into .update-backups (5 retained) + pulls web/migrate at the
  target version (upgrade_app pulls only the app image).
- install.sh: registry messaging, installs the upgrade hook, clone is only
  for deploy files now.
- update.sh REWRITTEN for registry mode: the app dir no longer contains
  source, so it runs from a repo clone — sync lib/service/hook (parse-
  checked, backed up) -> re-render compose -> /federated/bin/upgrade
  superbrain -> same-version compose safety pass -> health probe.
- STRATEGY.md interim-mode section replaced with the registry-mode record.

README: federated section updated (pulls, not builds; house upgrade flow)
and a new 'Environment variable reference' section — every variable the
stack reads, required/optional, defaults, grouped (core, compose, access
policy, OIDC, SMTP, AI, federated-only, tests-only), so generated .env
files stay correct as features are added.
2026-10-29 10:21:10 -05:00
Andrew S Erwin b217bedd8c update.sh: payload-sync only, never clobber the generated compose
release gate / check (push) Failing after 6m46s
Found by the live rehearsal on core: cp -a of the whole clone over the
app dir replaced config_superbrain's GENERATED docker-compose.yml (fixed
IPs, core network, env_file) with the repo's dev compose, whose :?
POSTGRES_PASSWORD interpolation then failed the build. The rollback path
worked exactly as designed (previous images retagged; running containers
were never touched), and the compose was restored by replaying the lib
heredoc with the install-time values.

Fix: sync the same explicit payload as the installer's staging (main.go,
go.mod, go.sum, Dockerfile, .dockerignore, internal, db, web, deploy) via
tar — the generated compose, .env and .update-backups are untouchable.
Plus a pre-build guard: the app dir's compose must contain the generated
stack's container_name or the update refuses to proceed.
2026-10-28 20:12:35 -05:00
Andrew S Erwin e0d922547b Add federated update script: one-command, roll-backable core updates
release gate / check (push) Failing after 6m16s
Other cores had an installer but no updater — updates meant re-running the
workstation tar-sync by hand. deploy/federated/update.sh ships inside the
app dir (the installer stages deploy/), so every installed core already
has its updater:

  sudo bash /federated/apps/superbrain/deploy/federated/update.sh [git-ref]

Flow, in house-safety order: re-exec from /tmp (the sync overwrites the
running script), clone the repo at REF (default main; sha refs fall back
to full-clone+checkout), record current image ids, compressed pre-update
pg_dump (last 5 retained, emptiness-checked), sync source (.env/data
untouched, .git kept out of the app dir/build context), refresh
lib+service suite files (parse-checked before replacing, backed up),
rebuild, force-recreate (migrate one-shot applies new migrations),
health-probe app+web for up to 3 minutes — and on ANY failure retag the
previous images and recreate, pointing at the dump.

Deliberate non-goal: an in-app update button. The scratch containers have
no docker socket and must never get one (read_only + cap_drop ALL is the
hardening model); host-level operator action is the trust boundary until
CI publishes registry images, at which point the generic house upgrade
flow and the panel button supersede this script (IMAGE_VERSION_HOLD comes
out of .env).

Also: .dockerignore gains .update-backups (dumps live under the app dir,
which is the build context); README/STRATEGY/install.sh document the
update path. shellcheck clean; tested live on the production core.
2026-10-28 20:05:10 -05:00
Andrew S Erwin 2fa3979451 Add one-shot federated installer for other cores
release gate / check (push) Failing after 6m37s
deploy/federated/install.sh packages what the 2026-10-26 core install did
by hand, for any operator running their own federated suite with repo
access. Run on the core host as root; it:

- Preflights the suite: installapp/functions.sh//etc/federated, the core
  docker network, Authelia (REQUIRED — the core tier is SSO-only, so an
  install without Authelia would lock everyone out) and the fcore SMTP
  credential source for the notification email channel.
- Refuses when the app dir exists, and checks the fixed core-network IPs
  (.93/.94/.95) against live allocations and other services' INTERNAL_IP;
  SUPERBRAIN_{WEB,APP,MIGRATE}_IP override and rewrite lib + service file.
- Stages the source by git clone (SUPERBRAIN_REPO/SUPERBRAIN_REF) or from
  a local tree (SUPERBRAIN_SRC), same payload as the workstation tar-sync.
- Installs lib/superbrain.sh + services/superbrain/service (backing up
  anything existing), then runs the house flow via
  /federated/bin/installapp superbrain (config/start/configsso/monitors/
  superpanel catalog).
- Verifies containers, the Authelia client AND claims-policy markers (the
  AccessDenied footgun), and the HTTPS login page with a retry loop for
  traefik cert provisioning; prints the operator's first-login steps,
  including that Authelia subjects are opaque UUIDs from
  user_opaque_identifier (not usernames) for offline SEED_SUBJECT links.

Validated: shellcheck clean; preflight chain smoke-tested against the
live core (correct refuse at the already-installed guard). STRATEGY.md
interim-mode section now points at the installer.
2026-10-26 23:33:50 -05:00
Andrew S Erwin f72e4fedb8 Federated install: SMTP relay for the notification email channel on core
release gate / check (push) Failing after 6m54s
The tier switch removed core's SMTP config when password reset became dead
in oidc mode, but the notification engine's email channel needs the same
relay. Reinstate the house pattern in config_superbrain (fcore submission
on mail.$DOMAIN:587, credential read from authelia's secret or
superpanel's .env, NETGUARD_TRUSTED_HOSTS pin for split-horizon DNS) and
correct STRATEGY.md, including the stale 'app sends no outbound mail'
claim in the suite-service notes.

Deployed to core: migration 013 applied, SMTP+pin env verified in the app
container, /api/notifications/* routes live behind auth (401 anonymous),
clean app/web logs. The live /federated/lib/superbrain.sh was synced from
this repo copy (backup kept as superbrain.sh.bak-20261026).
2026-10-26 15:09:04 -05:00
Andrew S Erwin f372936894 Add deployment tiers, self-service password reset, and Authelia SSO fixes
release gate / check (push) Failing after 7m28s
Product tiers (decided 2026-10-26): TIER=core|multi is the deployment knob.
core (federated install, paying customers) derives AUTH_MODE=oidc with
signup/bootstrap off - Authelia is the only way in and accounts are
provisioned upstream (Superpanel -> LDAP -> Authelia). multi (hosted
self-service) derives AUTH_MODE=password: signup, password login and
SMTP-backed self-reset, with the OIDC bridge refused even when variables
are set. Explicit AUTH_MODE/SIGNUP_ENABLED/ALLOW_BOOTSTRAP_SIGNUP always
override the tier; invalid values fail startup instead of falling back.
Go enforces every gate at the API; the web UI mirrors it (conditional
credentials provider, SSO-only login page, signup/reset redirects).

Authelia-only bootstrap: ProvisionExternal grants ADMIN to ADMIN_EMAILS
addresses at first SSO login, and --seed accepts SEED_SUBJECT to link a
pre-existing password account offline - the only path when 409 'account
link required' meets a deployment where nobody can password-login to call
oidc-link.

Self-service password reset (multi tier): POST /api/password/forgot and
/api/password/reset with hashed single-use 30-minute tokens
(PasswordResetToken, migration 011 + schema.sql), enumeration-safe
identical 200s, per-IP rate limits, tokenVersion bump on success (all
prior sessions revoked), OIDC-only accounts excluded by design. New
internal/mailer sends via netguard+outbound budget; NETGUARD_TRUSTED_HOSTS
pins operator-chosen relays that resolve privately (split-horizon DNS)
without the blanket INTEGRATIONS_ALLOW_PRIVATE switch. Web gains
/forgot-password and /reset-password pages and a login-page link.

Federated install fixes: the Authelia client now registers a
claims_policy putting email in the ID token (production AccessDenied -
Auth.js builds OIDC profiles exclusively from ID-token claims), config is
validated before restarting the shared Authelia, uninstall removes the
claims block marker-safely, and generated .env switches to TIER=core with
a password-less admin seed.

Tests: tier derivation/override unit tests, mode and tier integration
tests (403 gates, bridge refusal, ADMIN_EMAILS promotion, offline link),
reset-flow integration tests against a loopback SMTP fake, netguard
trusted-host tests. Docs: RUNNING.md, web/docs/AUTHELIA.md section 7,
.env.example, STRATEGY.md.
2026-10-26 12:28:43 -05:00
Andrew S Erwin d7a2abc683 Deploy script and AUTHELIA documentation (Tim did that)
release gate / check (push) Failing after 6m53s
2026-10-25 01:02:52 -05:00