fix(analytics): restrict Umami to production hostnames #4
@@ -178,7 +178,9 @@ jobs:
|
|||||||
- name: Review PR diff with Claude Code
|
- name: Review PR diff with Claude Code
|
||||||
env:
|
env:
|
||||||
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
GITEA_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
# Auto-provided per-run token from Gitea Actions (repo-scoped).
|
||||||
|
# GITHUB_TOKEN is the documented name; GITEA_TOKEN is its alias.
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
PR_NUMBER: ${{ gitea.event.pull_request.number }}
|
PR_NUMBER: ${{ gitea.event.pull_request.number }}
|
||||||
|
|||||||
+4
-3
@@ -56,7 +56,7 @@ fail the E2E gate. That's the point: staging absorbs the risk.
|
|||||||
|
|
||||||
| Secret | Purpose |
|
| Secret | Purpose |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `REGISTRY_TOKEN` | push images to the registry + post PR review comments (already set) |
|
| `REGISTRY_TOKEN` | push images to privaterepo.sitaru.org (already set) |
|
||||||
| `CLAUDE_CODE_OAUTH_TOKEN` | Claude Code subscription auth for the PR review — generate with `claude setup-token` on your machine |
|
| `CLAUDE_CODE_OAUTH_TOKEN` | Claude Code subscription auth for the PR review — generate with `claude setup-token` on your machine |
|
||||||
| `PORTAINER_STAGING_WEBHOOK` | staging stack redeploy webhook URL |
|
| `PORTAINER_STAGING_WEBHOOK` | staging stack redeploy webhook URL |
|
||||||
| `PORTAINER_PROD_WEBHOOK` | production stack redeploy webhook URL |
|
| `PORTAINER_PROD_WEBHOOK` | production stack redeploy webhook URL |
|
||||||
@@ -125,7 +125,8 @@ numbers, so scheduled data refreshes don't break the gate.
|
|||||||
|
|
||||||
`scripts/ci/ai_review.py` pipes the PR diff through headless Claude Code
|
`scripts/ci/ai_review.py` pipes the PR diff through headless Claude Code
|
||||||
(`claude -p`, authenticated with the subscription OAuth token — no API
|
(`claude -p`, authenticated with the subscription OAuth token — no API
|
||||||
billing), posts the structured findings as a PR comment via the Gitea API
|
billing), posts the structured findings as a PR comment using the per-run
|
||||||
(reusing `REGISTRY_TOKEN`), and fails the check only when a finding is rated
|
token Gitea Actions provides automatically (`secrets.GITEA_TOKEN` — no setup
|
||||||
|
needed), and fails the check only when a finding is rated
|
||||||
**severe** (would break prod, leak data, or corrupt data). Minor findings are
|
**severe** (would break prod, leak data, or corrupt data). Minor findings are
|
||||||
informational and never block a merge.
|
informational and never block a merge.
|
||||||
|
|||||||
@@ -76,9 +76,12 @@ export default function RootLayout({
|
|||||||
<head>
|
<head>
|
||||||
<link rel="preconnect" href="https://analytics.schoolcompare.co.uk" />
|
<link rel="preconnect" href="https://analytics.schoolcompare.co.uk" />
|
||||||
<link rel="preconnect" href="https://api.postcodes.io" />
|
<link rel="preconnect" href="https://api.postcodes.io" />
|
||||||
|
{/* data-domains: the tracker only fires on the production hostnames,
|
||||||
|
so staging (same image, different host) never pollutes Umami */}
|
||||||
<Script
|
<Script
|
||||||
src="https://analytics.schoolcompare.co.uk/script.js"
|
src="https://analytics.schoolcompare.co.uk/script.js"
|
||||||
data-website-id="d7fb0c95-bb6c-4336-8209-bd10077e50dd"
|
data-website-id="d7fb0c95-bb6c-4336-8209-bd10077e50dd"
|
||||||
|
data-domains="schoolcompare.co.uk,www.schoolcompare.co.uk"
|
||||||
data-performance="true"
|
data-performance="true"
|
||||||
strategy="afterInteractive"
|
strategy="afterInteractive"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user