From fc48827338c3eb5632249e34dcc1f5b8d1c61031 Mon Sep 17 00:00:00 2001 From: subnub <44621867+subnub@users.noreply.github.com> Date: Sat, 1 Mar 2025 03:07:19 -0500 Subject: [PATCH] feat: Add block account creation (#80) --- .env.example | 2 +- backend/config/.env.development.example | 5 ++++- backend/config/.env.production.example | 5 ++++- backend/config/.env.test.example | 5 ++++- backend/enviroment/env.ts | 4 ++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 81dd078..eff33e5 100644 --- a/.env.example +++ b/.env.example @@ -52,7 +52,7 @@ TEMP_DIRECTORY=/temp/ TEMP_VIDEO_THUMBNAIL_LIMIT=5000000000 # Block account creation (optional): If you want to block account creation, configure as so, but after you create an account. -BLOCK_CREATE_ACCOUNT=false +# BLOCK_CREATE_ACCOUNT=true # Ports (optional): The ports to run the server on. # HTTP_PORT: Default port is 3000 diff --git a/backend/config/.env.development.example b/backend/config/.env.development.example index 515ddca..e2c7a4c 100644 --- a/backend/config/.env.development.example +++ b/backend/config/.env.development.example @@ -93,4 +93,7 @@ SSL= # By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project HTTPS_KEY_PATH= HTTPS_CA_PATH= -HTTPS_CRT_PATH= \ No newline at end of file +HTTPS_CRT_PATH= + +# Block account creation (optional): If you want to block account creation, configure as so, but after you create an account. +# BLOCK_CREATE_ACCOUNT=true \ No newline at end of file diff --git a/backend/config/.env.production.example b/backend/config/.env.production.example index 515ddca..e2c7a4c 100644 --- a/backend/config/.env.production.example +++ b/backend/config/.env.production.example @@ -93,4 +93,7 @@ SSL= # By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project HTTPS_KEY_PATH= HTTPS_CA_PATH= -HTTPS_CRT_PATH= \ No newline at end of file +HTTPS_CRT_PATH= + +# Block account creation (optional): If you want to block account creation, configure as so, but after you create an account. +# BLOCK_CREATE_ACCOUNT=true \ No newline at end of file diff --git a/backend/config/.env.test.example b/backend/config/.env.test.example index 515ddca..e2c7a4c 100644 --- a/backend/config/.env.test.example +++ b/backend/config/.env.test.example @@ -93,4 +93,7 @@ SSL= # By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project HTTPS_KEY_PATH= HTTPS_CA_PATH= -HTTPS_CRT_PATH= \ No newline at end of file +HTTPS_CRT_PATH= + +# Block account creation (optional): If you want to block account creation, configure as so, but after you create an account. +# BLOCK_CREATE_ACCOUNT=true \ No newline at end of file diff --git a/backend/enviroment/env.ts b/backend/enviroment/env.ts index 305d661..65f80da 100644 --- a/backend/enviroment/env.ts +++ b/backend/enviroment/env.ts @@ -4,7 +4,7 @@ export default { passwordAccess: process.env.PASSWORD_ACCESS, passwordRefresh: process.env.PASSWORD_REFRESH, passwordCookie: process.env.PASSWORD_COOKIE, - createAcctBlocked: process.env.BLOCK_CREATE_ACCOUNT, + createAcctBlocked: process.env.BLOCK_CREATE_ACCOUNT === "true", root: process.env.ROOT, url: process.env.URL, mongoURL: process.env.MONGODB_URL, @@ -42,7 +42,7 @@ module.exports = { passwordAccess: process.env.PASSWORD_ACCESS, passwordRefresh: process.env.PASSWORD_REFRESH, passwordCookie: process.env.PASSWORD_COOKIE, - createAcctBlocked: process.env.BLOCK_CREATE_ACCOUNT, + createAcctBlocked: process.env.BLOCK_CREATE_ACCOUNT === "true", root: process.env.ROOT, url: process.env.URL, mongoURL: process.env.MONGODB_URL,