TurfAI Environment Variables Inventory
Synced from the TurfAI source on 2026-06-21.
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