-
-
Notifications
You must be signed in to change notification settings - Fork 275
enable configuration of allowed host #404
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
Conversation
|
This is strange. Why do we even have heroku hardcoded in there? |
|
@Hritik14 |
|
@sbs2001 I guess we should remove heroku as well. It could turn out to really unwanted for some installations. |
vulnerablecode/settings.py
Outdated
|
|
||
| ALLOWED_HOSTS = [ | ||
| ".herokuapp.com", | ||
| os.environ.get("VC_ALLOWED_HOSTS", ".herokuapp.com"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VC_ALLOWED_HOSTS here is not great since you are providing a single host through the environ and not a list of hosts.
I would suggest a simple VC_HOST for this env variable.
Also, we probably want to remove the ".herokuapp.com" default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to keep it near the django semantics, so I switched the variable to be splitable.
I removed herokuapp to switch to '*' for the default, as I am not sure we really want to get it not work by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that VC_ALLOWED_HOSTS can be used to specify multiple hosts separated via a colon, it solves both of the issues you guys pointed out ?
Signed-off-by: Pierre Tardy <pierre.tardy@renault.com>
|
Is it not better to let the let the user configure their |
|
In my case, I am deploying vulnerablecode via docker in a kubernetes cluster, so I would prefer to have a default configuration which does not require to modify the app code. |
when deploying this outside of heroku, we get strange 400 errors, which turn out to be this variable that needs to be configured.