This repository has been archived on 2026-10-08. You can view files and clone it, but cannot push or open issues or pull requests.
allotment/.env.example

55 lines
2.1 KiB
Plaintext

# Server
PORT=3001
NODE_ENV=development
MONGODB_URI=mongodb://127.0.0.1:27017/toms-allotment
SESSION_SECRET=replace-with-long-random-string
# Browser origin (CORS + session). In dev with Vite, use the Vite dev server URL so cookies work through the proxy.
CLIENT_URL=http://localhost:5173
# OIDC (optional — omit to disable sign-in; watering stays disabled)
OIDC_ISSUER=https://your-idp.example.com/realms/your-realm
OIDC_CLIENT_ID=toms-allotment
OIDC_CLIENT_SECRET=
# In dev, use Vite proxy so the callback is same-site with the UI:
OIDC_REDIRECT_URI=http://localhost:5173/auth/callback
# iOS app sign-in: after OIDC, /auth/login?app=1 redirects here with ?token=<session token>.
APP_REDIRECT_URI=allotment://auth
# OIDC callback used for app sign-in only. The phone must reach it, so in dev set it to the
# server's LAN address (and allow it in the IdP client). Defaults to OIDC_REDIRECT_URI.
# OIDC_APP_CALLBACK_URI=http://192.168.1.10:3001/auth/callback
# Shared secret the hub firmware sends as "Authorization: Bearer <key>" to /api/hub/* (see packages/app/BLE_PROTOCOL.md Appendix A)
HUB_API_KEY=
# MQTT (optional — copy config/mqtt.example.json to config/mqtt.json)
MQTT_CONFIG_PATH=
MQTT_PASSWORD=
# Single TTN device (optional — overrides packages/server/config.json device.*)
# DEMO_* still supported; DEVICE_TTN_* wins if both are set.
DEMO_TTN_APP_ID=demo-app
DEMO_TTN_DEV_ID=demo-device
# DEVICE_TTN_APPLICATION_ID=
# DEVICE_TTN_DEVICE_ID=
# DEVICE_NAME=
# S3-compatible storage (patch images). Prefer env for secrets — do not commit keys.
# Cloudflare R2: endpoint https://<ACCOUNT_ID>.r2.cloudflarestorage.com (no bucket in path).
# Region is forced to "auto" for R2 when the endpoint host is r2.cloudflarestorage.com.
# MinIO: set S3_ENDPOINT (e.g. http://localhost:9000) and S3_FORCE_PATH_STYLE=true
S3_BUCKET=
S3_PREFIX=allotment-images
S3_ENDPOINT=
# R2 API token or MinIO access key (AWS_* also work if unset here)
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
# Optional (temporary creds / assume-role)
S3_SESSION_TOKEN=
S3_FORCE_PATH_STYLE=
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_SESSION_TOKEN=