From c5da11792ccf350144f284445b0b19d77facc5ed Mon Sep 17 00:00:00 2001 From: biast12 Date: Wed, 5 Feb 2025 21:56:48 +0100 Subject: [PATCH] Removed FORCED_WHITELABEL This removes the env var FORCED_WHITELABEL, this was only used for testing in the early days of whitelabel and is unused now --- app/http/middleware/verifywhitelabel.go | 28 ++++++++----------------- config/config.go | 1 - envvars.md | 5 ++--- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/app/http/middleware/verifywhitelabel.go b/app/http/middleware/verifywhitelabel.go index 29393d6..0cec4b6 100644 --- a/app/http/middleware/verifywhitelabel.go +++ b/app/http/middleware/verifywhitelabel.go @@ -20,26 +20,16 @@ func VerifyWhitelabel(isApi bool) func(ctx *gin.Context) { } if tier < premium.Whitelabel { - var isForced bool - for _, id := range config.Conf.ForceWhitelabel { - if id == userId { - isForced = true - break - } - } - - if !isForced { - if isApi { - ctx.AbortWithStatusJSON(402, gin.H{ - "success": false, - "error": "You must have the whitelabel premium tier", - }) - } else { - ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite)) - ctx.Abort() - } - return + if isApi { + ctx.AbortWithStatusJSON(402, gin.H{ + "success": false, + "error": "You must have the whitelabel premium tier", + }) + } else { + ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite)) + ctx.Abort() } + return } } } diff --git a/config/config.go b/config/config.go index 9651b1f..fd460fd 100644 --- a/config/config.go +++ b/config/config.go @@ -9,7 +9,6 @@ import ( type Config struct { Admins []uint64 `env:"ADMINS"` - ForceWhitelabel []uint64 `env:"FORCED_WHITELABEL"` Debug bool `env:"DEBUG"` SentryDsn *string `env:"SENTRY_DSN"` JsonLogs bool `env:"JSON_LOGS" envDefault:"false"` diff --git a/envvars.md b/envvars.md index e6f4645..cfedd9e 100644 --- a/envvars.md +++ b/envvars.md @@ -9,9 +9,8 @@ --- - ADMINS -- FORCED_WHITELABEL -- SENTRY_DSN -- SERVER_ADDR +- SENTRY_DSN +- SERVER_ADD - METRIC_SERVER_ADDR - BASE_URL - MAIN_SITE