Configuration
Reference for lific.toml discovery, sections, values, defaults, and command line overrides.
Lific reads TOML configuration from lific.toml. Every section and key is optional. Missing values use built-in defaults.
File discovery
Lific uses the first configuration file that exists in this order.
- The path passed with
--config <PATH>. This path is used alone. Lific does not search other locations. ./lific.tomlin the current directory.- The user configuration directory.
- The system configuration directory.
User and system paths vary by platform.
| Platform | User path | System path |
|---|---|---|
| Linux | ~/.config/lific/lific.toml, respecting XDG_CONFIG_HOME | /etc/lific/lific.toml |
| macOS | ~/Library/Application Support/lific/lific.toml | /Library/Application Support/Lific/lific.toml |
| Windows | %APPDATA%\lific\lific.toml | %ProgramData%\lific\lific.toml |
A file that exists but cannot be read or parsed is a fatal error. Lific stops and names the file and the error; it does not fall through to the next location. Unknown keys are rejected, so a typo such as allow_signupp fails instead of being ignored. An explicit --config path that does not exist is also an error. If automatic discovery finds no file, Lific uses its built-in defaults.
Defaults do not create a database. Ordinary local commands refuse a missing database and name the expected path. Run lific init first, restore a backup, or use the explicit container bootstrap. lific doctor can diagnose an absent or unreadable config; it skips checks that depend on that config rather than silently using defaults.
Relative database.path values resolve relative to the directory containing the selected configuration file. A relative backup directory then resolves relative to the database directory.
Command line overrides
The following command line flags override configuration values.
| Flag | Effect |
|---|---|
--config <PATH> | Selects the configuration file and disables automatic discovery. |
--db <PATH> | Overrides database.path for the command. |
lific start --host <HOST> | Overrides server.host for that server process. |
lific start --port <PORT> | Overrides server.port for that server process. |
src/config.rs does not define environment variable overrides for lific.toml keys. Other commands use environment variables for their own inputs. For example, lific doctor --key can use LIFIC_API_KEY, and import commands can use source-specific credentials.
start --init-if-missing reads LIFIC_INIT_ADMIN_NAME and LIFIC_INIT_ADMIN_PASSWORD to create the first administrator on a fresh instance. These are bootstrap inputs, not general overrides of configuration or existing accounts. Multi-instance MCP uses a separate TOML file for server aliases and credential sources.
Default configuration
This is the built-in default configuration. Optional server keys are omitted because their default is unset.
[server]
host = "0.0.0.0"
port = 3456
cors_origins = []
trusted_proxies = []
[database]
path = "lific.db"
[backup]
enabled = true
dir = "backups"
interval_minutes = 60
retain = 24
[log]
level = "info"
[auth]
allow_signup = true
required = true[server]
| Key | Type | Default | Description |
|---|---|---|---|
host | string | "0.0.0.0" | Address used by lific start for the TCP listener. |
port | unsigned 16-bit integer | 3456 | TCP port used by lific start. |
public_url | optional string | unset | Public base URL. Lific uses it as the OAuth issuer. lific connect uses it to derive the remote MCP URL. |
cors_origins | array of strings | [] | Allowed browser CORS origins. An empty array allows any origin. |
trusted_proxies | array of strings | [] | Isolated IP addresses or CIDR ranges trusted to supply client IP proxy headers. Invalid values stop server startup. |
mcp_path_token | optional string | unset | Enables an unauthenticated MCP endpoint at /mcp/<token>. The path token is the credential. |
mcp_path_user | optional string | unset | Selects the username attributed to requests through mcp_path_token. When unset, Lific uses the first administrator if one exists. |
Use an HTTPS URL for public_url when Lific is exposed through a public HTTPS endpoint. The server includes the configured hostname in its MCP host allowlist for reverse proxy requests.
trusted_proxies identifies proxy hops, not trusted clients. Forwarding headers are ignored unless the immediate TCP peer is in this list. For a trusted peer, Lific walks X-Forwarded-For from right to left, skips configured proxy addresses, and uses the first untrusted address as the client IP. It uses X-Real-IP only when X-Forwarded-For is absent. Malformed or entirely trusted chains fall back to the TCP peer, and IPv4-mapped IPv6 addresses are normalized. List every proxy layer you operate; do not add client networks merely because they appear in a header.
mcp_path_token bypasses API key and OAuth authentication. Anyone who knows the resulting URL can use the endpoint. Use a long random token and HTTPS when this key is configured.
[database]
| Key | Type | Default | Description |
|---|---|---|---|
path | path string | "lific.db" | Path to the SQLite database file. Relative paths resolve beside the selected configuration file. |
The attachment directory is named attachments and is stored beside the database file.
A relative --db path is resolved against the current working directory. lific init --db <PATH> records the resulting absolute path in its config, so later commands select the same database regardless of their working directory. It refuses a conflicting path already named by the selected config.
[backup]
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enables automatic backup archives when the HTTP server starts. |
dir | path string | "backups" | Backup directory. An absolute path is used directly. A relative path resolves beside the database file. |
interval_minutes | unsigned integer | 60 | Interval between automatic backups, in minutes. |
retain | unsigned integer | 24 | Maximum number of backup artifacts to retain. The oldest matching artifacts are removed first. |
audit_retention_days | optional unsigned integer | unset | Number of days of audit log history to keep. Rows older than the window are deleted at the end of each backup cycle. Unset or 0 keeps history forever. |
Automatic backups use the same archive format as lific dump.
[log]
| Key | Type | Default | Description |
|---|---|---|---|
level | string | "info" | Lific log level. The documented levels are trace, debug, info, warn, and error. |
[auth]
| Key | Type | Default | Description |
|---|---|---|---|
allow_signup | boolean | true | Initial self-service signup setting. Lific seeds the database-backed instance setting from this value when it first creates the setting. Later changes through instance settings are stored in the database. |
required | boolean | true | Requires a bearer credential on REST and MCP requests. |
When required = false, a request with no credential is treated as an operator request. In the web UI, the browser automatically signs in as the first administrator; an instance with no accounts shows signup instead, so an attribution identity can be created. A request with an invalid credential still fails authentication.
Lific refuses to start with required = false or web_auto_login enabled if [server] host is not loopback, or if a nonempty server.public_url cannot be identified as loopback or private-network. Public DNS names and unparseable URLs fail this check. A loopback bind alone does not exempt a public URL.
secure_cookies is not a TOML key. Setting it under [auth] is now an unknown-key error; remove it if an older configuration file carries it. Lific derives the runtime value at startup: false only when server.public_url explicitly begins with http://, true for HTTPS and for an unset public URL.
What lific init writes
On a fresh install, lific init resolves an auth mode and edits the configuration file in place, leaving every other section and setting alone.
| Mode | [auth] required | [server] host | web_auto_login | First administrator |
|---|---|---|---|---|
login-free | false | 127.0.0.1 | enabled | passwordless |
passwords | true | unchanged | disabled | password you choose |
web_auto_login lives in the database rather than in lific.toml; change it later with lific instance set --auto-login <BOOLEAN>. Enabling it through the CLI checks the selected configuration using the same rule as startup and the web settings page. Disabling it remains available for recovery. Login-free mode writes a loopback bind; changing that bind or adding a public URL can make the instance refuse to start.
Example public configuration
This example sets an external HTTPS URL and restricts browser CORS requests to one origin. Replace the example values with values for the deployment.
[server]
host = "127.0.0.1"
port = 3456
public_url = "https://lific.example.com"
cors_origins = ["https://lific.example.com"]
trusted_proxies = []
[database]
path = "/var/lib/lific/lific.db"
[backup]
enabled = true
dir = "/var/backups/lific"
interval_minutes = 60
retain = 24
[log]
level = "info"
[auth]
allow_signup = true
required = true