89 Commits

Author SHA1 Message Date
Estrella Pan
843a014928 perf(backend): 日志修复、gzip、静态缓存头、部分索引命中、TMDB 负缓存与 LRU、镜像预编译
- 日志:basicConfig 加 force=True,避免 mcp 先导入后日志文件为空
- GZipMiddleware(minimum_size=1000),SSE 默认排除
- SPA 依赖为 /assets/ 加 immutable,入口 HTML 加 no-cache
- rename_operation 活动过滤改为 NOT IN,命中 ux_rename_operation_active_target
- TMDB 缓存:否定与回退结果 6 小时 TTL,命中时 move_to_end
- Dockerfile 构建阶段预编译字节码
2026-10-20 16:54:54 +02:00
Estrella Pan
0f2af080af chore(deps): 后端工具链升级到 Python 3.14,路由统一鉴权并清理 black/urllib3/dict 垫片 2026-10-20 10:43:24 +02:00
Estrella Pan
37fa6b4ea5 fix: RSS matching, proxy pool, parser, healthcheck and log issues (#1103 #1104 #1105 #1106 #1108 #1114 #1117)
- match_bangumi_in_list: also accept a torrent whose rebuilt title equals
  the stored title_raw (#1103, #1114)
- download_bangumi / collect_season: drop items whose season or type
  conflicts with the bangumi (#1105)
- request_url: swap in a fresh shared client on PoolTimeout without
  closing the old one (#1104)
- classic parser: Unicode Roman numeral season, strip fullwidth dash
  wrapper (#1108)
- Docker HEALTHCHECK: healthcheck.py reads the configured WebUI port and
  probes IPv4 then IPv6 loopback (#1106)
- scheduler: non-positive interval falls back to 1s; deploy docs cap
  container logs at 10 MB x 3 (#1117)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU9GqKzULrNb7MN5T9TYix
2026-09-19 17:58:17 +02:00
Estrella Pan
c1a0cf8559 perf(docker): shrink image 208MB -> 160MB
Two changes, verified with local builds:

- Drop UV_COMPILE_BYTECODE=1: shipped .pyc files were 51MB. The venv is
  root-owned and the app runs long-lived as 'ab', so bytecode only saved
  a few seconds of import time once per container start. This also
  matches the boot_overlay uv-sync path, which never compiled bytecode.
- mcp[cli] -> mcp: the app only imports mcp.server; the cli extra pulled
  typer/rich/pygments/markdown-it (~14MB) for an unused console script.
  python-dotenv, the extra's other member, is already a direct dep.

Compressed pull size drops 64.2MB -> 48.8MB. Image verified: packages
absent, no __pycache__, 'import main' succeeds; pytest and mypy green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XEnmRvBJL93fAURbRf1koK
2026-07-07 10:13:51 +02:00
Estrella Pan
27c04f5f5d feat(update): sign update bundles (ed25519) and stop root uv sync (P1)
Closes the update-chain trust gap: the sha256 came from the same GitHub
release as the bundle (integrity, not authenticity), and the boot overlay
re-applied ab-writable content as root — including uv sync on an
attacker-controllable lockfile.

- signing: new module/update/signing.py verifies an ed25519 signature;
  public key embedded in the image at /app/ab_update_pubkey.pem (outside
  the overlay-replaceable tree, so it is the trust root). Private key lives
  only in CI (UPDATE_SIGNING_KEY secret).
- updater: discover the .zip.sig asset, verify the signature after the
  sha256 check, reject any release without a signature, retain the verified
  bundle.zip+.sig for boot re-verification, and swap them on rollback.
- boot_overlay: re-verify the signed bundle at every boot and extract the
  module tree / webui dist FROM the verified zip — never from the
  ab-writable current/ tree; read the version from the zip manifest, not
  the ab-writable applied.json; drop to the ab user before any fallback
  uv sync so lockfile build hooks can't run as root; zip-slip guard uses
  is_relative_to (also fixed in updater._safe_extract).
- CI: build.yml signs the bundle with UPDATE_SIGNING_KEY and publishes the
  .zip.sig; the build fails if the secret is unset.
- deps: cryptography made an explicit dependency.

Tests cover bad-signature reject, unsigned-release reject, legacy overlay
without a signed bundle reject, verified-bundle retention, and boot-overlay
signature verification. Full backend suite: 1079 passed.

Ops: run `gh secret set UPDATE_SIGNING_KEY < ~/.autobangumi/update-signing-key.pem`
before the 3.3 release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
2026-07-03 11:15:03 +02:00
Estrella Pan
b34fa62403 feat(update): in-app auto-update via volume-backed overlay
Adds one-click update from the settings page so routine updates no
longer require pulling a new Docker image.

- CI attaches update-bundle-<version>.zip (+ .sha256) to each release:
  backend module tree, built webui, and a manifest; the image bakes
  /app/IMAGE_VERSION as the baseline
- boot_overlay.py (shipped in the image, outside /app/module so it can
  never overwrite its own deciding logic) runs from entrypoint before
  the app starts: if a persisted overlay in /app/config/updates is
  newer than the image it tree-replaces /app/module and /app/dist and
  runs `uv sync` when the lockfile changed; if the image is newer it
  clears the stale overlay. Applied via the config volume, so updates
  survive container recreate; a newer pulled image always wins
- GET/POST /api/v1/update/{check,apply,rollback} (auth-gated, repo
  pinned to EstrellaXD/Auto_Bangumi): check queries GitHub releases
  with a stable/beta channel; apply downloads, verifies sha256, stages,
  promotes current->backup, then exits the process so Docker restarts
  into the overlay; rollback swaps the backup back. Progress streams
  over the existing SSE channel
- Settings card (Log page) shows current/latest, release notes, channel
  toggle, update + rollback, with a restart:unless-stopped requirement
  note; compose examples updated

Requires restart: unless-stopped for self-restart (documented; no
Docker-socket fallback). 1043 backend tests, mypy 0, ruff clean; 135
frontend tests, vue-tsc clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTnuEgR78cBk32bLNKar3z
2026-07-03 09:22:34 +02:00
Estrella Pan
9fafaef494 feat(backend): add unauthenticated /health liveness endpoint
Add GET /health mounted outside the /api prefix so it bypasses
per-route auth and is reachable as a plain liveness/readiness probe.
Returns {status, version, db_ok}, degrading to db_ok=false with a 200
(not a raised exception) on database failure so the probe stays useful
even when the DB is unreachable. Add a Docker HEALTHCHECK that curls it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTnuEgR78cBk32bLNKar3z
2026-07-02 17:39:39 +02:00
EstrellaXD
7b5c8d9ac5 chore: upgrade Python version to 3.13
- Update requires-python to >=3.13 in pyproject.toml
- Update ruff and black target versions to py313
- Update Dockerfile to use python:3.13-alpine
- Add explicit Python 3.13 setup in CI workflow
- Regenerate uv.lock for Python 3.13

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:30:25 +01:00
Estrella Pan
f3505bbef0 fix(docker): remove --no-install-project flag to fix uvicorn import error
The --no-install-project flag causes uv to skip installing dependencies
when package = false is set in pyproject.toml, resulting in
ModuleNotFoundError for uvicorn at container startup.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-24 09:03:20 +01:00
EstrellaXD
9c5474d8e9 feat: migrate backend to uv package manager
Replace pip + requirements.txt with uv for dependency management.

- Multi-stage Dockerfile using ghcr.io/astral-sh/uv builder image
- CI updated to use astral-sh/setup-uv@v4
- Ruff config moved to [tool.ruff.lint] (fixes deprecation)
- Transitive deps removed, missing direct deps added (requests, PySocks, urllib3)
- Database layer migrated to async (AsyncSession + aiosqlite)
- Tests updated to match async database interface

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:56:23 +01:00
EstrellaXD
f296021d93 fix: analyser api error.
eps complete logic.
2023-10-30 20:29:00 +08:00
EstrellaXD
a69d832801 Merge branch 'local_deploy' into 3.1-dev 2023-10-05 00:51:50 +08:00
DDSRem
2fe002bd45 feat: add busybox-suid package 2023-10-04 21:44:53 +08:00
EstrellaXD
1a2f0b058c change: add package. 2023-10-04 21:14:12 +08:00
EstrellaXD
ffdb72ed3d fix: add aio-http for alpine. 2023-10-04 10:49:45 +08:00
EstrellaXD
29c8a8c46f fix: Dockerfile 2023-10-03 23:13:21 +08:00
EstrellaXD
7662f1d024 fix: 番剧收集无法进入数据库的问题。 2023-10-03 21:51:32 +08:00
DDSRem
bc89922aed feat: from s6-overlay change to tini and su-exec 2023-08-28 19:32:26 +08:00
DDSRem
f0bfe844e5 feat: clear pip cache 2023-06-16 15:05:25 +08:00
DDSRem
7478b21b33 feat: optimize project file structure 2023-06-16 15:03:50 +08:00
EstrellaXD
365354f7f7 fix: FastAPI mount problem. 2023-06-15 22:12:46 +08:00
Rewrite0
6c9ae56453 Revert "feat: mount static files for root router" 2023-06-15 21:44:58 +08:00
100gle
6ed02f103d chore: remove unused command 2023-06-15 21:23:33 +08:00
estrella
cbc5f77236 fix: ci problem 2023-06-12 22:30:54 +08:00
EstrellaXD
86a6ece510 fix: 2023-06-07 21:36:41 +08:00
EstrellaXD
77579a5a9c feat: add build webui into ci. Change Dockerfile, add webui in release draft. 2023-06-07 21:01:28 +08:00
EstrellaXD
24f63a7df8 fix: fix Dockerfile path problem 2023-06-07 20:26:20 +08:00
EstrellaXD
efd637182e fix: many bugs 2023-06-01 09:51:07 +08:00
EstrellaXD
7f5447c37c feat: add new ui 2023-05-29 16:28:51 +08:00
DDSDerek
0823e617bf fix: build 2023-05-21 15:23:58 +08:00
DDSRem
9f0a6cc6f1 feat: support armv7 2023-05-20 16:56:49 +08:00
EstrellaXD
87511c391b Fix Web UI 2023-05-13 10:25:19 +08:00
EstrellaXD
a9f3cdd281 temp save 2023-05-02 18:58:56 +08:00
DDSRem
9890365b08 feat: reduce image size 2023-04-29 18:19:45 +08:00
Trim21
7f61a8df5a Update Dockerfile 2023-04-29 17:53:31 +08:00
Trim21
ab8e041e5a Update Dockerfile 2023-04-29 17:53:09 +08:00
Trim21
5e03b41a47 Update Dockerfile 2023-04-29 17:48:36 +08:00
Trim21
79759d57d0 Merge branch '2.6-dev' into remove-lxml 2023-04-29 17:47:41 +08:00
Trim21
1effb84346 slim 2023-04-29 17:32:36 +08:00
Trim21
d63cc8efe2 speed up 2023-04-29 17:16:05 +08:00
Trim21
160088b0c5 remove lxml 2023-04-29 17:13:51 +08:00
DDSRem
3182a2af46 fix: bug 2023-04-29 12:24:04 +08:00
DDSRem
00c93599ee feat: Rewrite docker 2023-04-26 20:12:46 +08:00
EstrellaXD
7dc6d8d8a5 Change Data Model 2023-04-26 18:14:17 +08:00
EstrellaXD
b8906f53f4 2.6.0-beta6 2023-04-24 14:19:53 +08:00
EstrellaXD
6bc7a2dd62 - 新增自定义域名
- 增加连接报错域名提示 #195
- 修复 Dev-debug 开启的错误 #192
- 重做重命名逻辑,支持合集重命名以及文件夹内重命名,支持字幕重命名。
- Fix pytest
2023-04-23 21:49:14 +08:00
EstrellaXD
12309b43b3 Add custom url for mikanani.
Fix eps_complete.py.
2023-04-22 16:29:54 +08:00
EstrellaXD
6ac7de272e Fix GitHub action of docker.yml 2023-03-14 23:43:16 +08:00
EstrellaXD
cc65c07886 Fix RequestContent(), fix renamer.py 2023-03-14 23:11:45 +08:00
EstrellaXD
34216245f7 refactor
- fix rename bug
- temp save
2023-03-14 21:22:55 +08:00