Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Mar 12, 2024
1 parent a37c8cb commit 8dd295f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
1 change: 0 additions & 1 deletion .dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ DJANGO_SECRET_KEY=
DJANGO_DEBUG=True
DJANGO_BASE_URL="https://localhost:8080"
DJANGO_DB_ENGINE=django.db.backends.sqlite3
DJANGO_DB_NAME=${BACKEND_DIR}/db.sqlite3
DJANGO_REDIS_HOST=${REDIS_IP}
DJANGO_REDIS_PORT=${REDIS_PORT}
DJANGO_REDIS_PASSWORD=${REDIS_PASSWORD}
3 changes: 3 additions & 0 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ COPY requirements.txt /code/
RUN pip install -r requirements.txt

COPY . /code/

RUN ./setup.sh

1 change: 0 additions & 1 deletion backend/notifications/logic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import threading
from collections import defaultdict
from os import error
from smtplib import SMTPException
from typing import DefaultDict, Dict, List

Expand Down
2 changes: 1 addition & 1 deletion backend/ypovoli/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = environ.get("DJANGO_DEBUG", "False").lower() in ["true", "1", "t"]
ALLOWED_HOSTS = ["sel2-7.ugent.be"]
ALLOWED_HOSTS = ["localhost", "sel2-7.ugent.be"]


# Application definition
Expand Down
12 changes: 0 additions & 12 deletions data/nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ http {
}
}

server {
listen 8080 ssl;
listen [::]:8080 ssl;

ssl_certificate ssl/certificate.crt;
ssl_certificate_key ssl/private.key;

location / {
return 301 https://$host$request_uri;
}
}

server {
listen 443 ssl;
listen [::]:443 ssl;
Expand Down
8 changes: 6 additions & 2 deletions development.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
echo "Checking environment file..."

if ! [ -f .env ]; then
echo "Error: .env file does not exist."
exit 1
cp .dev.env .env
read -s -p "Enter a random string for the django secret (just smash keyboard): " new_secret
sed -i "s/^DJANGO_SECRET_KEY=.*/DJANGO_SECRET_KEY=$new_secret/" .env
echo "Created environment file"
fi

echo "Checking for existing SSL certificates..."
Expand Down
4 changes: 2 additions & 2 deletions development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
container_name: backend
build:
context: $BACKEND_DIR
dockerfile: Dockerfile
dockerfile: Dockerfile.dev
command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080"
expose:
- 8080
Expand Down Expand Up @@ -92,7 +92,7 @@ services:
ipv4_address: $REDIS_IP
expose:
- $REDIS_PORT
entrypoint: redis-server --appendonly yes --requirepass $REDIS_PASSWORD --maxmemory 512mb --maxmemory-policy allkeys-lru
entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- $DATADIR/redis:/data

0 comments on commit 8dd295f

Please sign in to comment.