Skip to content

Commit

Permalink
settings: Remove allow CIDR middleware, not necessary any more, and i…
Browse files Browse the repository at this point in the history
…s unmaintained and insecure.
  • Loading branch information
Kurocon committed Feb 17, 2025
1 parent 49a1c5c commit 10de156
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
12 changes: 0 additions & 12 deletions amelie/settings/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,11 @@ def custom_show_toolbar(request):
# Do not redirect to HTTPS, because the nginx proxy container only listens on HTTP
SECURE_SSL_REDIRECT = False

# Add allow cidr middleware as first middleware
MIDDLEWARE = ["allow_cidr.middleware.AllowCIDRMiddleware"] + MIDDLEWARE

# Allowed hosts -- localhost and 127.0.0.1 are always allowed, the rest comes from an environment variable.
ALLOWED_HOSTS = [
"localhost", "127.0.0.1"
] + env.list("DJANGO_ALLOWED_HOSTS", default=[])

# Allowed CIDR nets -- for kubernetes internal services
ALLOWED_CIDR_NETS = ['172.30.0.0/16']
ALLOWED_CIDR_NETS.extend(env.list("DJANGO_ALLOWED_CIDR_NETS", default=[]))

# Add Kubernetes POD IP, if running in Kubernetes
KUBE_POD_IP = env("THIS_POD_IP", default="")
if KUBE_POD_IP:
ALLOWED_CIDR_NETS.append(KUBE_POD_IP)

# Example: DJANGO_ADMINS="Jan Janssen <[email protected]>, Bob de Bouwer <[email protected]>"
ADMINS = getaddresses([env("DJANGO_ADMINS", default="WWW-committee <[email protected]>")])
MANAGERS = ADMINS
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ celery>=5.3.5,<5.4
flower==1.2.0
django-celery-results>=2.4,<2.5

django-allow-cidr>=0.5.0,<0.6
django-compressor>=4.1,<4.2
django-localflavor>=3.1,<3.2
django-extensions>=3.2.1,<3.3
Expand Down

0 comments on commit 10de156

Please sign in to comment.