19 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 ebe51fa38e feat(auth): every way in on AccountKit's own screens (#289)
* feat(auth): every way in on AccountKit's own screens

Botsmann signed people in against OrangeCat's GoTrue (auth.users). It now
runs on AccountKit (@bitbaum/accountkit 0.23) with AccountKit's own forms:
/auth/signin offers email and password, an emailed sign-in link, a
passkey, recovery through the mailed link and the second factor;
/auth/signup is sign-up; /account carries the account panel ("Sign-in and
security" in the account menu). "Continue with OrangeCat" and the shared
sign-in show when their clients are set, the link and recovery when mail
is. The GoTrue routes (/api/auth/signin, signup, forgot-password,
resend-verification, profile) and pages (callback, forgot-password,
reset-password, verify-email) and the cookie-session client are gone.

AccountKit's tables live in a host accounts database (drizzle/, loki
accounts-db.conf); the data stays in the botsmann supabase schema, which
every route already read with the service-role client. verifyUser now reads
AccountKit's session; /api/user/profile moves onto it too. New accounts get
uuid ids, and migration 013 drops the person columns' keys to auth.users,
which a new person's id is not in. Nothing is deleted. The profile editor
writes AccountKit's name and image.

Existing people keep their rows: scripts/db/accountkit-people.sql lists
everyone who owns rows with their OrangeCat actor id, and
scripts/db/accountkit-import.sql gives each an account under the same id,
linked to OrangeCat by that actor id, never by address (loki
accountkit-supabase.yml rehearses it rolled back, then imports).

Pages were served with public, max-age=3600 to every browser, account pages
included: after sign-out the browser showed its cached /account. /account
and /auth/* are now private, no-store. The account menu's trigger has a name.

tests/__tests__/accounts runs the ways in and the import on the committed
migration; browser-smoke.yml's account job rehearses the import and runs
the browser journey against the production build with AccountKit's real
mail caught by a sink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* fix(auth): send a signed-out visitor to sign in with the router

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci(auth): the shared sign-in's button is matched by how it starts

AccountKit 0.24 names only the providers Morulia publishes, so the label
changes with Morulia.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci(auth): expect the shared sign-in only once Morulia publishes a provider

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci: run the checks on the journey change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 23:27:16 +01:00
CatoandClaude Opus 5.5 4fd7cf0195 fix(settings): API keys are sealed at rest and checked before they are saved (#208)
* fix(settings): API keys are sealed at rest and checked before they are saved

Readers' Groq/OpenRouter keys sat in user_settings as plaintext, and GET
/api/settings returned the whole row — keys included — to the browser.

- Keys are sealed with @bitbaum/ai-kit/seal (BYOK_SEAL_SECRET); GET returns
  only a hint (…abcd). Without the secret nothing new is stored (503).
- Legacy plaintext rows keep working and are sealed in place on first read.
- Save checks a new key with probeByokKey first; a key the provider refuses is
  never stored, and the reason is the provider's own words.
- An empty key field keeps the saved key (removing is explicit); the old PUT
  wrote key || null, which would have wiped keys once they stopped being sent.
- The key check now runs on its own after pasting, and actually passes:
  both pages read the jsonSuccess payload at the top level, so settings never
  loaded and every key — good or bad — was reported invalid.
- OpenRouter is checked on /key: its /models is public and 200s a dead key.

ai-kit ^1.18.0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(settings): type the seal-secret lookup for plain env objects

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 12:35:30 -07:00
CatoandClaude Fable 5.1 bade0a1b8e chore: rename FleetCrown to Loki (#197)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
15 files changed, 29 insertions(+), 29 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:23:24 -07:00
a04d484451 refactor(email): SES -> @bitbaum/mail-kit; drop @aws-sdk/client-ses (#178)
The playbook expected no SES call sites, but lib/email/service.ts is live
(consultations route sends welcome + admin mails through it), so a bare dep
removal would have broken the build. Instead the transport is swapped to the
fleet's mail layer:

- EmailService now sends via @bitbaum/mail-kit sendMail; the throw-on-failure
  contract is preserved for the catching caller
- Sender comes from RESEND_FROM (fleet SSOT) with conventionalFrom('Botsmann')
  fallback; FROM_EMAIL and NEXT_AWS_* reads deleted from email config paths
- @aws-sdk/client-ses removed; tests mock @bitbaum/mail-kit instead of SES,
  with a new failed-send assertion


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-05 10:14:55 +00:00
107e8c5c08 docs(db): point this repo at its own database, and gate the way back (#143)
The schema fix landed in #138, but the repo still told you to operate a
Supabase we do not have. docs/SUPABASE_SETUP.md opened with "Completed Setup"
for a hosted project jkjmhtirxwhljpkcfxqe.supabase.co and said to apply
migrations by pasting SQL into a supabase.com dashboard. Two unreferenced
scripts printed the same instruction, one handing out a psql string against
pooler.supabase.com, and the CLI's .temp cache with the old project ref was
committed — twice, once nested under supabase/migrations/.

That is not stale clutter, it is the outage. A wrong pointer to a real-looking
place is worse than no pointer: no pointer makes someone ask, a plausible one
makes them assume it was handled. Nobody pasted anything, the eleven migrations
were never applied, and /api/health served PGRST205 for months while every
deploy went green.

So the doc now describes what is actually true — self-hosted on bitbaum at
supabase.orangecat.ch, our tables in the `botsmann` schema because one database
backs several apps and `public` is orangecat's, and migrations applied
automatically on deploy by fleetcrown's apply-schema.sh against the
botsmann._deploy_schema_history ledger. Nothing is pasted anywhere. 280 lines
became 100.

Fixing today's copies only clears today's copies, so check:selfhost joins
verify: it fails on supabase.com/dashboard, app.supabase.com, pooler URLs and
real project refs, allows supabase.com/docs because the product documentation
is still correct for us, and exempts docs/archive/ so history can stay honest.
Proven to fail before shipping — it catches an injected dashboard link and a
project ref, and leaves the your-project.supabase.co placeholder alone.


Claude-Session: https://claude.ai/code/session_018waGt1ieA9TjpscqrbrnGb

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 08:08:06 +00:00
Mao NakamotoandCursor 9ba0152ea3 fix(feedback): bake FleetCrown widget token at build time
Next tree-shakes an empty FLEETCROWN_FEEDBACK_TOKEN during next build, so a
runtime-only .env never emits the Script. Keep a public-token fallback so the
FAB ships on every deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 04:11:45 +02:00
Mao NakamotoandCursor 1aa7c88a26 feat(feedback): embed FleetCrown visitor widget on every page
Env-gated like OrangeCat so Hetzner builds with FLEETCROWN_FEEDBACK_TOKEN
from /opt/botsmann/shared/.env pick up the FAB without a one-click agent path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 03:03:10 +02:00
g-butandClaude Opus 4.6 9bf4630fd2 chore: clean up stale docs, fix outdated dates and content
- Archive 10 stale/completed docs to docs/archive/ (MongoDB-era,
  migration plans, stale status snapshots, AGENTS.md.new)
- Rewrite SHARED_CONTEXT.md: remove MongoDB sections, update env vars
  table to Supabase, fix project structure to match reality, fix data
  flow diagrams
- Fix "January 2025" typo → "January 2026" across 6 doc files
- Update governance demo dates from 2023 to 2026
- Fix "launching 2025" → "launching 2026" in techno-capital
- Update bot roadmap timelines and expected launch dates
- Fix demo chat bot status from "coming soon" to "demo available"
- Add missing OPENROUTER_API_KEY to .env.example
- Fix stale path in RALPH.md (src/lib/schemas/ → lib/validations/)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:22:39 +01:00
g-butandClaude Opus 4.5 e06e68f5fe Migrate database from MongoDB to Supabase
- Replace MongoDB/Mongoose with Supabase (free tier)
- Add lib/supabase.ts client with lazy loading
- Update consultations API to use Supabase
- Update health endpoint for Supabase
- Add SQL migration for consultations table
- Remove MongoDB dependencies from package.json
- Update .env.example with Supabase variables

Cost: $0/month (Supabase free tier)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 11:55:15 +01:00
Devin AIandcato 6a2720152b fix: add API key configuration for form submission
Co-Authored-By: G <butaeff@gmail.com>
2025-02-17 01:36:32 +00:00
Devin AIandcato 6bac54674d chore: update env example with generic placeholders
Co-Authored-By: G <butaeff@gmail.com>
2025-02-11 18:40:40 +00:00
Devin AIandcato e264b00789 chore: update env example with placeholder values
Co-Authored-By: G <butaeff@gmail.com>
2025-02-11 14:18:29 +00:00
Devin AIandcato c4a442864b chore: update env example with Mailgun template ID
Co-Authored-By: G <butaeff@gmail.com>
2025-02-11 14:07:16 +00:00
Devin AIandcato 6fac4b100b chore: update env example with Mailgun configuration
Co-Authored-By: G <butaeff@gmail.com>
2025-02-11 13:35:00 +00:00
Devin AIandcato f1b504a701 fix: add API key header and improve form error handling
Co-Authored-By: G <butaeff@gmail.com>
2025-02-11 00:09:29 +00:00
Devin AIandcato c97ce425b1 feat: add email templates and environment variables
Co-Authored-By: G <butaeff@gmail.com>
2025-02-10 23:39:57 +00:00
Devin AIandcato 65c87bb051 feat: add MongoDB integration for consultation form
Co-Authored-By: G <butaeff@gmail.com>
2025-02-09 20:34:49 +00:00
Devin AIandcato c3f6f96cc7 feat: add blog section, specialized bots, and project pages
Co-Authored-By: G <butaeff@gmail.com>
2025-02-08 18:28:51 +00:00
Devin AIandcato 22eb01ad44 feat: add OpenAI design system and layout components
Co-Authored-By: G <butaeff@gmail.com>
2025-02-08 17:46:55 +00:00