diff --git a/Dockerfile b/Dockerfile index 2e5cc769c..3691e898a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM python:3.8 +FROM python:3.10.6 ENV PYTHONUNBUFFERED 1 RUN mkdir /bugheist WORKDIR /bugheist -ADD . /bugheist +COPY . /bugheist # Install PostgreSQL dependencies @@ -18,12 +18,13 @@ RUN apt-get update && apt-get install -y \ libmemcached-dev \ libz-dev -RUN pip install pipenv -RUN pipenv install -RUN python manage.py migrate --noinput +RUN pip install poetry +RUN poetry config virtualenvs.create false +RUN poetry install + +RUN python manage.py migrate RUN python manage.py loaddata website/fixtures/initial_data.json -RUN python manage.py collectstatic +# RUN python manage.py collectstatic RUN python manage.py initsuperuser -CMD ["python","manage.py","runserver"] \ No newline at end of file diff --git a/bugheist/settings.py b/bugheist/settings.py index cfd78eeb1..4762ac749 100644 --- a/bugheist/settings.py +++ b/bugheist/settings.py @@ -282,7 +282,7 @@ SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") # Allow all host headers -ALLOWED_HOSTS = [".bugheist.com", "127.0.0.1", "localhost", "bugheist-staging.herokuapp.com"] +ALLOWED_HOSTS = [".bugheist.com", "127.0.0.1", "localhost", "bugheist-staging.herokuapp.com","0.0.0.0"] # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..3ab172ce1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + app: + command: "poetry run python manage.py runserver 0.0.0.0:8000" + build: . + volumes: + - .:/bugheist + ports: + - "8000:8000" \ No newline at end of file diff --git a/website/views.py b/website/views.py index 800a93c27..cd725b8a4 100644 --- a/website/views.py +++ b/website/views.py @@ -558,6 +558,7 @@ def get_initial(self): return initial def form_valid(self, form): + tokenauth = False obj = form.save(commit=False) if self.request.user.is_authenticated: @@ -568,6 +569,11 @@ def form_valid(self, form): obj.user = User.objects.get(id=token.user_id) tokenauth = True + captcha_form = CaptchaForm(self.request.POST) + if not captcha_form.is_valid(): + messages.error(self.request, "Invalid Captcha!") + return HttpResponseRedirect("/issue/") + domain, created = Domain.objects.get_or_create( name=obj.domain_name.replace("www.", ""), defaults={"url": "http://" + obj.domain_name.replace("www.", "")},