mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-27 21:06:35 +08:00
[日志审计]增加删除、清理和别的一些设置
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
|
||||
nodes "github.com/TeaOSLab/EdgeAdmin/internal/rpc"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/securitymanager"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/setup"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/uimanager"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -28,7 +27,7 @@ func (this *UserMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramNam
|
||||
var action = actionPtr.Object()
|
||||
|
||||
// 安全相关
|
||||
securityConfig, _ := securitymanager.LoadSecurityConfig()
|
||||
securityConfig, _ := configloaders.LoadSecurityConfig()
|
||||
if securityConfig == nil {
|
||||
action.AddHeader("X-Frame-Options", "SAMEORIGIN")
|
||||
} else if len(securityConfig.Frame) > 0 {
|
||||
@@ -84,7 +83,7 @@ func (this *UserMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramNam
|
||||
return true
|
||||
}
|
||||
|
||||
config, err := uimanager.LoadUIConfig()
|
||||
config, err := configloaders.LoadUIConfig()
|
||||
if err != nil {
|
||||
action.WriteString(err.Error())
|
||||
return false
|
||||
@@ -206,16 +205,16 @@ func (this *UserMustAuth) modules() []maps.Map {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"code": "log",
|
||||
"name": "日志审计",
|
||||
"icon": "history",
|
||||
},
|
||||
{
|
||||
"code": "settings",
|
||||
"name": "系统设置",
|
||||
"icon": "setting",
|
||||
},
|
||||
{
|
||||
"code": "log",
|
||||
"name": "操作日志",
|
||||
"icon": "history",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/securitymanager"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/utils/numberutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"net/http"
|
||||
@@ -16,7 +16,7 @@ func (this *UserShouldAuth) BeforeAction(actionPtr actions.ActionWrapper, paramN
|
||||
|
||||
// 安全相关
|
||||
action := this.action
|
||||
securityConfig, _ := securitymanager.LoadSecurityConfig()
|
||||
securityConfig, _ := configloaders.LoadSecurityConfig()
|
||||
if securityConfig == nil {
|
||||
action.AddHeader("X-Frame-Options", "SAMEORIGIN")
|
||||
} else if len(securityConfig.Frame) > 0 {
|
||||
|
||||
@@ -3,8 +3,8 @@ package helpers
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/events"
|
||||
nodes "github.com/TeaOSLab/EdgeAdmin/internal/rpc"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/securitymanager"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
"net"
|
||||
@@ -23,7 +23,7 @@ func init() {
|
||||
}
|
||||
|
||||
// 检查用户IP并支持缓存
|
||||
func checkIP(config *securitymanager.SecurityConfig, ipAddr string) bool {
|
||||
func checkIP(config *systemconfigs.SecurityConfig, ipAddr string) bool {
|
||||
ipCacheLocker.Lock()
|
||||
ipCache, ok := ipCacheMap[ipAddr]
|
||||
if ok && ipCache {
|
||||
@@ -46,7 +46,7 @@ func checkIP(config *securitymanager.SecurityConfig, ipAddr string) bool {
|
||||
}
|
||||
|
||||
// 检查用户IP
|
||||
func checkIPWithoutCache(config *securitymanager.SecurityConfig, ipAddr string) bool {
|
||||
func checkIPWithoutCache(config *systemconfigs.SecurityConfig, ipAddr string) bool {
|
||||
if config == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user