mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-20 16:10:50 +00:00
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>
This commit is contained in:
parent
5ae875a1ae
commit
48dc88acd0
3 changed files with 9 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue