feat(server): add Audiobookshelf and Calibre-Web Automated migration sources

Extend the migration module beyond Booklore and Grimmory so an existing Audiobookshelf or
Calibre-Web Automated library can be moved into BookOrbit without rebuilding user state by
hand. Audiobookshelf supports both a live API connection and an offline backup file, while
Calibre-Web Automated reads a stopped snapshot of the app and metadata databases.

Match source books by ASIN in addition to ISBN, and batch the ISBN, ASIN, file hash, file
path, and title/author lookups so planning a large library issues a bounded number of
queries rather than one per book. Route the batched author comparison through the shared
accent-insensitive predicate, which now accepts a SQL fragment so a per-row pattern column
is matched the same way a bound literal is.

Extract the shared source connection form into MigrationSourceFields so the modal and the
settings page stay in sync as source types are added, and allow a mapping to skip a source
user instead of forcing every account to be imported.

Closes #986
This commit is contained in:
neon
2026-08-16 05:15:34 +00:00
parent 5527852b4b
commit ec4072e4be
87 changed files with 13988 additions and 698 deletions
+10 -5
View File
@@ -38,10 +38,10 @@ APP_DATA_PATH=../local/data
# Keep unset/false to preserve strict CSP (`script-src 'self'`).
# CSP_ALLOW_CLOUDFLARE_INSIGHTS=false
# OIDC (optional — configure via admin settings UI; these are just for reference)
# OIDC (optional - configure via admin settings UI; these are just for reference)
# OIDC config is stored in the database (app_settings table, key: oidc_config)
# OIDC runtime tuning (optional — uncomment to override defaults)
# OIDC runtime tuning (optional - uncomment to override defaults)
# OIDC_STATE_TTL_SECS=600
# OIDC_DISCOVERY_CACHE_TTL_SECS=3600
# OIDC_JWKS_CACHE_TTL_SECS=3600
@@ -54,14 +54,19 @@ APP_DATA_PATH=../local/data
# App URL (used for building password reset links in emails)
APP_URL=http://localhost:5173
# Email encryption key (optional but recommended — 64-char hex string for AES-256)
# Email encryption key (optional but recommended - 64-char hex string for AES-256)
# Generate with: openssl rand -hex 32
# EMAIL_ENCRYPTION_KEY=
# Migration encryption key (optional but recommended — 64-char hex string for AES-256)
# Encrypts source connection config (database passwords) at rest.
# Migration encryption key (optional but recommended - 64-char hex string for AES-256)
# Encrypts source connection credentials at rest.
# Generate with: openssl rand -hex 32
# MIGRATION_ENCRYPTION_KEY=
# Server-side root containing migration backup files (optional).
# Use a dedicated read-only mount. Backup paths submitted through the migration API
# must be absolute and resolve inside this root.
# MIGRATION_IMPORT_ROOT=/imports
# SMTP for system emails (password reset) is configured via the admin UI,
# not via environment variables.