docs: bring the runbook, READMEs and notes up to date
- operations.md: verification gate setup (bot token, Transform Rule, header check, GATE_SECRET last, smoke tests, off switch); Web Analytics is injected by the zone (checked live), not a build token; staging is deployed by hand from any branch; a release checklist replaces the finished v4 release order; the unused repo secrets can go. - CLAUDE.md: gate, chart and changelog notes, three new gotchas, current counts, .rpm, announce-discussion.yml is local, current state. - READMEs (EN/VI): the quick check, list layout on phones, .rpm, TanStack Query only, the build monitor, cf_build_status.sh. - dev_env (EN/VI): GATE_* secrets, PKCS#1 keys work as downloaded. - webapp/README, TAURI.md, THIRD_PARTY.md, CONTRIBUTING (EN/VI): lazy routes, .rpm, Cargo.lock is committed, squash or merge commit. - _headers: caching for favicon.svg and the web manifest; comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
251369ede6
commit
7b73db9697
14 files changed
+166
-78
No files matched your search
@@ -8,7 +8,7 @@ A curated, auto-updating catalog of free itch.io games, published at **https://f
|
||||
everyone; the old github.io URL only redirects). Three layers share one JSON catalog:
|
||||
|
||||
1. **Python pipeline** — the data layer (GitHub Actions).
|
||||
- `data_game/game_info_NNN.json` — chunked records, max 500 per file, 2,681 games as of Sept 2026. Serialization is fixed: `json.dumps(..., ensure_ascii=False, indent=4)`, no trailing newline (`json_io.dumps`) — the Worker port (`webapp/worker/catalog.ts`) emits identical bytes (`tests/fixtures/golden/`).
|
||||
- `data_game/game_info_NNN.json` — chunked records, max 500 per file, 2,811 games on 2026-09-24. Serialization is fixed: `json.dumps(..., ensure_ascii=False, indent=4)`, no trailing newline (`json_io.dumps`) — the Worker port (`webapp/worker/catalog.ts`) emits identical bytes (`tests/fixtures/golden/`).
|
||||
- `data_game/index.json` — chunk manifest (total + per-file counts). `data_game/count_history.json` — date-keyed `{date,total}` series ("games over time" chart). `scripts/deleted_games.json` — removal log (public "Removed" page). `scripts/temp_link.json` — ingest queue.
|
||||
- `scripts/` — scanners never write the catalog: `update_info.py` (queued URLs) and `refresh.py` (rotating 1/7-per-day check; `--full` re-scrape) emit a URL-keyed **patch** (`patch.py`); `apply_patch.py` applies it to the latest `main` and runs `validate.py`; `bash/commit_push.sh` does fetch → reset → apply → commit → push with retries. Shared: `scraper.py` (session, `Pacer` + 429 back-off, parsing), `data_store.py` (chunks stay in place, rebalance only past thresholds, write-if-changed), `json_io.py`, `canonical.py` (canonical itch.io URL; vectors in `tests/fixtures/url_vectors.json`, shared with the Worker). Pipeline bookkeeping lives in `scripts/state/` (not published). Tests: `pytest` (network blocked). Lint: `ruff check scripts tests webapp/scripts`, `ruff format`, `vulture` (config in root `pyproject.toml`). Local env: `python -m venv .venv && .venv/Scripts/pip install -r requirements-dev.txt` (Windows: run with `PYTHONUTF8=1`).
|
||||
2. **Cloudflare Worker + static assets** — `webapp/worker/` + `webapp/wrangler.jsonc`, deployed by **Cloudflare Workers Builds** from `main` (root dir `webapp`, build `npm run build`, deploy `npx wrangler deploy`; no deploy workflow). The catalog JSON is bundled into the site at build time (`vite-plugins/catalog-data.ts` → `dist/data/*`, plus `data/urls.json` and `sitemap.xml`), so every data commit rebuilds the site.
|
||||
@@ -35,27 +35,29 @@ npm run tauri -- android init # generate src-tauri/gen/androi
|
||||
npm run tauri -- android build --apk --target aarch64 # arm64-v8a release APK (unsigned; CI post-signs)
|
||||
```
|
||||
|
||||
Local admin without Access: put `DEV_ADMIN_EMAIL=you@example.com` in `webapp/.dev.vars` — honoured only when the host is localhost. Turnstile test keys work locally (`TURNSTILE_SITEKEY=1x00000000000000000000AA`, `TURNSTILE_SECRET=1x0000000000000000000000000000000AA`, `SITE_ORIGIN=http://localhost:<port>` in `.dev.vars`). Android details live in `webapp/TAURI.md` → **Android APK**. Path alias: `@/*` → `webapp/src/*`.
|
||||
Local admin without Access: put `DEV_ADMIN_EMAIL=you@example.com` in `webapp/.dev.vars` — honoured only when the host is localhost. Turnstile test keys work locally (`TURNSTILE_SITEKEY=1x00000000000000000000AA`, `TURNSTILE_SECRET=1x0000000000000000000000000000000AA`, `SITE_ORIGIN=http://localhost:<port>` in `.dev.vars`); add a 32+ character `GATE_SECRET` to try the verification gate under `npx wrangler dev` (on localhost the cookie is `fig_gate` without `Secure`, and no bot token is needed). `npm run dev` never sees the gate — except that its `/img` proxy to `wrangler dev` does. Android details live in `webapp/TAURI.md` → **Android APK**. Path alias: `@/*` → `webapp/src/*`.
|
||||
|
||||
## Worker (`webapp/worker/`)
|
||||
|
||||
- `index.ts` routes: `/img/*` (img.ts), `/api/health`, `/api/suggest` (suggest.ts), `/api/ingest` (ingest.ts), `/api/admin/*` + `/admin*` (admin.ts), everything else that misses an asset → `spa.ts`. `scheduled()` (cron `23 */4 * * *`): `discover.ts` (one itch.io RSS feed per run, 6 h back-off on 429) → `QueueStore.reconcile` (queued → ingested / failed after 3 days) → `purge` (idempotency 7 d, Suggest notes 180 d).
|
||||
- `index.ts` routes: `/img/*` (img.ts, behind the gate), `/api/health`, `/api/verify` (gate.ts), `/api/suggest` (suggest.ts), `/api/ingest` (ingest.ts), `/api/admin/*` + `/admin*` (admin.ts), everything else that misses an asset → `spa.ts`. `run_worker_first` also lists `/` (otherwise served straight from `dist/index.html`) so the gate sees it. `scheduled()` (cron `23 */4 * * *`): `discover.ts` (one itch.io RSS feed per run, 6 h back-off on 429) → `QueueStore.reconcile` (queued → ingested / failed after 3 days) → `purge` (idempotency 7 d, Suggest notes 180 d).
|
||||
- `img.ts`: `/img/<160|640>/<path on img.itch.zone>` — allow-listed against `data/urls.json`, edge cache → R2 `THUMBS` (`w{w}/<sha256>.webp`) → `cf.image` transform (stored once) → fallback streams the original with a 1-day cache (quota error 9422). Upstream errors → controlled 502.
|
||||
- `spa.ts`: `not_found_handling` is `"none"`, so misses reach the Worker: `/assets/*`, `/data/*` and file-like paths get a real 404 (`no-store`); app routes get the shell with 200; unknown paths and game slugs not in the catalog get the shell with **404**. Keep its `ROUTES` in sync with `src/App.tsx` and `src/hooks/useSeoHead.ts`.
|
||||
- `spa.ts`: `not_found_handling` is `"none"`, so misses reach the Worker: `/assets/*`, `/data/*` and file-like paths get a real 404 (`no-store`); app routes get the shell with 200; unknown paths and game slugs not in the catalog get the shell with **404**; with the gate on, a visitor without a pass gets the verification page instead (checked before the shell is fetched, so never a 304). Keep its `ROUTES` in sync with `src/App.tsx` and `src/hooks/useSeoHead.ts`.
|
||||
- `gate.ts` + `gate-page.ts`: the **verification gate** (web only). App pages and `/img` need a pass: the `__Host-fig_gate` cookie (HMAC of its issue time, HttpOnly, `BOT_GATE_TTL_HOURS`, default 48) set by `POST /api/verify` after a Turnstile check (action `gate`, `RL_GATE`, same-origin); `GET /api/verify` reports `{enabled, valid, via, ttl}`. The page is self-contained (inline CSS/JS with a per-response CSP nonce, EN/VI, the site's og tags, 200 + noindex). Verified bots pass with `x-fig-known-bot: <GATE_BOT_TOKEN>` from a zone Transform Rule; clients that only claim to be a crawler get 503. `/assets`, `/data`, `/api/*`, `/admin*` and the other static files stay open. `turnstile.ts`: siteverify shared with Suggest (hostname + action checked; the test secrets skip both).
|
||||
- `access.ts`: verifies `Cf-Access-Jwt-Assertion` with jose (issuer + AUD). Maintainer = email in secret `ADMIN_EMAILS` + same-origin writes; ingest = service-token `common_name`.
|
||||
- `admin.ts`: API (queue list / approve / reject / add / edit the 3 fields / delete with reason + R2 cleanup / restore) and the `/admin` shell with its own CSP. The maintainer's email goes only to the D1 audit log, never into a commit (the repo is public).
|
||||
- `repo.ts` + `github.ts` + `catalog.ts`: writes as a **GitHub App** (installation token, cached per isolate) with GraphQL `createCommitOnBranch` + `expectedHeadOid` (verified commits; `commitWithRetry` rebuilds from the new head on a race). Reads use the raw media type (no base64/UTF-8 mojibake). `catalog.ts` ports `data_store.py` byte-for-byte (golden fixtures).
|
||||
- `queue.ts`: URL classification (catalog → blocklist → pending → previously deleted) + the D1 store (`worker/migrations/`, additive only — never edit an applied migration). `data.ts`: catalog facts read from the site's own `/data` via `env.ASSETS`, cached per isolate (loaded values only — see gotchas).
|
||||
- Configuration: non-secret settings are `vars` in `wrangler.jsonc` (empty until setup); secrets (`GH_APP_PRIVATE_KEY` — the PEM GitHub downloads (PKCS#1) or PKCS#8; `github.ts` converts, `ADMIN_EMAILS`, `TURNSTILE_SECRET`) via `wrangler secret put`, typed in `worker/env.ts` as optional. A feature whose settings are missing answers **503**; the public site needs none of them. `env.staging` = Worker `free-games-itchio-list-staging` on `staging.freeitchgames.win` (no cron, own R2/D1/rate-limit namespaces).
|
||||
- Configuration: non-secret settings are `vars` in `wrangler.jsonc` (empty until setup); secrets (`GH_APP_PRIVATE_KEY` — the PEM GitHub downloads (PKCS#1) or PKCS#8; `github.ts` converts, `ADMIN_EMAILS`, `TURNSTILE_SECRET`, `GATE_SECRET`, `GATE_BOT_TOKEN`) via `wrangler secret put`, typed in `worker/env.ts` as optional. A feature whose settings are missing answers **503** (the gate just stays off); the public site needs none of them. `env.staging` = Worker `free-games-itchio-list-staging` on `staging.freeitchgames.win` (no cron, own R2/D1/rate-limit namespaces).
|
||||
|
||||
## Web app structure (`webapp/src/`)
|
||||
|
||||
- `routes/*.tsx` — one file per route (`/`, `/games`, `/games/:slug`, `/charts`, `/removed` (`/deleted` redirects), `/suggest`, `/settings`, `/about`, `/errors/:code`); `App.tsx` wires them; `components/app-router.tsx` picks **BrowserRouter on the web, HashRouter in Tauri**. `lib/legacy.ts` rewrites v3 `#/x` links to `/x` (crafted hashes go home) and deletes v3 PAT/GPG storage keys.
|
||||
- Data: `lib/config.ts` (`DATA_BASE` = `/data` on the web, `https://freeitchgames.win/data` in Tauri), `lib/data/*`, `hooks/useGames.ts`. react-query cache persisted to IndexedDB (`webapp.query-cache`, 7 days); `CACHE_BUSTER = ${APP.version}:data-v1`. **`gcTime` must stay >= persist `maxAge`.**
|
||||
- Layout: `components/site/*` (sticky top nav + global search with the `/` shortcut + display menu + phone sheet menu; footer) — the window scrolls, not `<main>`. `/` is the Welcome page (`routes/welcome.tsx`).
|
||||
- `/games`: search, filters, sort and page live in the URL — `lib/game-filters.ts` (`parseQuery` / `toParams` drop defaults; params `q genre platform status tag lang input engine rating browser sort page`; unit-tested) — rendered by `components/games/*` (filter chips with facet counts that ignore their own filter, a desktop ARIA table / phone list chosen by `useIsMobile`, 100 per page; the detail page's breadcrumb links back to the same list via router state). Counts show the whole catalog ("2,602 of 2,681") because 18+ games are hidden by default.
|
||||
- `components/charts/` (16 charts, 4 lazy tabs, **no barrel `index.ts`**), `components/game-thumb.tsx` (`lib/thumbnail.ts` → `/img/160|640/...` on the web, the original URL in Tauri), `components/legal-gate.tsx` (a non-dismissable Radix dialog **over** the page, so deep links land where they pointed; links flagged `inGate` in `lib/about.ts`; re-prompts when `LEGAL_VERSION` in `stores/prefs.ts` changes; no "Leave" button in Tauri).
|
||||
- `/games`: search, filters, sort and page live in the URL — `lib/game-filters.ts` (`parseQuery` / `toParams` drop defaults; params `q genre platform status tag lang input engine rating browser sort page`; unit-tested) — rendered by `components/games/*` (filter chips with facet counts that ignore their own filter, a desktop ARIA table / phone list chosen by `useIsMobile`, 100 per page; the detail page's breadcrumb links back to the same list via router state). Counts show the whole catalog ("2,729 of 2,811") because 18+ games are hidden by default.
|
||||
- `components/charts/` (16 charts, 4 lazy tabs, **no barrel `index.ts`**; every Recharts tooltip/cursor comes from `chart-theme.ts` + `chart-tooltip.tsx`), `components/game-thumb.tsx` (`lib/thumbnail.ts` → `/img/160|640/...` on the web, the original URL in Tauri), `components/legal-gate.tsx` (a non-dismissable Radix dialog **over** the page, so deep links land where they pointed; links flagged `inGate` in `lib/about.ts`; re-prompts when `LEGAL_VERSION` in `stores/prefs.ts` changes; no "Leave" button in Tauri).
|
||||
- Styling: **Tailwind v4** via `@tailwindcss/vite` (no PostCSS, no `tailwind.config`); tokens are hex CSS variables in `src/index.css` (`:root` / `.dark`, `@theme inline`; `--brand-soft`, `--thumb`, `--success` besides the shadcn set) and must match the approved mockup. Self-hosted Geist / Geist Mono (`@fontsource-variable/*`, CSP `font-src 'self'`). Numbers and dates go through `lib/format.ts` (`useFormat`: en-GB / vi-VN). `webapp/scripts/gen_assets.py` redraws favicon, PWA icons and `og.png` from the same tokens and the Geist fonts in `node_modules`.
|
||||
- `lib/gate.ts` (web only): when a tab comes back into view or a cover fails and the verification pass may have run out (`webapp.gate` hint), it asks `GET /api/verify` and reloads into the verification page; `lib/reload.ts` is the shared at-most-every-30-s reload guard.
|
||||
- `hooks/useSeoHead.ts` sets canonical + robots per route (index.html has no static canonical/og:url on purpose).
|
||||
- `lib/i18n/` — `en.ts` is the source of truth; `vi.ts` is `Record<MessageKey, string>` and must never be static-imported (lazy chunk).
|
||||
- `stores/` — Zustand: `prefs` (`webapp.prefs`: language, density, legal acceptance…), `theme` (`webapp.theme`).
|
||||
@@ -76,9 +78,10 @@ Each game has **20** fields (plus optional `added_at` / `updated_at`, appended b
|
||||
| `notify-failure.yml` | `workflow_call` | Discord (`DISCORD_CI_WEBHOOK`) on failure / **cancelled** (job-level timeouts end as cancelled) / rate-limited / mass change / failed Cloudflare build. |
|
||||
| `python-ci.yml` / `webapp-ci.yml` | PRs (+ pushes for Python) | ruff + format + vulture + pytest + `validate.py` / `npm run cf:types -- --check` + lint + knip + vitest + build + `wrangler deploy --dry-run --env=""`. |
|
||||
| `deploy-status.yml` | Hourly + manual | Not a deploy. `bash/cf_build_status.sh` walks main's first-parent history to the latest finished `Workers Builds: free-games-itchio-list` check run (Cloudflare posts it only when a build ends; branch commits carry preview builds under the same name) and alerts once per failed build (cache key per check-run id, saved after the Discord post). Scheduled because GitHub never starts `check_run` workflows for `GITHUB_TOKEN` pushes (the data commits). |
|
||||
| `release_desktop.yml` | Tag `v*` push, or manual | `create-release` makes the single draft (id passed to tauri-action v1 `releaseId`); release builds use **no** npm/cargo caches (cache-poisoning). Win + macOS aarch64 + macOS x86_64 (cross-compile) + Linux (`ubuntu-22.04` for a low glibc floor). Uploads `.dmg` / `.app.tar.gz` / `.pkg` (macOS), `.msi` / `.exe` (Windows), `.deb` / `.AppImage` (Linux). macOS `.pkg` `--identifier` reads `tauri.conf.json`. |
|
||||
| `release_desktop.yml` | Tag `v*` push, or manual | `create-release` makes the single draft (id passed to tauri-action v1 `releaseId`); release builds use **no** npm/cargo caches (cache-poisoning). Win + macOS aarch64 + macOS x86_64 (cross-compile) + Linux (`ubuntu-22.04` for a low glibc floor). Uploads `.dmg` / `.app.tar.gz` / `.pkg` (macOS), `.msi` / `.exe` (Windows), `.deb` / `.rpm` / `.AppImage` (Linux). macOS `.pkg` `--identifier` reads `tauri.conf.json`. |
|
||||
| `release_android.yml` | Tag `v*` push, or manual | Tauri **Android** build → arm64-v8a APK, **post-signed** with `zipalign`+`apksigner` (gen/ stays gitignored). Tag → attaches to the same draft Release; manual dispatch → workflow artifact. Secrets: `ANDROID_KEYSTORE_BASE64` / `ANDROID_KEYSTORE_PASSWORD` / `ANDROID_KEY_ALIAS`. |
|
||||
| `announce-*.yml`, `notify-release-pipeline.yml` | Release published / pipeline runs | Reusable workflows from `poli0981/.github`, SHA-pinned — but at that pin they still check out their notifier script from that repo's `main`. |
|
||||
| `announce-release.yml`, `notify-release-pipeline.yml` | Release published / pipeline runs | Reusable workflows from `poli0981/.github`, SHA-pinned — but at that pin they still check out their notifier script from that repo's `main`. |
|
||||
| `announce-discussion.yml` | Release published; push to `main` touching `CHANGELOG.md` / `changelog/**` | Local. The release goes to Discussions → Announcements, a changelog push to → General unless the head commit says `[skip-discuss]`. |
|
||||
|
||||
All workflows: `permissions: {}` at the top, per-job grants, actions pinned by commit SHA.
|
||||
|
||||
@@ -93,7 +96,7 @@ git push origin vX.Y.Z
|
||||
gh release edit vX.Y.Z --draft=false
|
||||
```
|
||||
|
||||
Draft-first: **never** `gh release create` by hand before CI — tauri-action v1 refuses to upload into a published release, and announcements would go out before installers exist. Merge PRs into `main` with squash or a merge commit, never by fast-forward pushing a branch: its commits' preview-build check runs would then sit on main's own line and confuse `deploy-status.yml`. Tag from `main` only. Versions live in `webapp/src/lib/about.ts` (`APP.version`), `webapp/package.json`, `webapp/src-tauri/tauri.conf.json` and `Cargo.toml` (+ `Cargo.lock`) — keep them equal. GPG signing is wired through gpg-agent (`commit.gpgsign=true`, so `git tag -s` and `git commit` both sign; the pinentry must be answered — in unattended sessions commits fail rather than going unsigned). The historical key `03F965C2E2DB5C6B` was exposed in the browser extension's storage (Sept 2026) and is being replaced — use the maintainer's current key.
|
||||
Draft-first: **never** `gh release create` by hand before CI — tauri-action v1 refuses to upload into a published release, and announcements would go out before installers exist. Merge PRs into `main` with squash or a merge commit, never by fast-forward pushing a branch: its commits' preview-build check runs would then sit on main's own line and confuse `deploy-status.yml`. Tag from `main` only. Release notes go to `changelog/<major>.x/ver<major>.<minor>.x.md` plus a row in the `CHANGELOG.md` index (each row keeps the anchor of the old single-file heading as `<a name>`: published release notes link to them). Versions live in `webapp/src/lib/about.ts` (`APP.version`), `webapp/package.json`, `webapp/src-tauri/tauri.conf.json` and `Cargo.toml` (+ `Cargo.lock`) — keep them equal. GPG signing is wired through gpg-agent (`commit.gpgsign=true`, so `git tag -s` and `git commit` both sign; the pinentry must be answered — in unattended sessions commits fail rather than going unsigned). The historical key `03F965C2E2DB5C6B` was exposed in the browser extension's storage (Sept 2026) and is being replaced — use the maintainer's current key.
|
||||
|
||||
## Licenses & policies
|
||||
|
||||
@@ -123,6 +126,9 @@ Code **MIT** (`LICENSE`); catalog data **CC BY 4.0** for the maintainer's contri
|
||||
20. **D1 migrations are applied by hand** (`npx wrangler d1 migrations apply freeitchgames --remote`), never in the build — and before deploying code that needs them. Production `freeitchgames` was created by command (APAC); its `database_id` is in `wrangler.jsonc` (not a secret). **R2 must be enabled on the account** (dashboard, payment method) before `wrangler r2 bucket create`; a deploy whose bucket is missing fails.
|
||||
21. **React Router 8 wraps navigations in `startTransition` by default**: `useSearchParams` then returns the previous URL until the transition commits, so URL-driven state (the Games filters) overwrote itself on quick clicks. Both routers in `components/app-router.tsx` pass `useTransitions={false}`.
|
||||
22. **`window.confirm` / `alert` / `prompt` do nothing in the macOS app** (wry's WebKit answers "Cancel"). Use in-app dialogs (`components/nsfw-dialog.tsx` + `requestNsfw()` in `lib/nsfw.ts`).
|
||||
23. **The design tokens are hex: write `var(--x)`, never `hsl(var(--x))`.** The invalid colour painted the Recharts hover band black and left tooltips transparent (fixed in 4.1.0).
|
||||
24. **Recharts 3 makes charts focusable** (`accessibilityLayer`, plus `tabindex` on inner `<g>`s): a mouse click focused the SVG, Chromium drew its black focus ring and the tooltip stuck on the first item. `ChartCard` keeps mouse clicks from moving focus; keyboard focus keeps the `--ring` outline.
|
||||
25. **The verification gate fails open, and its off switch is deleting `GATE_SECRET`** (`BOT_GATE` changed in the dashboard is undone by the next deploy). It also needs `GATE_BOT_TOKEN` + the zone Transform Rule — without them Google would get the challenge; a client that only claims to be a crawler gets a 503, never the noindex page. Don't gate `/data`: the apps and CC BY reuse read it.
|
||||
|
||||
## Safe-edit rules
|
||||
|
||||
@@ -133,4 +139,6 @@ Code **MIT** (`LICENSE`); catalog data **CC BY 4.0** for the maintainer's contri
|
||||
|
||||
## Current state (Sept 2026)
|
||||
|
||||
**v4 is live** (2026-09-18): Phase 0 (#81) and Phase 1 (#82) were squash-merged, then PR **#88** merged branch `v4` (phases 2–5 and the approved Phase 3 redesign) with a merge commit (`a872644`); Workers Builds deployed it and https://freeitchgames.win serves the Worker. D1 `freeitchgames` and R2 `freeitchgames-thumbs` exist, Image Transformations are on for the zone (source `img.itch.zone`). **Still open (owner):** Cloudflare Access apps + the `ACCESS_*` vars, the GitHub App (`GH_APP_*` vars + `GH_APP_PRIVATE_KEY`), Turnstile (`TURNSTILE_SITEKEY` + secret), `ADMIN_EMAILS`, Web Analytics token, Email Routing — admin, ingest and Suggest answer 503 until then (`docs/operations.md` section 1); tagging `v4.0.0` (draft-first release); the legal-text review items; a new GPG signing key (commits are still signed with the exposed `03F965C2E2DB5C6B`).
|
||||
**v4.1.0** (2026-09-24): the Turnstile verification gate for the web app, readable chart tooltips, the changelog split into `changelog/`, a docs refresh, updated Privacy/ToS/EULA (`LEGAL_VERSION` 2026-09-24). The gate ships switched on in `wrangler.jsonc` but stays inert until `GATE_BOT_TOKEN`, the Transform Rule and `GATE_SECRET` are in place (`docs/operations.md` §1 step 14) — `curl -s https://freeitchgames.win/api/verify` says `"enabled"`.
|
||||
|
||||
**v4.0.0** (2026-09-18) moved the site to the Cloudflare Worker at https://freeitchgames.win (PRs #81, #82, #88). The whole chain is live: Access for `/admin`, the GitHub App (verified commits to `scripts/temp_link.json` → `update.yml`), Turnstile, `ADMIN_EMAILS`; D1 `freeitchgames`, R2 `freeitchgames-thumbs`, Image Transformations (source `img.itch.zone`); Web Analytics is injected by the zone. `/api/ingest` stays unused — the browser extension is archived. **Still open (owner):** Email Routing; the legal-text review items; a new GPG signing key (commits are still signed with the exposed `03F965C2E2DB5C6B`); deleting the unused repo secrets `GH_TOKEN`, `TELEGRAM_BOT_TOKEN`, `DISCUSSION_*`.
|
||||
+1
-1
@@ -68,7 +68,7 @@ Details live in the [Terms of Use](docs/ToS.md) and the [Disclaimer](docs/DISCLA
|
||||
**PR rules** (the non-negotiable part):
|
||||
|
||||
- **CI must pass.** Python CI (ruff check + format, vulture, pytest, `validate.py`) and Webapp CI (type generation check, lint, knip, tests, build, `wrangler deploy --dry-run`) both run on PRs. Red CI = no merge.
|
||||
- **PRs are squash-merged**: one PR becomes one commit on `main`, so make the PR title a good commit message (the repo uses the `type(scope): summary` style, e.g. `fix(web): …`).
|
||||
- **PRs are merged with squash** (one PR becomes one commit on `main`) **or a merge commit, never by fast-forward**, so make the PR title a good commit message (the repo uses the `type(scope): summary` style, e.g. `fix(web): …`).
|
||||
- **Licensing is inbound = outbound.** By opening a PR you agree that your contribution is licensed under the same license as the part it changes: **MIT** for code, **CC BY 4.0** for catalog data and documentation (see [README → License](README.md#license)). Only submit work you have the right to submit.
|
||||
- **Never commit secrets**: no tokens, API keys, `.dev.vars` / `.env` files, private keys (such as the GitHub App key) or signing keystores. If you pushed one by accident, report it privately (security@freeitchgames.win) and rotate it; deleting the commit is not enough.
|
||||
- **Don't edit `data_game/` by hand.** Data changes go through the pipeline (a patch + `apply_patch.py`, which runs `validate.py`), so concurrent writers never clobber each other.
|
||||
|
||||
@@ -34,11 +34,14 @@ read-only for everyone: no accounts, no sign-in, no comments, no ads, no payment
|
||||
|
||||
Everything lives on the website, **<https://freeitchgames.win>**:
|
||||
|
||||
- **Games**: the whole catalog in one fast table (cards on phones), with filters for genre, platform,
|
||||
- **Games**: the whole catalog in one fast table (a compact list on phones), with filters for genre, platform,
|
||||
status and more, plus a detail page for every game.
|
||||
- **Charts**: how the catalog breaks down, and how it has grown over time.
|
||||
- **Removed**: every game dropped from the catalog, with the reason
|
||||
(<https://freeitchgames.win/removed>).
|
||||
- **A quick check first.** Your first visit, then about once every 48 hours, starts with a short
|
||||
Cloudflare Turnstile check that keeps bots out. It usually passes by itself and then opens the page
|
||||
you asked for. The catalog data under `/data` and the apps don't need it.
|
||||
- **18+ content is hidden by default.** Games flagged `nsfw: Yes` stay hidden (covers included) unless
|
||||
you opt in under Settings after confirming you are 18 or older. That choice is stored only in your
|
||||
browser.
|
||||
@@ -62,7 +65,7 @@ from the latest [GitHub Release](https://github.com/poli0981/free-games-itchio-l
|
||||
|---|---|
|
||||
| Windows | `.msi` or `.exe` installer |
|
||||
| macOS | `.dmg`, `.pkg` or `.app.tar.gz` (needs Safari/WebKit 16.4 or newer) |
|
||||
| Linux | `.deb` or `.AppImage` |
|
||||
| Linux | `.deb`, `.rpm` or `.AppImage` |
|
||||
| Android 11+ (arm64-v8a) | `.apk` (sideloaded, see below) |
|
||||
|
||||
The apps download the catalog JSON from <https://freeitchgames.win/data> and load cover images directly
|
||||
@@ -150,9 +153,9 @@ The pipeline is polite to itch.io: it identifies itself as
|
||||
## Under the hood
|
||||
|
||||
- **Web app** ([`webapp/src/`](webapp/src/)): React + TypeScript + Vite + Tailwind CSS, TanStack
|
||||
Query / Table / Virtual, React Router, Zustand. English and Vietnamese UI.
|
||||
- **Cloudflare Worker** ([`webapp/worker/`](webapp/worker/)): serves the site and `/data`, the image proxy
|
||||
(`/img`, resized WebP covers stored on Cloudflare R2), the Suggest and ingest APIs, the review queue
|
||||
Query, React Router, Zustand. English and Vietnamese UI.
|
||||
- **Cloudflare Worker** ([`webapp/worker/`](webapp/worker/)): serves the site and `/data`, the verification gate
|
||||
(Cloudflare Turnstile), the image proxy (`/img`, resized WebP covers stored on Cloudflare R2), the Suggest and ingest APIs, the review queue
|
||||
(Cloudflare D1), the admin API and the RSS discovery schedule. Config:
|
||||
[`webapp/wrangler.jsonc`](webapp/wrangler.jsonc).
|
||||
- **Admin app** ([`webapp/admin/`](webapp/admin/)): the Maintainer-only review screen at `/admin`, behind
|
||||
@@ -199,6 +202,7 @@ scripts/
|
||||
└── state/ # Pipeline bookkeeping (last check, strikes, retries), not published
|
||||
|
||||
bash/commit_push.sh # fetch main → apply patch → validate → commit → push (with retries)
|
||||
bash/cf_build_status.sh # main's latest Cloudflare Workers Build → Discord on failure (deploy-status.yml)
|
||||
tests/ # pytest suite (no network) + fixtures shared with the Worker
|
||||
|
||||
webapp/
|
||||
@@ -223,8 +227,9 @@ docs/ # Policies, dev environment, third-party list (+ Vietnam
|
||||
| Refresh (`refresh.yml`) | Daily 02:47 UTC | Re-check 1/7 of the catalog: dead links, now-paid games, rating, status |
|
||||
| Force update (`force_update.yml`) | Manual | Re-scrape every field (one URL or the next batch); keeps `safe_virus` / `notes` / `nsfw` |
|
||||
| RSS discovery (Cloudflare Worker) | Every 4 hours | Poll one itch.io feed per run; new games go to the review queue |
|
||||
| Python CI / Webapp CI | Pull requests | Lint, tests, data validation / type-check, tests, build |
|
||||
| Python CI / Webapp CI | Pull requests (Python CI also on pushes to `main` that touch it) | Lint, tests, data validation / type-check, tests, build |
|
||||
| Deploy website | On push to `main` | Cloudflare Workers Builds (`webapp/wrangler.jsonc`) → freeitchgames.win |
|
||||
| Build monitor (`deploy-status.yml`) | Hourly | Posts each failed Workers Build of `main` to Discord, once |
|
||||
| Release desktop / Android | On `v*` tag push | Tauri installers (Win/macOS/Linux) and signed APK → draft Release |
|
||||
|
||||
Network errors are treated as transient; a game is removed only after the same 404/410 or paid status is
|
||||
|
||||
+9
-6
@@ -9,7 +9,7 @@
|
||||
[](data_game/LICENSE.md)
|
||||
[](README.md)
|
||||
|
||||
> Bản dịch từ bản tiếng Anh cập nhật ngày 2026-09-18 (English source revision 2026-09-18). Nếu có khác biệt, bản tiếng Anh được ưu tiên.
|
||||
> Bản dịch từ bản tiếng Anh cập nhật ngày 2026-09-24 (English source revision 2026-09-24). Nếu có khác biệt, bản tiếng Anh được ưu tiên.
|
||||
>
|
||||
> Bản tiếng Anh tại [`README.md`](README.md) là bản chính thức. Bản dịch tiếng Việt của các tài liệu chính sách nằm trong [`docs/i18n/vi/`](docs/i18n/vi/).
|
||||
|
||||
@@ -34,9 +34,10 @@ Một danh mục được tuyển chọn và tự động cập nhật gồm **h
|
||||
|
||||
Mọi thứ nằm trên website **<https://freeitchgames.win>**:
|
||||
|
||||
- **Danh sách game**: toàn bộ danh mục trong một bảng chạy nhanh (dạng thẻ trên điện thoại), lọc theo thể loại, nền tảng, trạng thái và nhiều thứ khác, cùng một trang chi tiết cho từng game.
|
||||
- **Danh sách game**: toàn bộ danh mục trong một bảng chạy nhanh (dạng danh sách gọn trên điện thoại), lọc theo thể loại, nền tảng, trạng thái và nhiều thứ khác, cùng một trang chi tiết cho từng game.
|
||||
- **Biểu đồ**: danh mục được chia ra sao, và đã lớn lên thế nào theo thời gian.
|
||||
- **Đã gỡ** (Removed): mọi game bị loại khỏi danh mục, kèm lý do (<https://freeitchgames.win/removed>).
|
||||
- **Kiểm tra nhanh trước.** Lần đầu vào, rồi khoảng mỗi 48 giờ, trang sẽ chạy một bước kiểm tra Cloudflare Turnstile ngắn để chặn bot. Thường nó tự qua rồi mở đúng trang bạn cần. Dữ liệu trong `/data` và các ứng dụng không cần bước này.
|
||||
- **Nội dung 18+ bị ẩn theo mặc định.** Game được đánh dấu `nsfw: Yes` sẽ bị ẩn (kể cả ảnh bìa) trừ khi bạn tự bật trong Settings sau khi xác nhận mình đủ 18 tuổi. Lựa chọn đó chỉ được lưu trong trình duyệt của bạn.
|
||||
|
||||
Mọi link đều dẫn tới trang riêng của game trên itch.io. Ảnh bìa trên website là bản thu nhỏ do freeitchgames.win phục vụ, nên trình duyệt của bạn không kết nối tới itch.io cho tới khi bạn bấm vào một link.
|
||||
@@ -53,7 +54,7 @@ Cùng một app cũng được phát hành dưới dạng **ứng dụng native
|
||||
|---|---|
|
||||
| Windows | Trình cài đặt `.msi` hoặc `.exe` |
|
||||
| macOS | `.dmg`, `.pkg` hoặc `.app.tar.gz` (cần Safari/WebKit 16.4 trở lên) |
|
||||
| Linux | `.deb` hoặc `.AppImage` |
|
||||
| Linux | `.deb`, `.rpm` hoặc `.AppImage` |
|
||||
| Android 11+ (arm64-v8a) | `.apk` (cài tay, xem bên dưới) |
|
||||
|
||||
Các app tải JSON danh mục từ <https://freeitchgames.win/data> và tải ảnh bìa trực tiếp từ CDN ảnh của itch.io (`img.itch.zone`); bấm vào một game sẽ mở itch.io trong trình duyệt của bạn. Không có telemetry. Cập nhật thủ công: khi có bản mới thì tải bản mới về. Cài app đồng nghĩa với việc chấp nhận [EULA](docs/i18n/vi/EULA.md) ([EN](docs/EULA.md)).
|
||||
@@ -106,8 +107,8 @@ Pipeline cư xử lịch sự với itch.io: nó tự xưng danh là `FreeItchGa
|
||||
|
||||
## Bên trong dự án
|
||||
|
||||
- **Web app** ([`webapp/src/`](webapp/src/)): React + TypeScript + Vite + Tailwind CSS, TanStack Query / Table / Virtual, React Router, Zustand. Giao diện tiếng Anh và tiếng Việt.
|
||||
- **Cloudflare Worker** ([`webapp/worker/`](webapp/worker/)): phục vụ website và `/data`, proxy ảnh (`/img`, ảnh bìa WebP đã thu nhỏ lưu trên Cloudflare R2), API Suggest và ingest, hàng chờ duyệt (Cloudflare D1), API quản trị và lịch phát hiện qua RSS. Cấu hình: [`webapp/wrangler.jsonc`](webapp/wrangler.jsonc).
|
||||
- **Web app** ([`webapp/src/`](webapp/src/)): React + TypeScript + Vite + Tailwind CSS, TanStack Query, React Router, Zustand. Giao diện tiếng Anh và tiếng Việt.
|
||||
- **Cloudflare Worker** ([`webapp/worker/`](webapp/worker/)): phục vụ website và `/data`, cổng xác minh (Cloudflare Turnstile), proxy ảnh (`/img`, ảnh bìa WebP đã thu nhỏ lưu trên Cloudflare R2), API Suggest và ingest, hàng chờ duyệt (Cloudflare D1), API quản trị và lịch phát hiện qua RSS. Cấu hình: [`webapp/wrangler.jsonc`](webapp/wrangler.jsonc).
|
||||
- **App quản trị** ([`webapp/admin/`](webapp/admin/)): màn hình duyệt chỉ dành cho Maintainer tại `/admin`, đứng sau Cloudflare Access. Nó ghi vào repo này dưới danh nghĩa một GitHub App.
|
||||
- **Vỏ native** ([`webapp/src-tauri/`](webapp/src-tauri/)): Tauri 2 cho Windows, macOS, Linux và Android. Xem [`webapp/TAURI.md`](webapp/TAURI.md).
|
||||
- **Pipeline dữ liệu** ([`scripts/`](scripts/), Python 3.14): scraper, refresh, patch/apply và validate, chạy bằng GitHub Actions.
|
||||
@@ -147,6 +148,7 @@ scripts/
|
||||
└── state/ # Sổ sách của pipeline (lần kiểm tra cuối, strike, lần thử lại), không công khai
|
||||
|
||||
bash/commit_push.sh # fetch main → áp patch → validate → commit → push (có thử lại)
|
||||
bash/cf_build_status.sh # Workers Build mới nhất của main → báo Discord khi lỗi (deploy-status.yml)
|
||||
tests/ # Bộ test pytest (không dùng mạng) + fixture dùng chung với Worker
|
||||
|
||||
webapp/
|
||||
@@ -171,8 +173,9 @@ docs/ # Chính sách, môi trường dev, danh sách bên th
|
||||
| Refresh (`refresh.yml`) | Hằng ngày 02:47 UTC | Kiểm tra lại 1/7 danh mục: link chết, game chuyển sang trả phí, rating, trạng thái |
|
||||
| Force update (`force_update.yml`) | Thủ công | Cào lại mọi trường (một URL hoặc lô tiếp theo); giữ nguyên `safe_virus` / `notes` / `nsfw` |
|
||||
| Phát hiện qua RSS (Cloudflare Worker) | Mỗi 4 giờ | Đọc một feed itch.io mỗi lượt; game mới vào hàng chờ duyệt |
|
||||
| Python CI / Webapp CI | Pull request | Lint, test, validate dữ liệu / type-check, test, build |
|
||||
| Python CI / Webapp CI | Pull request (Python CI còn chạy khi push vào `main` chạm tới phần Python) | Lint, test, validate dữ liệu / type-check, test, build |
|
||||
| Deploy website | Khi push vào `main` | Cloudflare Workers Builds (`webapp/wrangler.jsonc`) → freeitchgames.win |
|
||||
| Theo dõi build (`deploy-status.yml`) | Mỗi giờ | Báo mỗi Workers Build lỗi của `main` lên Discord, một lần |
|
||||
| Release desktop / Android | Khi push tag `v*` | Trình cài đặt Tauri (Win/macOS/Linux) và APK đã ký → draft Release |
|
||||
|
||||
Lỗi mạng được coi là tạm thời; game chỉ bị gỡ khi cùng lỗi 404/410 hoặc trạng thái trả phí được thấy lại ít nhất 20 giờ sau lần đầu. Lỗi, lượt bị hủy, bị giới hạn tốc độ và thay đổi hàng loạt đáng ngờ được báo về Discord của dự án dưới dạng thông báo tự động.
|
||||
|
||||
+6
-5
@@ -13,8 +13,9 @@ change them.
|
||||
[`webapp/src-tauri/Cargo.toml`](../webapp/src-tauri/Cargo.toml),
|
||||
[`requirements.txt`](../requirements.txt) and [`requirements-dev.txt`](../requirements-dev.txt).
|
||||
Exact versions, including dependencies of dependencies, are pinned in
|
||||
[`webapp/package-lock.json`](../webapp/package-lock.json) (npm) and resolved at build time for Rust and
|
||||
Python (`npm ls`, `cargo tree` and `pip list` show the full trees).
|
||||
[`webapp/package-lock.json`](../webapp/package-lock.json) (npm) and
|
||||
[`webapp/src-tauri/Cargo.lock`](../webapp/src-tauri/Cargo.lock) (Rust); Python dependencies are
|
||||
resolved at install time (`npm ls`, `cargo tree` and `pip list` show the full trees).
|
||||
- The runtime libraries are also listed on the [About page](https://freeitchgames.win/about), which reads
|
||||
the `THIRD_PARTY` array in [`webapp/src/lib/about.ts`](../webapp/src/lib/about.ts).
|
||||
|
||||
@@ -56,8 +57,8 @@ requests to third-party font services. The fonts are licensed under the SIL Open
|
||||
|
||||
The Worker runs on Cloudflare's Workers runtime and uses Cloudflare services (R2, D1, Images, Rate
|
||||
Limiting, Access). Two scripts come from Cloudflare instead of the site's own bundle: the Web Analytics
|
||||
beacon (`static.cloudflareinsights.com`) and, on the Suggest page only, the Turnstile widget
|
||||
(`challenges.cloudflare.com`). These are Cloudflare services under Cloudflare's own terms, not open-source
|
||||
beacon (`static.cloudflareinsights.com`) and, on the verification page and the Suggest page, the
|
||||
Turnstile widget (`challenges.cloudflare.com`). These are Cloudflare services under Cloudflare's own terms, not open-source
|
||||
components. Section 7 lists every service the project uses.
|
||||
|
||||
## 3. Desktop and Android apps (Rust crates)
|
||||
@@ -130,7 +131,7 @@ distributed with the project; each one is under the license in its own repositor
|
||||
|
||||
| Service | What it does for the project |
|
||||
|---|---|
|
||||
| **Cloudflare** | DNS, CDN, WAF, TLS; Workers and static assets (the website); R2 (resized cover images); D1 (the review queue); Images (resizing); Turnstile (Suggest page); Web Analytics (cookieless, aggregate); Workers Logs; Access (admin login); Rate Limiting; Email Routing (the project's contact addresses) |
|
||||
| **Cloudflare** | DNS, CDN, WAF, TLS; Workers and static assets (the website); R2 (resized cover images); D1 (the review queue); Images (resizing); Turnstile (the verification page and the Suggest page); Web Analytics (cookieless, aggregate); Workers Logs; Access (admin login); Rate Limiting; Email Routing (the project's contact addresses) |
|
||||
| **GitHub** | Code, catalog data, issues and discussions, Actions (the pipeline), release downloads |
|
||||
| **itch.io** | Where the games live; the pipeline and RSS discovery read public itch.io pages and feeds |
|
||||
| **Discord** | Receives automated CI and release notifications only |
|
||||
|
||||
+7
-3
@@ -112,15 +112,19 @@ DEV_ADMIN_EMAIL=you@example.com
|
||||
SITE_ORIGIN=http://localhost:5173
|
||||
TURNSTILE_SITEKEY=1x00000000000000000000AA
|
||||
TURNSTILE_SECRET=1x0000000000000000000000000000000AA
|
||||
# Only to try the verification gate under `npx wrangler dev` (http://localhost:8787):
|
||||
# GATE_SECRET=<32+ random characters, e.g. `openssl rand -hex 32`>
|
||||
```
|
||||
|
||||
| Key | Kind | What it does |
|
||||
|---|---|---|
|
||||
| `DEV_ADMIN_EMAIL` | local only, optional | Lets you into the admin without Cloudflare Access. Honoured only when the host is `localhost`, `127.0.0.1` or `[::1]`; ignored everywhere else |
|
||||
| `ADMIN_EMAILS` | secret | Comma-separated admin allow-list, checked behind Access. Not needed locally with `DEV_ADMIN_EMAIL` |
|
||||
| `TURNSTILE_SECRET` | secret | Suggest form, together with the `TURNSTILE_SITEKEY` var |
|
||||
| `GH_APP_PRIVATE_KEY` | secret | GitHub App private key (PKCS#8 PEM) for admin writes, together with the `GH_APP_ID` and `GH_APP_INSTALLATION_ID` vars |
|
||||
| `SITE_ORIGIN` | var override | The Suggest form only accepts POSTs whose `Origin` equals it |
|
||||
| `TURNSTILE_SECRET` | secret | Suggest form and verification gate, together with the `TURNSTILE_SITEKEY` var |
|
||||
| `GATE_SECRET` | secret | Signs the verification-gate cookie (32+ characters). Without it the gate stays off. Locally, set `SITE_ORIGIN=http://localhost:8787` and open the site through `wrangler dev`; the cookie is `fig_gate` there (no `Secure`) |
|
||||
| `GATE_BOT_TOKEN` | secret | The value the zone's Transform Rule sends for verified bots (32+ characters). Required in production, not on localhost |
|
||||
| `GH_APP_PRIVATE_KEY` | secret | GitHub App private key for admin writes — the PEM as GitHub downloads it (PKCS#1) or PKCS#8, together with the `GH_APP_ID` and `GH_APP_INSTALLATION_ID` vars |
|
||||
| `SITE_ORIGIN` | var override | The Suggest form and the verification gate only accept POSTs whose `Origin` equals it |
|
||||
|
||||
A feature whose settings are missing answers `503`; the public site needs none of them. The two
|
||||
Turnstile values above are Cloudflare's always-pass test keys
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Hướng dẫn đóng góp
|
||||
|
||||
> Bản dịch từ bản tiếng Anh cập nhật ngày 2026-09-18 (English source revision 2026-09-18). Nếu có khác biệt, bản tiếng Anh được ưu tiên.
|
||||
> Bản dịch từ bản tiếng Anh cập nhật ngày 2026-09-24 (English source revision 2026-09-24). Nếu có khác biệt, bản tiếng Anh được ưu tiên.
|
||||
>
|
||||
> Bản tiếng Anh tại [`CONTRIBUTING.md`](../../../CONTRIBUTING.md) là bản chính thức.
|
||||
|
||||
@@ -72,7 +72,7 @@ Chi tiết có trong [Điều khoản sử dụng](ToS.md) và [Tuyên bố mi
|
||||
**Quy tắc PR** (phần không thương lượng):
|
||||
|
||||
- **CI phải pass.** Python CI (ruff check + format, vulture, pytest, `validate.py`) và Webapp CI (kiểm tra type sinh ra, lint, knip, test, build, `wrangler deploy --dry-run`) đều chạy trên PR. CI đỏ = không merge.
|
||||
- **PR được squash-merge**: một PR thành một commit trên `main`, nên hãy đặt tiêu đề PR như một commit message tốt (repo dùng kiểu `type(scope): tóm tắt`, ví dụ `fix(web): …`).
|
||||
- **PR được merge bằng squash** (một PR thành một commit trên `main`) **hoặc merge commit, không bao giờ fast-forward**, nên hãy đặt tiêu đề PR như một commit message tốt (repo dùng kiểu `type(scope): tóm tắt`, ví dụ `fix(web): …`).
|
||||
- **Giấy phép theo nguyên tắc inbound = outbound.** Khi mở PR, bạn đồng ý rằng đóng góp của mình được cấp phép theo cùng giấy phép với phần mà nó thay đổi: **MIT** cho mã nguồn, **CC BY 4.0** cho dữ liệu danh mục và tài liệu (xem [README → Giấy phép](../../../README.vi.md#giấy-phép)). Chỉ gửi những gì bạn có quyền gửi.
|
||||
- **Không bao giờ commit secret**: không token, API key, file `.dev.vars` / `.env`, private key (chẳng hạn khóa của GitHub App) hay keystore dùng để ký. Nếu lỡ push một cái, hãy báo riêng (security@freeitchgames.win) và thay mới (rotate) nó; chỉ xóa commit là không đủ.
|
||||
- **Không sửa tay `data_game/`.** Thay đổi dữ liệu phải đi qua pipeline (một patch + `apply_patch.py`, có chạy `validate.py`), để các tiến trình ghi đồng thời không đè lên nhau.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Môi trường phát triển
|
||||
|
||||
> Bản dịch từ bản tiếng Anh cập nhật ngày 2026-09-18 (English source revision 2026-09-18). Nếu có khác biệt, bản tiếng Anh được ưu tiên.
|
||||
> Bản dịch từ bản tiếng Anh cập nhật ngày 2026-09-24 (English source revision 2026-09-24). Nếu có khác biệt, bản tiếng Anh được ưu tiên.
|
||||
> Bản gốc: [`dev_env.md`](../../dev_env.md).
|
||||
|
||||
Bộ công cụ Maintainer dùng để viết và kiểm thử code trong repo này, và cách chạy từng phần trên máy.
|
||||
@@ -115,15 +115,19 @@ DEV_ADMIN_EMAIL=you@example.com
|
||||
SITE_ORIGIN=http://localhost:5173
|
||||
TURNSTILE_SITEKEY=1x00000000000000000000AA
|
||||
TURNSTILE_SECRET=1x0000000000000000000000000000000AA
|
||||
# Chỉ khi muốn thử cổng xác minh qua `npx wrangler dev` (http://localhost:8787):
|
||||
# GATE_SECRET=<32+ ký tự ngẫu nhiên, ví dụ `openssl rand -hex 32`>
|
||||
```
|
||||
|
||||
| Key | Loại | Tác dụng |
|
||||
|---|---|---|
|
||||
| `DEV_ADMIN_EMAIL` | chỉ local, tùy chọn | Vào admin mà không cần Cloudflare Access. Chỉ có hiệu lực khi host là `localhost`, `127.0.0.1` hoặc `[::1]`; bị bỏ qua ở mọi nơi khác |
|
||||
| `ADMIN_EMAILS` | secret | Danh sách email admin (phân cách bằng dấu phẩy), được kiểm tra sau Access. Không cần khi chạy local với `DEV_ADMIN_EMAIL` |
|
||||
| `TURNSTILE_SECRET` | secret | Form Suggest, đi cùng var `TURNSTILE_SITEKEY` |
|
||||
| `GH_APP_PRIVATE_KEY` | secret | Private key của GitHub App (PEM PKCS#8) cho các thao tác ghi của admin, đi cùng var `GH_APP_ID` và `GH_APP_INSTALLATION_ID` |
|
||||
| `SITE_ORIGIN` | ghi đè var | Form Suggest chỉ nhận POST có `Origin` trùng với giá trị này |
|
||||
| `TURNSTILE_SECRET` | secret | Form Suggest và cổng xác minh, đi cùng var `TURNSTILE_SITEKEY` |
|
||||
| `GATE_SECRET` | secret | Ký cookie của cổng xác minh (32+ ký tự). Thiếu nó thì cổng tắt. Khi chạy local, đặt `SITE_ORIGIN=http://localhost:8787` và mở site qua `wrangler dev`; ở đó cookie tên `fig_gate` (không có `Secure`) |
|
||||
| `GATE_BOT_TOKEN` | secret | Giá trị mà Transform Rule của zone gửi kèm cho bot đã xác minh (32+ ký tự). Bắt buộc trên production, không cần trên localhost |
|
||||
| `GH_APP_PRIVATE_KEY` | secret | Private key của GitHub App cho các thao tác ghi của admin — file PEM đúng như GitHub tải về (PKCS#1) hoặc PKCS#8, đi cùng var `GH_APP_ID` và `GH_APP_INSTALLATION_ID` |
|
||||
| `SITE_ORIGIN` | ghi đè var | Form Suggest và cổng xác minh chỉ nhận POST có `Origin` trùng với giá trị này |
|
||||
|
||||
Tính năng nào thiếu cấu hình sẽ trả về `503`; trang công khai không cần cấu hình nào trong số này.
|
||||
Hai giá trị Turnstile ở trên là test key luôn-thành-công của Cloudflare
|
||||
|
||||
+75
-28
@@ -8,25 +8,26 @@ secret: secrets are only ever typed into Cloudflare (`wrangler secret put`) or a
|
||||
|
||||
| Piece | Where | What it does |
|
||||
|---|---|---|
|
||||
| Worker `free-games-itchio-list` | Cloudflare Workers, custom domain `freeitchgames.win` | Serves the built app + `/data` (static assets), `/img` (resized covers), `/api/suggest`, `/api/ingest`, `/api/admin/*`, `/admin`, and runs the RSS cron. Config: [`webapp/wrangler.jsonc`](../webapp/wrangler.jsonc). |
|
||||
| Worker `free-games-itchio-list` | Cloudflare Workers, custom domain `freeitchgames.win` | Serves the built app + `/data` (static assets), `/img` (resized covers), the verification gate (`/api/verify`), `/api/suggest`, `/api/ingest`, `/api/admin/*`, `/admin`, and runs the RSS cron. Config: [`webapp/wrangler.jsonc`](../webapp/wrangler.jsonc). |
|
||||
| Workers Builds | Cloudflare dashboard → the Worker → Settings → Build | Builds and deploys `main` on every push (data commits included). |
|
||||
| R2 `freeitchgames-thumbs` | Cloudflare R2 | Resized WebP covers (`w160/…`, `w640/…`). |
|
||||
| D1 `freeitchgames` | Cloudflare D1 | Review queue, feed state, audit log, idempotency keys ([`webapp/worker/migrations/`](../webapp/worker/migrations)). |
|
||||
| Access apps "Admin" / "Ingest" | Cloudflare Zero Trust | Login for `/admin` + `/api/admin/*`; service token for `/api/ingest` (browser extension). |
|
||||
| Turnstile widget | Cloudflare Turnstile | Anti-spam on `/suggest`. |
|
||||
| Turnstile widget | Cloudflare Turnstile | The verification gate in front of the web app (action `gate`) and anti-spam on `/suggest` (action `suggest`). |
|
||||
| Transform Rule "Verified bots skip the gate" | Cloudflare → Rules → Transform Rules | Adds `x-fig-known-bot: <GATE_BOT_TOKEN>` to requests from Cloudflare-verified bots, so search engines and link previews skip the gate (section 1, step 14). |
|
||||
| GitHub App | GitHub → Settings → Developer settings | The Worker's identity for commits (queue approvals, edits, removals). |
|
||||
| GitHub Actions | [`.github/workflows/`](../.github/workflows) | Data pipeline (`refresh.yml`, `update.yml`, `force_update.yml`), CI, releases, build monitor. |
|
||||
| Staging Worker `free-games-itchio-list-staging` | `staging.freeitchgames.win` (whole host behind Access) | Pre-release checks of branch `v4` (`wrangler.jsonc` → `env.staging`). |
|
||||
| Staging Worker `free-games-itchio-list-staging` | `staging.freeitchgames.win` (whole host behind Access) | Optional pre-release checks, deployed by hand from any branch with `npx wrangler deploy --env staging` (`wrangler.jsonc` → `env.staging`). |
|
||||
|
||||
## 1. Cloudflare
|
||||
|
||||
Do these once (and again with the `-staging` names for the staging Worker).
|
||||
|
||||
1. **Build settings** (Worker → Settings → Build): root directory `webapp`; build command
|
||||
`npm run build`; deploy command `npx wrangler deploy` (staging: `npx wrangler deploy --env staging`,
|
||||
production branch `v4`); build variables `NODE_VERSION=24` and, once Web Analytics exists,
|
||||
`VITE_CF_BEACON_TOKEN=<token>`. Builds for non-production branches: turn them **off** for the
|
||||
staging Worker (otherwise every push to `main` also gets a preview build there).
|
||||
`npm run build`; deploy command `npx wrangler deploy`; build variable `NODE_VERSION=24` (no
|
||||
`VITE_CF_BEACON_TOKEN`: the zone injects Web Analytics, step 10). The staging Worker, if you use
|
||||
it, is deployed by hand (`npx wrangler deploy --env staging`); turn its builds for non-production
|
||||
branches **off** (otherwise every push to `main` also gets a preview build there).
|
||||
2. **Domains & routes** (Worker → Settings → Domains & Routes): keep the custom domains
|
||||
`freeitchgames.win` and `www.freeitchgames.win`; delete any `*freeitchgames.win/*` route; a Redirect
|
||||
Rule sends `www` to the apex. `workers.dev` and preview URLs stay off (`wrangler.jsonc` sets them;
|
||||
@@ -51,7 +52,10 @@ Do these once (and again with the `-staging` names for the staging Worker).
|
||||
(Access → Service credentials) named e.g. `itch-f2p-extension`, with an expiry; copy the AUD tag.
|
||||
The extension sends `CF-Access-Client-Id` / `CF-Access-Client-Secret`.
|
||||
- Staging: one self-hosted app covering all of `staging.freeitchgames.win`.
|
||||
7. **Turnstile**: add a widget (Managed) for `freeitchgames.win` and `staging.freeitchgames.win`.
|
||||
7. **Turnstile**: add a widget (Managed) for `freeitchgames.win` and `staging.freeitchgames.win`. The
|
||||
same widget serves the verification gate (action `gate`) and the Suggest form (action `suggest`);
|
||||
the Worker checks the token, the hostname and the action, so a token from one can't be used for
|
||||
the other.
|
||||
8. **Fill in `wrangler.jsonc` vars** (not secret) and commit: `ACCESS_TEAM_DOMAIN`
|
||||
(`https://<team>.cloudflareaccess.com`, no trailing slash), `ACCESS_AUD_ADMIN`, `ACCESS_AUD_INGEST`,
|
||||
`GH_APP_ID`, `GH_APP_INSTALLATION_ID`, `TURNSTILE_SITEKEY` — in both the top level and
|
||||
@@ -64,19 +68,57 @@ Do these once (and again with the `-staging` names for the staging Worker).
|
||||
npx wrangler secret put GH_APP_PRIVATE_KEY < app.private-key.pem
|
||||
npx wrangler secret put ADMIN_EMAILS # comma-separated
|
||||
npx wrangler secret put TURNSTILE_SECRET
|
||||
npx wrangler secret put GATE_BOT_TOKEN # the verification gate, step 14
|
||||
openssl rand -base64 48 | npx wrangler secret put GATE_SECRET # last: this switches the gate on
|
||||
```
|
||||
Until a feature's settings exist it answers 503; the public site works without any of them.
|
||||
10. **Web Analytics**: add the site with *manual* setup (automatic injection off) and put the token in
|
||||
the `VITE_CF_BEACON_TOKEN` build variable.
|
||||
Until a feature's settings exist it answers 503 (the gate simply stays off); the public site works
|
||||
without any of them.
|
||||
10. **Web Analytics**: the site uses the **automatic** setup — the zone injects the beacon into every
|
||||
HTML response (checked on 2026-09-24), so the build needs no token. Don't also set
|
||||
`VITE_CF_BEACON_TOKEN`: every page view would count twice. The CSPs of the app, the admin page and
|
||||
the verification page allow the beacon.
|
||||
11. **Email Routing**: create `legal@`, `privacy@`, `security@`, `takedown@freeitchgames.win` and forward
|
||||
them to your mailbox (the policies publish these addresses).
|
||||
12. **Zone settings**: SSL/TLS Full (strict), Always Use HTTPS, minimum TLS 1.2, TLS 1.3 on; Smart
|
||||
Tiered Cache; Browser Cache TTL "Respect existing headers"; Rocket Loader and Email Obfuscation
|
||||
**off** (they rewrite HTML and break the CSP); WAF managed rules on; one rate-limiting rule for
|
||||
`/api/*`; Bot Fight Mode **off** (it can't be skipped for the extension or the apps). Keep HSTS
|
||||
`/api/*`; Bot Fight Mode **off** (it can't be skipped for the extension or the apps; the
|
||||
verification gate covers the web app instead). Keep HSTS
|
||||
`preload` only if every subdomain (including `staging`) will always be HTTPS.
|
||||
13. **Notifications**: enable the Workers Builds failure notification (independent of
|
||||
`deploy-status.yml`).
|
||||
14. **Verification gate** ([`webapp/worker/gate.ts`](../webapp/worker/gate.ts)). A visitor must pass a
|
||||
Turnstile check before the app shell and `/img` are served; the pass is an HttpOnly cookie good for
|
||||
`BOT_GATE_TTL_HOURS` (1–168, default 48; lowering it also shortens passes already given out).
|
||||
`/data`, `/assets`, robots, sitemap, the social image, `/api/*` and `/admin*` stay open, and the
|
||||
desktop/Android apps are not affected. `BOT_GATE` is `"on"` in `wrangler.jsonc`, but the gate
|
||||
stays off (fails open) until both secrets below exist. In this order:
|
||||
1. Check the Workers plan: `/` now runs the Worker too (on the Free plan, Worker-first paths answer
|
||||
429 once the day's 100,000 requests are used up; `/img` already uses most of them).
|
||||
2. Generate the bot token (`openssl rand -hex 32`), keep it in your password manager, and
|
||||
`npx wrangler secret put GATE_BOT_TOKEN` it.
|
||||
3. Rules → Transform Rules → **Modify Request Header** → create "Verified bots skip the gate":
|
||||
custom filter `(cf.client.bot)` — or `(cf.client.bot and not cf.verified_bot_category in
|
||||
{"AI Crawler"})` to keep AI crawlers out — then *Set static* header `x-fig-known-bot` to the token.
|
||||
4. Check that the header reaches the Worker: add a temporary rule `(ip.src eq <your IP>)` that sets
|
||||
the same header, then `curl -s https://freeitchgames.win/api/verify` must say `"via":"bot"`.
|
||||
Delete the temporary rule. If it doesn't say so, stop here and don't set `GATE_SECRET`.
|
||||
5. `openssl rand -base64 48 | npx wrangler secret put GATE_SECRET` — the gate is on.
|
||||
6. Smoke test: `curl -sI https://freeitchgames.win/` shows `x-robots-tag: noindex, nofollow` and
|
||||
`cache-control: no-store` (the verification page); `/img/160/x` answers 403;
|
||||
`/data/index.json` answers 200 with `access-control-allow-origin: *`;
|
||||
`curl -sI -A 'Googlebot/2.1' https://freeitchgames.win/` answers 503 (only verified bots, via
|
||||
the rule, get through); a real browser passes and lands on the page it opened; Search Console →
|
||||
URL Inspection → *Test live URL* renders the real app. Watch Security → Events and Search
|
||||
Console for a week.
|
||||
|
||||
**Off switch:** `npx wrangler secret delete GATE_SECRET` turns the gate off at once, and
|
||||
data-commit deploys don't bring it back; to keep it off, set `BOT_GATE` to `"off"` in
|
||||
`wrangler.jsonc`. Staging: set `TURNSTILE_SITEKEY` and `BOT_GATE: "on"` under `env.staging` and add
|
||||
both secrets with `--env staging`. Locally: put the Turnstile test keys,
|
||||
`SITE_ORIGIN=http://localhost:8787` and a 32+ character `GATE_SECRET` in `webapp/.dev.vars`, then
|
||||
`npm run build && npx wrangler dev` (on localhost the cookie is `fig_gate`, without `Secure`, and
|
||||
no bot token is needed).
|
||||
|
||||
## 2. GitHub
|
||||
|
||||
@@ -88,25 +130,27 @@ Do these once (and again with the `-staging` names for the staging Worker).
|
||||
Dependabot security updates on; CodeQL default setup and secret scanning if you want them (the
|
||||
policies don't claim them). Rulesets: target the default branch (block deletion and force
|
||||
pushes); protect tags `v*`. Merge PRs with squash or a merge commit — never fast-forward.
|
||||
3. **Secrets**: keep `DISCORD_CI_WEBHOOK`, the release webhooks and the Android keystore secrets;
|
||||
delete `GH_TOKEN`, `TELEGRAM_BOT_TOKEN` and `DISCUSSION_*` once nothing uses them.
|
||||
3. **Secrets**: keep `DISCORD_CI_WEBHOOK`, the release webhooks and the Android keystore secrets.
|
||||
`GH_TOKEN`, `TELEGRAM_BOT_TOKEN` and the three `DISCUSSION_*` secrets are still set but no workflow
|
||||
uses them any more (checked 2026-09-24): delete them.
|
||||
4. **Signing key**: the old key `03F965C2E2DB5C6B` was exposed; sign with the replacement key.
|
||||
|
||||
## 3. Release order for v4
|
||||
## 3. Releasing a version
|
||||
|
||||
1. Merge PR #81 (Phase 0), then PR #82 (Phase 1). Dispatch **Refresh catalog** once with a small
|
||||
`budget` (e.g. 50) and check the run summary.
|
||||
2. Rebase `v4` on `main`, push it, open the v4 PR. Set up the staging Worker (1.1, 1.3–1.9 with the
|
||||
staging names) and check `staging.freeitchgames.win`: covers load through `/img`, `/admin` asks
|
||||
for login (also in a private window), a Suggest submission appears in the admin queue, approving
|
||||
it creates a verified commit on a scratch branch or `main`, the Web Analytics beacon and Turnstile
|
||||
raise no CSP errors.
|
||||
3. Production: complete section 1 for the production names, apply the D1 migrations, then merge the v4
|
||||
PR (squash or merge commit). Watch the Workers Build; roll back from Workers → Deployments if
|
||||
needed.
|
||||
4. Tag `v4.0.0` from `main` (see the release process in [`CLAUDE.md`](../CLAUDE.md)), wait for the
|
||||
desktop + Android assets on the draft, publish it.
|
||||
5. Switch the browser extension to `/api/ingest` with the service token, then revoke its old PAT.
|
||||
1. Bump the version everywhere it lives: `webapp/src/lib/about.ts` (`APP.version`),
|
||||
`webapp/package.json` + `package-lock.json` (`npm version X.Y.Z --no-git-tag-version`),
|
||||
`webapp/src-tauri/tauri.conf.json`, `webapp/src-tauri/Cargo.toml` + `Cargo.lock`, and the version
|
||||
badges of `README.md` / `README.vi.md`. Write the notes in
|
||||
`changelog/<major>.x/ver<major>.<minor>.x.md` and add the row to [`CHANGELOG.md`](../CHANGELOG.md).
|
||||
2. Open a PR; when CI is green, merge it with squash or a merge commit — never fast-forward. A push
|
||||
that touches the changelog posts to Discussions → General unless the head commit says
|
||||
`[skip-discuss]` (the release announcement usually covers it).
|
||||
3. Apply any new D1 migration and set any new secret **before** the merge deploys code that needs them.
|
||||
4. Tag from `main`: `git fetch origin && git tag -s vX.Y.Z origin/main -m "…"`, then
|
||||
`git push origin vX.Y.Z`. `release_desktop.yml` opens one draft release and the desktop and Android
|
||||
jobs upload into it (12 assets for 4.x). Never create the release by hand first.
|
||||
5. When every asset is there, edit the title and notes (from the changelog), then
|
||||
`gh release edit vX.Y.Z --draft=false` — that fires the Discord and Discussions announcements.
|
||||
|
||||
## 4. Routine
|
||||
|
||||
@@ -121,3 +165,6 @@ Do these once (and again with the `-staging` names for the staging Worker).
|
||||
site keeps serving the previous deployment meanwhile.
|
||||
- **New D1 migration**: add `webapp/worker/migrations/000N_*.sql` (never edit applied ones), apply it
|
||||
to staging and production by hand, then deploy.
|
||||
- **Verification gate misbehaving** (visitors stuck on the check, crawl errors in Search Console):
|
||||
`npx wrangler secret delete GATE_SECRET` turns it off at once; then look at `npx wrangler tail` and
|
||||
`curl -s https://freeitchgames.win/api/verify`.
|
||||
+6
-1
@@ -104,7 +104,12 @@ Tauri apps use hash routes (`HashRouter`) on their custom protocol
|
||||
([`src/components/app-router.tsx`](src/components/app-router.tsx)). The Worker serves the app shell
|
||||
with `200` for known routes, `404` for anything else and a `301` for renamed routes
|
||||
(`/deleted` → `/removed`), so [`worker/spa.ts`](worker/spa.ts) must be kept in sync with `App.tsx`.
|
||||
Every route except `/`, `/games`, `/removed` and the Not Found page is `React.lazy`.
|
||||
Every route except `/`, `/games` and the Not Found page is `React.lazy`.
|
||||
|
||||
With the verification gate on, a visitor who has not passed the Turnstile check gets the
|
||||
verification page instead of the shell on every app route (and `403` on `/img`); see
|
||||
[`worker/gate.ts`](worker/gate.ts) and the setup in
|
||||
[`docs/operations.md`](../docs/operations.md) (section 1, step 14).
|
||||
|
||||
## Admin (`/admin/`)
|
||||
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ npm run tauri:build
|
||||
|
||||
- Windows: `webapp/src-tauri/target/release/bundle/msi/*.msi` and `nsis/*.exe`
|
||||
- macOS: `webapp/src-tauri/target/release/bundle/dmg/*.dmg` and `macos/*.app`
|
||||
- Linux: `webapp/src-tauri/target/release/bundle/{appimage,deb}/*`
|
||||
- Linux: `webapp/src-tauri/target/release/bundle/{appimage,deb,rpm}/*`
|
||||
|
||||
### Installer license page
|
||||
|
||||
@@ -89,7 +89,7 @@ only the desktop and Android apps.
|
||||
push (or `workflow_dispatch`). Its `create-release` job opens **one draft** GitHub Release; the build
|
||||
jobs (Windows, macOS aarch64 + x86_64 cross-compiled from an Apple Silicon runner, Linux) upload into
|
||||
it: `.msi` / `.exe`, `.dmg` / `.app.tar.gz` / `.pkg` (built with `pkgbuild`, identifier read from
|
||||
`tauri.conf.json`), `.deb` / `.AppImage`. Release builds use no npm / cargo caches. The Android job
|
||||
`tauri.conf.json`), `.deb` / `.rpm` / `.AppImage`. Release builds use no npm / cargo caches. The Android job
|
||||
([below](#ci)) attaches the APK to the same draft; the Maintainer publishes it once every asset is
|
||||
there (release steps: [`CLAUDE.md`](../CLAUDE.md#release--tag-process)).
|
||||
|
||||
|
||||
+13
-4
@@ -1,9 +1,12 @@
|
||||
# Cloudflare Workers static-asset headers (files in dist/ only — responses the
|
||||
# Worker builds itself set their own, see worker/http.ts).
|
||||
# Cloudflare Workers static-asset headers: files in dist/, served directly or
|
||||
# fetched by the Worker through env.ASSETS (the app shell). Responses the Worker
|
||||
# builds itself set their own — JSON and /img in worker/http.ts, the
|
||||
# verification page (its own CSP with a nonce) in worker/gate-page.ts.
|
||||
# HSTS and X-Content-Type-Options are already sent by the zone.
|
||||
#
|
||||
# CSP: everything is same-origin (/data catalog, /img covers). The Cloudflare
|
||||
# Web Analytics beacon and Turnstile (Suggest form) are the only third parties.
|
||||
# CSP: everything is same-origin (/data catalog, /img covers). The only third
|
||||
# parties are the Cloudflare Web Analytics beacon, which the zone injects into
|
||||
# every HTML response, and Turnstile (the Suggest form).
|
||||
# style-src needs 'unsafe-inline' (Radix and Recharts set inline styles at runtime).
|
||||
/*
|
||||
Referrer-Policy: strict-origin-when-cross-origin
|
||||
@@ -28,5 +31,11 @@
|
||||
/icon-*
|
||||
Cache-Control: public, max-age=604800
|
||||
|
||||
/favicon.svg
|
||||
Cache-Control: public, max-age=604800
|
||||
|
||||
/manifest.webmanifest
|
||||
Cache-Control: public, max-age=86400
|
||||
|
||||
/.well-known/security.txt
|
||||
Cache-Control: public, max-age=86400
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Cloudflare Turnstile, loaded on demand (only the Suggest page needs it; the
|
||||
* Cloudflare Turnstile, loaded on demand (in the app only the Suggest page needs it; the
|
||||
* site CSP allows its script and frame). Explicit rendering, so the widget
|
||||
* mounts and unmounts with the React component.
|
||||
*/
|
||||
|
||||
@@ -138,10 +138,12 @@ export function buildInfo(): Plugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Cloudflare Web Analytics beacon (cookieless), web build only, and only when
|
||||
* the build has a token (Workers Builds variable VITE_CF_BEACON_TOKEN; set up
|
||||
* the site as "manual" with automatic injection off). Never on the admin page,
|
||||
* whose CSP allows only its own scripts. The site CSP allows the beacon.
|
||||
* Cloudflare Web Analytics beacon (cookieless) for a *manual* Web Analytics
|
||||
* setup: web build only, only when the build has a token (Workers Builds
|
||||
* variable VITE_CF_BEACON_TOKEN), never on the admin page. freeitchgames.win
|
||||
* uses the automatic setup instead — the zone injects the beacon into every
|
||||
* HTML response — so the token stays unset; setting it too would count every
|
||||
* page view twice. The site CSP allows the beacon either way.
|
||||
*/
|
||||
export function analyticsBeacon(token: string | undefined): Plugin {
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user