ReferenceEnvironment Variables

Environment Variables

All Datafly Signal services are configured via environment variables. This page lists every variable, its default value, and which services use it.

Common Variables

These variables are used by all Go services.

VariableDefaultRequiredDescription
KAFKA_BROKERSlocalhost:9092YesComma-separated list of Kafka broker addresses
KAFKA_TLS_ENABLEDfalseNoEnable TLS for Kafka connections
REDIS_URLredis://localhost:6379YesRedis connection URL. Use rediss:// for TLS
DATABASE_URLpostgresql://datafly:datafly@localhost:5432/datafly?sslmode=disableYesPostgreSQL connection string
JWT_SECRETYesSecret key for signing and verifying JWT tokens (256-bit minimum)
LOG_LEVELinfoNoLog level: debug, info, warn, error
PORTService-specificNoHTTP server port (see per-service defaults below)
⚠️

JWT_SECRET has no default and must be explicitly set. Use a cryptographically random string of at least 32 characters. All services that validate JWTs must share the same secret.

Ingestion Gateway

Default port: 8080

VariableDefaultRequiredDescription
PORT8080NoHTTP server port
PIPELINE_KEY_CACHE_TTL300NoPipeline key cache TTL in seconds. Keys are cached in Redis to avoid repeated database lookups
COOKIE_DOMAINNoDomain for the _dfid cookie (e.g., .example.com). If unset, uses the request host
CORS_ORIGINS*NoComma-separated list of allowed origins for CORS. Use * for development only
MAX_BATCH_SIZE500NoMaximum number of events in a single batch request
MAX_PAYLOAD_SIZE524288NoMaximum request body size in bytes (default 512 KB)
RATE_LIMIT_RPS1000NoMaximum requests per second per pipeline key

In production, always set CORS_ORIGINS to the specific domains that should be allowed to send events. Using * disables CORS protection.

Event Processor

Default port: 8081

VariableDefaultRequiredDescription
PORT8081NoHTTP server port (health and metrics endpoints)
KAFKA_CONSUMER_GROUPevent-processorNoKafka consumer group ID
PROCESSING_WORKERS4NoNumber of concurrent event processing goroutines
KAFKA_INPUT_TOPICraw-eventsNoKafka topic to consume raw events from
KAFKA_OUTPUT_TOPIC_PREFIXdelivery-NoPrefix for per-integration delivery topics

Delivery Workers

Default port: 8082

VariableDefaultRequiredDescription
PORT8082NoHTTP server port (health and metrics endpoints)
KAFKA_CONSUMER_GROUPdelivery-workersNoKafka consumer group ID
RETRY_MAX_ATTEMPTS5NoMaximum number of retry attempts for failed deliveries
RETRY_BACKOFF_BASE4NoBase for exponential backoff in seconds (delay = base^attempt)
RATE_LIMIT_PER_SECOND100NoDefault rate limit for vendor API requests (per integration)
DLQ_TOPIC_PREFIXdlq-delivery-NoPrefix for dead letter queue topics
DLQ_RETENTION_DAYS7NoDays to retain events in the dead letter queue

Identity Hub

Default port: 8083

VariableDefaultRequiredDescription
PORT8083NoHTTP server port
ENCRYPTION_KEYYes32-byte hex-encoded AES-256 key for encrypting cross-domain identity tokens and vendor credentials
TOKEN_TTL60NoCross-domain identity token TTL in seconds
IDENTITY_CACHE_TTL3600NoIdentity mapping cache TTL in seconds (Redis)
⚠️

ENCRYPTION_KEY has no default and must be explicitly set. It must be exactly 64 hex characters (32 bytes). Losing this key makes all encrypted data (vendor credentials, identity tokens) unrecoverable.

Management API

Default port: 8084

VariableDefaultRequiredDescription
PORT8084NoHTTP server port
ACCESS_TOKEN_TTL900NoAccess token time-to-live in seconds (default 15 minutes)
REFRESH_TOKEN_TTL604800NoRefresh token time-to-live in seconds (default 7 days)
RATE_LIMIT_PER_MINUTE100NoAPI rate limit per authenticated user per minute
LOGIN_MAX_ATTEMPTS5NoMaximum consecutive failed login attempts before account lockout
LOGIN_LOCKOUT_DURATION900NoAccount lockout duration in seconds after max failed attempts

Management UI

Default port: 3000

The Management UI is a Next.js application with its own environment variables:

VariableDefaultRequiredDescription
PORT3000NoHTTP server port
NEXT_PUBLIC_API_URLhttp://localhost:8084YesManagement API URL (used by the browser)
NEXT_PUBLIC_WS_URLws://localhost:8084NoWebSocket URL for real-time event debugger

Example .env File (Local Development)

# Common
KAFKA_BROKERS=localhost:9092
REDIS_URL=redis://localhost:6379
DATABASE_URL=postgresql://datafly:datafly@localhost:5432/datafly?sslmode=disable
JWT_SECRET=your-local-dev-jwt-secret-at-least-32-chars
LOG_LEVEL=debug
 
# Ingestion Gateway
CORS_ORIGINS=http://localhost:3000,http://localhost:5173
COOKIE_DOMAIN=localhost
 
# Identity Hub
ENCRYPTION_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
TOKEN_TTL=60
 
# Management API
ACCESS_TOKEN_TTL=900
REFRESH_TOKEN_TTL=604800
 
# Management UI
NEXT_PUBLIC_API_URL=http://localhost:8084
NEXT_PUBLIC_WS_URL=ws://localhost:8084
⚠️

Never commit .env files containing secrets to version control. The example above uses placeholder values suitable only for local development.