feat(build): split standalone vs saas build modes #55
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/split-build-saas-standalone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mirrors the pattern used by RUS and Rusty Links. The server now compiles to one of two binaries depending on cargo features:
lets-chat(default,--features standalone): self-hosted build with built-in registration, login, and admin pages.lets-chat-saas(--no-default-features --features saas): integrates with a parent SaaS application. The /register and /admin routes are not registered, and a /webhooks/maintenance endpoint is added for the parent app to signal maintenance. Brings in hmac, hex, and jsonwebtoken crates as the foundation for future cookie-based auth.The Docker image accepts
--build-arg BUILD_MODE=saasto switch modes; the runtime binary is always installed as /usr/local/bin/lets-chat regardless of which mode it was built in. The cacher and builder stages branch on BUILD_MODE so dependency caching works for both. compose.dev.yml passes BUILD_MODE through, defaulting to standalone.Adds saas-suffixed justfile recipes (build-saas, build-docker-saas, check-server-saas, check-clippy-saas, check-docker-saas, dev-web-saas, dev-web-local-saas, test-saas) and includes both modes in the top-level
just checkso CI catches regressions in either binary. Adds .env.standalone and .env.saas templates documenting the per-mode environment variables. CLAUDE.md describes the two modes and the new recipes.The actual SaaS cookie validation logic is intentionally a stub for now: the maintenance webhook returns 200 OK and there is no JWT/HMAC verification yet. Future work will swap the inject_user middleware for saas mode and wire up the parent-app cookie handshake.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com