Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show warning if SITE_ENV is incorrect #2951

Closed
2 tasks
mariusandra opened this issue Jan 14, 2021 · 1 comment · Fixed by #4172
Closed
2 tasks

Show warning if SITE_ENV is incorrect #2951

mariusandra opened this issue Jan 14, 2021 · 1 comment · Fixed by #4172
Labels
bug Something isn't working right good first issue Good for newcomers infrastructure Everything related to deploying PostHog P2 Semi-urgent, non-breaking, affects UX but functional

Comments

@mariusandra
Copy link
Collaborator

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 to SITE_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 the SITE_URL variable is set to http://localhost:8000/ or even https://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

  1. Install PostHog.
  2. Either use a webhook or setup e-mail and invite an user (but forget to update SITE_URL)
  3. Be confused as to why the link doesn't work.

Environment

  • PostHog Cloud
  • self-hosted PostHog, version/commit: please provide

Additional context

Was raised in the users' slack.

Thank you for your bug report – we love squashing them!

@mariusandra mariusandra added the bug Something isn't working right label Jan 14, 2021
@macobo macobo added the infrastructure Everything related to deploying PostHog label Jan 15, 2021
@yakkomajuri yakkomajuri added the good first issue Good for newcomers label Jan 15, 2021
@paolodamico
Copy link
Contributor

paolodamico commented Jan 15, 2021

Love this! Adding a suggestion, maybe only show the warning to admin/owner users? I also think it's worth referencing the relevant page of the docs (after it has been updated, if applicable), so whomever picks this up has all the information in hand.

@EDsCODE EDsCODE added the P2 Semi-urgent, non-breaking, affects UX but functional label Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right good first issue Good for newcomers infrastructure Everything related to deploying PostHog P2 Semi-urgent, non-breaking, affects UX but functional
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants