Skip to main content

Configuration

Every runtime setting is available as a CLI flag and an environment variable. Flags take precedence when both are set. Defaults apply when neither is set.

Durations use Go's time.ParseDuration syntax (500ms, 5s, 1m, 1h).

Server

FlagEnvironmentDefaultDescription
--listenIMGSRV_LISTEN:8080HTTP listen address for the public API.
--node-nameIMGSRV_NODE_NAMEemptyPrefix used in background worker IDs.
--shutdown-timeoutIMGSRV_SHUTDOWN_TIMEOUT10sGraceful HTTP shutdown deadline.

Logging

FlagEnvironmentDefaultDescription
--log-formatIMGSRV_LOG_FORMATtextLog encoding. One of text, json.
--verbosityIMGSRV_VERBOSITYinfoMinimum log level. One of debug, info, warn, error.

Metrics

FlagEnvironmentDefaultDescription
--metrics-listenIMGSRV_METRICS_LISTEN127.0.0.1:9464Metrics HTTP listen address. Empty disables the metrics listener.
--metrics-pathIMGSRV_METRICS_PATH/metricsHTTP path that serves Prometheus metrics.

PostgreSQL

FlagEnvironmentDefaultDescription
--postgres-urlIMGSRV_POSTGRES_URLemptyPostgreSQL connection URL. Empty skips database startup; routes whose backing adapter is unavailable return 503.

S3-compatible object storage

FlagEnvironmentDefaultDescription
--s3-endpointIMGSRV_S3_ENDPOINTemptyS3-compatible endpoint host and port without a URL scheme.
--s3-bucketIMGSRV_S3_BUCKETemptyBucket used for staging and CAS objects.
--s3-access-key-idIMGSRV_S3_ACCESS_KEY_IDemptyS3 access key ID.
--s3-secret-access-keyIMGSRV_S3_SECRET_ACCESS_KEYemptyS3 secret access key.
--s3-session-tokenIMGSRV_S3_SESSION_TOKENemptyOptional temporary credential session token.
--s3-regionIMGSRV_S3_REGIONemptyOptional region.
--s3-use-tlsIMGSRV_S3_USE_TLSfalseUse HTTPS for the S3-compatible endpoint.
--s3-path-styleIMGSRV_S3_PATH_STYLEfalseUse path-style bucket addressing instead of virtual-hosted-style.

Uploads

FlagEnvironmentDefaultDescription
--upload-ttlIMGSRV_UPLOAD_TTL24hLifetime of a new upload session before it expires if not completed.

CAS promotion worker

The CAS promotion worker verifies completed upload sessions and records the resulting CAS blobs. It is disabled by default.

FlagEnvironmentDefaultDescription
--cas-promotion-enabledIMGSRV_CAS_PROMOTION_ENABLEDfalseRun the in-process CAS promotion worker.
--cas-promotion-poll-intervalIMGSRV_CAS_PROMOTION_POLL_INTERVAL5sIdle poll interval.
--cas-promotion-error-backoffIMGSRV_CAS_PROMOTION_ERROR_BACKOFF5sInitial delay after a failed promotion.
--cas-promotion-error-backoff-maxIMGSRV_CAS_PROMOTION_ERROR_BACKOFF_MAX1mMaximum delay between retries.
--cas-promotion-circuit-breaker-failuresIMGSRV_CAS_PROMOTION_CIRCUIT_BREAKER_FAILURES10Consecutive failures that open the circuit breaker.
--cas-promotion-circuit-breaker-cooldownIMGSRV_CAS_PROMOTION_CIRCUIT_BREAKER_COOLDOWN1mCooldown applied while the circuit breaker is open.

Build metadata

--version prints release version, commit, and build date, then exits. It has no environment-variable equivalent.