diff --git a/.env b/.env index 4d618a2..385a470 100644 --- a/.env +++ b/.env @@ -9,8 +9,8 @@ NOTESNOOK_API_SECRET= # Description: Use this flag to disable creation of new accounts on your instance (i.e. in case it is exposed to the Internet). # Required: yes -# Possible values: 0 for false; 1 for true -DISABLE_ACCOUNT_CREATION=0 +# Possible values: true/false +DISABLE_SIGNUPS=false ### SMTP Configuration ### # SMTP Configuration is required for sending emails for password reset, 2FA emails etc. You can get SMTP settings from your email provider. @@ -29,14 +29,6 @@ SMTP_HOST= # Required: yes # Example: 465 SMTP_PORT= -# Description: The FROM email address when sending out emails. Must be an email address under your control otherwise sending will fail. Most times it is the same email address as the SMTP_USERNAME. -# Required: no -# Example: support@notesnook.com -NOTESNOOK_SENDER_EMAIL= -# Description: The reply-to email is used whenever a user is replying to the email you sent. You can use this to set a different reply-to email address than the one you used to send the email. -# Required: no -# Example: support@notesnook.com -SMTP_REPLYTO_EMAIL= # Description: Twilio account SID is required for sending SMS with 2FA codes. Learn more here: https://help.twilio.com/articles/14726256820123-What-is-a-Twilio-Account-SID-and-where-can-I-find-it- # Required: no diff --git a/Streetwriters.Common/Constants.cs b/Streetwriters.Common/Constants.cs index 2c5f1c7..3631a54 100644 --- a/Streetwriters.Common/Constants.cs +++ b/Streetwriters.Common/Constants.cs @@ -25,7 +25,7 @@ namespace Streetwriters.Common { public static int COMPATIBILITY_VERSION = 1; public static bool IS_SELF_HOSTED => Environment.GetEnvironmentVariable("SELF_HOSTED") == "1"; - public static bool DISABLE_ACCOUNT_CREATION => Environment.GetEnvironmentVariable("DISABLE_ACCOUNT_CREATION") == "1"; + public static bool DISABLE_SIGNUPS => Environment.GetEnvironmentVariable("DISABLE_SIGNUPS") == "true"; public static string INSTANCE_NAME => Environment.GetEnvironmentVariable("INSTANCE_NAME") ?? "default"; // S3 related diff --git a/Streetwriters.Identity/Controllers/SignupController.cs b/Streetwriters.Identity/Controllers/SignupController.cs index c28cb4e..60cd2f8 100644 --- a/Streetwriters.Identity/Controllers/SignupController.cs +++ b/Streetwriters.Identity/Controllers/SignupController.cs @@ -53,7 +53,7 @@ namespace Streetwriters.Identity.Controllers [AllowAnonymous] public async Task Signup([FromForm] SignupForm form) { - if (Constants.DISABLE_ACCOUNT_CREATION) + if (Constants.DISABLE_SIGNUPS) return BadRequest(new string[] { "Creating new accounts is not allowed." }); try { diff --git a/docker-compose.yml b/docker-compose.yml index 66379a1..5f955cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: required_vars=( "INSTANCE_NAME" "NOTESNOOK_API_SECRET" - "DISABLE_ACCOUNT_CREATION" + "DISABLE_SIGNUPS" "SMTP_USERNAME" "SMTP_PASSWORD" "SMTP_HOST"