Check if reverse proxy is correctly configured (#30890)
Follow #27011 Follow #30885 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
b9396a9b85
commit
7424f27cf3
11 changed files with 93 additions and 19 deletions
|
@ -9,12 +9,14 @@ import (
|
|||
"net/http"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
activities_model "code.gitea.io/gitea/models/activities"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/httplib"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
@ -223,6 +225,16 @@ func SelfCheck(ctx *context.Context) {
|
|||
ctx.HTML(http.StatusOK, tplSelfCheck)
|
||||
}
|
||||
|
||||
func SelfCheckPost(ctx *context.Context) {
|
||||
var problems []string
|
||||
frontendAppURL := ctx.FormString("location_origin") + setting.AppSubURL + "/"
|
||||
ctxAppURL := httplib.GuessCurrentAppURL(ctx)
|
||||
if !strings.HasPrefix(ctxAppURL, frontendAppURL) {
|
||||
problems = append(problems, ctx.Locale.TrString("admin.self_check.location_origin_mismatch", frontendAppURL, ctxAppURL))
|
||||
}
|
||||
ctx.JSON(http.StatusOK, map[string]any{"problems": problems})
|
||||
}
|
||||
|
||||
func CronTasks(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.monitor.cron")
|
||||
ctx.Data["PageIsAdminMonitorCron"] = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue