Skip to main content
Version: 0.0.37

Configuration

Shisho can be configured via a YAML config file or environment variables.

Config File

By default, Shisho looks for a config file at /config/shisho.yaml. You can override this by setting the CONFIG_FILE environment variable to a different path.

A complete example config file is available at shisho.example.yaml.

Environment Variables

Every setting can be set via an environment variable using the uppercase, underscored version of the config key (e.g., database_file_path becomes DATABASE_FILE_PATH). Environment variables take precedence over config file values.

Settings

Database

SettingEnv VariableDefaultDescription
database_file_pathDATABASE_FILE_PATH/config/shisho.dbRequired. Path to the SQLite database file
database_debugDATABASE_DEBUGfalseEnable SQL query logging for debugging
database_connect_retry_countDATABASE_CONNECT_RETRY_COUNT5Number of connection retry attempts on startup
database_connect_retry_delayDATABASE_CONNECT_RETRY_DELAY2sDelay between connection retry attempts
database_busy_timeoutDATABASE_BUSY_TIMEOUT5sHow long to wait when the database is locked
database_max_retriesDATABASE_MAX_RETRIES5Max retries for database operations on busy/locked errors

Server

SettingEnv VariableDefaultDescription
server_hostSERVER_HOST0.0.0.0Host address to bind the server to
server_portSERVER_PORT3689Port to listen on

Application

SettingEnv VariableDefaultDescription
sync_interval_minutesSYNC_INTERVAL_MINUTES60How often to scan libraries for new content (in minutes)
worker_processesWORKER_PROCESSES2Number of background worker processes
job_retention_daysJOB_RETENTION_DAYS30Days to retain completed/failed jobs before cleanup. Set to 0 to disable

Library Monitor

SettingEnv VariableDefaultDescription
library_monitor_enabledLIBRARY_MONITOR_ENABLEDtrueEnable real-time filesystem monitoring of library paths. When enabled, file changes are detected automatically and trigger targeted rescans. Disable if your library is on a network drive that doesn't support inotify/FSEvents. On Linux, large libraries may require increasing fs.inotify.max_user_watches (see below)
library_monitor_delay_secondsLIBRARY_MONITOR_DELAY_SECONDS60Seconds to wait before processing detected changes. Additional changes during this window reset the timer, batching rapid changes into a single rescan
Linux inotify watch limits

On Linux, the monitor uses inotify which has a per-user watch limit (default 8192 on some distros). Large libraries with many subdirectories may exceed this. To increase it:

# Temporary (until reboot)
sudo sysctl -w fs.inotify.max_user_watches=524288

# Permanent
echo "fs.inotify.max_user_watches=524288" | sudo tee /etc/sysctl.d/99-inotify.conf
sudo sysctl --system

macOS (FSEvents) and Docker containers typically don't need this adjustment.

Cache

SettingEnv VariableDefaultDescription
cache_dirCACHE_DIR/config/cacheDirectory for caching generated files (downloads, extracted CBZ pages, and rendered PDF pages)
download_cache_max_size_gbDOWNLOAD_CACHE_MAX_SIZE_GB5Maximum size of the download cache in GB. Older files are removed automatically (LRU) when the limit is exceeded
pdf_render_dpiPDF_RENDER_DPI200DPI for rendering PDF pages in the viewer. Higher values produce sharper images but larger files. Range: 72-600
pdf_render_qualityPDF_RENDER_QUALITY85JPEG quality for rendered PDF pages (1-100). Higher values produce better quality but larger files

Plugins

SettingEnv VariableDefaultDescription
plugin_dirPLUGIN_DIR/config/plugins/installedDirectory where installed plugins are stored
plugin_data_dirPLUGIN_DATA_DIR/config/plugins/dataDirectory where plugin persistent data is stored (caches, tokens, DB files). Data survives plugin updates; optionally deleted on uninstall with delete_data=true

Enrichment

SettingEnv VariableDefaultDescription
enrichment_confidence_thresholdENRICHMENT_CONFIDENCE_THRESHOLD0.85Confidence threshold (0-1) for automatic metadata enrichment during scans. When a plugin returns a confidence score, results below this threshold are skipped. Per-plugin thresholds override this value.

Supplement Discovery

SettingEnv VariableDefaultDescription
supplement_exclude_patternsSUPPLEMENT_EXCLUDE_PATTERNS[".*", ".DS_Store", "Thumbs.db", "desktop.ini"]Glob patterns to exclude from supplement file discovery. Env var accepts comma-separated values

Docker / Caddy

These environment variables are only relevant when running Shisho in Docker, where Caddy serves as the reverse proxy.

Env VariableDefaultDescription
CADDY_ACCESS_LOG_OUTPUTdiscardCaddy access log output. Set to stdout to enable access logs. Logs are disabled by default to reduce noise
PUID1000User ID for the Shisho process inside the container
PGID1000Group ID for the Shisho process inside the container
STARTUP_TIMEOUT_SECONDS120Seconds to wait for the backend to start before giving up. Increase for slow storage (e.g., NAS devices)
LOG_FORMATconsoleLog output format. Set to json for structured JSON logs (useful for log aggregation)

Authentication

SettingEnv VariableDefaultDescription
jwt_secretJWT_SECRET-Required. Secret key for signing JWT authentication tokens. Use a long, random string (at least 32 characters). Generate one with: openssl rand -base64 32
session_duration_daysSESSION_DURATION_DAYS30How many days a login session remains valid before requiring re-authentication