32 Commits

Author SHA1 Message Date
Estrella Pan
a421814ab8 chore(release): 准备 4.0.0-beta.1 2026-10-08 17:55:01 +02:00
Estrella Pan
3179c971f5 feat(4.0-P7): ab_sdk 独立打包为 autobangumi-sdk,新增 ab-plugin 命令行与四个契约测试套件
- backend/sdk/pyproject.toml 构建 autobangumi-sdk 轮子(版本取 SDK_VERSION),后端 dev 组可编辑安装,uv run ab-plugin 可用
- 清单解析移入 ab_sdk.manifest(宿主与命令行共用),保留 id 增加 local,新增 check() 与 native_files()
- ab-plugin new / validate / pack / dev:骨架(rename / notifier / search)、校验、确定性打包、链接到本地插件目录并写入 dev_mode
- ab_sdk.testing 新增 DownloaderContract、RenameStrategyContract、NotifierContract、SearchSiteContract;内置下载器、重命名方式、通知渠道与默认搜索站点通过
2026-10-08 14:23:06 +02:00
Claude
94da8fa741 feat(4.0-P1): 插件运行时与 SDK 骨架
- ab_sdk:Plugin[ConfigT] 基类、@hook / @provider / @subscribe、只读的
  PluginContext 协议、事件基类,以及插件单测辅助 ab_sdk.testing;SDK 不依赖
  module.*(有边界测试)
- module/plugin:plugin.toml 清单校验(含 sdk 版本范围),内置 / 本地目录 /
  pip entry point 三种来源的发现与加载(ab_plugin_<id> 包名、支持相对导入、
  vendor 纯 Python 依赖、拒绝原生扩展)
- 扩展点注册表;HookRunner 负责 filter / transform 钩子的优先级与 hook_order
  排序、超时、fail-open / fail-closed,以及按插件熔断
- EventBus:每个订阅者独立的有序队列,失败与超时隔离,计入熔断
- PluginManager:失败时回滚注册;配置变更只重载受影响的插件;失败插件在其
  配置变化后才重试;熔断后自动禁用并发布 PluginDisabled
- 插件私有 KV 存储(plugin_kv 表,迁移 v25)、plugins 配置段、
  GET /api/v1/plugins
- 插件随进程 lifespan 启停,reload_settings 时重新应用插件配置

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 04:37:57 +00:00
Claude
8ccacb6060 refactor(4.0-P0): 清理死代码与 3.x 兼容层
- 4.0 只支持从 3.3.x 升级:version_check 改为完整 semver 比较,数据低于 3.3
  或残留 2.x data.json 时抛 UnsupportedUpgradeError 中止启动;删除 3.0→3.2
  跨版本迁移、data.json 迁移和 Database.migrate()
- 删除 3.2 兼容的 GET 控制端点与 GET /auth/refresh_token
- 删除旧 JWT 与内存会话实现,密码哈希移到 security/password.py
- 删除 experimental_openai 配置节、通知单 provider 旧字段、3.1 配置字段改名迁移
  与 DEFAULT_SETTINGS;normal 重命名方式迁移为 none
- 删除约 70 处无调用方的函数、方法、模型及未使用的 qB API 封装
- CI 新增 vulture 死代码检查(配置见 pyproject.toml 与 vulture_whitelist.py)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoBUPFw7Ty1epuPESdELs1
2026-10-08 04:19:53 +00:00
Estrella Pan
aaa464193b chore(release): prepare 3.3.6
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU9GqKzULrNb7MN5T9TYix
2026-09-19 17:58:18 +02:00
Estrella Pan
f354a63959 chore(release): prepare 3.3.4 2026-07-13 20:36:26 +02:00
Estrella Pan
37d794db0d chore(release): prepare 3.3.4-beta.2 2026-07-13 01:36:29 +02:00
Estrella Pan
86e39811d1 fix(ci): track e2e fixture and sync beta lock 2026-07-10 14:12:00 +02:00
Estrella Pan
18f5fab9db chore: bump version to 3.3.0
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz1EmcTPzjgEpkGQWzb8AQ
2026-07-07 14:24:06 +02:00
Estrella Pan
f2875d9870 chore: release 3.3.0-beta.8
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pz1EmcTPzjgEpkGQWzb8AQ
2026-07-07 11:38:00 +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
c19da52497 chore: release 3.3.0-beta.7
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
2026-07-06 16:38:20 +02:00
Estrella Pan
1dc1eb01b4 chore: release 3.3.0-beta.5
Bump version, uv lock, and CHANGELOG for 3.3.0-beta.5 — ships the
overlayfs EXDEV fix for in-app updates (needs a fresh image to take
effect) and moves the Software Update card into Settings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
2026-07-05 12:31:12 +02:00
Estrella Pan
685711d927 chore: release 3.3.0-beta.4
Bump version, uv lock, and CHANGELOG for 3.3.0-beta.4 — bundles the login
redirect fixes, the container-startup optimizations, and the update-check
feedback improvement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
2026-07-05 09:42:42 +02:00
Estrella Pan
9a0347cb95 chore: release 3.3.0-beta.3
Bump version, uv lock, and CHANGELOG for the 3.3.0-beta.3 beta.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
2026-07-04 07:42:10 +02:00
Estrella Pan
c8f402fd68 chore: bump version to 3.3.0-beta.2
CHANGELOG: fold the unreleased in-app updater + multi-provider LLM
entries into 3.3.0-beta.2 and add the WebUI UX/a11y/perf pass and
post-review backend fixes. docs/changelog/3.3.md (the release body)
gains the beta.2 highlights.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
2026-07-03 16:23:38 +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
93d3f1a947 feat(parser): multi-provider LLM parser with selectable fallback/primary mode
Generalizes the OpenAI-only title parser into a provider-dispatching
LLMParser (openai-compatible / Anthropic / Gemini) with a parse-mode
switch:

- fallback (default): regex parser runs first, LLM only rescues titles
  the regex can't handle — minimal LLM spend
- primary: LLM parses every title first, regex is the safety net so no
  title is dropped on LLM failure

The openai provider takes a base_url, covering any OpenAI-compatible
endpoint (DeepSeek, Ollama, LM Studio, OpenRouter, OneAPI). Anthropic
uses structured JSON output with refusal handling; Gemini uses
response_mime_type=application/json.

Config auto-migrates the legacy experimental_openai section into a new
llm section on load (migrated users get mode=primary, preserving their
original LLM-first behavior); the old section is kept for downgrade
safety and llm.api_key is redacted by the config API. Settings page
swaps the OpenAI panel for an LLM panel with provider + mode selects.

1018 backend tests, mypy 0, ruff clean; 131 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 08:51:01 +02:00
Estrella Pan
820ff29537 refactor(security): migrate JWT/password hashing from jose+passlib to pyjwt+bcrypt
Drop python-jose and passlib in favor of direct pyjwt (with pinned
decode algorithm) and bcrypt 4.x hashpw/checkpw calls. Existing
passlib-generated $2b$ hashes keep validating unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTnuEgR78cBk32bLNKar3z
2026-07-02 18:58:22 +02:00
Estrella Pan
4d7104ca7f chore: bump version to 3.3.0 and add changelog for the architecture refactor
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014w1Z6Nxy6XTRgkFXqPr9Zh
2026-07-02 15:06:42 +02:00
Estrella Pan
ded24b10da fix(downloader): fix qBittorrent SSL connection and rename verification (#923)
- Decouple HTTPS scheme selection from TLS certificate verification:
  `verify=False` always, since self-signed certs are the norm for
  home-server/NAS/Docker qBittorrent setups
- Bump connect timeout from 3.1s to 5.0s for slow TLS handshakes
- Add actionable error messages when HTTPS connection fails
- Fix `continue` → `break` bug in torrents_rename_file verification loop
- Consolidate json imports to top-level
- Add 31 unit tests for QbDownloader constructor, auth, and error handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 19:52:50 +01:00
Estrella Pan
b57d3c49ae feat(security): add security config UI and improve auth/MCP security
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:19:14 +01:00
Estrella Pan
e82e6ab128 fix(ui): fix auth routing, i18n init, and component lifecycle issues
- useAuth: replace watcher with explicit router.replace on login/logout
- useMyI18n: create single i18n instance at module level (avoid dupes)
- usePasskey: detect WebAuthn support synchronously (no onMounted)
- main.ts: import i18n from hook module instead of calling composable
- ab-add-rss: hoist useApi composables outside functions to avoid
  recreating them on each call
- calendar: prevent duplicate refreshes when already refreshing
- downloader: guard interval polling against stale activation state
- router: only mark setupChecked on successful status check
- log store: stop SSE log updates on logout
- i18n: add missing "edit" translation key (en + zh-CN)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:46:56 +01:00
Estrella Pan
fb2dd17c0c feat(mcp): add MCP server for LLM tool integration via SSE
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:42:39 +01:00
Estrella Pan
5f604e94fd perf(logging): optimize logging with rotation, async I/O, and lazy formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:10:56 +01:00
Estrella Pan
3146029d0b fix: add socksio dependency to support SOCKS proxy (#961)
When users have a SOCKS proxy configured (via HTTP_PROXY or ALL_PROXY
environment variables), httpx's AsyncClient automatically tries to use
it but fails without the socksio package installed.

Changed httpx dependency from httpx>=0.25.0 to httpx[socks]>=0.25.0 to
include the socksio package as an extra dependency.

Fixes #961

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-27 06:42:03 +01: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
EstrellaXD
f22f5c657f fix(test): correct TypeScript types in frontend test mocks
- Use RSS type instead of non-existent RSSItem/RSSResponse
- Add expire field to mockLoginSuccess
- Replace offset with episode_offset/season_offset in mockBangumiAPI
- Add needs_review_reason field to mockBangumiAPI
- Add missing RSS fields (connection_status, last_checked_at, last_error)
- Fix generic types in test utilities

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:24:31 +01:00
Estrella Pan
c044b65fef chore: bump version to 3.2.0-beta.9
Fix TypeScript error in ab-search-bar.vue and include pending changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:29:12 +01:00
Estrella Pan
929a88c343 test: add comprehensive test suite for core business logic
Cover RSS engine, downloader, renamer, auth, notifications, search,
config, API endpoints, and end-to-end integration flows. When all
210 tests pass, the program's key behavioral contracts are verified.

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 18:59:18 +01:00
Estrella Pan
a98a162500 feat: fix search, poster serving, and add hover overlay UI for cards
- Fix search store exports to match component expectations (inputValue,
  bangumiList, onSearch) and transform data to SearchResult format
- Fix poster endpoint path check that incorrectly blocked all requests
- Add resolvePosterUrl utility to handle both external URLs and local paths
- Move tags into hover overlay on homepage cards and calendar cards
- Show title and tags on poster hover with dark semi-transparent styling
- Add downloader API, store, and page
- Update backend to async patterns and uv migration changes
- Remove .claude/settings.local.json from tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:20:12 +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