From c49cc70c188ca5efd9dc4e2ab8ad5507452b46c0 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Sun, 31 May 2026 08:33:29 -0400 Subject: [PATCH] feat(analytics): load Umami first-party via /_a on both docs sites (ADR-0006 Phase 2b) Switch user-docs (docs.jellyrock.app) and dev-docs (dev.jellyrock.app) from the cross-origin analytics.jellyrock.app tracker to the same-origin /_a proxy (live since infra #27): src: '/_a/script.js' data-host-url: 'https://docs.jellyrock.app/_a' (resp. https://dev.jellyrock.app/_a) Events POST to /_a/api/send, which Caddy strips to umami's /api/send. Works under the current CSP already (/_a/script.js is 'self'); the shared CSP tightens to script-src 'self' in the final infra phase. analytics.jellyrock.app stays live as rollback (Bridge scope). Verified: both workspaces build; check (astro+eslint+prettier) clean; each dist/index.html embeds /_a/script.js with zero analytics.jellyrock.app refs. --- dev-docs/astro.config.mjs | 5 ++++- user-docs/astro.config.mjs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dev-docs/astro.config.mjs b/dev-docs/astro.config.mjs index e0dd26a..4542a30 100644 --- a/dev-docs/astro.config.mjs +++ b/dev-docs/astro.config.mjs @@ -39,8 +39,11 @@ export default defineConfig({ tag: 'script', attrs: { defer: true, - src: 'https://analytics.jellyrock.app/script.js', + // First-party Umami tracker via the same-origin /_a proxy + // (ADR-0006) so the CSP can stay strict script-src 'self'. + src: '/_a/script.js', 'data-website-id': 'de160b80-2b3e-488e-b9df-d9a92ca42e1c', + 'data-host-url': 'https://dev.jellyrock.app/_a', }, }, ], diff --git a/user-docs/astro.config.mjs b/user-docs/astro.config.mjs index 7a4a788..639b4ce 100644 --- a/user-docs/astro.config.mjs +++ b/user-docs/astro.config.mjs @@ -22,8 +22,11 @@ export default defineConfig({ tag: 'script', attrs: { defer: true, - src: 'https://analytics.jellyrock.app/script.js', + // First-party Umami tracker via the same-origin /_a proxy + // (ADR-0006) so the CSP can stay strict script-src 'self'. + src: '/_a/script.js', 'data-website-id': 'f86f75e9-4236-40c4-bf32-7ef74f1939d8', + 'data-host-url': 'https://docs.jellyrock.app/_a', }, }, ],