KOsync can be configured via environment variables.
They can either be set in the environment or in a kosync.env file that is placed besides the KOsync executable.
Here is a list of configuration variables currently supported:
DATABASE_FILE: Path to the SQLite database. Default./kosync.dbLISTEN_ADDRESS: Address to listen on. Default:8080DISABLE_REGISTRATION: Disable user registration via KOReader. DefaultfalseLOG_TO_FILE: Write logs to file. DefaultfalseLOG_FILE: Path to the log file. Default./kosync.logDEBUG_LOG: Enable debug logging. DefaultfalseENABLE_WEBUI: Enable the web UI if available¹. DefaultfalseENABLE_WEBSOCKET_API: Enable the experimental WebSocket API. DefaultfalseENABLE_TRUSTED_PROXIES: Enable support for trusted proxies. DefaultfalseTRUSTED_PROXIES: Comma separated list of trusted proxies. Default""PROXY_IP_VALIDATION: Enable IP validation for trusted proxies. DefaultfalsePRINT_CRYPTO_KEYS: Print crypto keys used for JWT to stdout. DefaultfalseCRYPTO_KEYS_SEED: Seed for the crypto keys. Must be 32 Characters log. Default""(random)JWT_DURATION: Duration of the JWT validity in seconds. Default21600(6 hours)
¹: Requires a KOsync executable with the WebUI compiled in. See the build documentation.
Example kosync.env with common configuration:
# Only available on current machine instead of all networks
LISTEN_ADDRESS=127.0.0.1:8080
# Allow users to register
DISABLE_REGISTRATION=false
# Enable the web UI so users can view their progress
ENABLE_WEBUI=true
ENABLE_WEBSOCKET_API=true
# Stay logged in for 24 hours
JWT_DURATION=86400
# Write logs to file
LOG_TO_FILE=true
The way KOsync is currently configured, the environment used to start KOsync overrides the configuration file.