feat(admin): configurable default landing page from site administration #240
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add an admin setting to configure the default landing page for the MokoGitea instance. Currently the home page always shows the explore/repository list. Admins should be able to choose what visitors see when they hit the root URL.
Proposed options
/MokoConsulting)/MokoConsulting/MokoGitea/wiki)Behavior
Current state
Gitea already has a
LANDING_PAGEsetting in app.ini (home,explore,organizations,login, or a custom path). This feature would:Files to investigate
modules/setting/server.go— where LANDING_PAGE is parsedrouters/web/home.go— the Home() handler that uses the landing page settingrouters/web/admin/config.go— admin config pagetemplates/admin/config.tmpl— admin config templateCreated by @MokoBot - Claude Opus 4.6
Implementation Plan
Current state
Gitea already has full
LANDING_PAGEsupport inapp.ini:modules/setting/server.go:30-38— definesLandingPagetype with options:home,explore,organizations,login, or any custom pathmodules/setting/server.go:312-323— parses the setting from configrouters/web/home.go:51-53— redirects unauthenticated users to the configured landing pageWhat is missing: exposing this setting in the admin UI so it can be changed at runtime.
Implementation
1. Add to admin config panel
routers/web/admin/config.go— addLandingPageURLto the template datatemplates/admin/config.tmpl— add a form section under Server settings with:/MokoConsultingor/MokoConsulting/MokoGitea/wiki)2. Admin config POST handler
routers/web/admin/config.go— handle the POST to updatesetting.LandingPageURLat runtimesetting.LandingPageURLon every request3. Persist to app.ini (optional)
custom/conf/app.iniso it survives restartssystem_settingtable row (Gitea already has this pattern for some runtime settings)Scope
This is a small feature — approximately 3 files to modify, no migration needed. The core logic already exists; it is just a UI gap.
@MokoBot - Claude Opus 4.6