mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-08-30 14:56:17 +00:00
move paths to xray process
This commit is contained in:
parent
ac8b218545
commit
8ef89eaa99
1 changed files with 38 additions and 0 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
"sync"
|
||||
"syscall"
|
||||
"x-ui/config"
|
||||
"x-ui/logger"
|
||||
"x-ui/util/common"
|
||||
|
||||
"github.com/Workiva/go-datastructures/queue"
|
||||
|
@ -47,10 +48,47 @@ func GetBlockedIPsPath() string {
|
|||
return config.GetBinFolderPath() + "/BlockedIps"
|
||||
}
|
||||
|
||||
func GetIPLimitLogPath() string {
|
||||
return config.GetLogFolder() + "/3xipl.log"
|
||||
}
|
||||
|
||||
func GetIPLimitBannedLogPath() string {
|
||||
return config.GetLogFolder() + "/3xipl-banned.log"
|
||||
}
|
||||
|
||||
func GetAccessPersistentLogPath() string {
|
||||
return config.GetLogFolder() + "/3xui-access-persistent.log"
|
||||
}
|
||||
|
||||
func GetAccessLogPath() string {
|
||||
config, err := os.ReadFile(GetConfigPath())
|
||||
if err != nil {
|
||||
logger.Warningf("Something went wrong: %s", err)
|
||||
}
|
||||
|
||||
jsonConfig := map[string]interface{}{}
|
||||
err = json.Unmarshal([]byte(config), &jsonConfig)
|
||||
if err != nil {
|
||||
logger.Warningf("Something went wrong: %s", err)
|
||||
}
|
||||
|
||||
if jsonConfig["log"] != nil {
|
||||
jsonLog := jsonConfig["log"].(map[string]interface{})
|
||||
if jsonLog["access"] != nil {
|
||||
|
||||
accessLogPath := jsonLog["access"].(string)
|
||||
|
||||
return accessLogPath
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func stopProcess(p *Process) {
|
||||
p.Stop()
|
||||
}
|
||||
|
||||
|
||||
type Process struct {
|
||||
*process
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue