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

Book Import Sources

VariableDescription
GOOGLE_BOOKS_API_KEYGoogle Books API key (see API Keys)
HARDCOVER_APP_API_TOKENHardcover.app API token (see API Keys)

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

Frontend Build

VariableDescriptionDefault
PUBLIC_DEFAULT_LOCALEDefault UI language (en or de)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.

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

Released under the MIT License.