Skip to content

Configuration

Settings load at startup from the working directory’s .env and process environment; existing environment values win. Parent .env files are not loaded. Restart after changes. Tables list the server defaults.

MB settings use 1,048,576 bytes. Pixel limits use decimal pixels. Booleans use lowercase true or false. Relative paths use the process working directory.

VariableDefaultDescription
PORT3000Listen port on 0.0.0.0
SOURCE_DIRunsetNonempty local root selects local mode instead of S3
S3_ENDPOINTrequired in S3 modeEndpoint; http:// explicitly permits HTTP
S3_REGIONautoProvider region
S3_BUCKETrequired in S3 modeSingle source bucket
S3_ACCESS_KEY_IDrequired in S3 modeAccess key
S3_ACCESS_KEY_SECRETrequired in S3 modeSecret key
STATIC_DIRstaticLocal /static/ root; must exist
OG_WATERMARKassets/og_wm.pngReadable watermark required at startup
RUST_LOGpixerve=infoTracing filter, e.g. pixerve=warn

S3 requests use path-style addressing. The server reads objects; your application uploads them. No arbitrary remote URL source or upload HTTP endpoint is exposed.

VariableDefaultDescription
MAX_CONCURRENT1Positive active-job limit, including source reads
MAX_QUEUE16Additional waiting unique jobs; zero disables waiting
MAX_REQUESTS128Positive concurrent image request limit, including shared waiters
VIPS_CONCURRENCY1Native concurrency, clamped to 1–4
MAX_SOURCE_MB20Positive source byte limit, including raw/static
MAX_INPUT_PIXELS40000000Positive decoded transform input pixel limit
MP_LIMIT12Positive finite output megapixel limit

Requested width/height also have a parser ceiling of 2400 each. Raw/static do not decode images, so only the source byte limit applies to them. The source timeout is fixed at 30 seconds.

VariableDefaultDescription
MEM_CACHE_MB8Weighted RAM capacity; zero disables retention
DISK_CACHE_MB256Disk result capacity; zero disables disk cache
DISK_CACHE_DIR.cache/imagesDedicated writable directory for one process
CACHE_TTL86400Positive result lifetime in seconds
CACHE_IDLE_SECS300Positive RAM idle expiration in seconds

These are not RSS or total-filesystem caps. Disk entries also use a bounded memory index. Do not share a writable cache among instances. Disk-to-RAM promotion keeps the remaining result lifetime.

VariableDefaultDescription
SIGNING_KEYemptyHMAC key; empty selects unsigned open mode
OPEN_MAX_W1280Open output width ceiling
OPEN_MAX_H1200Open output height ceiling
OPEN_MAX_MP3Positive finite open output megapixel ceiling
OPEN_MAX_BLUR10Finite open blur ceiling, at least 0.3
OPEN_ALLOWED_FORMATSavif,webp,jpegComma-separated open transform formats
OPEN_RPS5Positive request count per OPEN_WINDOW for each IP
OPEN_WINDOW60Positive IP window length in seconds
TRUST_PROXYfalseUse CF-Connecting-IP, then X-Real-IP, for the client IP

Open IP limits apply to transforms, including OG, before cache lookup. OG is exempt from open geometry/format policy, while global image/source/job limits remain active. Raw/static do not consume the transform IP bucket. Signed mode does not use this IP limiter, but retains capacity/global image limits.

Trust proxy headers only after restricting origin access and having a trusted proxy replace client-supplied values. X-Forwarded-For is not used for this.

VariableDefaultDescription
PIPELINE_VERSION1Nonempty, at most 32 ASCII letters/digits or -_.
CACHE_VISIBILITYpublicpublic or private; private requires signing key
BROWSER_CACHE_TTL300Mutable browser freshness ceiling, seconds
CDN_CACHE_TTL86400Mutable shared-cache freshness ceiling, seconds
IMMUTABLE_CACHE_TTL31536000Public versioned fixed-output freshness, seconds
STALE_WHILE_REVALIDATE60Mutable stale revalidation allowance, seconds
STALE_IF_ERROR86400Mutable stale error allowance, seconds
CANONICAL_REDIRECTStrueUncached 308 redirects to normalized URLs
PRESETS_ONLYfalseRestrict ordinary transforms to normalized preset options
METRICS_TOKENemptyEmpty disables metrics; otherwise at least 16 characters
ORIGIN_TOKENemptyOptional origin header secret; otherwise at least 16 characters

The five CDN durations accept 0–31,536,000 seconds. Mutable freshness is capped by remaining origin lifetime; browser freshness is capped by edge freshness. Private responses always use private, no-store. Origin and metrics tokens are independent of URL signing. See signing and CDN delivery.