+
+ {window.location.port !== '8010' && (
+
+ You're currently using the app over port 8000,
+
+ which only serves the web app, without capture (/e/).
+
+ Use port 8010 for full PostHog, proxied via Caddy.
+ >
+ }
+ placement="right"
+ >
+
+
+
+ Click here to fix port!
+
+
+
+ )}
)
}
diff --git a/frontend/src/scenes/PreflightCheck/preflightLogic.tsx b/frontend/src/scenes/PreflightCheck/preflightLogic.tsx
index 8bae1653241c7..a48c832ce7979 100644
--- a/frontend/src/scenes/PreflightCheck/preflightLogic.tsx
+++ b/frontend/src/scenes/PreflightCheck/preflightLogic.tsx
@@ -230,7 +230,17 @@ export const preflightLogic = kea([
// http://localhost:6006, but in the local dockerized setup http://host.docker.internal:6006
return false
}
- return !!preflight && (!preflight.site_url || preflight.site_url != window.location.origin)
+ const isMismatchPresent =
+ !!preflight && (!preflight.site_url || preflight.site_url != window.location.origin)
+ if (
+ isMismatchPresent &&
+ preflight.site_url === 'http://localhost:8010' &&
+ window.location.origin === 'http://localhost:8000'
+ ) {
+ // Local development setup using the old port - we have a warning in DebugNotice for this
+ return false
+ }
+ return isMismatchPresent
},
],
configOptions: [
diff --git a/posthog/settings/__init__.py b/posthog/settings/__init__.py
index 3e7ebc0b7c984..e39ab1506bdb8 100644
--- a/posthog/settings/__init__.py
+++ b/posthog/settings/__init__.py
@@ -58,7 +58,7 @@
"disable_paid_fs": disable_paid_fs,
}
-SITE_URL: str = os.getenv("SITE_URL", "http://localhost:8000").rstrip("/")
+SITE_URL: str = os.getenv("SITE_URL", "http://localhost:8010").rstrip("/")
INSTANCE_TAG: str = os.getenv("INSTANCE_TAG", "none")
if DEBUG:
diff --git a/posthog/settings/access.py b/posthog/settings/access.py
index 6915d320abcf2..34cfcf2065e57 100644
--- a/posthog/settings/access.py
+++ b/posthog/settings/access.py
@@ -25,7 +25,12 @@
if get_from_env("DISABLE_SECURE_SSL_REDIRECT", False, type_cast=str_to_bool):
SECURE_SSL_REDIRECT = False
-CSRF_TRUSTED_ORIGINS = [os.getenv("SITE_URL", "http://localhost:8000").rstrip("/")]
+raw_site_url = os.getenv("SITE_URL")
+CSRF_TRUSTED_ORIGINS = (
+ [raw_site_url.rstrip("/")]
+ if raw_site_url
+ else ["http://localhost:8000", "http://localhost:8010"] # 8000 is just Django, 8010 is Django + Capture via Caddy
+)
# Proxy settings
IS_BEHIND_PROXY = get_from_env("IS_BEHIND_PROXY", False, type_cast=str_to_bool)