Skip to content

Environment Variables

API Service (Nitro)

VariableRequiredDefaultPurpose
NITRO_DATABASE_URLYes (prod)postgresql://localhost/librisPostgreSQL connection string
NITRO_REDIS_URLYes (prod)Redis connection for BullMQ + cache
NITRO_INBOX_PATHYes (prod)Directory watched for new book files
NITRO_LIBRARY_PATHYes (prod)Directory for organized book storage
NITRO_API_SECRET_KEYYesSecret for token encryption (min 32 chars)
NITRO_KOSYNC_USERNAMENoKoSync credentials (env var fallback)
NITRO_KOSYNC_PASSWORD_HASHNobcrypt hash of KoSync password

In development, Redis and cache use in-memory storage drivers.

Metadata Sources

API keys for metadata enrichment are stored in the database via Settings > Connections, not as env vars. Both are optional — sources without a configured key are skipped during ingestion.

SourceKey typeWhere to get it
HardcoverBearer tokenhardcover.app/account/api
Google BooksAPI keyGoogle Cloud Console (enable Books API)

Frontend (Nuxt)

VariableRequiredDefaultPurpose
NUXT_SESSION_PASSWORDYesSession cookie encryption (min 32 chars)
NUXT_API_BASE_URLNohttp://localhost:3000Internal BFF-to-API URL
NUXT_PUBLIC_API_PUBLIC_URLNoClient-side API URL (for OPDS/KoSync display)

Test Environment

VariableValuePurpose
NITRO_DATABASE_URLpostgresql://libris_test:libris_test@localhost:5433/libris_testIsolated test DB
NITRO_REDIS_URLredis://localhost:6380Isolated test Redis
NITRO_INBOX_PATH/tmp/test-inboxEphemeral inbox
NITRO_LIBRARY_PATH/tmp/test-libraryEphemeral library
E2E_TEST1Disables rate limiting
E2E_API_KEY(generated)Seeded by global-setup.ts

See .env.test.example for a complete template.