Skip to main content

Configuration

Orisun reads environment variables with the ORISUN_ prefix.

Configuration is shared across release binaries, Docker images, and embedded deployments that call config.InitializeConfig(). If you run the binary directly, set these variables in your shell, process supervisor, service manager, or platform secret store.

Required settings

VariableDescription
ORISUN_BACKENDpostgres or sqlite; defaults to postgres.
ORISUN_BOUNDARIESJSON array of boundary definitions.
ORISUN_ADMIN_BOUNDARYBoundary used for admin state.

For PostgreSQL, also set:

VariableDescription
ORISUN_PG_HOSTPostgreSQL host.
ORISUN_PG_PORTPostgreSQL port.
ORISUN_PG_USERPostgreSQL user.
ORISUN_PG_PASSWORDPostgreSQL password.
ORISUN_PG_NAMEPostgreSQL database.
ORISUN_PG_SCHEMASComma-separated boundary:schema mappings.

For SQLite, set:

VariableDescription
ORISUN_SQLITE_DIRDirectory for per-boundary SQLite database files.
ORISUN_NATS_CLUSTER_ENABLEDMust be false for SQLite.

Boundary configuration

ORISUN_BOUNDARIES is a JSON array:

ORISUN_BOUNDARIES='[{"name":"orders","description":"orders"},{"name":"orisun_admin","description":"admin"}]'

For PostgreSQL, every boundary should also appear in ORISUN_PG_SCHEMAS:

ORISUN_PG_SCHEMAS=orders:public,orisun_admin:admin

Common settings

VariableDefaultDescription
ORISUN_GRPC_PORT5005gRPC API port.
ORISUN_ADMIN_PORT8991Admin HTTP port.
ORISUN_ADMIN_USERNAMEadminBootstrap admin username.
ORISUN_ADMIN_PASSWORDchangeitBootstrap admin password.
ORISUN_LOGGING_LEVELINFODEBUG, INFO, WARN, or ERROR.
ORISUN_PG_LISTEN_ENABLEDtrueUse PostgreSQL LISTEN/NOTIFY wake-ups.
ORISUN_POLLING_PUBLISHER_BATCH_SIZE1000Max events drained per publisher read batch.

PostgreSQL pool settings

VariableDefault
ORISUN_PG_WRITE_MAX_OPEN_CONNS25
ORISUN_PG_WRITE_MAX_IDLE_CONNS10
ORISUN_PG_WRITE_CONN_MAX_IDLE_TIME5m
ORISUN_PG_WRITE_CONN_MAX_LIFETIME30m
ORISUN_PG_READ_MAX_OPEN_CONNS50
ORISUN_PG_READ_MAX_IDLE_CONNS25
ORISUN_PG_READ_CONN_MAX_IDLE_TIME5m
ORISUN_PG_READ_CONN_MAX_LIFETIME30m
ORISUN_PG_ADMIN_MAX_OPEN_CONNS5
ORISUN_PG_ADMIN_MAX_IDLE_CONNS2

NATS settings

VariableDefaultDescription
ORISUN_NATS_PORT4224Embedded NATS client port.
ORISUN_NATS_STORE_DIR./data/orisun/natsNATS data directory.
ORISUN_NATS_EVENT_STREAM_MAX_BYTES536870912Per-boundary event stream memory cap.
ORISUN_NATS_EVENT_STREAM_MAX_MSGS-1Per-boundary event stream message cap.
ORISUN_NATS_EVENT_STREAM_MAX_AGE5mRetention overlap for catch-up subscribers.

TLS settings

VariableDefault
ORISUN_GRPC_TLS_ENABLEDfalse
ORISUN_GRPC_TLS_CERT_FILE/etc/orisun/tls/server.crt
ORISUN_GRPC_TLS_KEY_FILE/etc/orisun/tls/server.key
ORISUN_GRPC_TLS_CA_FILE/etc/orisun/tls/ca.crt
ORISUN_GRPC_TLS_CLIENT_AUTH_REQUIREDfalse

Telemetry and profiling

VariableDefaultDescription
ORISUN_OTEL_ENABLEDtrueEnable OpenTelemetry.
ORISUN_OTEL_ENDPOINTlocalhost:4317OTLP gRPC endpoint.
ORISUN_PPROF_ENABLEDfalseEnable pprof.
ORISUN_PPROF_PORT6060pprof port.

Cluster settings

VariableDefault
ORISUN_NATS_CLUSTER_ENABLEDfalse
ORISUN_NATS_CLUSTER_NAMEorisun-nats-cluster
ORISUN_NATS_CLUSTER_HOST0.0.0.0
ORISUN_NATS_CLUSTER_PORT6222
ORISUN_NATS_CLUSTER_ROUTESnats://0.0.0.0:6223,nats://0.0.0.0:6224
ORISUN_NATS_CLUSTER_USERNAMEnats
ORISUN_NATS_CLUSTER_PASSWORDpassword@1