Skip to content

Configuration

Configuration is layered (highest priority first):

  1. CLI flags--port 3000
  2. Environment variablesRUSTYFILE_PORT=3000
  3. Config fileconfig.toml
  4. Compiled defaults
OptionCLI FlagEnv VarDefaultDescription
host--hostRUSTYFILE_HOST0.0.0.0Bind address
port--portRUSTYFILE_PORT8080Listen port
root--rootRUSTYFILE_ROOT./dataFilesystem root to serve
data_dir--data-dirRUSTYFILE_DATA_DIR./rustyfile-dataDatabase and persistent data
cache_dir--cache-dirRUSTYFILE_CACHE_DIR{data_dir}/cacheThumbnails, HLS segments, TUS temp files
log_level--log-levelRUSTYFILE_LOG_LEVELinfodebug, info, warn, error
log_format--log-formatRUSTYFILE_LOG_FORMATprettypretty or json
jwt_expiry_hours--jwt-expiry-hoursRUSTYFILE_JWT_EXPIRY_HOURS2JWT token lifetime in hours
min_password_length--min-password-lengthRUSTYFILE_MIN_PASSWORD_LENGTH10Minimum password length
max_password_length--max-password-lengthRUSTYFILE_MAX_PASSWORD_LENGTH128Maximum password length (Argon2 DoS guard)
setup_timeout_minutes--setup-timeout-minutesRUSTYFILE_SETUP_TIMEOUT_MINUTES5First-run setup window duration
cors_origins--cors-originsRUSTYFILE_CORS_ORIGINSsame-originComma-separated allowed origins, or * for any
max_upload_bytes--max-upload-bytesRUSTYFILE_MAX_UPLOAD_BYTES52428800Non-TUS upload body limit (50 MB)
max_listing_items--max-listing-itemsRUSTYFILE_MAX_LISTING_ITEMS10000Max items returned in directory listing
trusted_proxies--trusted-proxiesRUSTYFILE_TRUSTED_PROXIES127.0.0.1Comma-separated IPs for X-Forwarded-For
tus_expiry_hours--tus-expiry-hoursRUSTYFILE_TUS_EXPIRY_HOURS24Hours before incomplete uploads are purged
secure_cookie--secure-cookieRUSTYFILE_SECURE_COOKIEtrueSet Secure flag on auth cookies (requires HTTPS)
blocked_upload_extensions--blocked-upload-extensionsRUSTYFILE_BLOCKED_UPLOAD_EXTENSIONS.php,.sh,.exe,...Comma-separated blocked file extensions for uploads
api_rate_limit--api-rate-limitRUSTYFILE_API_RATE_LIMIT60Max API requests per IP per minute (search, thumbnails, HLS)
config.toml
host = "0.0.0.0"
port = 8080
root = "/srv/files"
data_dir = "/var/lib/rustyfile"
log_level = "info"
log_format = "json"
jwt_expiry_hours = 8
cors_origins = "https://files.example.com"
secure_cookie = true

Place the config file as config.toml in the working directory where RustyFile is launched.

{data_dir}/
├── rustyfile.db # SQLite database
└── cache/
├── thumbs/ # Image thumbnail cache
├── hls/ # HLS segment cache
└── uploads/ # In-progress TUS uploads