Skip to content

Configuration

All platform configuration is expressed as environment variables. For Docker and manual deployments these live in a .env file; for Kubernetes they are declared under global in values.yaml and injected into pods as environment variables at runtime.

Each subsection below covers one configuration group. Every table lists the values.yaml path (Helm), its .env counterpart, the default value, and a description of what the variable controls.

Secrets

Cryptographic secrets used across the platform for authentication, encryption, and hashing. All five values are auto-generated at install time if left empty — a random string of the appropriate length is produced and stored in a Kubernetes Secret (or written to .env for local setups). In production, supply explicit values and store them in a secrets manager to ensure consistency across restarts and replicas.

.env variablevalues.yaml pathDefaultDescription
ROOT_PASSWORDglobal.secrets.init.rootPasswordrandom 40 charsPassword for the root admin account seeded during db:seed.
CLIENT_SECRETglobal.secrets.init.clientSecretrandom 40 charsSecret for the default OAuth client created during initialization.
AES_SECRETglobal.secrets.aesrandom 64 charsKey used for AES-256 symmetric encryption of sensitive fields stored in the database.
JWT_SECRETglobal.secrets.jwtrandom 64 charsSigning key for all JWT access and refresh tokens issued by the auth service.
BCRYPT_SALTglobal.secrets.bcryptrandom 32 charsSalt used by bcrypt for password hashing.

General

Runtime behavior settings that apply globally to every service and worker process.

.env variablevalues.yaml pathDefaultDescription
NODE_ENVglobal.environments.nodeEnvdevelopRuntime environment. Set to production for deployed instances — affects logging verbosity, error detail, and compiler optimizations.
DEBUGglobal.environments.debugwnx:*Namespace filter for the debug module. wnx:* enables all platform debug output; set to an empty string to silence it.
TIMEOUTglobal.environments.timeout90000Global timeout in milliseconds applied to outbound gRPC calls between the gateway and services.

Internationalization

Controls the default locale and timezone applied to date formatting, number formatting, and time-based operations across all services.

.env variablevalues.yaml pathDefaultDescription
LOCALEglobal.environments.localefaBCP 47 language tag for the default locale (e.g., fa for Persian, en for English).
REGIONglobal.environments.regionIRISO 3166-1 alpha-2 country code used for locale-specific number and currency formatting.
TZglobal.environments.tzAsia/TehranIANA timezone identifier applied to all date/time operations across the platform.

Redis

Redis is used for distributed caching, session storage, rate limiting, and BullMQ job queues. All services and workers share the same Redis instance, isolated from each other via the key prefix.

.env variablevalues.yaml pathDefaultDescription
REDIS_HOSTglobal.environments.redis.hostredis-stack-master.redis.svc.cluster.localHostname of the Redis instance.
REDIS_PORTglobal.environments.redis.port6379Port Redis listens on.
REDIS_PREFIXglobal.environments.redis.prefixwnxKey prefix applied to every Redis entry to prevent collisions in shared instances.
REDIS_PASSWORDglobal.environments.redis.passwordAuthentication password. Leave empty if Redis runs without auth.

MinIO

MinIO provides S3-compatible object storage for the special service, which handles file uploads. Two buckets — public and private — are created during the storage:init step.

.env variablevalues.yaml pathDefaultDescription
MINIO_HOSTglobal.environments.minio.hostminio.minio-tenant.svc.cluster.localHostname of the MinIO server.
MINIO_PORTglobal.environments.minio.port80HTTP port MinIO listens on (typically 80 in-cluster, 9000 for direct access).
MINIO_ACCESS_KEYglobal.environments.minio.accessKeyMinIO access key ID used for authentication.
MINIO_SECRET_KEYglobal.environments.minio.secretKeyMinIO secret access key used for authentication.

MongoDB

MongoDB is the primary data store for all 14 domain services. The platform requires a replica set — change data capture via Debezium depends on the oplog, which is only available in replica set mode.

.env variablevalues.yaml pathDefaultDescription
MONGO_HOSTglobal.environments.mongo.hostpsmdb-server-psmdb-db-rs0.mongodb.svc.cluster.localComma-separated list of host:port pairs for the replica set members.
MONGO_DBglobal.environments.mongo.dbwenexName of the primary MongoDB database.
MONGO_PREFIXglobal.environments.mongo.prefixwnxPrefix applied to all collection names, enabling isolation in a shared database.
MONGO_USERglobal.environments.mongo.userdatabaseAdminMongoDB username with read/write access to the target database.
MONGO_PASSglobal.environments.mongo.passMongoDB password.
MONGO_QUERYglobal.environments.mongo.queryreplicaSet=rs0&loadBalanced=true&authSource=adminAdditional query string parameters appended to the MongoDB connection URI.

PostgreSQL

PostgreSQL is used by the worker layer for durable relational storage: the logger worker persists audit logs and the dispatcher worker stashes failed CQRS webhook deliveries for retry (the cleaner worker purges both on a TTL). Platform domain services — including saga state in the essential service — store their data in MongoDB, not PostgreSQL.

.env variablevalues.yaml pathDefaultDescription
POSTGRES_HOSTglobal.environments.postgres.hostpostgres-cluster-rw.cnpg-system.svc.cluster.localHostname of the PostgreSQL server.
POSTGRES_PORTglobal.environments.postgres.port5432Port PostgreSQL listens on.
POSTGRES_DBglobal.environments.postgres.dbwenexName of the PostgreSQL database.
POSTGRES_PREFIXglobal.environments.postgres.prefixwnxPrefix applied to table names to avoid collisions in a shared database.
POSTGRES_USERglobal.environments.postgres.userpostgresPostgreSQL username.
POSTGRES_PASSWORDglobal.environments.postgres.passwordPostgreSQL password.

Elasticsearch

Elasticsearch stores aggregated logs shipped by the logger worker, full-text search indices for messages, posts, and products (maintained by preserver), and is also used by the APM stack.

.env variablevalues.yaml pathDefaultDescription
ELASTICSEARCH_NODEglobal.environments.elasticsearch.nodehttps://elk-cluster-es-http.elastic-system.svc.cluster.local:9200Full URL (protocol + host + port) of the Elasticsearch node.
ELASTIC_PREFIXglobal.environments.elasticsearch.prefixwnxPrefix applied to all index names created by the platform.
ELASTICSEARCH_USERNAMEglobal.environments.elasticsearch.usernameelasticElasticsearch username for Basic Auth.
ELASTICSEARCH_PASSWORDglobal.environments.elasticsearch.passwordElasticsearch password for Basic Auth.

Kafka

Kafka is the event bus that carries CDC change events from MongoDB (via Debezium) to the worker layer. The Kafka-consuming workers — dispatcher, observer, publisher, logger, and watcher — consume topics under the mongo. prefix. (The preserver worker is an EMQX ExHook gRPC server and does not consume Kafka; the cleaner worker runs on a schedule rather than from Kafka.)

.env variablevalues.yaml pathDefaultDescription
KAFKA_HOSTglobal.environments.kafka.hostwenex-kafka-bootstrap.kafka.svc.cluster.localHostname of the Kafka broker.
KAFKA_PORTglobal.environments.kafka.port9092Port the Kafka broker listens on.
KAFKAJS_NO_PARTITIONER_WARNINGglobal.environments.kafka.noPartitionerWarning1Set to 1 to suppress KafkaJS default partitioner deprecation warnings.

EMQX

EMQX is the MQTT broker used by the conjoint service for real-time messaging. The platform registers an ExHook gRPC server (hosted by the preserver worker) that EMQX calls to authorize publish and subscribe actions before delivering messages.

.env variablevalues.yaml pathDefaultDescription
EMQX_USERNAMEglobal.environments.emqx.usernameadminAdmin username for the EMQX HTTP management API.
EMQX_PASSWORDglobal.environments.emqx.passwordAdmin password for the EMQX HTTP management API.
EMQX_EXHOOK_URLglobal.environments.emqx.exhookUrlhttp://platform-preserver.wenex-platform.svc.cluster.local:8080URL of the platform's gRPC ExHook server that EMQX calls for publish/subscribe authorization.
EMQX_BASE_URLglobal.environments.emqx.baseUrlhttp://emqx-dashboard.emqx-operator-system.svc.cluster.local:18083/api/v5Base URL of the EMQX REST API used to manage rules, connections, and authorization sources.

OpenStreetMap

Optional geospatial services used by the logistic domain. Both can be self-hosted or replaced with any compatible API endpoint.

.env variablevalues.yaml pathDefaultDescription
VALHALLA_API_BASE_URLglobal.environments.valhalla.apiBaseUrlhttp://valhalla.openstreetmap.svc.cluster.localBase URL of the Valhalla routing engine, used for turn-by-turn navigation and route calculation.
NOMINATIM_API_BASE_URLglobal.environments.nominatim.apiBaseUrlhttp://mediagis-nominatim.openstreetmap.svc.cluster.localBase URL of the Nominatim geocoding service, used for address lookup and reverse geocoding.

TURN / STUN

Coturn provides WebRTC relay for NAT traversal, required by the conjoint service for peer-to-peer media streams. Time-limited credentials are generated using the shared secret so that no long-lived passwords are distributed to clients.

.env variablevalues.yaml pathDefaultDescription
COTURN_AUTH_SECRETglobal.environments.coturn.authSecretShared secret used to generate time-limited TURN credentials for WebRTC clients.
COTURN_ICE_SERVERSglobal.environments.coturn.iceServers["turn.wenex.org"]List of TURN/STUN server addresses exposed to WebRTC peers via the ICE negotiation.

OpenTelemetry

Distributed traces and metrics are exported via the OpenTelemetry Protocol (OTLP) over HTTP. Any OTLP-compatible collector is supported — the default configuration targets a Jaeger instance deployed in the cluster.

.env variablevalues.yaml pathDefaultDescription
OTLP_HOSTglobal.environments.otlp.hostjaeger-instance-collector.opentelemetry.svc.cluster.localHostname of the OTLP-compatible collector that receives traces and metrics.
OTLP_PORTglobal.environments.otlp.port4318HTTP port the collector listens on for the http/protobuf OTLP exporter.

Elastic APM

Application Performance Monitoring via the Elastic APM agent. When configured, every service reports transaction timings, error rates, and slow spans to the APM server for analysis in Kibana.

.env variablevalues.yaml pathDefaultDescription
ELASTIC_APM_SERVER_URLglobal.environments.apm.serverUrlURL of the Elastic APM server that ingests performance data.
ELASTIC_APM_SECRET_TOKENglobal.environments.apm.secretTokenSecret token used to authenticate with the APM server.
ELASTIC_APM_VERIFY_SERVER_CERTglobal.environments.apm.verifyServerCertfalseWhether to verify the APM server's TLS certificate. Set to false for self-signed certificates.

Sentry

Error tracking via Sentry. When a DSN is provided, unhandled exceptions and rejected promises from every service and worker are captured and reported, along with request breadcrumbs and performance traces.

.env variablevalues.yaml pathDefaultDescription
SENTRY_DSNglobal.environments.sentry.dsnData Source Name URL for the Sentry project that receives error reports. Leave empty to disable.
SENTRY_MAX_BREADCRUMBSglobal.environments.sentry.maxBreadcrumbs100Maximum number of breadcrumb entries captured per error event.
SENTRY_TRACES_SAMPLE_RATEglobal.environments.sentry.tracesSampleRate0.8Fraction of transactions sampled for Sentry performance monitoring (0.0–1.0).

Cleaner Worker

The cleaner worker runs on a schedule and hard-deletes soft-deleted records once their retention period has elapsed. Each TTL value accepts a human-readable duration string (e.g., 30day, 6months, 2years).

.env variablevalues.yaml pathDefaultDescription
CLEANER_STATS_TTLglobal.environments.cleaner.statsTTL10yearsRetention period for aggregated statistics records.
CLEANER_METRICS_TTLglobal.environments.cleaner.metricsTTL5yearsRetention period for time-series metrics records.
CLEANER_AUDIT_LOGS_TTLglobal.environments.cleaner.auditLogsTTL4yearsRetention period for audit log entries tracking user and system actions.
CLEANER_STASH_LOGS_TTLglobal.environments.cleaner.stashLogsTTL100dayRetention period for stash/debug log entries.
CLEANER_SAGA_STAGES_TTLglobal.environments.cleaner.sagaStagesTTL1yearRetention period for completed saga stage records after a distributed transaction finishes.