+0
日增长
299
stars
13
forks
3
watchers
14
prs
37
issues
0
releases
README
douban-book-plus-homepage The Douban Book+ homepage, built with VitePress and Vue. This repository contains the website and its supporting APIs, not the browser extension source. Development Use Node.js 22.23.4 (pinned in .node-version) and the pnpm version in package.json. The supported alternatives are Node.js 24.22.1+ on the 24.x line and 26.12.1+ on the 26.x line. Older releases are rejected during installation. Tests use Node's built-in SQLite and TypeScript support. These minimum versions include the Brotli decoder fix for CVE-2026-111497. This requirement covers local development, tests, and Node-based build tools. Cloudflare Pages can select the build runtime from .node-version; any explicit NODE_VERSION setting must also select a patched release. This file does not change the managed runtime used by Pages Functions or Workers. sh pnpm install --frozen-lockfile pnpm run docs:dev pnpm run docs:build builds the website; pnpm run docs:preview serves the static build on port 4173. These VitePress servers do not run the Pages Functions, so feedback is unavailable there and store cards use fallback data. For local Pages Functions, build first, apply local migrations with pnpm run db:migrate:local, then run: sh pnpm exec wrangler pages dev docs/.vitepress/dist --port 8788 Feedback is disabled by default locally. Automated tests mock external services and need no production secrets. Never use production credentials for local tests. Both form APIs require PUBLIC_FORM_HMAC_SECRET: a server-only secret containing 32 cryptographically random bytes encoded as 64 hexadecimal characters. For local API testing, use a separate value in ignored .dev.vars, never public Wrangler variables. Missing or invalid secrets reject submissions with HTTP 503. Before upgrading an existing deployment, follow the HMAC rollout sequence; migration 0009 must run after the HMAC-aware Functions are deployed. Validation and deployment pnpm run check runs type checks, automated tests, the website and Pages Functions builds, and an analytics Worker dry run. It does not deploy or migrate production. The website and feedback/uninstall APIs run on Cloudflare Pages. A separately deployed Worker handles analytics ingestion, extension-store statistics, and scheduled retention cleanup. Both use the configured D1 database. Deploying Pages does not deploy that Worker. Review the relevant runbook before migrations, deployment, or production queries: - Homepage feedback - Uninstall survey - Analytics, store statistics, and scheduled maintenance Keep credentials and the private feedback destination in server-side encrypted secrets. Local environment files are ignored except sanitized .env.example templates; the public Turnstile site key is not a secret.