From 9f17d834f670753fbad16870eca958e19aa41a9c Mon Sep 17 00:00:00 2001 From: "DESKTOP-RTLN3BA\\$punk" Date: Wed, 11 Mar 2026 23:18:09 -0700 Subject: [PATCH] fix: update PostHog configuration for improved tracking - Changed PostHog API host to a secure URL to enhance data ingestion. - Updated default date for event tracking to reflect a new timeline. --- surfsense_web/instrumentation-client.ts | 4 ++-- surfsense_web/next.config.ts | 21 --------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/surfsense_web/instrumentation-client.ts b/surfsense_web/instrumentation-client.ts index 31a4e620e..bb2bd08c5 100644 --- a/surfsense_web/instrumentation-client.ts +++ b/surfsense_web/instrumentation-client.ts @@ -5,9 +5,9 @@ function initPostHog() { if (!process.env.NEXT_PUBLIC_POSTHOG_KEY) return; posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, { - api_host: "/ingest", + api_host: "https://assets.surfsense.com", ui_host: "https://us.posthog.com", - defaults: "2025-11-30", + defaults: "2026-01-30", capture_pageview: "history_change", capture_pageleave: true, before_send: (event) => { diff --git a/surfsense_web/next.config.ts b/surfsense_web/next.config.ts index 2b8c31062..075383682 100644 --- a/surfsense_web/next.config.ts +++ b/surfsense_web/next.config.ts @@ -52,27 +52,6 @@ const nextConfig: NextConfig = { return config; }, - - // PostHog reverse proxy configuration - // This helps bypass ad blockers by routing requests through your domain - async rewrites() { - return [ - { - source: "/ingest/static/:path*", - destination: "https://us-assets.i.posthog.com/static/:path*", - }, - { - source: "/ingest/:path*", - destination: "https://us.i.posthog.com/:path*", - }, - { - source: "/ingest/decide", - destination: "https://us.i.posthog.com/decide", - }, - ]; - }, - // Required for PostHog reverse proxy to work correctly - skipTrailingSlashRedirect: true, }; // Wrap the config with MDX and next-intl plugins