Show warning if SITE_ENV is incorrect #2951
Labels
bug
Something isn't working right
good first issue
Good for newcomers
P2
Semi-urgent, non-breaking, affects UX but functional
team/infra
Everything related to deploying PostHog
Bug description
The SITE_ENV variable, which is quite useful for PostHog to function properly, is not mentioned in any of the deployment guides and only alluded to in the Configuring Email page.
Apparently upgrading from one version of posthog to another broke some links in invite e-mails. I'm not sure, but I assume the e-mail sending code went into an async task, and as of such the URL couldn't be taken from
request
anymore, but reverted toSITE_URL
that was unset. The e-mail config docs say to set this variable, but it might be easy to skip. Not sure.Expected behavior
I'd expect the site to give me a warning if I'm visiting
https://posthog.mysite.com/
while theSITE_URL
variable is set tohttp://localhost:8000/
or evenhttps://posthog.othersite.com/
.In an ideal world, I would see a warning like "You're browsing posthog from https://posthog.newsite.com/ yet your SITE_URL variable is set to https://posthog.oldurl.com/. Would you like to update it?" and a button to update it directly. Alternatively it would send me to a page on the docs that would describe the situation.
How to reproduce
Environment
Additional context
Was raised in the users' slack.
Thank you for your bug report – we love squashing them!
The text was updated successfully, but these errors were encountered: