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.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 052ec377..d82f16db 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -48,12 +48,13 @@ var (
BuildGitHash string
// App settings
- AppVer string
- AppName string
- AppUrl string
- AppSubUrl string
- AppPath string
- AppDataPath = "data"
+ AppVer string
+ AppName string
+ AppUrl string
+ AppSubUrl string
+ AppSubUrlDepth int // Number of slashes
+ AppPath string
+ AppDataPath = "data"
// Server settings
Protocol Scheme
@@ -113,10 +114,12 @@ var (
AdminRepoPagingNum int
AdminNoticePagingNum int
AdminOrgPagingNum int
+ ThemeColorMetaTag string
// Markdown sttings
Markdown struct {
EnableHardLineBreak bool
+ CustomURLSchemes []string `ini:"CUSTOM_URL_SCHEMES"`
}
// Picture settings
@@ -299,7 +302,9 @@ func NewContext() {
if err != nil {
log.Fatal(4, "Invalid ROOT_URL '%s': %s", AppUrl, err)
}
+ // Suburl should start with '/' and end without '/', such as '/{subpath}'.
AppSubUrl = strings.TrimSuffix(url.Path, "/")
+ AppSubUrlDepth = strings.Count(AppSubUrl, "/")
Protocol = HTTP
if sec.Key("PROTOCOL").String() == "https" {
@@ -403,6 +408,7 @@ func NewContext() {
AdminRepoPagingNum = sec.Key("REPO_PAGING_NUM").MustInt(50)
AdminNoticePagingNum = sec.Key("NOTICE_PAGING_NUM").MustInt(50)
AdminOrgPagingNum = sec.Key("ORG_PAGING_NUM").MustInt(50)
+ ThemeColorMetaTag = sec.Key("THEME_COLOR_META_TAG").MustString("#ff5343")
sec = Cfg.Section("picture")
PictureService = sec.Key("SERVICE").In("server", []string{"server"})
@@ -449,7 +455,6 @@ var Service struct {
DisableRegistration bool
ShowRegistrationButton bool
RequireSignInView bool
- EnableCacheAvatar bool
EnableNotifyMail bool
EnableReverseProxyAuth bool
EnableReverseProxyAutoRegister bool
@@ -463,7 +468,6 @@ func newService() {
Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool()
Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration)
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
- Service.EnableCacheAvatar = sec.Key("ENABLE_CACHE_AVATAR").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()