From 7154cef9b95493d249114931ddcfb1c997c70f8e Mon Sep 17 00:00:00 2001 From: Junyoung Yang Date: Thu, 18 Jun 2026 17:11:56 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=B4=88=EA=B8=B0=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=EA=B3=84=EC=A0=95=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/README.md | 2 +- backend/deploy/entrypoint.sh | 2 +- backend/init_db.sh | 2 +- backend/utils/api/tests.py | 2 +- backend/utils/management/commands/inituser.py | 6 ++++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/README.md b/backend/README.md index 81714f530..dd8c10238 100644 --- a/backend/README.md +++ b/backend/README.md @@ -63,7 +63,7 @@ pip3 install -r requirements.txt sh init_db.sh # md5sum secret key 초기화 및 django migrate 실행 -# super admin 생성(아이디 root, 비밀번호 rootroot로 자동생성됩니다.) +# 초기 super admin 계정 생성(username: root, email: root@pusan.ac.kr, password: rootroot) sh init_db.sh --migrate # 프로젝트를 실행합니다. localhost:8080으로 접속할 수 있습니다. diff --git a/backend/deploy/entrypoint.sh b/backend/deploy/entrypoint.sh index afbe39479..0fd972d90 100755 --- a/backend/deploy/entrypoint.sh +++ b/backend/deploy/entrypoint.sh @@ -27,7 +27,7 @@ n=0 while [ $n -lt 5 ] do python3 manage.py migrate --no-input - python manage.py inituser --username=root --password=rootroot --action=create_super_admin && + python manage.py inituser --username=root --email=root@pusan.ac.kr --password=rootroot --action=create_super_admin && echo "from options.options import SysOptions; SysOptions.judge_server_token='$JUDGE_SERVER_TOKEN'" | python manage.py shell && echo "from conf.models import JudgeServer; JudgeServer.objects.update(task_number=0)" | python manage.py shell && break diff --git a/backend/init_db.sh b/backend/init_db.sh index 82a8cb13f..1d7789c05 100755 --- a/backend/init_db.sh +++ b/backend/init_db.sh @@ -23,5 +23,5 @@ if [ "$1" = "--migrate" ]; then sleep 3 echo `cat /dev/urandom | head -1 | md5sum | head -c 32` > data/config/secret.key python3 manage.py migrate - python3 manage.py inituser --username root --password rootroot --action create_super_admin + python3 manage.py inituser --username root --email root@pusan.ac.kr --password rootroot --action create_super_admin fi diff --git a/backend/utils/api/tests.py b/backend/utils/api/tests.py index abbb34cc9..7c03cd52e 100644 --- a/backend/utils/api/tests.py +++ b/backend/utils/api/tests.py @@ -57,7 +57,7 @@ def create_admin(self, email="admin@admin.com", username="admin", password="admi problem_permission=ProblemPermission.OWN, login=login) - def create_super_admin(self, email="root@root.com", username="root", password="root1234!", login=True): + def create_super_admin(self, email="root@pusan.ac.kr", username="root", password="root1234!", login=True): return self.create_user( email=email, username=username, diff --git a/backend/utils/management/commands/inituser.py b/backend/utils/management/commands/inituser.py index 24e5d5fbb..45677b9a4 100644 --- a/backend/utils/management/commands/inituser.py +++ b/backend/utils/management/commands/inituser.py @@ -8,11 +8,13 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument("--username", type=str) + parser.add_argument("--email", type=str) parser.add_argument("--password", type=str) parser.add_argument("--action", type=str) def handle(self, *args, **options): username = options["username"] + email = options.get("email") or username password = options["password"] action = options["action"] @@ -27,7 +29,7 @@ def handle(self, *args, **options): user = User.objects.create( username=username, - email=username, + email=email, admin_type=AdminType.SUPER_ADMIN, problem_permission=ProblemPermission.ALL) user.set_password(password) @@ -39,7 +41,7 @@ def handle(self, *args, **options): self.stdout.write(self.style.SUCCESS("User created")) elif action == "create_admin": user = User.objects.create( - username=username, email=username, admin_type=AdminType.ADMIN, problem_permission=ProblemPermission.OWN) + username=username, email=email, admin_type=AdminType.ADMIN, problem_permission=ProblemPermission.OWN) user.set_password(password) user.save() UserProfile.objects.create(user=user) From 349e98a595a2454163f4d03e21b18824fcc37df5 Mon Sep 17 00:00:00 2001 From: Junyoung Yang Date: Thu, 18 Jun 2026 17:12:15 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=9D=B4?= =?UTF-8?q?=EB=A9=94=EC=9D=BC=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/oj/components/NavBar.vue | 55 ++++- frontend/src/pages/oj/views/user/Login.vue | 236 +++++++++++++++++--- 2 files changed, 250 insertions(+), 41 deletions(-) diff --git a/frontend/src/pages/oj/components/NavBar.vue b/frontend/src/pages/oj/components/NavBar.vue index 7d892fb87..fc6fad002 100644 --- a/frontend/src/pages/oj/components/NavBar.vue +++ b/frontend/src/pages/oj/components/NavBar.vue @@ -1,5 +1,5 @@