Skip to content

Configuration ​

All configuration is done via environment variables in a .env file at the project root.

Core Settings ​

VariableDescriptionDefault
DATABASE_URLSQLite database file pathsqlite:///./data/librislog.db
CORS_ORIGINSAllowed CORS origins (JSON array or comma-separated)["http://localhost", "http://localhost:5173", "http://localhost:4173"]
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFO
API_KEY_ENCRYPTION_KEYSecret key for API key encryption (must be real, not placeholder)Requires 32+ characters
FORWARDED_ALLOW_IPSTrusted proxy IPs*

Authentication ​

VariableDescriptionDefault
AUTH_COOKIE_NAMESession cookie namelibrislog_session
AUTH_COOKIE_SECUREUse secure cookies (HTTPS only)false
AUTH_COOKIE_SAMESITESameSite cookie attributelax
AUTH_COOKIE_DOMAINCookie domain—

OIDC (Optional) ​

VariableDescription
OIDC_ENABLEDEnable OIDC authentication (true/false)
OIDC_CLIENT_IDOIDC client ID
OIDC_CLIENT_SECRETOIDC client secret
OIDC_WELL_KNOWN_URLOIDC well-known configuration URL

Password Reset / Email (Optional) ​

Password reset is optional. If mail is not configured, the "Forgot password?" link on the login page still appears, but no reset email is sent. A warning is logged at startup when mail is not configured.

VariableDescriptionDefault
MAIL_SERVERSMTP server hostname (e.g. smtp.gmail.com). Leave empty to disable password reset emails.—
MAIL_PORTSMTP server port587
MAIL_USERNAMESMTP username (leave empty for unauthenticated relay)—
MAIL_PASSWORDSMTP password—
MAIL_FROMSender email address—
MAIL_FROM_NAMESender display nameLibrisLog
MAIL_STARTTLSUse STARTTLS (True/False)True
MAIL_SSL_TLSUse implicit SSL/TLS (True/False)False
PUBLIC_APP_URLPublic URL of the frontend (used to build the reset link in emails)http://localhost:5173
PASSWORD_RESET_TOKEN_MAX_AGEReset token validity in seconds3600 (1 hour)

Local Development

For local development, use Mailpit (included in docker-compose.dev.yml):

bash
MAIL_SERVER=localhost
MAIL_PORT=1025
MAIL_STARTTLS=False
MAIL_SSL_TLS=False
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM=noreply@localhost

The Mailpit web UI is available at http://localhost:8025 to inspect sent emails.

Book Import Sources ​

Every search source can be switched on or off individually. At least one source must be able to answer: if every source is disabled, or the only enabled ones are Hardcover and Google Books without their credentials, the backend refuses to start and logs an error naming the variables to set.

VariableDescriptionBuilt-in defaultRecommended
OPEN_LIBRARY_IMPORT_SEARCH_ENABLEDQuery Open Librarytruetrue
BNF_IMPORT_SEARCH_ENABLEDQuery BnF (French national library), title and ISBNtruetrue
INVENTAIRE_IMPORT_SEARCH_ENABLEDQuery Inventaire.io, ISBN onlytruetrue
LIBRARY_OF_CONGRESS_IMPORT_SEARCH_ENABLEDQuery the Library of Congress, title and ISBNtruedepends, see below
DNB_IMPORT_SEARCH_ENABLEDQuery the Deutsche Nationalbibliothek (German National Library), title and ISBNtruetrue
HARDCOVER_IMPORT_SEARCH_ENABLEDQuery Hardcover.app (also needs HARDCOVER_APP_API_TOKEN)truefalse unless a token is set
GOOGLE_BOOKS_IMPORT_SEARCH_ENABLEDAllow the Google Books fallback (also needs GOOGLE_BOOKS_API_KEY)truefalse unless a key is set
GOOGLE_BOOKS_API_KEYGoogle Books API key (see API Keys)empty—
HARDCOVER_APP_API_TOKENHardcover.app API token (see API Keys)empty—

The built-in default is true for every source, so upgrading never silently drops a source that worked before these switches existed. .env.example sets the two keyed sources to false, which is what you want unless you have configured a key or token.

BnF, Inventaire, the Library of Congress, and the German National Library need no API key and are enabled by default.

Hardcover and Google Books cannot answer without credentials. Either way they are handled the same way: if the switch is on and the key or token is empty, the source is reported as skipped in the search progress list and no request is sent, so it never slows a search down. To use either, set its credential and keep the switch on:

bash
GOOGLE_BOOKS_API_KEY=your-key
GOOGLE_BOOKS_IMPORT_SEARCH_ENABLED=true

Inventaire answers ISBN lookups only; it has no title search, so on a title search it is reported as skipped. Google Books runs last, only when every other enabled source returned nothing. Setting GOOGLE_BOOKS_IMPORT_SEARCH_ENABLED=false also turns off the on-demand Search Google Books too button.

Warning: The Library of Congress SRU endpoint (http://lx2.loc.gov:210/LCDB) is only reachable over plain HTTP. Queries are therefore unencrypted and can be observed or altered on the network path. It is the official, documented LC SRU server and returns public bibliographic data only, but set LIBRARY_OF_CONGRESS_IMPORT_SEARCH_ENABLED=false if unencrypted egress to port 210 is not acceptable in your environment. The other sources are all HTTPS.

Cover Scraping ​

VariableDescriptionDefault
COVERS_DIRDirectory for cached cover images./data/covers
THALIA_COVER_SEARCH_ENABLEDEnable Thalia cover searchfalse

Disclaimer: Enabling Thalia cover search uses automated scraping of thalia.de. This likely violates their Terms of Service. The app ships with this feature disabled by default. Enable it only for research purposes and at your own risk. Do not use in production.

Dashboard ​

VariableDescriptionDefault
DASHBOARD_QUOTE_ENABLEDEnable dashboard quotetrue
DASHBOARD_QUOTE_URLQuote API endpointhttps://motivational-spark-api.vercel.app/api/quotes/random
DASHBOARD_QUOTE_CACHE_TTLQuote cache time-to-live (seconds)86400

Telemetry ​

LibrisLog sends minimal, anonymous installation telemetry (see Telemetry) to understand how many installations exist and on which platforms they run. It is an installation census. No user, book, reading, or host data is ever collected.

The telemetry server is open source (github.com/codebude/librislog-telemetry) and the aggregated results are public at metrics.librislog.app.

VariableDescriptionDefault
TELEMETRY_DISABLEDDisable all telemetry (true/false)false
TELEMETRY_ENDPOINTTelemetry API endpointhttps://metrics.librislog.app/api/telemetry
TELEMETRY_TIMEOUT_SECONDSHTTP timeout for telemetry requests10

To opt out entirely:

bash
TELEMETRY_DISABLED=true

Frontend ​

Run Time ​

VariableDescription
BACKEND_ADDRConfigures the upstream address for the Nginx webserver. For the default docker-compose.yml this is set to http://backend:8000. NOTE: Remove trailing / as they might interfere with NGINXs routing behavior.

Build Time ​

VariableDescriptionDefault
PUBLIC_DEFAULT_LOCALEDefault UI language (en, de, zh, es, or fr)en

Import Limits ​

VariableDescriptionDefault
MAX_IMPORT_FILE_SIZE_MBMaximum import file size (MB)100
MAX_IMPORT_ROW_COUNTMaximum import row count10000

Validation Rules ​

  • API_KEY_ENCRYPTION_KEY must be a real secret key (minimum 32 characters). Do not use the placeholder value from .env.example. If left as placeholder or set to a weak value, API key creation will fail.
  • When OIDC_ENABLED=true, all three OIDC variables must be set.
  • GOOGLE_BOOKS_API_KEY and HARDCOVER_APP_API_TOKEN are optional. See API Keys for how to obtain them. The app runs fine without them using Open Library, BnF, Inventaire, the Deutsche Nationalbibliothek, and the Library of Congress. .env.example sets HARDCOVER_IMPORT_SEARCH_ENABLED and GOOGLE_BOOKS_IMPORT_SEARCH_ENABLED to false; set either to true once its credential is configured.
  • At least one book import source must be able to answer. Disabling every source, or enabling only Hardcover and Google Books without their credentials, stops the backend from starting.

Example .env ​

bash
DATABASE_URL=sqlite:///./data/librislog.db
CORS_ORIGINS=["http://localhost", "http://localhost:5173", "http://localhost:4173"]
LOG_LEVEL=INFO
API_KEY_ENCRYPTION_KEY=  # CHANGE ME: generate with `openssl rand -base64 32`
FORWARDED_ALLOW_IPS=*

AUTH_COOKIE_NAME=librislog_session
AUTH_COOKIE_SECURE=false
AUTH_COOKIE_SAMESITE=lax

GOOGLE_BOOKS_API_KEY=your-google-books-api-key
HARDCOVER_APP_API_TOKEN=your-hardcover-token

COVERS_DIR=./data/covers
THALIA_COVER_SEARCH_ENABLED=false

DASHBOARD_QUOTE_ENABLED=true
DASHBOARD_QUOTE_URL=https://motivational-spark-api.vercel.app/api/quotes/random
DASHBOARD_QUOTE_CACHE_TTL=86400

PUBLIC_DEFAULT_LOCALE=en
MAX_IMPORT_FILE_SIZE_MB=100
MAX_IMPORT_ROW_COUNT=10000

# Password reset (optional — leave empty to disable)
MAIL_SERVER=
MAIL_PORT=587
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM=
MAIL_FROM_NAME=LibrisLog
MAIL_STARTTLS=True
MAIL_SSL_TLS=False
PUBLIC_APP_URL=http://localhost:5173
PASSWORD_RESET_TOKEN_MAX_AGE=3600

Released under the MIT License.