mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-01-03 17:46:37 +08:00
用户使用反向代理访问系统时主动引导用户设置“自定义客户端IP报头“
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package security
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
)
|
||||
|
||||
type DismissXFFPromptAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *DismissXFFPromptAction) RunPost(params struct{}) {
|
||||
helpers.DisableXFFPrompt()
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -19,7 +19,11 @@ func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ShowAll bool
|
||||
}) {
|
||||
this.Data["showAll"] = params.ShowAll
|
||||
|
||||
config, err := configloaders.LoadSecurityConfig()
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
@@ -66,6 +70,7 @@ func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.Data["provinces"] = provinceMaps
|
||||
|
||||
this.Data["config"] = config
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ func init() {
|
||||
Helper(settingutils.NewHelper("security")).
|
||||
Prefix("/settings/security").
|
||||
GetPost("", new(IndexAction)).
|
||||
Post("/dismissXFFPrompt", new(DismissXFFPromptAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user