ReferenceEnvironment variables

This is mainly for operators running their own orchestrator instance. SaaS users don’t need to set any of these — we configure them on your behalf.

Backend (backend-ai-orchestrator/.env)

Required

VarDescription
DATABASE_URLPostgres connection string. postgresql+asyncpg://user:pass@host:5432/db
REDIS_URLRedis URL. redis://host:6379/0
MONGO_URLMongoDB URL with auth. mongodb://admin:pw@host:27017/dbname?authSource=admin
MONGO_DBDefault Mongo database name
JWT_SECRETHS256 secret for API auth JWTs. Min 32 bytes. Generate via openssl rand -hex 32.
(model-provider key)LLM provider API key — exact variable name is provided with your self-host onboarding bundle

Environment / mode

VarDefaultDescription
ENVlocalOne of local, staging, production. Production triggers strict startup validators (KMS required for OIDC, etc.)
APP_BASE_URLhttp://localhost:3000Frontend URL used in verification email links, Stripe redirects
FRONTEND_URLhttp://localhost:3000Same as above; legacy duplicate (will be consolidated)
ALLOWED_ORIGINShttps://app.hivedeploy.in,http://localhost:3000CORS allow-list for the frontend

Cloud provider credentials (orchestrator’s own GCP identity)

For Stripe Atlas / KMS-protected signing key (production):

VarDescription
GOOGLE_APPLICATION_CREDENTIALSPath to GCP SA key JSON inside the container (mounted via Docker volume)

OIDC issuer (for cloud WIF — see Connect GCP)

VarDefaultDescription
GCP_WIF_ISSUER_ENABLEDfalseFeature flag — enable to start serving /.well-known/* endpoints
JWT_ISSUER_URL""Public HTTPS URL where customers point their WIF provider. Must match APP_BASE_URL semantically
JWT_ISSUER_KMS_KEY""Production: full GCP KMS resource name (projects/.../cryptoKeyVersions/N). HSM-protected signing
JWT_ISSUER_PRIVATE_KEY""Dev/staging only: full RSA PEM as env value (multi-line; quote in .env)
JWT_ISSUER_PRIVATE_KEY_PATH""Dev/staging alternative: filesystem path to PEM file
OIDC_KEY_DIRvar/oidc-keysWhere LocalFileKeyProvider writes auto-generated dev keys
JWT_ISSUER_TOKEN_TTL_SECONDS300JWT TTL (5 min default; matches GitHub Actions)
KEY_ROTATION_DAYS30Signing key rotation cadence
KEY_OVERLAP_DAYS7How long retired keys stay in JWKS after rotation

JWT (API auth)

VarDefaultDescription
JWT_ISSUERai-orchestratoriss claim value on user-auth JWTs

Billing / payment provider

VarDefaultDescription
PAYMENT_PROVIDERstripeOne of stripe, none, or future lemonsqueezy. none skips Stripe validators (used during migration)
STRIPE_API_KEY""sk_live_* or sk_test_*. Required if PAYMENT_PROVIDER=stripe
STRIPE_WEBHOOK_SECRET""Webhook signing secret (whsec_*). Required if PAYMENT_PROVIDER=stripe
STRIPE_MOCK_MODEfalseLocal-dev only. Returns mock checkout URLs. Hard-fails in production
PLAN_PICKER_ENABLEDfalseShow the post-verification plan picker on signup
BILLING_OVERAGE_MARKUP_DEFAULT1.40Markup multiplier for credit-usage above included budget

Auth & signup

VarDefaultDescription
SIGNUP_MODEinvite_onlyOne of open, invite_only, waitlist
TURNSTILE_SITE_KEY""Cloudflare Turnstile public site key (frontend uses this)
TURNSTILE_SECRET_KEY""Cloudflare Turnstile secret key (backend uses this to verify)

Email (verification, password reset, notifications)

VarDescription
RESEND_API_KEYResend.com API key
EMAIL_FROMfrom: address (e.g., no-reply@hivedeploy.in)

Notifications + retention

VarDefaultDescription
NOTIFICATIONS_RETENTION_DAYS90How long in-app notifications persist

Celery

VarDefaultDescription
CELERY_BROKER_URL(falls back to REDIS_URL)Override if you want a separate broker

Frontend (frontend-ai-orchestrator/.env.local)

VarDescription
NEXT_PUBLIC_API_URLBackend URL the frontend talks to (e.g., https://backend.hivedeploy.in or http://localhost:8000 for dev)

That’s it. The frontend reads its other config (Turnstile key, signup mode, OAuth toggles) from /api/config/public at runtime — no env-var coupling beyond NEXT_PUBLIC_API_URL.

Validator behavior

The backend’s startup validator (app/domains/billing/startup_validation.py) checks:

  • validate_billing_config(settings) — gated by PAYMENT_PROVIDER. When stripe, enforces all the Stripe-specific config. When none or any other value, skips entirely.
  • validate_oidc_issuer_config(settings) — gated by GCP_WIF_ISSUER_ENABLED. When true, in production requires JWT_ISSUER_URL (https), JWT_ISSUER_KMS_KEY, and rejects local PEM env vars.

Both raise ConfigurationError in production to prevent boots with broken config. In dev / staging, they log warnings and continue.

See also

Was this page helpful?