Skip to content

Configuration Reference

Liwan can be configured using a configuration file or environment variables. Configuration files are written in TOML format. Liwan tries to load the configuration file from the current directory (or ~/.config/liwan/liwan.config.toml on linux/macos) by default. Alternatively, you can use the --config flag or the LIWAN_CONFIG environment variable to specify a path to the configuration file.

To generate a default configuration file, you can run liwan generate-config (or liwan generate-config -o OUTPUT_PATH), which will create a liwan.config.toml file in the current directory with the following content:

liwan.config.toml
# The base URL of the Liwan instance
base_url="http://localhost:9042"
# The port to listen on (http)
port=9042
# # Folder to store the database in (Will be created if it doesn't exist)
# # defaults to $HOME/.local/share/liwan/data on linux/macos
# # defaults to ./liwan-data on other platforms
# data_dir="./liwan-data"
# GeoIp settings (Optional)
[geoip]
# # MaxMind account ID and license key
# # Required to automatically download the database and keep it up to date
# maxmind_account_id="MY_ACCOUNT_ID"
# maxmind_license_key="MY_LICENSE_KEY"
# maxmind_edition="GeoLite2-City"
# # If you don't want to automatically download the database, you can specify a path to a local file
# # Otherwise, the database will be downloaded automatically and stored in the data_dir
# maxmind_db_path="/path/to/GeoLite2-City.mmdb"

Configuration Options

TOML KeyEnvironment VariableDefault
base_urlLIWAN_BASE_URL(none)
data_dirLIWAN_DATA_DIR./liwan-data
portLIWAN_PORT9042
geoip.maxmind_account_idLIWAN_MAXMIND_ACCOUNT_ID(none)
geoip.maxmind_license_keyLIWAN_MAXMIND_LICENSE_KEY(none)
geoip.maxmind_editionLIWAN_MAXMIND_EDITIONGeoLite2-City
geoip.maxmind_db_pathLIWAN_MAXMIND_DB_PATH(none)
duckdb.memory_limitDUCKDB_MEMORY_LIMIT(none)
duckdb.threadsDUCKDB_THREADS(core count)