Configuration
Trestle validates configuration before listening. Command-line flags override environment variables, which override conservative defaults.
Process and HTTP
| Flag | Environment | Default |
|---|---|---|
--listen | TRESTLE_LISTEN | 127.0.0.1:8090 |
--data-dir | TRESTLE_DATA_DIR | ./data |
--shutdown-timeout | TRESTLE_SHUTDOWN_TIMEOUT | 10s |
--log-level | TRESTLE_LOG_LEVEL | info |
--trusted-proxies | TRESTLE_TRUSTED_PROXIES | none |
--read-header-timeout | TRESTLE_READ_HEADER_TIMEOUT | 5s |
--read-timeout | TRESTLE_READ_TIMEOUT | 5m |
--idle-timeout | TRESTLE_IDLE_TIMEOUT | 60s |
--max-header-bytes | TRESTLE_MAX_HEADER_BYTES | 1048576 |
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/24Timeout 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.