From aade2d402c069dc15b32c5cdf7efb286cb00fcf5 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Thu, 26 Oct 2023 12:58:41 +0530 Subject: [PATCH] dev: remove default user --- ENV_SETUP.md | 3 --- apiserver/.env.example | 3 --- apiserver/bin/takeoff | 3 --- apiserver/bin/user_script.py | 28 ---------------------------- 4 files changed, 37 deletions(-) delete mode 100644 apiserver/bin/user_script.py diff --git a/ENV_SETUP.md b/ENV_SETUP.md index 6796c3db6b..37136ffda8 100644 --- a/ENV_SETUP.md +++ b/ENV_SETUP.md @@ -116,9 +116,6 @@ USE_MINIO=1 # Nginx Configuration NGINX_PORT=80 ​ -# Default Creds -DEFAULT_EMAIL="captain@plane.so" -DEFAULT_PASSWORD="password123" ​ # SignUps ENABLE_SIGNUP="1" diff --git a/apiserver/.env.example b/apiserver/.env.example index 8193b5e771..0bfcfd7013 100644 --- a/apiserver/.env.example +++ b/apiserver/.env.example @@ -53,9 +53,6 @@ USE_MINIO=1 # Nginx Configuration NGINX_PORT=80 -# Default Creds -DEFAULT_EMAIL="captain@plane.so" -DEFAULT_PASSWORD="password123" # SignUps ENABLE_SIGNUP="1" diff --git a/apiserver/bin/takeoff b/apiserver/bin/takeoff index dc25a14e2d..e43bd6219f 100755 --- a/apiserver/bin/takeoff +++ b/apiserver/bin/takeoff @@ -3,7 +3,4 @@ set -e python manage.py wait_for_db python manage.py migrate -# Create a Default User -python bin/user_script.py - exec gunicorn -w 8 -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile - diff --git a/apiserver/bin/user_script.py b/apiserver/bin/user_script.py deleted file mode 100644 index e115b20b8c..0000000000 --- a/apiserver/bin/user_script.py +++ /dev/null @@ -1,28 +0,0 @@ -import os, sys, random, string -import uuid - -sys.path.append("/code") - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plane.settings.production") -import django - -django.setup() - -from plane.db.models import User - - -def populate(): - default_email = os.environ.get("DEFAULT_EMAIL", "captain@plane.so") - default_password = os.environ.get("DEFAULT_PASSWORD", "password123") - - if not User.objects.filter(email=default_email).exists(): - user = User.objects.create(email=default_email, username=uuid.uuid4().hex) - user.set_password(default_password) - user.save() - print(f"User created with an email: {default_email}") - else: - print(f"User already exists with the default email: {default_email}") - - -if __name__ == "__main__": - populate()