Files
TX/.env.example
T

103 lines
4.8 KiB
Bash
Raw Normal View History

# ============================================================================
# Tx OS — environment configuration. Copy to `.env` and edit before deploying.
# Everything in this file is read either by docker-compose.yml at `up` time
# or directly by the application processes (`api-server`, `tx-os`, scripts).
# NEVER commit `.env` — it is gitignored. `.env.example` is the public template.
# ============================================================================
# -----------------------------------------------------------------------------
# Host ports (compose only)
# -----------------------------------------------------------------------------
# Port the SPA (nginx) is reachable on. Front with TLS in production.
WEB_PORT=3000
# Port the API container is reachable on. In public deployments, bind this
# to 127.0.0.1 only so the edge proxy is the sole external entry point.
API_PORT=8080
# Component preview server port (dev profile only).
MOCKUP_PORT=8081
# -----------------------------------------------------------------------------
# API server runtime
# -----------------------------------------------------------------------------
# In compose this is set automatically; required when running natively.
PORT=8080
# Public base URL the SPA + API are reachable at. Used to build absolute
# upload URLs for the local-FS storage driver and to validate CORS origins.
PUBLIC_BASE_URL=http://localhost:3000
# Comma-separated list of origins allowed by the API server's CORS layer.
# Must include PUBLIC_BASE_URL and any additional reverse-proxy domains.
ALLOWED_ORIGINS=http://localhost:3000
# pino log level: trace | debug | info | warn | error | fatal
LOG_LEVEL=info
# 32+ random bytes. Generate with `openssl rand -hex 32`. REQUIRED.
SESSION_SECRET=change-me-session-secret-min-32-chars-please
# -----------------------------------------------------------------------------
# SPA build (tx-os) — read by Vite at build time AND `pnpm --filter tx-os dev`
# -----------------------------------------------------------------------------
# Path the SPA is mounted at. Use "/" when serving from the domain root.
BASE_PATH=/
# -----------------------------------------------------------------------------
# Database
# -----------------------------------------------------------------------------
POSTGRES_USER=tx
POSTGRES_PASSWORD=change-me-postgres
POSTGRES_DB=tx_os
# Composed automatically by docker-compose; set explicitly when running natively.
# DATABASE_URL=postgres://tx:change-me-postgres@localhost:5432/tx_os
DATABASE_URL=postgres://tx:change-me-postgres@db:5432/tx_os
# -----------------------------------------------------------------------------
# Object storage
# -----------------------------------------------------------------------------
# Driver selection. Set to "s3" for production (MinIO/S3); "local" persists
# uploads on the API container's filesystem (single-host, dev-only).
# If unset, the driver auto-detects: "s3" when S3_ENDPOINT is set, else "local".
STORAGE_DRIVER=s3
# Bucket-level paths used by the API. Format: /<bucket>/<prefix>
PRIVATE_OBJECT_DIR=/tx-private/private
PUBLIC_OBJECT_SEARCH_PATHS=/tx-public/public
# Bucket names — created on first boot by the minio-init container.
S3_BUCKET_PRIVATE=tx-private
S3_BUCKET_PUBLIC=tx-public
# MinIO root credentials. Used both as MINIO_ROOT_USER/PASSWORD and as the
# API server's S3 access key. Change before first boot.
S3_ACCESS_KEY_ID=tx-minio-admin
S3_SECRET_ACCESS_KEY=change-me-minio-secret-min-20-chars
# Region label is cosmetic for MinIO but @aws-sdk requires one.
S3_REGION=us-east-1
# Local-FS driver settings (only consulted when STORAGE_DRIVER=local).
# Filesystem root for uploaded objects. Defaults to ./storage relative to
# the API server's working directory.
LOCAL_STORAGE_ROOT=./storage
# HMAC key used to sign + verify upload URLs for the local driver. If
# unset, the driver falls back to SESSION_SECRET. Set explicitly to rotate
# upload-URL trust independently of session trust.
LOCAL_STORAGE_SIGNING_SECRET=
# -----------------------------------------------------------------------------
# Seeded demo accounts
# -----------------------------------------------------------------------------
# Used only by `docker compose run --rm migrate` on first boot. REQUIRED in
# production — the seed script throws if these are unset and NODE_ENV=production.
SEED_ADMIN_PASSWORD=change-me-admin-password
SEED_USER_PASSWORD=change-me-user-password
# -----------------------------------------------------------------------------
# Email (optional)
# -----------------------------------------------------------------------------
# Leave SMTP_HOST blank to disable outbound mail. The Executive Meetings
# notifier no-ops when no SMTP config is present.
SMTP_HOST=
SMTP_PORT=587
SMTP_USER=
SMTP_PASS=
SMTP_SECURE=false
SMTP_FROM=Tx OS <noreply@example.com>