aboutsummaryrefslogtreecommitdiff
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 79aaf7a0..f5212a28 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -50,7 +50,8 @@ var (
Protocol Scheme
Domain string
HttpAddr, HttpPort string
- SshPort int
+ DisableSSH bool
+ SSHPort int
OfflineMode bool
DisableRouterLog bool
CertFile, KeyFile string
@@ -213,7 +214,8 @@ func NewConfigContext() {
Domain = sec.Key("DOMAIN").MustString("localhost")
HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
HttpPort = sec.Key("HTTP_PORT").MustString("3000")
- SshPort = sec.Key("SSH_PORT").MustInt(22)
+ DisableSSH = sec.Key("DISABLE_SSH").MustBool()
+ SSHPort = sec.Key("SSH_PORT").MustInt(22)
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
@@ -315,6 +317,7 @@ func NewConfigContext() {
var Service struct {
RegisterEmailConfirm bool
DisableRegistration bool
+ ShowRegistrationButton bool
RequireSignInView bool
EnableCacheAvatar bool
EnableNotifyMail bool
@@ -328,6 +331,7 @@ func newService() {
Service.ActiveCodeLives = Cfg.Section("service").Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180)
Service.ResetPwdCodeLives = Cfg.Section("service").Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180)
Service.DisableRegistration = Cfg.Section("service").Key("DISABLE_REGISTRATION").MustBool()
+ Service.ShowRegistrationButton = Cfg.Section("service").Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration)
Service.RequireSignInView = Cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").MustBool()
Service.EnableCacheAvatar = Cfg.Section("service").Key("ENABLE_CACHE_AVATAR").MustBool()
Service.EnableReverseProxyAuth = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()