Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ ENV PYTHONUNBUFFERED 1
RUN mkdir /vulnerablecode
WORKDIR /vulnerablecode
ADD . /vulnerablecode/
RUN pip install -r requirements.txt
RUN pip install -r requirements.txt && \
DJANGO_DEV=1 python manage.py collectstatic

LABEL "base_image": "pkg:docker/python@sha256%3Ae9b7e3b4e9569808066c5901b8a9ad315a9f14ae8d3949ece22ae339fff2cad0"
LABEL "dockerfile_url": "https://github.com/nexB/vulnerablecode/blob/develop/Dockerfile"
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ On Debian-based distros, these can be installed with::

**Application dependencies**

Create a virtualenv, install dependencies, and run the database migrations::
Create a virtualenv, install dependencies, generate static files and run the database migrations::

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
DJANGO_DEV=1 python manage.py collectstatic
DJANGO_DEV=1 python manage.py migrate

The environment variable ``DJANGO_DEV`` is used to load settings suitable for
Expand Down
1 change: 1 addition & 0 deletions vulnerablecode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG_PROPAGATE_EXCEPTIONS = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling this when the DJANGO_DEV=1 env variable is also set is probably better idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, the whole point is to stil enable this when not using DJANGO_DEV.

If we don't have this in prod, we have absolutely no visibility in case of error 500.

This setting allows to propagate the exception to the base logger, and thus to display them in runserver's stdout.
I dont think there are security implication to this.

If we are in DJANGO_DEV, then DEBUG is true, and exception is printed in the browser along with debug UI which is really insecure.


ALLOWED_HOSTS = [
".herokuapp.com",
Expand Down