Skip to content
On this page

3. Environment Variables

Each service has its own .env file:

ServiceFileDescription
Auth Service.env.authJWT and Mongo configuration
API Gateway.env.gatewayHTTP gateway + CORS
Controller.env.controllerCore logic, RabbitMQ, MongoDB
WS Broker.env.wsWebSocket broker configuration

🧩 Example configuration

WS Broker

VariableExampleDescription
PORT8081HTTP port exposed by the broker
JWT_AGENT_SECRETsupersecret_agentToken for agent auth
JWT_BROWSER_SECRETsupersecret_browserToken for browser sessions

API Gateway

VariableExampleDescription
PORT8080API Gateway port
AUTH_URLhttp://auth:4000Internal service URL for Auth
CONTROLLER_URLhttp://controller:3000Internal service URL for Controller
CORS_ORIGINhttp://localhost:5173,http://127.0.0.1:5173Allowed origins for web UI
BROKER_URLhttp://ws-broker:8081Internal URL to WebSocket broker

Controller

VariableExampleDescription
PORT3000HTTP port for Controller
CORS_ORIGIN*Allowed origins
LOG_LEVELinfoLogging verbosity
MONGO_URLmongodb://mongo:27017/hvwmMongo connection string
MONGO_DBopenhvxDatabase name
RMQ_URLamqp://guest:guest@rabbitmq:5672/RabbitMQ connection
JOBS_EXCHANGEjobsExchange for async jobs
TELEMETRY_EXCHANGEagent.telemetryExchange for telemetry
RESULTS_EXCHANGEresultsExchange for agent task results
HEARTBEATS_QUEUEagent.heartbeatsQueue for agent heartbeats
HEARTBEATS_TTL_MS120000Heartbeat timeout (ms)
INVENTORIES_QUEUEagent.inventoriesQueue for agent inventories
RESULTS_QUEUEresults.controllerQueue consumed by controller
RESULTS_BINDINGresults.*Routing key pattern
AGENT_STALE_MS120000Delay to mark agent as offline
IMAGES_INDEX_PATH/share/_index/images.jsonPath to shared image index
JWT_AGENT_SECRETsupersecret_agentJWT secret for agents
JWT_BROWSER_SECRETsupersecret_browserJWT secret for browsers
PUBLIC_WS_BASEwss://console.openhvx.local/apiBrowser WebSocket endpoint
BROKER_WS_BASEwss://ws.openhvx.localDirect agent WebSocket endpoint

Auth Service

VariableExampleDescription
PORT4000HTTP port
MONGO_URLmongodb://mongo:27017/hvwm_authAuth DB connection
JWT_SECRETchange-meMain signing secret
JWT_EXPIRES8hDefault token lifetime
AUTH_DEBUGtrueEnable verbose logs
JWT_TENANT_ISSauth-service/tenantJWT issuer (tenant)
JWT_TENANT_AUDapi://tenantJWT audience (tenant)
JWT_TENANT_SECRETexample_secretTenant token secret
JWT_TENANT_EXPIRES8hTenant token lifetime
JWT_ADMIN_ISSauth-service/adminJWT issuer (admin)
JWT_ADMIN_AUDapi://adminJWT audience (admin)
JWT_ADMIN_SECRETexample_secretAdmin token secret
JWT_ADMIN_EXPIRES30mAdmin token lifetime
REGISTER_ENABLEDtrueAllow new user registration
REGISTER_API_KEYexample_api_keyOptional registration key

Released under the Apache-2.0 License.