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

The URL for the allow list script on the admin page should be "HTTPS" in live #247

Open
2 tasks
jon-betts opened this issue Mar 18, 2021 · 4 comments
Open
2 tasks
Assignees
Labels
Backend bug Something isn't working

Comments

@jon-betts
Copy link
Contributor

jon-betts commented Mar 18, 2021

Currently the admin page gives a command to run to upload allow rules, but the route it gives to call it on is always "HTTP" rather than the "HTTPS" it needs to be to work anywhere other than locally.

This requires you to edit this before you run it and will cause confusion one day:

This was created as a result of: #195

@jon-betts jon-betts added the bug Something isn't working label Mar 18, 2021
@jon-betts jon-betts self-assigned this Mar 18, 2021
@jon-betts
Copy link
Contributor Author

jon-betts commented Mar 23, 2021

There's quite a chain of calls inside route_url, but I think we need to have the environment variable wsgi.url_scheme for webob.request:BaseRequest.host_url() to pick up.

This is set by gunicorn I think in response to certain headers as specified here: https://docs.gunicorn.org/en/stable/settings.html#secure-scheme-headers. The defaults are:

{'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}

So best guess first is this isn't getting passed on for some reason.

@jon-betts
Copy link
Contributor Author

jon-betts commented Mar 23, 2021

It seems like by default ElasticBeanstalk should be sending X-FORWARDED-PROTO:

https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/x-forwarded-headers.html#x-forwarded-proto

Edit: I'm not sure this is the right thing, or we're even using it. Ian is going to take a look as this is getting outside of my comfort zone.

@seanh seanh added the Backend label Apr 1, 2021
@indigobravo indigobravo self-assigned this Jun 1, 2021
@indigobravo
Copy link
Member

I have taken a look into this issue, but I have not been able to find a workable solution. Here is a link to a slack thread where we have discussed the problem further. https://hypothes-is.slack.com/archives/CR3E3S7K8/p1616521583023800

I can take another look into this, but I am going to need to scheduled this after the work to get Canada deployed complete.

@jon-betts
Copy link
Contributor Author

I think this is enough to park this for now:

  • The immediate impact is low
  • It doesn't look trivial to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants