Skip to content

Commit 3a66734

Browse files
Merge branch 'main' into patch-1
2 parents c266aba + c9e07cc commit 3a66734

73 files changed

Lines changed: 7072 additions & 1698 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ Pluggable providers in `cps/metadata_provider/`:
186186
- `CWA_WATCH_MODE`: Force polling watcher (`poll`) or inotify (default)
187187
- `HARDCOVER_TOKEN`: API key for Hardcover metadata provider
188188
- `COOKIE_PREFIX`: Custom prefix for session cookies
189+
- `TRUSTED_PROXY_COUNT`: Number of proxies to trust for X-Forwarded-* headers (default: 1, use 2+ for CF Tunnel + reverse proxy)
189190

190191
## Common Pitfalls
191192
1. **Don't import SQLite on main thread**: Always use `init_db_thread()` in background tasks
@@ -195,6 +196,7 @@ Pluggable providers in `cps/metadata_provider/`:
195196
5. **WAL mode errors**: Usually means network share deployment without `NETWORK_SHARE_MODE=true`
196197
6. **Port binding**: Ports below 1024 need `cap_add: [NET_BIND_SERVICE]` in docker-compose
197198
7. **Calibre plugins**: Requires `customize.py.json` in `/config/.config/calibre/` to register
199+
8. **Session protection errors**: Behind multiple proxies? Set `TRUSTED_PROXY_COUNT` to match your proxy chain depth
198200

199201
## Version Management
200202
- **Installed version**: `/app/CWA_RELEASE` (baked at build time)

.github/workflows/tests.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,18 @@ jobs:
3333
fast-tests:
3434
name: Fast Tests (Smoke + Unit)
3535
runs-on: ubuntu-latest
36+
env:
37+
PYTHONDONTWRITEBYTECODE: '1'
3638

3739
steps:
3840
- name: Checkout code
3941
uses: actions/checkout@v4
42+
43+
- name: Remove Python bytecode and pycache
44+
run: |
45+
echo "Removing any leftover .pyc and pycache"
46+
find . -name '__pycache__' -type d -print -exec rm -rf {} +
47+
find . -name '*.pyc' -type f -print -delete
4048
4149
- name: Set up Python 3.13
4250
uses: actions/setup-python@v5
@@ -136,10 +144,15 @@ jobs:
136144
pip install -r requirements.txt
137145
pip install -r requirements-dev.txt
138146
139-
- name: Pull/cache Docker images
140-
run: |
141-
docker pull doubleuynn/calibre-web-automated:latest || true
142-
docker pull python:3.13-slim || true
147+
- name: Build Docker image
148+
uses: docker/build-push-action@v5
149+
with:
150+
context: .
151+
push: false
152+
load: true
153+
tags: crocodilestick/calibre-web-automated:latest
154+
cache-from: type=gha
155+
cache-to: type=gha,mode=max
143156

144157
- name: Run Docker integration tests
145158
run: |
@@ -151,6 +164,7 @@ jobs:
151164
--junitxml=integration-results.xml
152165
env:
153166
CWA_TEST_PORT: "8083" # CI uses production default port
167+
CWA_TEST_IMAGE: "crocodilestick/calibre-web-automated:latest"
154168
timeout-minutes: 30 # Kill if stuck
155169

156170
- name: Upload test results

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ docs/
2626
test_venv
2727
cwa.code-workspace
2828

29+
30+
2931
# Test Scripts
3032
DEV
3133
*/REFERENCE
@@ -80,6 +82,7 @@ htmlcov/
8082
.cache
8183
nosetests.xml
8284
coverage.xml
85+
coverage.md
8386
*.cover
8487
*.py,cover
8588
.hypothesis/
@@ -156,13 +159,14 @@ celerybeat.pid
156159
*.sage.py
157160

158161
# Environments
159-
.env
162+
*.env
160163
.venv
161164
env/
162165
venv/
163166
ENV/
164167
env.bak/
165168
venv.bak/
169+
tmp/
166170

167171
# Spyder project settings
168172
.spyderproject
@@ -193,4 +197,7 @@ cython_debug/
193197
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
194198
# and can be added to the global gitignore or merged into this file. For a more nuclear
195199
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
196-
#.idea/
200+
#.idea/
201+
202+
# Dev instance files for testing in the same folder
203+
instance/

CONTRIBUTORS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CONTRIBUTORS
22

33
This file is automatically generated. DO NOT EDIT MANUALLY.
4-
Generated on: 2025-12-02T08:25:18.397010Z
54

65
Upstream project: https://github.com/janeczku/calibre-web
76
Fork project (Calibre-Web Automated, since 2024): https://github.com/crocodilestick/calibre-web-automated
@@ -304,7 +303,7 @@ Copyright (C) 2024-2025 Calibre-Web Automated contributors
304303
- zhiyue (1 commits)
305304
# Fork Contributors (crocodilestick/calibre-web-automated)
306305

307-
- crocodilestick (797 commits)
306+
- crocodilestick (796 commits)
308307
- jmarmstrong1207 (73 commits)
309308
- demitrix (30 commits)
310309
- sirwolfgang (29 commits)

0 commit comments

Comments
 (0)