summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorFluf <36822577+flufmonster@users.noreply.github.com>2018-07-05 00:13:05 -0400
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-07-05 00:13:05 -0400
commitf035dcd4f221a631cc499d90661237d6cf601843 (patch)
tree18f7cfd148dd36c85e4c82c8cd5fdef88c249606 /modules/setting/setting.go
parent54fedd4070be9819a6dd4e441b3c5689334eae9d (diff)
downloadgitea-f035dcd4f221a631cc499d90661237d6cf601843.tar.gz
gitea-f035dcd4f221a631cc499d90661237d6cf601843.zip
Add Recaptcha functionality to Gitea (#4044)
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index a5f4457f33..5230307cab 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -75,6 +75,12 @@ const (
RepoCreatingPublic = "public"
)
+// enumerates all the types of captchas
+const (
+ ImageCaptcha = "image"
+ ReCaptcha = "recaptcha"
+)
+
// settings
var (
// AppVer settings
@@ -1165,6 +1171,9 @@ var Service struct {
EnableReverseProxyAuth bool
EnableReverseProxyAutoRegister bool
EnableCaptcha bool
+ CaptchaType string
+ RecaptchaSecret string
+ RecaptchaSitekey string
DefaultKeepEmailPrivate bool
DefaultAllowCreateOrganization bool
EnableTimetracking bool
@@ -1189,7 +1198,10 @@ func newService() {
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()
- Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool()
+ Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool(false)
+ Service.CaptchaType = sec.Key("CAPTCHA_TYPE").MustString(ImageCaptcha)
+ Service.RecaptchaSecret = sec.Key("RECAPTCHA_SECRET").MustString("")
+ Service.RecaptchaSitekey = sec.Key("RECAPTCHA_SITEKEY").MustString("")
Service.DefaultKeepEmailPrivate = sec.Key("DEFAULT_KEEP_EMAIL_PRIVATE").MustBool()
Service.DefaultAllowCreateOrganization = sec.Key("DEFAULT_ALLOW_CREATE_ORGANIZATION").MustBool(true)
Service.EnableTimetracking = sec.Key("ENABLE_TIMETRACKING").MustBool(true)