Skip to content

fix(csp): allow the self-hosted Umami tracker - #178

Merged
manager merged 1 commit into
devfrom
umami-csp
Aug 12, 2026
Merged

fix(csp): allow the self-hosted Umami tracker#178
manager merged 1 commit into
devfrom
umami-csp

Conversation

@manager

@manager manager commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #176. Our own Content-Security-Policy blocks the tracker: analytics.administration.ae is missing from script-src (the script never loads) and from connect-src (events never send). Adds the host to both lists in next.config.js.

Found while verifying the production release: the origin serves the tag correctly, but no browser would have executed it.

🤖 Generated with Claude Code

The Umami script tag shipped in #176 is blocked by our own CSP: neither
script-src nor connect-src allows analytics.administration.ae, so browsers
refuse to load the tracker and to send events. Adds the host to both.
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Claude finished @manager's task in 36s —— View job


Review: allow the self-hosted Umami tracker in CSP

  • Gather context (diff, CSP config, _document.tsx)
  • Understand the request
  • Review the change
  • Post final review

Correct and minimal fix. Verified against src/pages/_document.tsx:16-21: the Umami <script> tag has no data-host-url override, so event beacons POST back to the same origin the script was loaded from (analytics.administration.ae). That means the host genuinely needs to be in both script-src (to load script.js) and connect-src (to send events) — this PR adds exactly that, matching the existing metrics.administration.ae pattern already used for AI Atlas.

No issues found:

  • Values are added to the existing .filter(Boolean).join(' ') arrays, consistent with surrounding style.
  • Comments (// Self-hosted Umami tracker. / // Self-hosted Umami event collection.) are appropriately terse and explain non-obvious intent.
  • No unrelated changes, no hardcoded secrets, no scope creep — a clean 4-line, single-file diff.

Nothing to flag. Approving the change on merits (note: I can't submit a formal GitHub approval per my permissions).

@manager
manager merged commit 1c69c67 into dev Aug 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant