Config file location
The config file is located at:APP_DIR is platform-specific, resolved via typer.get_app_dir("LNCrawl"):
| Platform | Default path |
|---|---|
| Linux | ~/.config/LNCrawl/ |
| macOS | ~/Library/Application Support/LNCrawl/ |
| Windows | %APPDATA%\LNCrawl\ |
LNCRAWL_DATA_PATH environment variable to override this directory. See Environment variables for details.
Config file format
The config file is a JSON object with top-level keys for each section:Do not edit the config file while Lightnovel Crawler is running. The application writes to it atomically but reads it on startup.
Using lncrawl config
The lncrawl config command lets you view and modify settings without editing the file directly.
Config sections
app — Application settings
app — Application settings
General application settings.
| Key | Type | Default | Description |
|---|---|---|---|
openai_api_key | string | "" | API key for OpenAI integrations. |
database — Database connection
database — Database connection
Controls the database used to store novels, chapters, and jobs.
Example database URLs:The
| Key | Type | Default | Description |
|---|---|---|---|
url | string | sqlite:///<APP_DIR>/sqlite.db | SQLAlchemy database URL. Supports SQLite, PostgreSQL, and MySQL. |
pool_size | integer | 10 | Number of connections to maintain in the connection pool. |
pool_timeout | integer | 30 | Seconds to wait before giving up on obtaining a connection. |
pool_recycle | integer | 3600 | Recycle connections after this many seconds to prevent stale connections. |
connect_timeout | integer | 10 | Timeout in seconds for establishing a database connection. |
admin_email | string | "admin" | Email address for the default admin account. |
admin_password | string | "admin" | Password for the default admin account. |
DATABASE_URL environment variable overrides the url config key. See Environment variables.crawler — Crawling behavior
crawler — Crawling behavior
Controls how the crawler fetches and processes content.
| Key | Type | Default | Description |
|---|---|---|---|
can_use_browser | boolean | true | Allow the crawler to use a headless browser (Chrome/Selenium) for JavaScript-heavy sites. |
selenium_grid | string | "" | URL of a remote Selenium Grid endpoint. Leave empty to use a local browser. |
ignore_images | boolean | false | Skip downloading images when crawling chapters. |
runner_concurrency | integer | 5 | Number of crawler jobs that can run concurrently. |
runner_cooldown | integer | 1 | Seconds to wait between starting consecutive crawler jobs. |
cleaner_cooldown | integer | 1800 | Seconds between scrubber/cleanup job runs (default: 30 minutes). |
runner_reset_interval | integer | 14400 | Seconds between scheduler restarts (default: 4 hours). |
disk_size_limit_mb | integer | 0 | Maximum disk space in MB for crawled data. 0 means unlimited. |
server — Web server settings
server — Web server settings
Controls the built-in HTTP server and authentication tokens.
| Key | Type | Default | Description |
|---|---|---|---|
base_url | string | "http://localhost:8080" | Public base URL of the server. Used for generating absolute links. |
token_secret | string | auto-generated UUID | Secret key used to sign authentication tokens. Regenerated if not set. |
token_algorithm | string | "HS256" | JWT signing algorithm. |
token_expiry_minutes | integer | 10080 | Token validity in minutes (default: 7 days). |
mail — SMTP email settings
mail — SMTP email settings
Controls outbound email delivery.
| Key | Type | Default | Description |
|---|---|---|---|
smtp_server | string | "localhost" | SMTP server hostname. |
smtp_port | integer | 1025 | SMTP server port. |
smtp_username | string | "" | SMTP authentication username. |
smtp_password | string | "" | SMTP authentication password. |
smtp_sender | string | "" | From address used in outgoing emails. |
CLI flags override config
Some CLI flags set config values for the duration of a single command without persisting them to the file:| Flag | Effect |
|---|---|
--config <path> | Load a specific config file instead of the default. |
--verbose / -l | Increase log verbosity (-l = warn, -ll = info, -lll = debug). |
Resetting config to defaults
To reset all settings to their defaults, delete the config file. Lightnovel Crawler recreates it with default values on the next run.Deleting the config file also regenerates
token_secret, which invalidates any existing authentication tokens.