Monoize

Configuration

Environment variables for the Monoize process.

Overview

Environment variables control process bootstrap only. Providers, Channels, models, routing policy, transforms, users, and API keys live in the database. Manage them through the dashboard.

Core variables

VariableDefaultPurpose
MONOIZE_LISTEN0.0.0.0:8080HTTP listen address
MONOIZE_DATABASE_DSNsqlite://./data/monoize.dbSQLite or PostgreSQL DSN
DATABASE_URLunsetFallback DSN when MONOIZE_DATABASE_DSN is unset
MONOIZE_METRICS_PATH/metricsPrometheus metrics path
MONOIZE_HTTP_BODY_MAX_BYTES52428800Forwarding request-body limit in bytes
MONOIZE_TRUSTED_PROXY_CIDRS127.0.0.0/8,::1/128Trusted reverse-proxy networks; an explicitly empty value disables trust
MONOIZE_UPSTREAM_PROXY_URLunsetOutbound HTTP(S) proxy for upstream calls; a Channel can override it with proxy_url

Database

Monoize supports SQLite and PostgreSQL. One Monoize process is the supported writer for its business tables.

Example DSN values:

MONOIZE_DATABASE_DSN=sqlite://./data/monoize.db
MONOIZE_DATABASE_DSN=postgres://user:password@host:5432/monoize

Image transform limits

The image_compress_input, image_compress_output, and image_resolve_urls transforms share bounded resources:

VariableDefaultPurpose
MONOIZE_IMAGE_TRANSFORM_MAX_ENCODED_BYTES20971520Maximum encoded source size per image
MONOIZE_IMAGE_TRANSFORM_MAX_PIXELS40000000Maximum decoded pixel count per image
MONOIZE_IMAGE_TRANSFORM_MAX_CONCURRENCY2Concurrent encode operations
MONOIZE_IMAGE_TRANSFORM_CACHE_DIR${TMPDIR}/monoize/image-transform-cacheCache directory
MONOIZE_IMAGE_TRANSFORM_CACHE_TTL_SECONDS3600Cache entry lifetime
MONOIZE_IMAGE_TRANSFORM_CACHE_MAX_FILES2048Maximum cache entries
MONOIZE_IMAGE_TRANSFORM_CACHE_MAX_BYTES536870912Maximum total cache size
MONOIZE_IMAGE_TRANSFORM_CACHE_MAX_ENTRY_BYTES33554432Maximum size per cache entry

A source image above a limit passes through unchanged.

Request capture limits

Request capture obeys these process-level bounds:

VariableDefaultPurpose
MONOIZE_REQUEST_CAPTURE_MAX_ATTEMPTS16Captured upstream attempts per request
MONOIZE_REQUEST_CAPTURE_MAX_FRAMES4096Captured stream frames per request
MONOIZE_REQUEST_CAPTURE_MAX_FRAME_BYTES262144Bytes per captured frame
MONOIZE_REQUEST_CAPTURE_MAX_SESSION_BYTES16777216Bytes per captured request

Enable capture in the dashboard. See Request Logs.

Primary/replica deployment

Monoize can run as one writable primary plus read-only replicas that share one PostgreSQL database. Replicas serve /v1/** traffic only. They ship request logs and billing deltas to the primary over an authenticated internal API.

VariableDefaultPurpose
MONOIZE_NODE_ROLEprimaryprimary or replica
MONOIZE_PRIMARY_INTERNAL_URLrequired on replicasBase URL of the primary for metering shipment
MONOIZE_REPLICA_TOKENunsetShared secret; required on replicas, enables the ingest endpoint on the primary
MONOIZE_CONFIG_POLL_INTERVAL_SECONDS5Replica config poll interval
MONOIZE_METERING_SHIP_INTERVAL_SECONDS10Replica metering shipment interval
MONOIZE_METERING_SHIP_BATCH_MAX_ENTRIES500Per-batch entry cap (hard cap 2000)
MONOIZE_REPLICA_METERING_SPOOL_DIR./data/replica-metering-spoolDurable delta spool directory

Failover is manual: promote a replica by switching its role and restarting the process.

On this page