Skip to content

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

This is my blog and home page.

Installation

npm install

Running development server:

npm start

Server is located at http://localhost:3000

Running tests:

npm test

Building

Change buildPath in webpack.config.js, then:

npm run build

PostHog SDK (self-hosted, pinned, lean)

Every site on ciunkos.com loads PostHog from /vendor/posthog/<build>/posthog.js (build = <version>-<sha256 prefix>) with an SRI hash, never from PostHog. The Workers' /ph/* proxies only pass events and JSON config.

The file is built by scripts/vendor-posthog.mjs from scripts/posthog/entry.ts: PostHog's TypeScript source at the commit tagged posthog-js@<version> (pinned in versions.json), bundled and tree-shaken with the pinned esbuild. It keeps only what the sites use (click autocapture, pageviews, web vitals, exceptions, session replay) and has no external script loader, so it can't fetch more code. Same queue contract as PostHog's array.js snippet.

  • posthog-js is pinned exactly in package.json. Dependabot proposes updates weekly, 7 days after release. On its PR, .github/workflows/vendor-posthog.yml builds and commits the new src/www/vendor/posthog/<build>/, versions.json and src/utils/posthog-sdk.mjs.
  • Manually: npm ci --ignore-scripts && npm run vendor:posthog.
  • node scripts/vendor-posthog.mjs --check --rebuild proves the vendored file is reproducible.
  • Old versions stay in src/www/vendor/posthog/ until no Worker points at them.
  • After the Pages deploy, sync the copies in the other repos and deploy them: node scripts/check-posthog-copies.mjs --fix.

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages