Configuration

Configuration

Trestle validates configuration before listening. Command-line flags override environment variables, which override conservative defaults.

Process and HTTP

FlagEnvironmentDefault
--listenTRESTLE_LISTEN127.0.0.1:8090
--data-dirTRESTLE_DATA_DIR./data
--shutdown-timeoutTRESTLE_SHUTDOWN_TIMEOUT10s
--log-levelTRESTLE_LOG_LEVELinfo
--trusted-proxiesTRESTLE_TRUSTED_PROXIESnone
--read-header-timeoutTRESTLE_READ_HEADER_TIMEOUT5s
--read-timeoutTRESTLE_READ_TIMEOUT5m
--idle-timeoutTRESTLE_IDLE_TIMEOUT60s
--max-header-bytesTRESTLE_MAX_HEADER_BYTES1048576

Trusted proxies

Provide comma-separated CIDRs only for reverse proxies you administer. Forwarded scheme and client data are ignored from every other immediate peer. Trestle walks a trusted chain from right to left and stops at the first untrusted address.

TRESTLE_TRUSTED_PROXIES=127.0.0.1/32,10.20.0.0/24

Timeout boundaries

The header timeout limits slow header delivery. The read timeout covers request bodies, including uploads, while the idle timeout bounds unused keep-alive connections. Trestle deliberately has no global response write timeout because realtime SSE connections are long lived.

Secret handling

Keep S3 and AWS credentials in an owner-readable environment file or secret manager. Do not put them in service definitions, command lines, support bundles or source control. The data directory is normalized to mode 0700 on Unix.

Shutdown

SIGINT and SIGTERM remove readiness, stop background work and allow in-flight requests to finish within the configured timeout.