Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
72 lines (67 loc) · 3.51 KB
/
Copy path.env.example
File metadata and controls
72 lines (67 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copy to .env and adjust. .env is gitignored.
#
# THIS FILE IS FOR BARE-METAL DEV (`npm run dev` on the host).
#
# Two things worth knowing:
#
# 1. Nothing loads this file into the app. There is no dotenv and no
# --env-file anywhere in the repo, and Node does not auto-load .env. Bare-metal
# dev works because every value below equals the zod default in
# apps/api/src/env.ts. Change one here and the app will NOT see it — export it
# in your shell instead.
#
# 2. Docker Compose DOES read this file, for ${VAR} interpolation. That means
# anything defined here overrides the `:-default` build args in
# docker-compose.yml. The VITE_* values below deliberately match those
# defaults so the shadowing is a no-op. Verify with:
# docker compose --profile prod config | grep VITE_
# Container runtime values are set inline in docker-compose.yml, not here —
# they differ (postgres:5432, not localhost:5434).
# --- Control-plane API (apps/api) ---
PORT=4000
HOST=0.0.0.0
# ToggleFlow's own dev Postgres (`docker compose --profile dev up -d postgres`).
# Host port 5434 — 5433 belongs to the fixmytext stack's velobits-dev-db.
DATABASE_URL=postgres://toggleflow:toggleflow@localhost:5434/toggleflow
# --- Auth (shared keycloak-dev + shared Velobits realm, velobits-infra stack) ---
# Start that stack first (`docker compose up -d` in ../velobits-infra).
# ToggleFlow uses the shared Velobits realm with its own clients
# (toggleflow-dashboard SPA/PKCE + toggleflow-api bearer audience) —
# decided 2026-07-27, superseding the earlier dedicated-realm plan.
# KEYCLOAK_URL is the ISSUER: it must match the `iss` claim byte-for-byte.
# velobits-infra pins KC_HOSTNAME=localhost, so every token says
# http://localhost:8080/realms/Velobits regardless of the request's Host header.
KEYCLOAK_URL=http://localhost:8080
# Containers only: the base used for the JWKS *network fetch*, because the issuer
# address above is unreachable from inside one. docker-compose.yml sets this to
# http://keycloak-dev:8080; leave it unset on bare metal.
# KEYCLOAK_INTERNAL_URL=http://keycloak-dev:8080
KEYCLOAK_REALM=Velobits
# Access-token audience the API requires (set by the dashboard client's audience mapper).
KEYCLOAK_AUDIENCE=toggleflow-api
# --- Billing (Stripe — not wired yet) ---
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# --- Delivery plane (publish pipeline, apps/api → KV) ---
# KV_MODE: miniflare (default — local workerd KV shared with `wrangler dev`),
# memory (tests), or cloudflare (production REST API).
KV_MODE=miniflare
# Must match the kv_namespaces id in apps/edge-worker/wrangler.jsonc.
KV_NAMESPACE_ID=toggleflow-rulesets-dev
# Where miniflare persists KV — the edge worker's wrangler state, so the
# worker reads exactly what the API publishes. Relative to apps/api.
KV_PERSIST_PATH=../edge-worker/.wrangler/state/v3/kv
# Debounce for auto-publish after mutations (ms).
PUBLISH_DEBOUNCE_MS=500
# Production only (KV_MODE=cloudflare); also used by wrangler for deploys.
# CLOUDFLARE_API_TOKEN=
# CLOUDFLARE_ACCOUNT_ID=
# --- Dashboard (apps/dashboard) ---
# Vite BAKES these into the bundle at build time (apps/dashboard/src/auth/oidc.ts),
# so they are browser-facing HOST addresses even for containerized builds. These
# also feed the ${} build args in docker-compose.yml — see the header note about
# shadowing, and keep VITE_KEYCLOAK_URL in sync with the CSP connect-src in
# docker/nginx.router.prod.conf.
VITE_KEYCLOAK_URL=http://localhost:8080
VITE_KEYCLOAK_REALM=Velobits
VITE_KEYCLOAK_CLIENT_ID=toggleflow-dashboard