Commit Graph
32 Commits
Author SHA1 Message Date
Emmanuel Ferdman bf6a8996c3 Fix indentation in convert_library.py
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-08-24 11:04:57 -07:00
crocodilestick b05d342db8 Made encoding more explicit at each stage to prevent potential encoding related errors 2025-08-19 12:46:04 +02:00
crocodilestick a719e14a6c SQLite stability and concurrency:
- Added connection timeouts everywhere:
SQLAlchemy engines: connect_args={'timeout': 30}
sqlite3 direct connects: timeout=30 across scripts

- Enabled WAL mode on local disks and made it conditional via an environment flag.
-Added small retry/backoff in read-only UI probes to tolerate transient “database is locked.”

Increased Network share support (NFS/SMB):

- Introduced NETWORK_SHARE_MODE to disable WAL and suppress permission-changing operations that can break on network filesystems.
- Suppressed recursive chown when NETWORK_SHARE_MODE is true:
Python:
scripts/auto_library.py: skip chown for /config and /calibre-library during app.db/new library setup
scripts/ingest_processor.py: skip chown of library in set_library_permissions
scripts/convert_library.py: skip chown of convert-library.log; skip library chown
scripts/kindle_epub_fixer.py: skip chown of epub-fixer.log
cps/updater.py: disable os.chown during updates when flag is enabled
Shell:
scripts/setup-cwa.sh: guard chown of /etc/s6-overlay
root/etc/s6-overlay/s6-rc.d/cwa-init/run: guard initial chown of /config and cps/cache; guard requiredDirs loop

Documentation and configuration:

- README: Added “Network shares and SQLite WAL mode” section; documented that NETWORK_SHARE_MODE disables WAL and chown behavior for safety on network shares.
- docker-compose.yml and docker-compose.yml.dev: Exposed NETWORK_SHARE_MODE (default false) in environment.
Fixed a minor YAML indentation issue during compose edits.

Impacts on the Project:

- Fewer “database is locked” errors due to timeouts, gentle retries, and WAL on local disks.
- Safer behavior on NFS/SMB: WAL disabled and chown suppressed when NETWORK_SHARE_MODE=true.
- Clearer guidance for users via README and compose templates.

[bug] chown failed
Fixes #175
Calibre-Web-automated [bug]
Fixes #530
2025-08-18 12:35:12 +02:00
crocodilestick a978996662 Fixed [bug] Authors interface has display bugs
Fixes #298
Now on all list.html based pages, filtering elements now collapse into a drop down if there would otherwise be too many to display neatly
2025-08-12 15:56:11 +02:00
root 72991c03d6 Add ACSM format 2025-08-10 23:15:11 +00:00
crocodilestick 4dfbcba34d Reverted unwanted changes 2025-08-09 23:42:20 +02:00
crocodilestick 0c891d259f REFACTOR - Moved audiobook.py, auto_library.py, auto_zip.py, convert_library.py, cover_enforcer.py, cwa_db.py, cwa_functions.py, cwa_schema.sql, ingest_processor.py & kindle_epub_fixer.py to the cps dir, changing dependencies as necessary 2025-08-09 20:21:58 +02:00
crocodilestick 9259658821 Fixed spdx headers 2025-08-09 16:30:04 +02:00
crocodilestick d54e34d47f Updated spdx headers to more accurately reflect the current status of the project & it's contributors 2025-08-09 16:25:35 +02:00
crocodilestick d10ba0ca4e Reversed switch from lsiown to chown as it was causing issues for some users 2025-08-02 19:10:52 +02:00
crocodilestick 584e757697 Attempting to fix some of the issues users utilising network shares have with chown by switching out chow commands for lsiown which should be more compatible. Also adding cps.py to repo which was forgotten 2025-08-02 14:50:56 +02:00
crocodilestick 429a007e9d Fixed syntax errors and attempted to make it so that the cover display is centered in dark mode but normal in light mode 2025-07-28 23:25:51 +02:00
crocodilestick 6e2e489539 Fixes to plugin support, changed approach to users adding their plugins and fixes to mobile styling 2025-07-27 12:30:39 +02:00
crocodilestick 3746332a6d Added /config as the HOME env in the ENV variables passed to Calibre to enable plugin functionality 2025-06-02 13:10:25 +02:00
crocodilestick b27b9e9e41 Fixed metadata enforcement with split libraries 2025-05-30 17:58:12 +02:00
crocodilestick 4a04e26616 Fixed universal-calibre-setup script now that the newest versions of Calibre are compatible with CWA and WIP fixes towards split library functionality 2025-05-27 17:46:21 +02:00
crocodilestick 5b0795566a Fixed syntax errors and removed split library user warning 2025-05-27 15:50:06 +02:00
crocodilestick 2756bde5d4 Added first iteration of split library support for CWA 2025-05-26 16:32:05 +02:00
Dee Abson 503f47c6de Fix: Kepub conversion not being passed the full path of the source file. 2025-05-08 18:06:37 -06:00
crocodilestick ab534076b3 Added code to ensure any lof files created by CWA services have the correct permissions and aren't created with root ownership (Issue #241) 2025-02-07 12:25:44 +01:00
crocodilestick 2e7dafeeb9 Fixed logging errors in kindle_epub_fixer and convert_library as well as fixing integration between ingest_processor and convert_library with kindle_epub_fixer 2025-01-06 01:14:00 +01:00
crocodilestick 47e8cf0d66 Major Changes -
- kindle_epub_fixer.py has been completely rewritten to more closely replicate the function of the original JS tool written by innocenat
- Auto backup of files processed by kindle_epub_fixer is now added, enabled by default and able to be turned on or off by the user in the settings panel
- Entries for Files that have been processed by kindle_epub_fixer are now automatically added to cwa.db in a new table called epub_fixes. These entries are now also available to view in the CWA Stats page accessible via the Admin Panel
- CWA Stats pages has been rearranged to have the stats for the functions users care most about at the top and a bug was fixed in the see more pages where the title for all pages was for the enforcement statistics regardless of what was being shown
- Creation of the /config/processed_books archive folders as well the setting of their permissions is now the sole responsibility of the CWA Auto Zipper service
- Major improvements to exception handling in both convert_library and ingest_processor when handling files to improve performance, reliability as well as making it much easier to diagnose user errors
- The default CWA settings are now pulled from the schema instead of being hardcoded into the CWA_DB class
- Plus general refactoring and tidying up of the codebase
2025-01-05 21:26:32 +01:00
crocodilestick df199e9124 Fixed configuration errors with the logs for the epub_fixer and convert_library services as well as improving the formatting of the epub_fixer log to make it easier to read as well as fixing a typo in cwa_functions 2025-01-04 00:27:14 +01:00
crocodilestick 20e485e9fa Changes:
- Fixed pagination css on main page in dark theme
- Added the ability for users to use the Send-to-Kindle epub fixer service on all epubs present in their library from the Web UI as well as from the CLI
- Fixed high CPU usage bug when using the Convert-Library service from the Web UI
- Fixed bug that could occur for new users with the Auto-Zipper service who hadn't yet run the convert_library process or ingested a book
2025-01-03 16:03:14 +01:00
crocodilestick 992fc938ef Attempted to fix DB error that occurs when first updating from V2.1.2 to V3.0.0. Also made improvments to the convert-library user experiance 2024-12-31 22:01:10 +00:00
crocodilestick f06bc09d1a Finished new version of CWA Convert Library function and edited universal-calibre-setup service to no longer produce a verbose otput that has confused users 2024-12-19 17:15:45 +00:00
crocodilestick 254124efcb Adding the ability to cancel a running convert-library process 2024-12-13 16:49:58 +00:00
crocodilestick 580694d01a -Fixed error introduced in cwa_db in commit b160544.
-Added the ability to also see the progress of the subprocesses in the Web UI during convert-library
2024-12-13 13:35:41 +00:00
crocodilestick 93edaa0638 Attempting to improve user experiance when using convert-library from the Web UI 2024-12-12 15:56:52 +00:00
crocodilestick 24cbe2fdb7 Cleaned up numerous python scripts and fixed numerous minor errors 2024-12-12 11:39:00 +00:00
crocodilestick b8260b463f Added a message in the log for when the kindle-epub-fix script has been run on an epub in convert-library.
Rearranged the CWA Settings page to be more logical and improived the description for the Kindle-EPUB-Fix function
2024-12-11 20:07:57 +00:00
crocodilestick 1a63a51c1f NEW FEATURE - Added Kindle-EPUB-Fixer
- Originally developed by [innocenat](https://github.com/innocenat/kindle-epub-fix), this tool corrects the following potential issues for every EPUB processed by CWA:
    - Fixes UTF-8 encoding problem by adding UTF-8 declaration if no encoding is specified
    - Fixes hyperlink problem (result in Amazon rejecting the EPUB) when NCX table of content link to `<body>` with ID hash.
    - Detect invalid and/or missing language tag in metadata, and prompt user to select new language.
    - Remove stray `<img>` tags with no source field.
- This ensures maximum comparability for each EPUB file with the Amazon Send-to-Kindle service and for those who don't use Amazon devices, has the side benefit of cleaning up your lower quality files
- This feature is on by default and is able to be toggled on and off by the user in the CWA Settings panel

Minor Changes:
- All CWA python scripts now conform to the snake_case naming convention
- Minor refactoring of ingest_processor script
2024-12-11 13:59:53 +00:00