feat: manga bookmark sync backend + Bromite userscript

Backend (Go, stdlib net/http + modernc.org/sqlite, CGO-free static binary):
- GET/PUT/DELETE /bookmarks{,/key} + /healthz
- bearer auth (constant-time), CORS origin reflection + 204 preflight
- SQLite store keyed <site>:<series_id>, last-write-wins, server-set updated_at
- httptest + temp-sqlite tests (auth, CORS, round-trip); go vet clean
- multi-stage Dockerfile (distroless static nonroot) + compose (base + prod proxy override)

Userscript (single Bromite-compatible IIFE, no GM_* APIs):
- Asura + Demonic adapters, URL-regex ids + og: title/cover
- Shadow-DOM floating UI, localStorage cache, optimistic sync
- auto-progress (no regress) + manual override; framework-agnostic nav watcher

Live-verified adapters (Playwright, 2026-07-24): asurascans.com /comics/<slug-hash>,
demonicscans.org /manga/<slug> + /title/<slug>/chapter/<n> — corrects the plan's
assumed /series/ paths and asuracomic.net domain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
claude
2026-07-24 16:48:28 +07:00
parent d47a07af46
commit f58d113934
15 changed files with 1494 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Production override: attach to an existing external reverse-proxy Docker
# network instead of publishing a host port. The proxy routes
# manga-api.<domain> -> manga-api:8080 over the shared network.
#
# docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# The network must already exist (created by your proxy stack):
# docker network create proxy # if it doesn't yet
# Override the name with PROXY_NETWORK in .env if yours differs.
services:
manga-api:
# Drop the loopback port publish; traffic comes over the proxy network.
ports: !reset []
networks:
- proxy
networks:
proxy:
external: true
name: ${PROXY_NETWORK:-proxy}