TurfAI Environment Variables Inventory
Synced from the TurfAI source on 2026-09-14 ยท 7c101c0.
This document provides a comprehensive inventory of all environment variables used across TurfAI services for both local development and cloud deployment.
Last Updated : November 4, 2025
Project : TurfAI v0.9.1
GCP Project : turfai-476911
Shared Secrets
DMS (Strapi)
Router Service
Processor Service
LLM Service
RAG Query Service
RAG Embeddings Worker
Infrastructure
Local Development Setup
Cloud Deployment Setup
๐ด Required - Must be set for service to function
๐ก Recommended - Should be set for full functionality
๐ข Optional - Can be omitted (has default)
๐ Secret - Sensitive value, store securely
๐ Shared - Must be identical across multiple services
These secrets MUST be identical across all services for proper authentication and communication.
Variable Type Description Local Value Cloud Value STRAPI_JWT_SECRET / JWT_SECRET๐ด๐๐ JWT token secret for user authentication Generate with openssl rand -base64 32 Same as local, stored in env ROUTER_API_KEY๐ด๐๐ API key for router service authentication Generate UUID Same as local, stored in env
Generation Commands :
# Generate JWT Secret
openssl rand -base64 32
# Generate Router API Key
uuidgen
# or
openssl rand -hex 16
Services Using JWT_SECRET :
DMS (as JWT_SECRET)
Router (as STRAPI_JWT_SECRET)
Processor (as STRAPI_JWT_SECRET)
RAG Query Service (as STRAPI_JWT_SECRET)
RAG Embeddings Worker (as STRAPI_JWT_SECRET)
Services Using ROUTER_API_KEY :
DMS (for submitting jobs)
Router (for validating requests)
Service : Document Management System (Strapi CMS)
Location : /dms/
Port : 1338 (local), Cloud Run (cloud)
Config File : .env
Variable Type Description Local Value Cloud Value DATABASE_CLIENT๐ด Database type postgrespostgresDATABASE_HOST๐ด PostgreSQL host localhost/cloudsql/turfai-476911:us-central1:turfai-dbDATABASE_PORT๐ด PostgreSQL port 54325432DATABASE_NAME๐ด Database name turfai_dmsturfai_dmsDATABASE_USERNAME๐ด Database user postgrespostgresDATABASE_PASSWORD๐ด๐ Database password (local password) Secret Manager: turfai-db-password DATABASE_SSL๐ข Enable SSL falsefalse (Unix socket)
Variable Type Description Local Value Cloud Value APP_KEYS๐ด๐ Strapi app keys (4 comma-separated) Generate 4 keys Same, stored in env API_TOKEN_SALT๐ด๐ Salt for API tokens openssl rand -base64 32Same ADMIN_JWT_SECRET๐ด๐ Admin JWT secret openssl rand -base64 32Same TRANSFER_TOKEN_SALT๐ด๐ Transfer token salt openssl rand -base64 32Same JWT_SECRET๐ด๐๐ User JWT secret (SHARED) openssl rand -base64 32Same
Variable Type Description Local Value Cloud Value STORAGE_PROVIDER๐ด Storage backend gcsgcsGCS_BUCKET_NAME๐ด GCS bucket name turfai-documents-devturfai-documents-turfai-476911GCS_PROJECT_ID๐ด GCP project ID (your project) turfai-476911GCS_KEY_FILE๐ก Service account key path /path/to/key.json(empty - use Workload Identity)
Variable Type Description Local Value Cloud Value REDIS_HOST๐ด Redis host localhost10.233.40.195REDIS_PORT๐ด Redis port 63796379
Variable Type Description Local Value Cloud Value ROUTER_URL๐ด Router service URL http://localhost:8000https://turfai-router-eatorcypia-uc.a.run.appJOB_ROUTER_URL๐ด Job submission endpoint http://localhost:8000/api/v1/jobshttps://turfai-router-eatorcypia-uc.a.run.app/api/v1/jobsRAG_QUERY_SERVICE_URL๐ด RAG query service URL http://localhost:8003https://turfai-rag-eatorcypia-uc.a.run.app
Variable Type Description Local Value Cloud Value HOST๐ข Bind host 0.0.0.00.0.0.0PORT๐ข Service port 13381338NODE_ENV๐ด Environment developmentproductionENABLE_ADMIN_ACCESS๐ก Enable admin UI truetrue (initial), false (production)STRAPI_LOG_LEVEL๐ข Log level debuginfoADMIN_PATH๐ข Admin UI path /admin/admin
Service : Job routing and API gateway
Location : /router/
Port : 8000 (local), Cloud Run (cloud)
Config File : .env
Variable Type Description Local Value Cloud Value DATABASE_HOST๐ด PostgreSQL host localhost/cloudsql/turfai-476911:us-central1:turfai-dbDATABASE_PORT๐ด PostgreSQL port 54325432DATABASE_NAME๐ด Database name turfai_dmsturfai_dmsDATABASE_USERNAME๐ด Database user postgrespostgresDATABASE_PASSWORD๐ด๐ Database password (local password) Secret Manager: turfai-db-password
Variable Type Description Local Value Cloud Value REDIS_HOST๐ด Redis host localhost10.233.40.195REDIS_PORT๐ด Redis port 63796379
Variable Type Description Local Value Cloud Value STRAPI_JWT_SECRET๐ด๐๐ JWT secret (SHARED) (shared secret) (shared secret) ROUTER_API_KEY๐ด๐๐ Router API key (SHARED) (shared secret) (shared secret)
Variable Type Description Local Value Cloud Value DMS_URL๐ด DMS service URL http://localhost:1338https://turfai-dms-eatorcypia-uc.a.run.appLLM_SERVICE_URL๐ด LLM service URL http://localhost:9090https://turfai-llm-eatorcypia-uc.a.run.app
Variable Type Description Local Value Cloud Value HOST๐ข Bind host 0.0.0.00.0.0.0PORT๐ข Service port 80008000LOG_LEVEL๐ข Log level DEBUGINFO
Service : Document processing and workflow execution
Location : /processors/
Port : 8001 (local), Cloud Run (cloud)
Config File : .env
Variable Type Description Local Value Cloud Value DATABASE_HOST๐ด PostgreSQL host localhost/cloudsql/turfai-476911:us-central1:turfai-dbDATABASE_PORT๐ด PostgreSQL port 54325432DATABASE_NAME๐ด Database name turfai_dmsturfai_dmsDATABASE_USERNAME๐ด Database user postgrespostgresDATABASE_PASSWORD๐ด๐ Database password (local password) Secret Manager: turfai-db-password
Variable Type Description Local Value Cloud Value REDIS_HOST๐ด Redis host localhost10.233.40.195REDIS_PORT๐ด Redis port 63796379REDIS_QUEUE_NAME๐ข Processor queue name processor_queueprocessor_queueRESULTS_QUEUE_NAME๐ข Results queue name results_queueresults_queue
Variable Type Description Local Value Cloud Value STRAPI_JWT_SECRET๐ด๐๐ JWT secret (SHARED) (shared secret) (shared secret)
Variable Type Description Local Value Cloud Value DMS_URL๐ด DMS service URL http://localhost:1338https://turfai-dms-eatorcypia-uc.a.run.appLLM_SERVICE_URL๐ด LLM service URL http://localhost:9090https://turfai-llm-eatorcypia-uc.a.run.app
Variable Type Description Local Value Cloud Value GCS_BUCKET_NAME๐ด GCS bucket name turfai-documents-devturfai-documents-turfai-476911GOOGLE_CLOUD_PROJECT๐ด GCP project ID (your project) turfai-476911GOOGLE_APPLICATION_CREDENTIALS๐ก Service account key /path/to/key.json(empty - use Workload Identity)
Variable Type Description Local Value Cloud Value HOST๐ข Bind host 0.0.0.00.0.0.0PORT๐ข Service port 80018001LOG_LEVEL๐ข Log level DEBUGINFOWORKER_CONCURRENCY๐ข Concurrent workers 44
Service : LLM abstraction layer
Location : /llm-service/
Port : 9090 (local), Cloud Run (cloud)
Config File : .env
Variable Type Description Local Value Cloud Value OPENAI_API_KEY๐ก๐ OpenAI API key sk-...Secret Manager: openai-api-key ANTHROPIC_API_KEY๐ก๐ Anthropic API key sk-ant-...Secret Manager: anthropic-api-key GEMINI_API_KEY๐ก๐ Gemini API key (if using) Secret Manager: gemini-api-key
Variable Type Description Local Value Cloud Value GOOGLE_CLOUD_PROJECT๐ด GCP project ID (your project) turfai-476911VERTEX_LOCATION๐ด Vertex AI region us-central1us-central1GOOGLE_APPLICATION_CREDENTIALS๐ก Service account key /path/to/key.json(empty - use Workload Identity)
Variable Type Description Local Value Cloud Value OLLAMA_BASE_URL๐ข Ollama service URL http://localhost:11434(not used in cloud)
Variable Type Description Local Value Cloud Value HOST๐ข Bind host 0.0.0.00.0.0.0PORT๐ข Service port 90909090LOG_LEVEL๐ข Log level DEBUGINFO
Service : Real-time RAG query processing
Location : /rag_query_service/
Port : 8003 (local), Cloud Run (cloud)
Config File : .env
Variable Type Description Local Value Cloud Value DATABASE_HOST๐ด PostgreSQL host localhost/cloudsql/turfai-476911:us-central1:turfai-dbDATABASE_PORT๐ด PostgreSQL port 54325432DATABASE_NAME๐ด Database name turfai_dmsturfai_dmsDATABASE_USERNAME๐ด Database user postgrespostgresDATABASE_PASSWORD๐ด๐ Database password (local password) Secret Manager: turfai-db-password
Variable Type Description Local Value Cloud Value STRAPI_JWT_SECRET๐ด๐๐ JWT secret (SHARED) (shared secret) (shared secret)
Variable Type Description Local Value Cloud Value DMS_URL๐ด DMS service URL http://localhost:1338https://turfai-dms-eatorcypia-uc.a.run.appLLM_SERVICE_URL๐ด LLM service URL http://localhost:9090https://turfai-llm-eatorcypia-uc.a.run.app
Variable Type Description Local Value Cloud Value GCS_BUCKET_NAME๐ด GCS bucket name turfai-documents-devturfai-documents-turfai-476911GOOGLE_CLOUD_PROJECT๐ด GCP project ID (your project) turfai-476911GOOGLE_APPLICATION_CREDENTIALS๐ก Service account key /path/to/key.json(empty - use Workload Identity)
Variable Type Description Local Value Cloud Value HOST๐ข Bind host 0.0.0.00.0.0.0PORT๐ข Service port 80038003LOG_LEVEL๐ข Log level DEBUGINFO
Service : Background RAG embedding generation
Location : /processors/rag_embeddings/
Port : N/A (background worker), Cloud Run (cloud)
Config File : .env
Variable Type Description Local Value Cloud Value DATABASE_HOST๐ด PostgreSQL host localhost/cloudsql/turfai-476911:us-central1:turfai-dbDATABASE_PORT๐ด PostgreSQL port 54325432DATABASE_NAME๐ด Database name turfai_dmsturfai_dmsDATABASE_USERNAME๐ด Database user postgrespostgresDATABASE_PASSWORD๐ด๐ Database password (local password) Secret Manager: turfai-db-password
Variable Type Description Local Value Cloud Value REDIS_HOST๐ด Redis host localhost10.233.40.195REDIS_PORT๐ด Redis port 63796379RAG_EMBEDDINGS_QUEUE๐ข RAG queue name rag_embeddings_queuerag_embeddings_queue
Variable Type Description Local Value Cloud Value STRAPI_JWT_SECRET๐ด๐๐ JWT secret (SHARED) (shared secret) (shared secret)
Variable Type Description Local Value Cloud Value DMS_URL๐ด DMS service URL http://localhost:1338https://turfai-dms-eatorcypia-uc.a.run.appLLM_SERVICE_URL๐ด LLM service URL http://localhost:9090https://turfai-llm-eatorcypia-uc.a.run.app
Variable Type Description Local Value Cloud Value GCS_BUCKET_NAME๐ด GCS bucket name turfai-documents-devturfai-documents-turfai-476911GOOGLE_CLOUD_PROJECT๐ด GCP project ID (your project) turfai-476911GOOGLE_APPLICATION_CREDENTIALS๐ก Service account key /path/to/key.json(empty - use Workload Identity)
Variable Type Description Local Value Cloud Value OCR_ENABLED๐ข Enable OCR truetrueOCR_DEFAULT_PROVIDER๐ข Primary OCR provider googlegoogleOCR_FALLBACK_PROVIDER๐ข Fallback OCR provider tesseracttesseractOCR_PER_DOCUMENT_MAX_USD๐ข Max cost per document 0.500.50OCR_TENANT_DAILY_MAX_USD๐ข Max daily cost per tenant 10.0010.00OCR_TENANT_MONTHLY_MAX_USD๐ข Max monthly cost per tenant 100.00100.00
Variable Type Description Local Value Cloud Value LOG_LEVEL๐ข Log level DEBUGINFOWORKER_POLL_INTERVAL๐ข Poll interval (seconds) 55
These are not environment variables but configuration values used during infrastructure setup.
Parameter Value Instance Name turfai-dbRegion us-central1Tier db-f1-microDatabase turfai_dmsExtensions vector (pgvector v0.8.0)
Parameter Value Instance Name turfai-redisRegion us-central1Size 1 GBVersion redis_7_0
Parameter Value Bucket Name turfai-documents-turfai-476911Region us-central1Storage Class Standard
Parameter Value Name turfai-servicesEmail turfai-services@turfai-476911.iam.gserviceaccount.comRoles cloudsql.client, storage.objectAdmin, aiplatform.user, iam.serviceAccountTokenCreator
Copy example environment file :
Generate shared secrets :
# JWT Secret
export JWT_SECRET = $( openssl rand -base64 32 )
echo "JWT_SECRET= $JWT_SECRET " >> .env
# Router API Key
export ROUTER_API_KEY = $( uuidgen )
echo "ROUTER_API_KEY= $ROUTER_API_KEY " >> .env
Configure local infrastructure :
# PostgreSQL (via Docker or local install)
export DATABASE_HOST = localhost
export DATABASE_PORT = 5432
export DATABASE_NAME = turfai_dms
export DATABASE_USERNAME = postgres
export DATABASE_PASSWORD = your_local_password
# Redis (via Docker or local install)
export REDIS_HOST = localhost
export REDIS_PORT = 6379
# GCS (use local bucket or dev bucket)
export GCS_BUCKET_NAME = turfai-documents-dev
export GOOGLE_CLOUD_PROJECT = your-gcp-project
export GOOGLE_APPLICATION_CREDENTIALS = /path/to/service-account-key.json
Configure service URLs (all local) :
export DMS_URL = http://localhost:1338
export ROUTER_URL = http://localhost:8000
export LLM_SERVICE_URL = http://localhost:9090
export RAG_QUERY_SERVICE_URL = http://localhost:8003
Propagate to all services :
# Copy .env to each service directory
cp .env dms/.env
cp .env router/.env
cp .env processors/.env
cp .env llm-service/.env
cp .env rag_query_service/.env
# Terminal 1: Start PostgreSQL and Redis (via Docker Compose)
cd dev/bootstrap
docker-compose up -d postgres redis
# Terminal 2: Start DMS
cd dms
npm run develop
# Terminal 3: Start LLM Service
cd llm-service
python -m uvicorn api.main:app --host 0.0.0.0 --port 9090 --reload
# Terminal 4: Start RAG Query Service
cd rag_query_service
python -m uvicorn main:app --host 0.0.0.0 --port 8003 --reload
# Terminal 5: Start Router
cd router
python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
# Terminal 6: Start Processor
cd processors
python -m uvicorn main:app --host 0.0.0.0 --port 8001 --reload
# Terminal 7: Start RAG Embeddings Worker
cd processors/rag_embeddings
python worker.py
Before deploying, ensure you have:
Generated shared secrets :
โ
JWT_SECRET (used across all services)
โ
ROUTER_API_KEY (used by DMS and Router)
โ
Strapi secrets (APP_KEYS, API_TOKEN_SALT, etc.)
Infrastructure configured :
โ
Cloud SQL instance created
โ
Redis Memorystore created
โ
GCS bucket created
โ
Service account created with all permissions
Secrets stored :
โ
Database password in Secret Manager
โ
LLM API keys in Secret Manager (if using)
โ
Service account key in Secret Manager
Service URLs discovered :
โ
DMS URL (from first deployment)
โ
Router URL (from deployment)
โ
LLM Service URL (from deployment)
โ
RAG Query Service URL (from deployment)
Infrastructure (Cloud SQL, Redis, GCS, Service Account)
DMS - Base URL needed by all other services
LLM Service - Required by RAG and Processor
RAG Query Service - Required by DMS RAG proxy
RAG Embeddings Worker - Background processing
Router - Job routing
Processor - Job execution
All deployment scripts auto-detect URLs from previous deployments:
# Configuration stored in deploy/.config/
deploy/.config/
โโโ cloudsql.env # Cloud SQL connection info
โโโ redis.env # Redis connection info
โโโ storage.env # GCS bucket info
โโโ service-account.env # Service account details
โโโ shared-secrets.env # JWT secrets, API keys
โโโ dms-deployment.env # DMS URL
โโโ router-deployment.env # Router URL
โโโ llm-deployment.env # LLM URL
โโโ rag-deployment.env # RAG Query URL
โโโ rag-embeddings-deployment.env # RAG Embeddings URL
# Run this script to validate environment variables
bash deploy/scripts/validate-env-vars.sh
# Test database connection
psql -h $DATABASE_HOST -U $DATABASE_USERNAME -d $DATABASE_NAME -c "SELECT version();"
# Test Redis connection
redis-cli -h $REDIS_HOST -p $REDIS_PORT ping
# Test GCS access
gsutil ls gs:// $GCS_BUCKET_NAME /
# Test service URLs
curl $DMS_URL /_health
curl $LLM_SERVICE_URL /health
curl $RAG_QUERY_SERVICE_URL /health
Issue: Services can't authenticate with DMS
Check that JWT_SECRET / STRAPI_JWT_SECRET matches across all services
Verify JWT secret is exactly the same (no extra whitespace)
Issue: Router API calls fail
Check that ROUTER_API_KEY matches between DMS and Router
Ensure API key is in UUID format
Issue: Database connection fails
For local: Check PostgreSQL is running
For cloud: Verify Cloud SQL connection string format
Check DATABASE_PASSWORD is correct
Issue: Redis connection fails
For local: Check Redis is running on port 6379
For cloud: Verify VPC connector is configured
Check internal IP address is correct
Issue: GCS operations fail
Check GCS_BUCKET_NAME is correct
Verify service account has storage.objectAdmin role
For local: Check GOOGLE_APPLICATION_CREDENTIALS path
For cloud: Verify Workload Identity is configured
Issue: RAG embeddings not generating
Check Cloud Vision API is enabled
Verify service account has aiplatform.user role
Check LLM_SERVICE_URL is accessible
Never commit secrets to git
Use .env.example for templates
Keep actual .env files in .gitignore
Use Secret Manager in cloud
Store all passwords in Secret Manager
Reference via secrets, not environment variables
Rotate secrets regularly
JWT secrets should be rotated quarterly
API keys should be rotated on compromise
Limit service account permissions
Use least-privilege principle
Only grant necessary roles
Enable audit logging
Log all authentication attempts
Monitor for suspicious activity
Deployment Lessons Learned : /docs/deployment-lessons-learned-2025-11-04.md
Deployment Checklist : /docs/deployment-checklist.md
Database Schema : /docs/database-schema-complete.md
Architecture : /CLAUDE.md
Last Updated : November 4, 2025
Maintainers : TurfAI Development Team