Skip to content

Startup Parameters

These settings live in config.toml and require restart to take effect.

For backend-specific database URL details, see Storage Overview.

Server

TOML keyTypeDefaultDescription
server.hostString127.0.0.1Bind address (use 0.0.0.0 in Docker)
server.portInteger8080Bind port
server.unix_socketString(empty)Unix socket path (overrides host/port)
server.cpu_countInteger(auto)Worker threads (defaults to CPU cores, capped at 32)

Database

TOML keyTypeDefaultDescription
database.database_urlStringshortlinks.dbDatabase URL or file path (backend type inferred from this value)
database.pool_sizeInteger20Pool size (MySQL/PostgreSQL only; SQLite uses built-in pool settings)
database.timeoutInteger30(currently unused; connect/acquire timeout is fixed at 8s)
database.retry_countInteger3Retry count for some DB operations
database.retry_base_delay_msInteger100Retry base delay (ms)
database.retry_max_delay_msInteger2000Retry max delay (ms)

See Storage Backends for URL formats.

Cache

TOML keyTypeDefaultDescription
cache.typeStringmemoryCache type: memory / redis
cache.default_ttlInteger3600Default TTL (seconds)
cache.redis.urlStringredis://127.0.0.1:6379/Redis URL
cache.redis.key_prefixStringshortlinker:Redis key prefix
cache.memory.max_capacityInteger10000In-memory cache max entries

Logging

TOML keyTypeDefaultDescription
logging.levelStringinfoLog level: error / warn / info / debug / trace
logging.formatStringtextOutput format: text / json
logging.fileString(empty)Log file path (empty = stdout)
logging.max_backupsInteger5How many rotated files to keep
logging.enable_rotationBooleantrueEnable rotation (currently daily rotation)
logging.max_sizeInteger100(currently unused; rotation is time-based)

IPC

TOML keyTypeDefaultDescription
ipc.enabledBooleantrueEnable IPC server (required for CLI/TUI communication with a running server)
ipc.socket_pathString(platform default)Custom IPC path (Unix socket / Windows named pipe)
ipc.max_message_sizeInteger65536Max IPC message size in bytes
ipc.timeoutInteger5Default IPC timeout (seconds)
ipc.reload_timeoutInteger30Timeout for reload-type IPC operations (seconds)
ipc.bulk_timeoutInteger60Timeout for import/export IPC operations (seconds)

Notes:

  • Path priority: CLI --socket > ipc.socket_path > platform default. Defaults are Unix ./shortlinker.sock, Windows \\.\\pipe\\shortlinker.
  • On Unix, the IPC socket file permission is fixed to 0600 (owner-only read/write).
  • If ipc.enabled=false, ./shortlinker status and CLI/TUI IPC sync are unavailable; use Admin API POST /admin/v1/config/reload or restart to apply runtime config changes.

GeoIP (startup)

TOML keyTypeDefaultDescription
analytics.maxminddb_pathString(empty)MaxMind GeoLite2-City.mmdb path (optional; preferred when readable)
analytics.geoip_api_urlStringhttp://ip-api.com/json/{ip}?fields=status,countryCode,cityExternal GeoIP API URL fallback ({ip} placeholder)

Notes:

  • Provider selection: when analytics.maxminddb_path is set and readable, MaxMind is used; otherwise it falls back to the external API (analytics.geoip_api_url).
  • The external API provider has a built-in cache (not configurable): LRU max 10,000 entries, TTL 15 minutes (including negative caching on failures). Concurrent lookups for the same IP are singleflighted into one request. HTTP timeout is 2 seconds.
  • The current version initializes a GeoIP provider, but GeoIP lookup is not yet executed in the click-write path, so click_logs.country/city remain null by default.

Released under the MIT License