* refactor(ui): replace anchor tags with next/link in SidebarNavLink and UserMenu Update SidebarNavLink to use next/link for navigation instead of anchor tags, ensuring proper routing and improved accessibility in Next.js. Refactor UserMenu to remove legacy Link wrappers and directly use SidebarNavLink for signin and signup links. This streamlines navigation components and aligns with Next.js best practices. * fix(pdf): handle non-zero viewport origins and improve layout model ordering Update normalizeTextItemsForLayout to correctly apply viewport transforms, including non-zero page origins, ensuring accurate mapping of PDF text items to top-left coordinates. Refactor runLayoutModel to implement a custom order sequence builder for layout regions using model order logits, improving region ordering consistency with model semantics. Update related tests to cover viewport transform edge cases. * refactor(pdf): improve text normalization with font ascent and vertical overlap logic Enhance text normalization by incorporating font ascent and descent data to more accurately position glyphs, especially for decorative initials. Update merge logic to better detect line membership using vertical overlap, ensuring drop caps and overlapping glyphs are merged correctly. Extend tests to cover these layout scenarios. * style(range): redesign slider with precision gauge and ruler ticks Revamp the range input to feature a minimalist "precision gauge" style. Introduce a hairline rail, ruler notches for discrete steps, and a slim needle thumb. Add CSS variables and logic for per-instance tick sizing and coloring. Remove bulky inline class-based styling in favor of centralized CSS for improved maintainability and visual clarity. * refactor(ui): modularize PDF loader and range slider visuals Move PDF layout scan visualization and range slider styles into dedicated CSS modules, isolating their styles from the global scope. Integrate PdfLayoutScan component into the PDF viewer loader UI for animated parse progress. Refactor progress bars to use a reusable progress-fill class with animated sheen effect. Update range input to use CSS module for precision gauge styling. * style(reader): remove grid overlay from PdfLayoutScan visualization * refactor(api): add staleness detection for inflight worker operation states Integrate isWorkerOperationStateStale checks into document parse API endpoints to ensure inflight worker operation states are not reused if stale. Introduce helper for staleness detection and corresponding unit tests. Enhance SSE event streaming with keepalive intervals and improve progress acknowledgment error handling. * feat(worker): recover and fail stale in-flight pdf ops on startup Add orphaned operation recovery logic to detect and mark stale in-flight pdf_layout jobs as failed during worker startup. Extend OperationStateStore with listOpStates for state enumeration. Update tests and documentation to cover recovery behavior and new environment variable COMPUTE_PDF_JOB_ATTEMPTS. * refactor(worker): distinguish staleness thresholds for running and queued pdf ops Update orphan recovery logic to apply separate timeouts for 'running' and 'queued' pdf_layout operations. Adjust tests to verify that only stale 'running' operations are failed, while stale 'queued' operations remain untouched. * feat(worker): extend orphan recovery to handle whisper_align ops and improve logging Update orphan recovery to detect and fail stale 'running' whisper_align operations in addition to pdf_layout. Refactor recovery logic to generalize staleness checks across operation kinds and enhance log output with detailed operation info. Expand tests to verify correct handling of both whisper_align and pdf_layout operations in running and queued states. * refactor(control-plane): introduce revision-based CAS for operation state updates Add revision tracking and compare-and-set (CAS) semantics to operation state stores, enabling atomic state transitions and preventing lost updates. Extend the OperationStateStore interface with getOpStateRecord and compareAndSetOpState methods. Update orchestrator and worker runtime to utilize CAS for marking operations as failed only if the state is unchanged. Enhance in-memory, JetStream, and test control plane implementations to support revision logic. This change improves concurrency safety and correctness of operation state management across distributed components. * feat(ui): add parse failure state to PDF layout scan animation Display a distinct "parse halted" visual state in the PDF layout scan component and PDF viewer page when parsing fails. The loader animation is replaced by a static, dimmed page with an alert glyph and updated styling, ensuring users are not misled by an active animation after a failure. CSS and component logic updated to support the new state. * feat(worker): extract orphaned operation recovery to module with periodic sweep Move orphaned operation recovery logic into a dedicated orphan-recovery module, introducing a periodic sweep timer that triggers recovery every 15 seconds while the worker is connected. Refactor runtime to delegate orphan detection and handling to the new module, improving modularity and maintainability. Add unit tests for orphan-recovery to ensure correctness. * fix(ui): adjust PDF viewer layout and update parse loader description * refactor(pdf): streamline layout model region extraction and update test coverage - Replace custom order sequence logic with softmax-based class selection in runLayoutModel - Remove unused sigmoid and buildOrderSequence functions - Simplify detection loop to filter and map regions directly - Add targeted tests for layout model extraction logic - Update CSS animation naming for consistency - Clarify test description and add inline comments for orphan recovery scenario * fix(pdf): add strict validation for layout model output shapes and extend test coverage Add explicit error handling for invalid or inconsistent pred_boxes and logits array lengths in runLayoutModel to prevent silent failures. Expand test suite to verify correct region filtering and error scenarios, ensuring only labeled regions are returned and malformed outputs are handled robustly.
91 lines
4.6 KiB
Text
91 lines
4.6 KiB
Text
|
|
# Logging
|
|
# pretty (default): human-readable logs
|
|
# json: structured logs for log platforms
|
|
# LOG_FORMAT=pretty
|
|
# LOG_LEVEL=info
|
|
|
|
# Local / OpenAI TTS API Configuration (default)
|
|
# Suggest using https://github.com/remsky/Kokoro-FastAPI
|
|
#
|
|
# NOTE: On first boot, the server auto-seeds these values into a "default-openai"
|
|
# admin-managed shared provider (DB-backed, encrypted at rest). After that, the
|
|
# admin UI is authoritative and changing these env vars has no effect. You may
|
|
# remove them once the seed has run. Auth must be configured for this seed path.
|
|
# See Settings → Admin → Shared providers.
|
|
API_BASE=http://localhost:8880/v1
|
|
API_KEY=api_key_optional
|
|
|
|
# Auth configuration (required in v4+)
|
|
BASE_URL=http://localhost:3003 # Externally facing URL for this app (set to LAN IP for access from other devices on the network)
|
|
AUTH_SECRET=some_random_secret_key # Generate with `openssl rand -hex 32`
|
|
AUTH_TRUSTED_ORIGINS=http://localhost:3003,http://127.0.0.1:3003 # Additional trusted origins (BASE_URL is always trusted)
|
|
# (Optional) Allow anonymous auth sessions (default: `false`)
|
|
# USE_ANONYMOUS_AUTH_SESSIONS=false
|
|
# (Optional) Sign in w/ GitHub Configuration
|
|
# GITHUB_CLIENT_ID=
|
|
# GITHUB_CLIENT_SECRET=
|
|
|
|
# (Optional) Comma-separated list of emails that are auto-promoted to admin.
|
|
ADMIN_EMAILS=
|
|
|
|
# (Optional) Backend DB used for server-side metadata (documents/audiobooks) and auth tables.
|
|
# Defaults to SQLite at docstore/sqlite3.db when not set.
|
|
# POSTGRES_URL=
|
|
|
|
# Embedded SeaweedFS weed mini config
|
|
# (Optional) Enable embedded weed mini for local S3-compatible storage (defaults shown below)
|
|
# USE_EMBEDDED_WEED_MINI=true
|
|
# WEED_MINI_DIR=docstore/seaweedfs
|
|
# WEED_MINI_WAIT_SEC=20
|
|
|
|
# S3 storage config (use with embedded weed mini or external S3-compatible storage)
|
|
# (Optional) For embedded weed mini, set explicit keys if you want stable credentials across restarts.
|
|
S3_ACCESS_KEY_ID=
|
|
S3_SECRET_ACCESS_KEY=
|
|
S3_BUCKET=
|
|
# S3_REGION=
|
|
# (Optional) If empty in embedded mode, OpenReader uses BASE_URL host (when set) or detected LAN host.
|
|
# S3_ENDPOINT=
|
|
# S3_FORCE_PATH_STYLE=
|
|
# S3_PREFIX=
|
|
|
|
# (Optional) Library import mode directory (uses /docstore/library by default)
|
|
# IMPORT_LIBRARY_DIR=
|
|
# IMPORT_LIBRARY_DIRS=
|
|
|
|
# Compute worker configuration
|
|
# (Optional) Embedded compute worker (automatic startup) for local compute tasks (defaults shown below)
|
|
# EMBEDDED_COMPUTE_WORKER_PORT=8081
|
|
# EMBEDDED_NATS_PORT=4222
|
|
# EMBEDDED_NATS_MONITOR_PORT=8222
|
|
# EMBEDDED_NATS_STORE_DIR=docstore/nats/jetstream
|
|
# NATS_URL=nats://127.0.0.1:4222
|
|
# COMPUTE_LOG_LEVEL=info
|
|
# COMPUTE_JOB_CONCURRENCY=1
|
|
# COMPUTE_WHISPER_TIMEOUT_MS=30000
|
|
# COMPUTE_PDF_TIMEOUT_MS=300000
|
|
# COMPUTE_PDF_JOB_ATTEMPTS=1
|
|
# COMPUTE_OP_STALE_MS=1800000
|
|
# WHISPER_MODEL_BASE_URL=https://huggingface.co/onnx-community/whisper-base_timestamped/resolve/main
|
|
# PDF_LAYOUT_MODEL_BASE_URL=https://huggingface.co/Bei0001/PP-DocLayoutV3-ONNX/resolve/main
|
|
# (Optional) External compute worker config (see docs/deploy/compute-worker)
|
|
# COMPUTE_WORKER_URL=http://localhost:8081
|
|
# COMPUTE_WORKER_TOKEN=local-compute-token
|
|
|
|
# (Optional) Override ffmpeg binary path used for audio processing
|
|
# FFMPEG_BIN=
|
|
|
|
# (Optional) Test/dev overrides
|
|
# DISABLE_AUTH_RATE_LIMIT=false
|
|
# ENABLE_TEST_NAMESPACE=false
|
|
|
|
# (Optional) Skip automatic startup migrations when set to `false` (default: `true`)
|
|
# RUN_DRIZZLE_MIGRATIONS=true
|
|
# (Optional) Skip automatic filesystem->S3/DB migration pass when set to `false` (default: `true`)
|
|
# RUN_FS_MIGRATIONS=true
|
|
|
|
# (Optional) v4 JSON seed for first-boot runtime config + shared providers.
|
|
# If both are set, RUNTIME_SEED_JSON_PATH is used.
|
|
# RUNTIME_SEED_JSON_PATH=/absolute/path/to/openreader-seed.json
|
|
# RUNTIME_SEED_JSON={"version":1,"runtimeConfig":{"enableUserSignups":true,"restrictUserApiKeys":true,"defaultTtsProvider":"custom-openai","enableTtsProvidersTab":true,"enableAudiobookExport":true,"enableDocxConversion":true,"showAllProviderModels":true,"disableTtsRateLimit":true,"ttsDailyLimitAnonymous":50000,"ttsDailyLimitAuthenticated":500000,"ttsIpDailyLimitAnonymous":100000,"ttsIpDailyLimitAuthenticated":1000000,"ttsCacheMaxSizeBytes":268435456,"ttsCacheTtlMs":1800000,"ttsUpstreamMaxRetries":2,"ttsUpstreamTimeoutMs":285000,"disableComputeRateLimit":true,"computeParseBurstMax":8,"computeParseBurstWindowSec":60,"computeParseSustainedMax":24,"computeParseSustainedWindowSec":600,"maxUploadMb":200,"changelogFeedUrl":"https://docs.openreader.richardr.dev/changelog/manifest.json"},"providers":[{"slug":"default-openai","displayName":"Default (seeded)","providerType":"custom-openai","baseUrl":"http://localhost:8880/v1","apiKey":"api_key_optional","defaultModel":"kokoro","enabled":true}]}
|