#14 · Multi-tenant config: load tenant-specific env from `tenants/<id>/.env`
+240 pts on merge
Claim on GitLab
Submit a merge request that closes this issue to earn points on merge — bounties stack on the standard
+40 merge_pr award. New to the repo? See the
Contributing guide,
and Local Development & SSO
to run the app locally (
cp .dev.vars.example .dev.vars && pnpm dev, after rebasing on main) and fully test your change before opening the MR.
Description
Context
Forks of the bot can't easily run multiple Signal accounts on one host. A multi-tenant layout (tenants/<tenant_id>/.env, tenants/<tenant_id>/state/) would let one container serve N communities with isolated state, sharing only the binary. This is foundational for the fork-friendly direction in selfhost/.
Acceptance criteria
- [ ] Bot reads
TENANT_IDenv var; if set, loadstenants/$TENANT_ID/.envinstead of root.env - [ ] All file paths (signal-cli state, file index, logs) namespace under
tenants/<id>/ - [ ] Database connection string uses
DB_NAME=signalbot_<tenant_id>if multi-tenant mode active - [ ] Default behavior unchanged when
TENANT_IDunset (single-tenant compatibility) - [ ]
docker compose upwithTENANT_ID=fooexample documented in README - [ ] Tests: at least one integration test runs in multi-tenant mode
Technical hints
- Centralize env loading in
apps/signal-bot/src/src/utils/config.ts(probably already exists — extend it) - Update
compose.ymlto honorTENANT_IDbuild arg / env - PostgreSQL: per-tenant database, NOT per-tenant schema (avoids cross-tenant leaks via shared sequences)
- signal-cli stores account state in
~/.local/share/signal-cli/— must override per-tenant
--- *Submit a merge request that says Closes #<this issue iid> in the description. On merge to main, the GitLab webhook will auto-award your bounty + the standard merge_pr (40 pts) to your scoreboard account. Email on commit must match your Authentik email.*
Relevant files
No relevant files linked yet.
Hints
No hints yet.
Activity
No points have been awarded for this bounty yet.
Comments
Sign in to join the discussion.
No comments yet. Be the first to weigh in.