CO2T-TSIRailway

Env Wizard

Variable reference for Railway dev / main (primary) and optional local dev. Set STACK_URL on the deploy-console service first. Download template is for local .env.local only.

Generate secrets with: python3 -c "import secrets; print(secrets.token_hex(32))"

VariableRequiredDescriptionAccount / link
SECRET_KEY
e.g. <hex-32>
YesMain JWT signing key — generate fresh
BACKEND_SECRET_KEY
e.g. <hex-32>
YesSecondary signing key
ALGORITHM
e.g. HS256
Yes
local default ok
JWT algorithm
ACCESS_TOKEN_EXPIRE_MINUTES
e.g. 30
Yes
local default ok
Token TTL

Set on deploy-console service in dev/main — no secrets. Primary probe target for dashboard.

VariableRequiredDescriptionAccount / link
STACK_URL
e.g. https://main-api-dev-6c56.up.railway.app
YesPublic main-api base URL for /api/stack-health and dashboarddeploy-console dev
RAILWAY_ENV
e.g. dev
NoLabel for active stack (dev | main)
MAIN_API_URL_DEV
e.g. https://main-api-dev-6c56.up.railway.app
NoPreset URL shown for dev stack card
MAIN_API_URL_MAINNoPreset URL for main stack when provisioned
RAILWAY_PROJECT_ID
e.g. 0846c0a0-1ad9-4d8a-9618-91be49e18208
Noco2t-tsi project — quick linksRailway → co2t-tsi

Tier A shared vars: co2t-tracking-system/env/tsi.*.shared.env.example → railway-push-shared-env.sh. DB/RabbitMQ via ${{service}} references.

VariableRequiredDescriptionAccount / link
DATABASE_URL
e.g. ${{Postgres.DATABASE_URL}}
YesFrom Postgres service — never localhost on Railway
RABBITMQ_URL
e.g. ${{rabbitmq.RABBITMQ_URL}}
NoInternal rabbitmq.railway.internal — not guest/guest
CO2TRUST_DISABLE_QUEUE
e.g. false
Notrue only for smoke when broker unavailable

Security reminder

  • Never commit .env.local or any file containing real secret values.
  • All TSI repos already have .env.local and .env*.local in .gitignore.
  • For Railway: set vars in the Railway dashboard or with railway variables --set KEY=VALUE.
  • Generate fresh JWT secrets for each environment with python3 -c "import secrets; print(secrets.token_hex(32))".
  • Use Stripe test keys (sk_test_…) for dev; never use live keys locally.