aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2018-11-15 02:00:04 +0100
committertechknowlogick <hello@techknowlogick.com>2018-11-14 20:00:04 -0500
commitb97af15de67b04fd259bd70a4abbc873f12e9491 (patch)
tree9a88d821a0ec98edc6dba64804ca6d0692df91fe /modules/setting
parent4c1f1f96465e809161f7d634a07eb60b4511db35 (diff)
downloadgitea-b97af15de67b04fd259bd70a4abbc873f12e9491.tar.gz
gitea-b97af15de67b04fd259bd70a4abbc873f12e9491.zip
Block registration based on email domain (#5157)
* implement email domain whitelist
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index b31162c140..b0bcd2ead8 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -1215,6 +1215,7 @@ var Service struct {
ActiveCodeLives int
ResetPwdCodeLives int
RegisterEmailConfirm bool
+ EmailDomainWhitelist []string
DisableRegistration bool
AllowOnlyExternalRegistration bool
ShowRegistrationButton bool
@@ -1248,6 +1249,7 @@ func newService() {
Service.ResetPwdCodeLives = sec.Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180)
Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool()
Service.AllowOnlyExternalRegistration = sec.Key("ALLOW_ONLY_EXTERNAL_REGISTRATION").MustBool()
+ Service.EmailDomainWhitelist = sec.Key("EMAIL_DOMAIN_WHITELIST").Strings(",")
Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!(Service.DisableRegistration || Service.AllowOnlyExternalRegistration))
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()