Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
96 lines (85 loc) · 5.36 KB
/
Copy path.env.example
File metadata and controls
96 lines (85 loc) · 5.36 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# RequestFlow – every runtime variable, documented. Copy to `.env` for local overrides.
# The values below are LOCAL DEFAULTS for the machine-local Docker stack with synthetic data only
# (the same defaults as compose.yaml). Real environments set their own secrets in a secret manager;
# never commit a `.env` (it is git-ignored).
# --- PostgreSQL (container) --------------------------------------------------------------------
# Superuser of the local container only; the app never connects with it.
POSTGRES_PASSWORD=postgres-local-dev
# Passwords for the two app roles, created by docker/postgres/init/01-roles.sh on first start.
APP_OWNER_PASSWORD=owner-local-dev
APP_RW_PASSWORD=rw-local-dev
# Host port of the local database.
POSTGRES_PORT=54329
# --- App database connections ------------------------------------------------------------------
# Runtime role (web + worker): app_rw – no superuser, NOBYPASSRLS, row-level security applies.
DATABASE_URL=postgres://app_rw:rw-local-dev@127.0.0.1:54329/requestflow
# Owner role for migrations only (deploy step `pnpm setup:deploy`, integration-test setup).
MIGRATION_DATABASE_URL=postgres://app_owner:owner-local-dev@127.0.0.1:54329/requestflow
# --- Object storage (S3 API; local SeaweedFS) --------------------------------------------------
S3_ENDPOINT=http://127.0.0.1:8333
S3_REGION=eu-central-1
S3_BUCKET=requestflow-documents
S3_ACCESS_KEY_ID=local-access-key
S3_SECRET_ACCESS_KEY=local-secret-key
# SeaweedFS and most self-hosted S3 servers need path-style URLs.
S3_FORCE_PATH_STYLE=true
# Host port of the local S3 gateway.
S3_PORT=8333
# --- Environment -------------------------------------------------------------------------------
# local | showcase | production. Only `local` accepts the committed local-default auth secret.
APP_ENV=local
# --- Authentication (Better Auth) ---------------------------------------------------------------
# Signs sessions and cookies; at least 32 characters. Generate a real one: `openssl rand -base64 32`.
BETTER_AUTH_SECRET=local-dev-only-secret-change-me-0123456789
# Public base URL of the web app (cookies, redirects, trusted origin).
BETTER_AUTH_URL=http://localhost:3000
# Client IP for the login rate limit. Set to what YOUR reverse proxy writes and list the proxy
# addresses; without trusted proxies only a single-value header is trusted. If the web container is
# reachable without a proxy, clients can forge this header – put a proxy in front (see operations.md).
AUTH_IP_HEADERS=x-forwarded-for
AUTH_TRUSTED_PROXIES=
# Demo seed only (`pnpm seed:demo`): password of the synthetic demo accounts, local use only.
SEED_PASSWORD=demo-password-local-only
# --- Upload limits (intake) ---------------------------------------------------------------------
# Maximum size per file in bytes (default 20 MiB) and files per request (default 10).
UPLOAD_MAX_FILE_BYTES=20971520
UPLOAD_MAX_FILES=10
# Cap of one whole upload request (all files + form overhead); requests without Content-Length are refused.
UPLOAD_MAX_REQUEST_BYTES=41943040
# Uploads per person and hour – a cost cap (every upload starts AI calls). Empty = no cap (local, CI);
# required with APP_ENV=showcase.
UPLOAD_MAX_PER_HOUR=
# --- AI service (services/ai) --------------------------------------------------------------------
# Called by the worker only. The token must equal the service's AI_SERVICE_TOKEN (at least 24 chars).
AI_SERVICE_URL=http://127.0.0.1:8000
AI_SERVICE_TOKEN=local-dev-only-ai-token-0123456789
# Per-document timeout; a timeout is retried with backoff.
AI_SERVICE_TIMEOUT_MS=120000
# --- ERP export (ADR-0001 D9) ----------------------------------------------------------------------
# Base URL of the ERP REST API; the pilot uses the mock inside the web app. The worker exports, the
# web app serves the mock – both need the same token (at least 24 chars; the local default is
# refused outside APP_ENV=local).
# Host value for `pnpm worker` outside Docker; compose sets http://web:3000/api/erp-mock itself – do not
# copy this line into a .env used by compose.
ERP_BASE_URL=http://127.0.0.1:3000/api/erp-mock
ERP_TOKEN=local-dev-only-erp-token-0123456789
# Per-call timeout (max 20000); a timeout is retried with backoff under the same idempotency key.
ERP_TIMEOUT_MS=10000
# The mock route exists only with "true". Fault injection for demos, consumed in order per process:
# 503 (before storing), lost (stored, answer 503), timeout (hangs) – e.g. ERP_MOCK_FAULTS=503,lost
ERP_MOCK_ENABLED=true
ERP_MOCK_FAULTS=
# --- Serverless showcase (Vercel, #59 – docs/technical/deployment-vercel.md) ----------------------
# Without a worker process, `/api/jobs/drain` runs one bounded round of processing + export jobs.
# Bearer secret of that route (at least 24 chars; Vercel Cron sends it). Unset → the route answers 404.
# Generate: `openssl rand -base64 32`. Docker Compose runs the worker and leaves it unset.
# CRON_SECRET=
# "true": also drain once via after() right after upload, approval and reprocess (serverless only).
# With CRON_SECRET or this switch set, AI_SERVICE_TIMEOUT_MS × UPLOAD_MAX_FILES must fit into one
# 300 s function run (e.g. 60000 × 3) – otherwise the configuration is refused.
JOB_DRAIN_INLINE=false
# "true": banner „Demo – nur synthetische Daten" on every page (showcase).
DEMO_MODE=false
# --- Web ---------------------------------------------------------------------------------------
# Host port of the web container.
WEB_PORT=3000