diff options
author | techknowlogick <techknowlogick@gitea.io> | 2022-04-05 12:16:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-05 12:16:01 -0400 |
commit | 48dc88acd06a440cd630f0768329563ca7f6e6f3 (patch) | |
tree | 1b8483fad41ba5664353b28fad7716eef6c75d66 /modules/setting | |
parent | 5ae875a1ae0c51705cc8c79536b23130f7ce5394 (diff) | |
download | gitea-48dc88acd06a440cd630f0768329563ca7f6e6f3.tar.gz gitea-48dc88acd06a440cd630f0768329563ca7f6e6f3.zip |
Allow custom redirect for landing page (#19324)
* Allow custom redirect for landing page
* Update modules/setting/setting.go
Co-authored-by: delvh <dev.lh@web.de>
* fix lint
* one option
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index ed91382de3..5e317b39ea 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -106,6 +106,7 @@ var ( StaticCacheTime time.Duration EnableGzip bool LandingPageURL LandingPage + LandingPageCustom string UnixSocketPermission uint32 EnablePprof bool PprofDataPath string @@ -776,15 +777,19 @@ func loadFromConf(allowEmpty bool, extraConfig string) { PprofDataPath = filepath.Join(AppWorkPath, PprofDataPath) } - switch sec.Key("LANDING_PAGE").MustString("home") { + landingPage := sec.Key("LANDING_PAGE").MustString("home") + switch landingPage { case "explore": LandingPageURL = LandingPageExplore case "organizations": LandingPageURL = LandingPageOrganizations case "login": LandingPageURL = LandingPageLogin - default: + case "": + case "home": LandingPageURL = LandingPageHome + default: + LandingPageURL = LandingPage(landingPage) } if len(SSH.Domain) == 0 { |