Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

The laurus-server can be configured through CLI arguments, environment variables, and a TOML configuration file.

Configuration Priority

Server and index settings are resolved in the following order (highest priority first):

CLI arguments > Environment variables > Config file > Defaults

Log verbosity is controlled exclusively by the RUST_LOG environment variable (default: info).

For example:

# CLI argument wins over environment variable and config file
LAURUS_PORT=4567 laurus serve --config config.toml --port 1234
# -> Listens on port 1234

# Environment variable wins over config file
LAURUS_PORT=4567 laurus serve --config config.toml
# -> Listens on port 4567

# Config file value is used when no CLI argument or env var is set
laurus serve --config config.toml
# -> Uses port from config.toml (or default 50051 if not set)

TOML Configuration File

Format

[server]
host = "0.0.0.0"
port = 50051
http_port = 8080  # Optional: enables HTTP Gateway

[index]
data_dir = "./laurus_index"

Log verbosity is controlled by the RUST_LOG environment variable (default: info), not through the config file.

Field Reference

[server] Section

FieldTypeDefaultDescription
hostString"0.0.0.0"Listen address for the gRPC server
portInteger50051Listen port for the gRPC server
http_portIntegerHTTP Gateway port. When set, the HTTP/JSON gateway starts alongside gRPC.

[index] Section

FieldTypeDefaultDescription
data_dirString"./laurus_index"Path to the index data directory

Environment Variables

VariableMaps ToDescription
LAURUS_HOSTserver.hostListen address
LAURUS_PORTserver.portgRPC listen port
LAURUS_HTTP_PORTserver.http_portHTTP Gateway port
LAURUS_INDEX_DIRindex.data_dirIndex data directory
RUST_LOGLog filter directive (e.g. info, debug, laurus=debug,tonic=warn)
LAURUS_CONFIGPath to TOML config file

CLI Arguments

OptionShortDefaultDescription
--config <PATH>-cPath to TOML configuration file
--host <HOST>-H0.0.0.0Listen address
--port <PORT>-p50051gRPC listen port
--http-port <PORT>HTTP Gateway port
--index-dir <PATH>./laurus_indexIndex data directory (global option)

Common Configurations

Development (gRPC only)

[server]
host = "127.0.0.1"
port = 50051

[index]
data_dir = "./dev_data"
RUST_LOG=debug laurus serve --config config.toml

Production (gRPC + HTTP Gateway)

[server]
host = "0.0.0.0"
port = 50051
http_port = 8080

[index]
data_dir = "/var/lib/laurus/data"

Minimal (environment variables only)

export LAURUS_INDEX_DIR=/var/lib/laurus/data
export LAURUS_PORT=50051
export LAURUS_HTTP_PORT=8080
export RUST_LOG=info
laurus serve