Adding support for an external CloudFlare bypasser service and
introducing a new Docker image build with a dedicated target.
Key Changes
- Added `cloudflare_bypasser_external.py` for external bypasser
integration.
- Updated Docker Compose files to support the new service.
- Introduced a new Docker target for building a separate image for the
external bypasser.
- Refactored relevant modules to utilize the external bypasser when
configured.
- Documentation and configuration updates to reflect new options and
Docker targets.
Impact
- Users can now choose between internal and external CloudFlare
bypassing.
- New Docker image and target streamline deployment of the external
bypasser.
- Improved modularity and maintainability.
- No breaking changes for existing workflows.
Testing
- Manual and E2E tests performed for both bypasser modes.
- Docker Compose setups and new image build verified for development and
production.
Notes
Please review the new configuration options and Docker targets. Update
your environment and deployment scripts as needed. Feedback and
suggestions are welcome!
Changed intermediate download file naming in backend.py to use
.crdownload extension. Refactored URL selection logic in book_manager.py
to adjust order and inclusion based on Cloudflare bypass and donator
key. Added extra Chromium arguments in cloudflare_bypasser.py to ignore
certificate and SSL errors for improved bypass reliability.
Added details to fix "database locked" error for anyone using a cifs
share for their library under volumes. nobrl option needs to be added to
the mount line in your fstab file. e.g. //192.168.1.1/Books /media/books
cifs credentials=.smbcredentials,uid=1000,gid=1000,iocharset=utf8,nobrl
In response to #184, and for my own desperate need for PDFs, I
implemented this change.
The UI needs some tweaking, the functionality looks complete.
Before this pull request is merged, I'm modifying my docker compose as
follows to use the version that includes format options:
```diff
services:
calibre-web-automated-book-downloader:
- image: ghcr.io/calibrain/calibre-web-automated-book-downloader:latest
+ build:
+ context: https://github.com/mruijzendaal/calibre-web-automated-book-downloader.git
```
@calibrain Could you adjust the UI such that this fits better with the
rest of the application? I'm not well-versed with UIKit. Thanks in
advance for considering this pull request!
### Problem
The current `HEALTHCHECK` uses a custom script that fails on any non-2xx
HTTP response. When the API returns a `401 Unauthorized` status (a
common and valid case), the container is incorrectly marked as
`unhealthy`, even though the web server is running perfectly.
### Solution
This PR replaces the custom `pyrequests` script with a standard `curl`
command. The new `HEALTHCHECK` now only verifies that the server is
reachable and responding to connections, regardless of the HTTP status
code.
`curl` is used instead of patching the existing script because it is the
standard, most robust, and simplest solution for this type of check in a
Docker environment. It removes a custom dependency and follows a
well-understood pattern.
This change ensures the container's health status accurately reflects
the state of the server process, improving reliability for orchestration
platforms.
This commit adds user authentication, using Calibre-Web's app.db as its
authentication source, as requested in #56. It uses @prinzpi's
[comment](https://github.com/calibrain/calibre-web-automated-book-downloader/issues/56#issuecomment-2919335169)
as a starting point, but integrates the logic directly into the app.
This requires the user to specify the environment variable CONFIG_ROOT,
set to Calibre-Web's config directory (the directory that contains the
app.db database that holds the user's authentication information).
If the user does not wish to add authentication, they can simply leave
CONFIG_ROOT unset, or not pointing at Calibre-Web's app.db directory.