From 0b0e42a84f9ad329b737a477abb62e4ed7aa9363 Mon Sep 17 00:00:00 2001 From: seungwonme Date: Sat, 28 Dec 2024 15:27:23 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20.env.example=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20Makefile,=20.gitignore=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 33 +++++++ .gitignore | 48 +++++++--- Makefile | 16 +--- backend/transcendence/settings.py | 148 +++++++++++++++--------------- 4 files changed, 149 insertions(+), 96 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6db8bf9 --- /dev/null +++ b/.env.example @@ -0,0 +1,33 @@ +POSTGRES_USER= +POSTGRES_PASSWORD= + +DB_NAME= +DB_USER= +DB_PASSWORD= +DB_HOST= +DB_PORT= + +DJANGO_SUPERUSER_USERNAME= +DJANGO_SUPERUSER_PASSWORD= +DJANGO_SUPERUSER_EMAIL= + +OAUTH_URL=https://api.intra.42.fr/oauth/authorize +OAUTH_CLIENT_ID= +OAUTH_CLIENT_SECRET= +OAUTH_REDIRECT_URI= +OAUTH_TOKEN_URL=https://api.intra.42.fr/oauth/token +OAUTH_USER_INFO_URL=https://api.intra.42.fr/v2/me +OAUTH_STATE= + +SECRET_KEY= + +EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST= +EMAIL_PORT= +EMAIL_HOST_USER= +EMAIL_HOST_PASSWORD= +DEFAULT_FROM_EMAIL= + +CONTRACT_ADDRESS= +RPC_URL= +PRIVATE_KEY= diff --git a/.gitignore b/.gitignore index 398e72d..3f30a02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,4 @@ -# OS -.DS_Store - -# Nginx -default.conf - -# vite -node_modules/ - -# Django -0001_initial.py +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # Byte-compiled / optimized / DLL files __pycache__/ @@ -72,6 +62,7 @@ cover/ local_settings.py db.sqlite3 db.sqlite3-journal +0001_initial.py # Flask stuff: instance/ @@ -106,12 +97,18 @@ ipython_config.py # install all needed dependencies. #Pipfile.lock +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +#uv.lock + # poetry # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. # This is especially recommended for binary packages to ensure reproducibility, and is more # commonly ignored for libraries. # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock +poetry.lock # pdm # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. @@ -134,7 +131,12 @@ celerybeat.pid *.sage.py # Environments +# Environment files .env +.env.local* +.env.test* +.env.development* +.env.production* .venv env/ venv/ @@ -172,3 +174,25 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# PyPI configuration file +.pypirc + +# Miscellaneous files +.DS_Store +*.pem + +# VSCode specific files +.vscode/ +tempCodeRunnerFile.* + +# Git related files +*.patch + +# Python specific files +.venv +__pycache__/ + +# My specific files +review.md +default.conf diff --git a/Makefile b/Makefile index a0beb26..62f2a10 100644 --- a/Makefile +++ b/Makefile @@ -29,29 +29,23 @@ RESET := \033[0m all: @sh nginx/make_config.sh - @$(MAKE) build @$(MAKE) up -build: - @echo "๐Ÿณ $(FG_BLUE)Building images$(RESET) ๐Ÿณ" - @docker-compose -f docker-compose.yml build - @echo "๐Ÿ›  $(FG_GREEN)Built images$(RESET) ๐Ÿ› " - up: - @docker-compose -f docker-compose.yml up -d + @docker compose -p transcendence -f docker-compose.yml up --build -d @echo "๐Ÿ›œ $(FG_GREEN)Connect to $(FG_WHITE)$(UNDERLINE)https://localhost$(RESET) ๐Ÿ›œ" down: - @docker-compose -f docker-compose.yml down + @docker compose -p transcendence -f docker-compose.yml down @echo "๐Ÿšซ $(FG_RED)Disconnected$(RESET) ๐Ÿšซ" stop: - @docker-compose -f docker-compose.yml stop + @docker compose -p transcendence -f docker-compose.yml stop @echo "๐Ÿ›‘ $(FG_YELLOW)Stopped$(RESET) ๐Ÿ›‘" start: @echo "$(FG_GREEN)Started$(RESET)" - @docker-compose -f docker-compose.yml start + @docker compose -p transcendence -f docker-compose.yml start @echo "$(FG_GREEN)Connect to $(FG_WHITE)$(UNDERLINE)https://localhost$(RESET)" re: @@ -61,7 +55,7 @@ re: log: @echo "๐Ÿ“„ $(FG_CYAN)Logs$(RESET) ๐Ÿ“„" - @docker-compose -f docker-compose.yml logs -f + @docker compose -p transcendence -f docker-compose.yml logs -f clean: @$(MAKE) down diff --git a/backend/transcendence/settings.py b/backend/transcendence/settings.py index dcbbd29..5e1027e 100644 --- a/backend/transcendence/settings.py +++ b/backend/transcendence/settings.py @@ -6,7 +6,6 @@ from rest_framework.response import Response - # TEST: ๋กœ์ปฌ์—์„œ ํ…Œ์ŠคํŠธํ•  ๋•Œ ์‚ฌ์šฉ, docker-compose ์ด์šฉ ์‹œ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์•Œ์•„์„œ ์„ค์ •๋จ from dotenv import load_dotenv @@ -19,23 +18,23 @@ # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = os.getenv('SECRET_KEY') -OAUTH_REDIRECT_URI = os.getenv('OAUTH_REDIRECT_URI') - -OAUTH_URL = os.getenv('OAUTH_URL') -OAUTH_TOKEN_URL = os.getenv('OAUTH_TOKEN_URL') -OAUTH_USER_INFO_URL = os.getenv('OAUTH_USER_INFO_URL') -OAUTH_CLIENT_ID = os.getenv('OAUTH_CLIENT_ID') -OAUTH_CLIENT_SECRET = os.getenv('OAUTH_CLIENT_SECRET') -OAUTH_STATE = os.getenv('OAUTH_STATE') - -EMAIL_BACKEND = os.getenv('EMAIL_BACKEND') -EMAIL_HOST = os.getenv('EMAIL_HOST') -EMAIL_PORT = os.getenv('EMAIL_PORT') +SECRET_KEY = os.getenv("SECRET_KEY") +OAUTH_REDIRECT_URI = os.getenv("OAUTH_REDIRECT_URI") + +OAUTH_URL = os.getenv("OAUTH_URL") +OAUTH_TOKEN_URL = os.getenv("OAUTH_TOKEN_URL") +OAUTH_USER_INFO_URL = os.getenv("OAUTH_USER_INFO_URL") +OAUTH_CLIENT_ID = os.getenv("OAUTH_CLIENT_ID") +OAUTH_CLIENT_SECRET = os.getenv("OAUTH_CLIENT_SECRET") +OAUTH_STATE = os.getenv("OAUTH_STATE") + +EMAIL_BACKEND = os.getenv("EMAIL_BACKEND") +EMAIL_HOST = os.getenv("EMAIL_HOST") +EMAIL_PORT = os.getenv("EMAIL_PORT") EMAIL_USE_TLS = True -EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER') -EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD') -DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL') +EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER") +EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD") +DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL") # SECURITY WARNING: don't run with debug turned on in production! @@ -47,53 +46,58 @@ # Application definition INSTALLED_APPS = [ - "daphne", - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'rest_framework', + "daphne", + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "rest_framework", "corsheaders", - 'drf_yasg', - 'rest_framework_simplejwt', + "drf_yasg", + "rest_framework_simplejwt", "users", "login.apps.LoginConfig", "game", ] + + def custom_exception_handler(exc, context): - view = context.get('view', None) - func_name = view.__class__.__name__ if view else 'UnknownFunction' + view = context.get("view", None) + func_name = view.__class__.__name__ if view else "UnknownFunction" logger = logging.getLogger(func_name) - logger.error(f"Exception: {exc.__class__.__name__} - {str(exc)} \n Context: {context}") + logger.error( + f"Exception: {exc.__class__.__name__} - {str(exc)} \n Context: {context}" + ) response = exception_handler(exc, context) if response is not None: return response else: - return Response({'Unkwon Error': 'An error occurred.'}, status=500) + return Response({"Unkwon Error": "An error occurred."}, status=500) + REST_FRAMEWORK = { - 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework_simplejwt.authentication.JWTAuthentication', + "DEFAULT_AUTHENTICATION_CLASSES": ( + "rest_framework_simplejwt.authentication.JWTAuthentication", ), - 'EXCEPTION_HANDLER': 'transcendence.custom_exception_handler.custom_exception_handler', + "EXCEPTION_HANDLER": "transcendence.custom_exception_handler.custom_exception_handler", } MIDDLEWARE = [ - 'corsheaders.middleware.CorsMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", ] CORS_ORIGIN_ALLOW_ALL = True # TEST: ๋ชจ๋“  ๋„๋ฉ”์ธ ํ—ˆ์šฉ (๋ณด์•ˆ ์ทจ์•ฝ) @@ -102,9 +106,7 @@ def custom_exception_handler(exc, context): "http://localhost:5173", ] -ALLOWED_HOSTS = [ - "*" -] +ALLOWED_HOSTS = ["*"] CORS_ALLOWED_ORIGINS = [ "http://localhost:5173", @@ -112,41 +114,41 @@ def custom_exception_handler(exc, context): CORS_ALLOW_CREDENTIALS = True # ์ฟ ํ‚ค ํ—ˆ์šฉ -SESSION_COOKIE_HTTPONLY = True # ์ฟ ํ‚ค๋ฅผ HTTP๋กœ๋งŒ ์ „์†ก +SESSION_COOKIE_HTTPONLY = True # ์ฟ ํ‚ค๋ฅผ HTTP๋กœ๋งŒ ์ „์†ก -ROOT_URLCONF = 'transcendence.urls' +ROOT_URLCONF = "transcendence.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', + "BACKEND": "django.template.backends.django.DjangoTemplates", # feature01-42OAuth_Login ์—์„œ ์ถ”๊ฐ€๋จ ์›๋ž˜ [] ๋กœ ๋น„์–ด์žˆ์—ˆ์Œ - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'transcendence.wsgi.application' +WSGI_APPLICATION = "transcendence.wsgi.application" # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': os.getenv('DB_NAME'), - 'USER': os.getenv('DB_USER'), - 'PASSWORD': os.getenv('DB_PASSWORD'), - 'HOST': os.getenv('DB_HOST', 'localhost'), - 'PORT': os.getenv('DB_PORT', '5432'), + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": os.getenv("DB_NAME"), + "USER": os.getenv("DB_USER"), + "PASSWORD": os.getenv("DB_PASSWORD"), + "HOST": os.getenv("DB_HOST", "postgres"), + "PORT": os.getenv("DB_PORT", "5432"), } } @@ -156,16 +158,16 @@ def custom_exception_handler(exc, context): AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] @@ -173,9 +175,9 @@ def custom_exception_handler(exc, context): # Internationalization # https://docs.djangoproject.com/en/4.2/topics/i18n/ -LANGUAGE_CODE = 'ko-kr' +LANGUAGE_CODE = "ko-kr" -TIME_ZONE = 'Asia/Seoul' +TIME_ZONE = "Asia/Seoul" USE_I18N = True @@ -185,12 +187,12 @@ def custom_exception_handler(exc, context): # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = "static/" # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" # Daphne ASGI_APPLICATION = "transcendence.asgi.application" From 1649dc96f13d1756ebe23f6d7522b5159c39166f Mon Sep 17 00:00:00 2001 From: seungwonme Date: Sat, 28 Dec 2024 16:17:25 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20make=20=EC=8B=9C=20.env.production?= =?UTF-8?q?=20=ED=8C=8C=EC=9D=BC=EC=9D=84=20backend=20=EB=94=94=EB=A0=89?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=EB=A1=9C=20=EB=B3=B5=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 62f2a10..edc5fdf 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,7 @@ RESET := \033[0m all: @sh nginx/make_config.sh + @cp .env.production ./backend/.env @$(MAKE) up up: From faad2ecd7bd5c07f0f3b4b3e98ecbbfd08a3924c Mon Sep 17 00:00:00 2001 From: seungwonme Date: Sat, 28 Dec 2024 16:20:25 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20make=20=EC=8B=9C=20=EB=A3=A8?= =?UTF-8?q?=ED=8A=B8=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC=EC=97=90=20.en?= =?UTF-8?q?v.production=EC=9D=84=20.env=EB=A1=9C=20=EB=B3=B5=EC=82=AC?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index edc5fdf..a27d57a 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ RESET := \033[0m all: @sh nginx/make_config.sh @cp .env.production ./backend/.env + @cp .env.production .env @$(MAKE) up up: From 1c7ac63a9a681f94b6c3a1745f421b8b105d6efb Mon Sep 17 00:00:00 2001 From: seungwonme Date: Sat, 28 Dec 2024 17:10:46 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=ED=99=98=EA=B2=BD=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=84=A4=EC=A0=95=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20API=20=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=EC=97=90=20=EB=B0=B1=EC=97=94=EB=93=9C=20=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=EB=A5=BC=20=ED=99=98=EA=B2=BD=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 + Makefile | 4 +- backend/transcendence/settings.py | 6 +- frontend/package-lock.json | 272 ++++++++++++------ frontend/package.json | 3 +- frontend/src/app.js | 8 +- frontend/src/components/2FA.js | 10 +- frontend/src/components/Edit-Profile.js | 10 +- frontend/src/components/Friends-List.js | 12 +- frontend/src/components/Game-Core.js | 8 +- frontend/src/components/Game-Result-Page.js | 6 +- .../src/components/Game-Tournament-Core.js | 8 +- frontend/src/components/Game-matching-Core.js | 8 +- frontend/src/components/Home-Login.js | 6 +- frontend/src/components/Main-Menu.js | 8 +- frontend/src/components/Profile-Info.js | 6 +- frontend/src/components/Tournament-Setting.js | 6 +- frontend/src/core/router.js | 14 +- run_backend.sh | 2 + run_frontend.sh | 3 + set_env_production.sh | 3 + 21 files changed, 277 insertions(+), 128 deletions(-) create mode 100644 set_env_production.sh diff --git a/.env.example b/.env.example index 6db8bf9..e719397 100644 --- a/.env.example +++ b/.env.example @@ -31,3 +31,5 @@ DEFAULT_FROM_EMAIL= CONTRACT_ADDRESS= RPC_URL= PRIVATE_KEY= + +HOST_ADDRESS= diff --git a/Makefile b/Makefile index a27d57a..ac2b2d6 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,7 @@ RESET := \033[0m all: @sh nginx/make_config.sh - @cp .env.production ./backend/.env - @cp .env.production .env + @sh set_env_production.sh.sh @$(MAKE) up up: @@ -67,7 +66,6 @@ clean: fclean: @$(MAKE) down @docker system prune -af --volumes - @docker volume rm transcendence_db_data @echo "๐Ÿงน $(FG_BLUE)Fully cleaned up$(RESET) ๐Ÿงน" populatedb: diff --git a/backend/transcendence/settings.py b/backend/transcendence/settings.py index ba1177e..8294ae0 100644 --- a/backend/transcendence/settings.py +++ b/backend/transcendence/settings.py @@ -36,6 +36,8 @@ EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD") DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL") +HOST_ADDRESS = os.getenv("HOST_ADDRESS") + # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -103,13 +105,13 @@ def custom_exception_handler(exc, context): CORS_ORIGIN_ALLOW_ALL = True # TEST: ๋ชจ๋“  ๋„๋ฉ”์ธ ํ—ˆ์šฉ (๋ณด์•ˆ ์ทจ์•ฝ) CSRF_TRUSTED_ORIGINS = [ - "http://localhost:5173", + f"http://{HOST_ADDRESS}:5173", ] ALLOWED_HOSTS = ["*"] CORS_ALLOWED_ORIGINS = [ - "http://localhost:5173", + f"http://{HOST_ADDRESS}:5173", ] CORS_ALLOW_CREDENTIALS = True # ์ฟ ํ‚ค ํ—ˆ์šฉ diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8b87080..45937cc 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,7 +8,8 @@ "name": "vite", "version": "0.0.0", "dependencies": { - "bootstrap": "^5.3.3" + "bootstrap": "^5.3.3", + "dotenv": "^16.4.7" }, "devDependencies": { "vite": "^5.3.4" @@ -393,218 +394,277 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.1.tgz", - "integrity": "sha512-XzqSg714++M+FXhHfXpS1tDnNZNpgxxuGZWlRG/jSj+VEPmZ0yg6jV4E0AL3uyBKxO8mO3xtOsP5mQ+XLfrlww==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", + "integrity": "sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.1.tgz", - "integrity": "sha512-thFUbkHteM20BGShD6P08aungq4irbIZKUNbG70LN8RkO7YztcGPiKTTGZS7Kw+x5h8hOXs0i4OaHwFxlpQN6A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.1.tgz", + "integrity": "sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.1.tgz", - "integrity": "sha512-8o6eqeFZzVLia2hKPUZk4jdE3zW7LCcZr+MD18tXkgBBid3lssGVAYuox8x6YHoEPDdDa9ixTaStcmx88lio5Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz", + "integrity": "sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.1.tgz", - "integrity": "sha512-4T42heKsnbjkn7ovYiAdDVRRWZLU9Kmhdt6HafZxFcUdpjlBlxj4wDrt1yFWLk7G4+E+8p2C9tcmSu0KA6auGA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.1.tgz", + "integrity": "sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.29.1.tgz", + "integrity": "sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.29.1.tgz", + "integrity": "sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.1.tgz", - "integrity": "sha512-MXg1xp+e5GhZ3Vit1gGEyoC+dyQUBy2JgVQ+3hUrD9wZMkUw/ywgkpK7oZgnB6kPpGrxJ41clkPPnsknuD6M2Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.1.tgz", + "integrity": "sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.1.tgz", - "integrity": "sha512-DZNLwIY4ftPSRVkJEaxYkq7u2zel7aah57HESuNkUnz+3bZHxwkCUkrfS2IWC1sxK6F2QNIR0Qr/YXw7nkF3Pw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.1.tgz", + "integrity": "sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.1.tgz", - "integrity": "sha512-C7evongnjyxdngSDRRSQv5GvyfISizgtk9RM+z2biV5kY6S/NF/wta7K+DanmktC5DkuaJQgoKGf7KUDmA7RUw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.1.tgz", + "integrity": "sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.1.tgz", - "integrity": "sha512-89tFWqxfxLLHkAthAcrTs9etAoBFRduNfWdl2xUs/yLV+7XDrJ5yuXMHptNqf1Zw0UCA3cAutkAiAokYCkaPtw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.1.tgz", + "integrity": "sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.29.1.tgz", + "integrity": "sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.1.tgz", - "integrity": "sha512-PromGeV50sq+YfaisG8W3fd+Cl6mnOOiNv2qKKqKCpiiEke2KiKVyDqG/Mb9GWKbYMHj5a01fq/qlUR28PFhCQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.1.tgz", + "integrity": "sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.1.tgz", - "integrity": "sha512-/1BmHYh+iz0cNCP0oHCuF8CSiNj0JOGf0jRlSo3L/FAyZyG2rGBuKpkZVH9YF+x58r1jgWxvm1aRg3DHrLDt6A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.1.tgz", + "integrity": "sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.1.tgz", - "integrity": "sha512-0cYP5rGkQWRZKy9/HtsWVStLXzCF3cCBTRI+qRL8Z+wkYlqN7zrSYm6FuY5Kd5ysS5aH0q5lVgb/WbG4jqXN1Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.1.tgz", + "integrity": "sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz", - "integrity": "sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.1.tgz", + "integrity": "sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.1.tgz", - "integrity": "sha512-V7cBw/cKXMfEVhpSvVZhC+iGifD6U1zJ4tbibjjN+Xi3blSXaj/rJynAkCFFQfoG6VZrAiP7uGVzL440Q6Me2Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.1.tgz", + "integrity": "sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.1.tgz", - "integrity": "sha512-88brja2vldW/76jWATlBqHEoGjJLRnP0WOEKAUbMcXaAZnemNhlAHSyj4jIwMoP2T750LE9lblvD4e2jXleZsA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.1.tgz", + "integrity": "sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.1.tgz", - "integrity": "sha512-LdxxcqRVSXi6k6JUrTah1rHuaupoeuiv38du8Mt4r4IPer3kwlTo+RuvfE8KzZ/tL6BhaPlzJ3835i6CxrFIRQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.1.tgz", + "integrity": "sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.1.tgz", - "integrity": "sha512-2bIrL28PcK3YCqD9anGxDxamxdiJAxA+l7fWIwM5o8UqNy1t3d1NdAweO2XhA0KTDJ5aH1FsuiT5+7VhtHliXg==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.1.tgz", + "integrity": "sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" }, "node_modules/bootstrap": { "version": "5.3.3", @@ -624,6 +684,18 @@ "@popperjs/core": "^2.11.8" } }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -668,6 +740,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -677,9 +750,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -687,6 +760,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -695,15 +769,16 @@ } }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "funding": [ { @@ -719,22 +794,24 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/rollup": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.1.tgz", - "integrity": "sha512-K5vziVlg7hTpYfFBI+91zHBEMo6jafYXpkMlqZjg7/zhIG9iHqazBf4xz9AVdjS9BruRn280ROqLI7G3OFRIlw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz", + "integrity": "sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -744,43 +821,48 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.19.1", - "@rollup/rollup-android-arm64": "4.19.1", - "@rollup/rollup-darwin-arm64": "4.19.1", - "@rollup/rollup-darwin-x64": "4.19.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.19.1", - "@rollup/rollup-linux-arm-musleabihf": "4.19.1", - "@rollup/rollup-linux-arm64-gnu": "4.19.1", - "@rollup/rollup-linux-arm64-musl": "4.19.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.19.1", - "@rollup/rollup-linux-riscv64-gnu": "4.19.1", - "@rollup/rollup-linux-s390x-gnu": "4.19.1", - "@rollup/rollup-linux-x64-gnu": "4.19.1", - "@rollup/rollup-linux-x64-musl": "4.19.1", - "@rollup/rollup-win32-arm64-msvc": "4.19.1", - "@rollup/rollup-win32-ia32-msvc": "4.19.1", - "@rollup/rollup-win32-x64-msvc": "4.19.1", + "@rollup/rollup-android-arm-eabi": "4.29.1", + "@rollup/rollup-android-arm64": "4.29.1", + "@rollup/rollup-darwin-arm64": "4.29.1", + "@rollup/rollup-darwin-x64": "4.29.1", + "@rollup/rollup-freebsd-arm64": "4.29.1", + "@rollup/rollup-freebsd-x64": "4.29.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.29.1", + "@rollup/rollup-linux-arm-musleabihf": "4.29.1", + "@rollup/rollup-linux-arm64-gnu": "4.29.1", + "@rollup/rollup-linux-arm64-musl": "4.29.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.29.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.29.1", + "@rollup/rollup-linux-riscv64-gnu": "4.29.1", + "@rollup/rollup-linux-s390x-gnu": "4.29.1", + "@rollup/rollup-linux-x64-gnu": "4.29.1", + "@rollup/rollup-linux-x64-musl": "4.29.1", + "@rollup/rollup-win32-arm64-msvc": "4.29.1", + "@rollup/rollup-win32-ia32-msvc": "4.29.1", + "@rollup/rollup-win32-x64-msvc": "4.29.1", "fsevents": "~2.3.2" } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/vite": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", - "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -799,6 +881,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -816,6 +899,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, diff --git a/frontend/package.json b/frontend/package.json index 63ddf0a..a89efd2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,6 +12,7 @@ "vite": "^5.3.4" }, "dependencies": { - "bootstrap": "^5.3.3" + "bootstrap": "^5.3.3", + "dotenv": "^16.4.7" } } diff --git a/frontend/src/app.js b/frontend/src/app.js index 6be822d..229c696 100644 --- a/frontend/src/app.js +++ b/frontend/src/app.js @@ -1,5 +1,9 @@ import { initializeRouter, createRoutes, changeUrl } from "./core/router.js"; import { getCookie } from "./core/jwt.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; class App { app; @@ -27,7 +31,7 @@ const closeAllSockets = () => { const online = () => { const onlineSocket = new WebSocket( 'wss://' - + "localhost:443" + + `${host}` + '/ws/online/' ); socketList.push(onlineSocket); @@ -45,4 +49,4 @@ const online = () => { } initializeRouter(routes); -online(); \ No newline at end of file +online(); diff --git a/frontend/src/components/2FA.js b/frontend/src/components/2FA.js index 88ad8e0..f55dcd0 100644 --- a/frontend/src/components/2FA.js +++ b/frontend/src/components/2FA.js @@ -2,6 +2,10 @@ import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/js/bootstrap.bundle.min.js'; import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class TwoFA extends Component { template() { @@ -54,7 +58,7 @@ export class TwoFA extends Component { this.addEvent('click', '#resendButton', () => { // resend msg ์ „์†ก - fetch('https://localhost:443/api/send-mail/', { + fetch(`https://${host}/api/send-mail/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ }) @@ -77,7 +81,7 @@ export class TwoFA extends Component { } // API code ์ผ์น˜ ํ™•์ธ ์š”์ฒญ - fetch('https://localhost:443/api/verify-otp/', { + fetch(`https://${host}/api/verify-otp/`, { method: 'POST', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ headers: { @@ -93,7 +97,7 @@ export class TwoFA extends Component { if (data) { if (data.success) { // API!!! jwt๊ฐ€ ์žˆ์œผ๋ฉด ํ•ด๋‹น ์œ ์ €์˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ์–ธ์–ด ๋ฒˆํ˜ธ (0 or 1 or 2) ์–ป์–ด์˜ค๊ธฐ - fetch("https://localhost:443/api/language/", { + fetch(`https://${host}/api/language/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) diff --git a/frontend/src/components/Edit-Profile.js b/frontend/src/components/Edit-Profile.js index 6e1a885..cfd9de8 100644 --- a/frontend/src/components/Edit-Profile.js +++ b/frontend/src/components/Edit-Profile.js @@ -1,6 +1,10 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; import { parseJWT } from "../core/jwt.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class EditProfile extends Component { @@ -64,7 +68,7 @@ export class EditProfile extends Component { this.is_2FA = true; //API!! ME GET - fetch("https://localhost:443/api/me/", { + fetch(`https://${host}/api/me/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) @@ -177,7 +181,7 @@ export class EditProfile extends Component { this.addEvent('click', '#deleteYesButton', () => { //API!! ME DELETE - fetch("https://localhost:443/api/me/", { + fetch(`https://${host}/api/me/`, { method: 'DELETE', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) @@ -206,7 +210,7 @@ export class EditProfile extends Component { formData.append('img_url', imageUrl); // API!! ME PUT - fetch('https://localhost:443/api/me/', { + fetch(`https://${host}/api/me/`, { method: 'PUT', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) body: formData diff --git a/frontend/src/components/Friends-List.js b/frontend/src/components/Friends-List.js index 8c0c5cb..6cb199d 100644 --- a/frontend/src/components/Friends-List.js +++ b/frontend/src/components/Friends-List.js @@ -3,6 +3,10 @@ import { FriendsInfo } from "./Friends-Info.js"; import { List } from "./List.js"; import { changeUrl, parsePath } from "../core/router.js"; import { Input } from "./Input.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class FriendsList extends Component { @@ -69,7 +73,7 @@ export class FriendsList extends Component { mounted() { // API !!! Friends GET - fetch("https://localhost:443/api/friends/", { + fetch(`https://${host}/api/friends/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ }) @@ -164,7 +168,7 @@ export class FriendsList extends Component { else { // API !!! Friends POST - fetch("https://localhost:443/api/friends/", { + fetch(`https://${host}/api/friends/`, { method: 'POST', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ headers: { @@ -196,7 +200,7 @@ export class FriendsList extends Component { const nickname = part[0]; //API !!! userList - fetch("https://localhost:443/api/user/", { + fetch(`https://${host}/api/user/`, { method: 'GET', }) .then(response => { @@ -248,7 +252,7 @@ export class FriendsList extends Component { const uid = part[1]; // API !!! Friends DELETE - fetch("https://localhost:443/api/friends/", { + fetch(`https://${host}/api/friends/`, { method: 'DELETE', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ headers: { diff --git a/frontend/src/components/Game-Core.js b/frontend/src/components/Game-Core.js index e4253b3..f723bcf 100644 --- a/frontend/src/components/Game-Core.js +++ b/frontend/src/components/Game-Core.js @@ -2,6 +2,10 @@ import { Component } from "../core/Component.js"; import { getCookie } from "../core/jwt.js"; import { socketList } from "../app.js"; import { changeUrl } from "../core/router.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class GameCore extends Component { constructor($el, props) { @@ -12,7 +16,7 @@ export class GameCore extends Component { this.keysPressed = {}; this.gameSocket = new WebSocket( 'wss://' - + "localhost:443" + + `${host}` + '/ws/game/' + this.props.uid + '/' @@ -470,4 +474,4 @@ export class GameCore extends Component { mounted() { this.gameStart(); } -} \ No newline at end of file +} diff --git a/frontend/src/components/Game-Result-Page.js b/frontend/src/components/Game-Result-Page.js index ecb7ff1..f9ed754 100644 --- a/frontend/src/components/Game-Result-Page.js +++ b/frontend/src/components/Game-Result-Page.js @@ -1,5 +1,9 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class GameResultPage extends Component { @@ -94,7 +98,7 @@ export class GameResultPage extends Component { }) }; - fetch("https://localhost:443/api/game-history/tournament", { + fetch(`https://${host}/api/game-history/tournament`, { method: 'POST', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ headers: { diff --git a/frontend/src/components/Game-Tournament-Core.js b/frontend/src/components/Game-Tournament-Core.js index cf773ae..779ae3f 100644 --- a/frontend/src/components/Game-Tournament-Core.js +++ b/frontend/src/components/Game-Tournament-Core.js @@ -2,6 +2,10 @@ import { Component } from "../core/Component.js"; import { getCookie } from "../core/jwt.js"; import { socketList } from "../app.js" import { changeUrl } from "../core/router.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class GameTournamentCore extends Component { constructor($el, props) { @@ -12,7 +16,7 @@ export class GameTournamentCore extends Component { this.keysPressed = {}; this.gameSocket = new WebSocket( 'wss://' - + "localhost:443" + + `${host}` + '/ws/game/' + this.props.uid + '/' @@ -487,4 +491,4 @@ export class GameTournamentCore extends Component { mounted() { this.gameStart(); } -} \ No newline at end of file +} diff --git a/frontend/src/components/Game-matching-Core.js b/frontend/src/components/Game-matching-Core.js index e4ddd85..70e1ff6 100644 --- a/frontend/src/components/Game-matching-Core.js +++ b/frontend/src/components/Game-matching-Core.js @@ -2,6 +2,10 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; import { getCookie } from "../core/jwt.js"; import { socketList } from "../app.js" +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class GameMatchingCore extends Component { constructor($el, props) { @@ -12,7 +16,7 @@ export class GameMatchingCore extends Component { this.keysPressed = {}; this.gameSocket = new WebSocket( 'wss://' - + "localhost:443" + + `${host}` + '/ws/game/vs/' + this.props.room + '/' @@ -470,4 +474,4 @@ export class GameMatchingCore extends Component { mounted() { this.gameStart(); } -} \ No newline at end of file +} diff --git a/frontend/src/components/Home-Login.js b/frontend/src/components/Home-Login.js index 13b3cda..169220d 100644 --- a/frontend/src/components/Home-Login.js +++ b/frontend/src/components/Home-Login.js @@ -1,5 +1,9 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class Login extends Component { @@ -14,7 +18,7 @@ export class Login extends Component { setEvent () { this.addEvent('click', '#login', () => { // ๋กœ๊ทธ์ธ ์š”์ฒญ - window.location.href = 'https://localhost:443/api/login/'; + window.location.href = `https://${host}/api/login/`; }); } } diff --git a/frontend/src/components/Main-Menu.js b/frontend/src/components/Main-Menu.js index 383d092..83ae426 100644 --- a/frontend/src/components/Main-Menu.js +++ b/frontend/src/components/Main-Menu.js @@ -2,6 +2,10 @@ import { Component } from "../core/Component.js"; import { List } from "./List.js"; import { changeUrl } from "../core/router.js"; import { parseJWT } from "../core/jwt.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class Menu extends Component { translate() { @@ -66,7 +70,7 @@ export class Menu extends Component { }); function storeLang(value) { - fetch("https://localhost:443/api/language/", { + fetch(`https://${host}/api/language/`, { method: 'PUT', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) headers: { @@ -110,7 +114,7 @@ export class Menu extends Component { this.addEvent('click', '#Logout', () => { // API !! ME POST - fetch("https://localhost:443/api/me/", { + fetch(`https://${host}/api/me/`, { method: 'POST', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) diff --git a/frontend/src/components/Profile-Info.js b/frontend/src/components/Profile-Info.js index fdc7d47..aacf2d7 100644 --- a/frontend/src/components/Profile-Info.js +++ b/frontend/src/components/Profile-Info.js @@ -2,6 +2,10 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; import { MatchList } from "./Profile-List.js"; import { parseJWT } from "../core/jwt.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class ProfileInfo extends Component { @@ -45,7 +49,7 @@ export class ProfileInfo extends Component { this.rate = null; this.games = null; - fetch(`https://localhost:443/api/user/${this.props.uid}`, { + fetch(`https://${host}/api/user/${this.props.uid}`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) diff --git a/frontend/src/components/Tournament-Setting.js b/frontend/src/components/Tournament-Setting.js index 4d09ca1..12da49c 100644 --- a/frontend/src/components/Tournament-Setting.js +++ b/frontend/src/components/Tournament-Setting.js @@ -2,6 +2,10 @@ import { Component } from "../core/Component.js"; import { TournamentHistory } from "./Tournament-History.js"; import { parseJWT } from "../core/jwt.js"; import { changeUrl } from "../core/router.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export class TournamentSetting extends Component { @@ -60,7 +64,7 @@ export class TournamentSetting extends Component { const translations = this.translations; - fetch("https://localhost:443/api/game-history/tournament", { + fetch(`https://${host}/api/game-history/tournament`, { method: "GET", credentials: "include", // ์ฟ ํ‚ค ํฌํ•จ }) diff --git a/frontend/src/core/router.js b/frontend/src/core/router.js index 2d7f39a..0c5c609 100644 --- a/frontend/src/core/router.js +++ b/frontend/src/core/router.js @@ -13,6 +13,10 @@ import { GameTournament } from "../components/Game-Tournament.js"; import { GameMatching } from "../components/Game-matching.js"; import { Error } from "../components/Error.js"; import { GameResult } from "../components/Game-Result.js"; +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; export const createRoutes = (root) => { return { @@ -84,7 +88,7 @@ export async function parsePath(path) { const code = urlParams.get('code'); // code ๋ณด๋‚ด๊ณ  2FA ์—ฌ๋ถ€ ํ™•์ธ!! (์ถ”๊ฐ€ ๋ถ€๋ถ„!!) - fetch('https://localhost:443/api/callback/', { + fetch(`https://${host}/api/callback/`, { method: 'POST', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ headers: { @@ -102,7 +106,7 @@ export async function parsePath(path) { if (data){ if (data.is_2FA) { // email ์ „์†ก ์š”์ฒญ - fetch('https://localhost:443/api/send-mail/',{ + fetch(`https://${host}/api/send-mail/`,{ method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ headers: { @@ -117,7 +121,7 @@ export async function parsePath(path) { }); } else { // API!!! jwt๊ฐ€ ์žˆ์œผ๋ฉด ํ•ด๋‹น ์œ ์ €์˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ์–ธ์–ด ๋ฒˆํ˜ธ (0 or 1 or 2) ์–ป์–ด์˜ค๊ธฐ - fetch("https://localhost:443/api/language/", { + fetch(`https://${host}/api/language/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) @@ -176,7 +180,7 @@ export const initializeRouter = () => { window.addEventListener("popstate", async () => { await parsePath(window.location.pathname); }); - fetch("https://localhost:443/api/language/", { + fetch(`https://${host}/api/language/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ (์‚ฌ์šฉ์ž ์ธ์ฆ ํ•„์š” ์‹œ) }) @@ -197,7 +201,7 @@ export const initializeRouter = () => { async function checkAuth() { try { - const response = await fetch('https://localhost:443/api/validate/', { + const response = await fetch(`https://${host}/api/validate/`, { method: 'GET', credentials: 'include', // ์ฟ ํ‚ค๋ฅผ ํฌํ•จํ•˜์—ฌ ์š”์ฒญ }); diff --git a/run_backend.sh b/run_backend.sh index cf0278f..630fe7a 100755 --- a/run_backend.sh +++ b/run_backend.sh @@ -2,6 +2,8 @@ # TEST: ๊ฐœ๋ฐœ ์‹œ ๋กœ์ปฌ ์‹คํ–‰์šฉ +cp .env.local .env + # Initialize the environment (arg 1 to clear everything) if [ "$1" == "1" ]; then ./clean.sh diff --git a/run_frontend.sh b/run_frontend.sh index 38a6b06..2b2f1ae 100755 --- a/run_frontend.sh +++ b/run_frontend.sh @@ -1,3 +1,6 @@ #!/bin/bash # TEST: ๊ฐœ๋ฐœ ์‹œ ๋กœ์ปฌ ์‹คํ–‰์šฉ + +cp .env.local .env +cp .env.local frontend/.env cd frontend && npm install && npm run dev diff --git a/set_env_production.sh b/set_env_production.sh new file mode 100644 index 0000000..1a035bc --- /dev/null +++ b/set_env_production.sh @@ -0,0 +1,3 @@ +cp .env.production ./frontend/.env +cp .env.production ./backend/.env +cp .env.production .env From 881028103939a379b96e266ebc17bfae849bd23a Mon Sep 17 00:00:00 2001 From: seungwonme Date: Sat, 28 Dec 2024 17:25:58 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=EC=86=8C=EC=BC=93=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=EC=A3=BC=EC=86=8C=EC=97=90=20=ED=8F=AC=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- frontend/src/app.js | 2 +- frontend/src/components/Game-Core.js | 2 +- frontend/src/components/Game-Tournament-Core.js | 2 +- frontend/src/components/Game-matching-Core.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ac2b2d6..f01fb6d 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ RESET := \033[0m all: @sh nginx/make_config.sh - @sh set_env_production.sh.sh + @sh set_env_production.sh @$(MAKE) up up: diff --git a/frontend/src/app.js b/frontend/src/app.js index 229c696..e098825 100644 --- a/frontend/src/app.js +++ b/frontend/src/app.js @@ -31,7 +31,7 @@ const closeAllSockets = () => { const online = () => { const onlineSocket = new WebSocket( 'wss://' - + `${host}` + + `${host}:443` + '/ws/online/' ); socketList.push(onlineSocket); diff --git a/frontend/src/components/Game-Core.js b/frontend/src/components/Game-Core.js index f723bcf..1fd3461 100644 --- a/frontend/src/components/Game-Core.js +++ b/frontend/src/components/Game-Core.js @@ -16,7 +16,7 @@ export class GameCore extends Component { this.keysPressed = {}; this.gameSocket = new WebSocket( 'wss://' - + `${host}` + + `${host}:443` + '/ws/game/' + this.props.uid + '/' diff --git a/frontend/src/components/Game-Tournament-Core.js b/frontend/src/components/Game-Tournament-Core.js index 779ae3f..8406c59 100644 --- a/frontend/src/components/Game-Tournament-Core.js +++ b/frontend/src/components/Game-Tournament-Core.js @@ -16,7 +16,7 @@ export class GameTournamentCore extends Component { this.keysPressed = {}; this.gameSocket = new WebSocket( 'wss://' - + `${host}` + + `${host}:443` + '/ws/game/' + this.props.uid + '/' diff --git a/frontend/src/components/Game-matching-Core.js b/frontend/src/components/Game-matching-Core.js index 70e1ff6..0fd4974 100644 --- a/frontend/src/components/Game-matching-Core.js +++ b/frontend/src/components/Game-matching-Core.js @@ -16,7 +16,7 @@ export class GameMatchingCore extends Component { this.keysPressed = {}; this.gameSocket = new WebSocket( 'wss://' - + `${host}` + + `${host}:443` + '/ws/game/vs/' + this.props.room + '/' From 351a6fa2496031760d07afd0ddbb74c53b8d4661 Mon Sep 17 00:00:00 2001 From: seungwonme Date: Sat, 28 Dec 2024 17:45:36 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=ED=99=98=EA=B2=BD=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=EC=97=90=EC=84=9C=20=ED=98=B8=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=A3=BC=EC=86=8C=20=EB=A1=9C=EB=93=9C=20=EB=B0=A9=EC=8B=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/transcendence/settings.py | 1 - frontend/src/app.js | 5 +---- frontend/src/components/2FA.js | 5 +---- frontend/src/components/Edit-Profile.js | 5 +---- frontend/src/components/Friends-List.js | 5 +---- frontend/src/components/Game-Core.js | 5 +---- frontend/src/components/Game-Result-Page.js | 5 +---- frontend/src/components/Game-Tournament-Core.js | 5 +---- frontend/src/components/Game-matching-Core.js | 5 +---- frontend/src/components/Home-Login.js | 5 +---- frontend/src/components/Main-Menu.js | 5 +---- frontend/src/components/Profile-Info.js | 5 +---- frontend/src/components/Tournament-Setting.js | 5 +---- frontend/src/core/router.js | 5 +---- frontend/src/load_host.js | 6 ++++++ 15 files changed, 19 insertions(+), 53 deletions(-) create mode 100644 frontend/src/load_host.js diff --git a/backend/transcendence/settings.py b/backend/transcendence/settings.py index 8294ae0..3b26626 100644 --- a/backend/transcendence/settings.py +++ b/backend/transcendence/settings.py @@ -38,7 +38,6 @@ HOST_ADDRESS = os.getenv("HOST_ADDRESS") - # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True diff --git a/frontend/src/app.js b/frontend/src/app.js index e098825..924c906 100644 --- a/frontend/src/app.js +++ b/frontend/src/app.js @@ -1,9 +1,6 @@ import { initializeRouter, createRoutes, changeUrl } from "./core/router.js"; import { getCookie } from "./core/jwt.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; class App { app; diff --git a/frontend/src/components/2FA.js b/frontend/src/components/2FA.js index f55dcd0..345b54e 100644 --- a/frontend/src/components/2FA.js +++ b/frontend/src/components/2FA.js @@ -2,10 +2,7 @@ import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/js/bootstrap.bundle.min.js'; import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class TwoFA extends Component { template() { diff --git a/frontend/src/components/Edit-Profile.js b/frontend/src/components/Edit-Profile.js index cfd9de8..94c4129 100644 --- a/frontend/src/components/Edit-Profile.js +++ b/frontend/src/components/Edit-Profile.js @@ -1,10 +1,7 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; import { parseJWT } from "../core/jwt.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class EditProfile extends Component { diff --git a/frontend/src/components/Friends-List.js b/frontend/src/components/Friends-List.js index 6cb199d..2a83acc 100644 --- a/frontend/src/components/Friends-List.js +++ b/frontend/src/components/Friends-List.js @@ -3,10 +3,7 @@ import { FriendsInfo } from "./Friends-Info.js"; import { List } from "./List.js"; import { changeUrl, parsePath } from "../core/router.js"; import { Input } from "./Input.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class FriendsList extends Component { diff --git a/frontend/src/components/Game-Core.js b/frontend/src/components/Game-Core.js index 1fd3461..7df26d9 100644 --- a/frontend/src/components/Game-Core.js +++ b/frontend/src/components/Game-Core.js @@ -2,10 +2,7 @@ import { Component } from "../core/Component.js"; import { getCookie } from "../core/jwt.js"; import { socketList } from "../app.js"; import { changeUrl } from "../core/router.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class GameCore extends Component { constructor($el, props) { diff --git a/frontend/src/components/Game-Result-Page.js b/frontend/src/components/Game-Result-Page.js index f9ed754..6e8d6dd 100644 --- a/frontend/src/components/Game-Result-Page.js +++ b/frontend/src/components/Game-Result-Page.js @@ -1,9 +1,6 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class GameResultPage extends Component { diff --git a/frontend/src/components/Game-Tournament-Core.js b/frontend/src/components/Game-Tournament-Core.js index 8406c59..cd33fd8 100644 --- a/frontend/src/components/Game-Tournament-Core.js +++ b/frontend/src/components/Game-Tournament-Core.js @@ -2,10 +2,7 @@ import { Component } from "../core/Component.js"; import { getCookie } from "../core/jwt.js"; import { socketList } from "../app.js" import { changeUrl } from "../core/router.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class GameTournamentCore extends Component { constructor($el, props) { diff --git a/frontend/src/components/Game-matching-Core.js b/frontend/src/components/Game-matching-Core.js index 0fd4974..e562e2b 100644 --- a/frontend/src/components/Game-matching-Core.js +++ b/frontend/src/components/Game-matching-Core.js @@ -2,10 +2,7 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; import { getCookie } from "../core/jwt.js"; import { socketList } from "../app.js" -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class GameMatchingCore extends Component { constructor($el, props) { diff --git a/frontend/src/components/Home-Login.js b/frontend/src/components/Home-Login.js index 169220d..9f15863 100644 --- a/frontend/src/components/Home-Login.js +++ b/frontend/src/components/Home-Login.js @@ -1,9 +1,6 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class Login extends Component { diff --git a/frontend/src/components/Main-Menu.js b/frontend/src/components/Main-Menu.js index 83ae426..dbdca81 100644 --- a/frontend/src/components/Main-Menu.js +++ b/frontend/src/components/Main-Menu.js @@ -2,10 +2,7 @@ import { Component } from "../core/Component.js"; import { List } from "./List.js"; import { changeUrl } from "../core/router.js"; import { parseJWT } from "../core/jwt.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class Menu extends Component { translate() { diff --git a/frontend/src/components/Profile-Info.js b/frontend/src/components/Profile-Info.js index aacf2d7..3a16b12 100644 --- a/frontend/src/components/Profile-Info.js +++ b/frontend/src/components/Profile-Info.js @@ -2,10 +2,7 @@ import { Component } from "../core/Component.js"; import { changeUrl } from "../core/router.js"; import { MatchList } from "./Profile-List.js"; import { parseJWT } from "../core/jwt.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class ProfileInfo extends Component { diff --git a/frontend/src/components/Tournament-Setting.js b/frontend/src/components/Tournament-Setting.js index 12da49c..9b876a5 100644 --- a/frontend/src/components/Tournament-Setting.js +++ b/frontend/src/components/Tournament-Setting.js @@ -2,10 +2,7 @@ import { Component } from "../core/Component.js"; import { TournamentHistory } from "./Tournament-History.js"; import { parseJWT } from "../core/jwt.js"; import { changeUrl } from "../core/router.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export class TournamentSetting extends Component { diff --git a/frontend/src/core/router.js b/frontend/src/core/router.js index 0c5c609..6edef7a 100644 --- a/frontend/src/core/router.js +++ b/frontend/src/core/router.js @@ -13,10 +13,7 @@ import { GameTournament } from "../components/Game-Tournament.js"; import { GameMatching } from "../components/Game-matching.js"; import { Error } from "../components/Error.js"; import { GameResult } from "../components/Game-Result.js"; -import dotenv from 'dotenv'; - -dotenv.config(); -const host = process.env.HOST_ADDRESS; +import host from "./load_host.js"; export const createRoutes = (root) => { return { diff --git a/frontend/src/load_host.js b/frontend/src/load_host.js new file mode 100644 index 0000000..0e575e6 --- /dev/null +++ b/frontend/src/load_host.js @@ -0,0 +1,6 @@ +import dotenv from 'dotenv'; + +dotenv.config(); +const host = process.env.HOST_ADDRESS; + +export default host;