Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xray
diff options
context:
space:
mode:
authorHo3ein <ho3ein.sanaei@gmail.com>2023-04-14 04:58:03 +0300
committerGitHub <noreply@github.com>2023-04-14 04:58:03 +0300
commitb70ecc12b3870fe7ed77242b77369008de4b5441 (patch)
treed93f5233a3ee0514cfece964c68d28afe30ebbac /xray
parent0c047cf1245411394d77c3d7880bfc7466716856 (diff)
parent4f952963aea1c51c65cc8419abda31e2bfd8f5ea (diff)
Merge pull request #261 from hamid-gh98/main
Support set db and bin folder path from env
Diffstat (limited to 'xray')
-rw-r--r--xray/process.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/xray/process.go b/xray/process.go
index a73ff95f..35907391 100644
--- a/xray/process.go
+++ b/xray/process.go
@@ -14,6 +14,7 @@ import (
"runtime"
"strings"
"time"
+ "x-ui/config"
"x-ui/util/common"
"github.com/Workiva/go-datastructures/queue"
@@ -29,19 +30,23 @@ func GetBinaryName() string {
}
func GetBinaryPath() string {
- return "bin/" + GetBinaryName()
+ return config.GetBinFolderPath() + "/" + GetBinaryName()
}
func GetConfigPath() string {
- return "bin/config.json"
+ return config.GetBinFolderPath() + "/config.json"
}
func GetGeositePath() string {
- return "bin/geosite.dat"
+ return config.GetBinFolderPath() + "/geosite.dat"
}
func GetGeoipPath() string {
- return "bin/geoip.dat"
+ return config.GetBinFolderPath() + "/geoip.dat"
+}
+
+func GetBlockedIPsPath() string {
+ return config.GetBinFolderPath() + "/blockedIPs"
}
func stopProcess(p *Process) {
@@ -162,7 +167,7 @@ func (p *process) Start() (err error) {
return common.NewErrorf("Failed to write configuration file: %v", err)
}
- cmd := exec.Command(GetBinaryPath(), "-c", configPath, "-restrictedIPsPath", "./bin/blockedIPs")
+ cmd := exec.Command(GetBinaryPath(), "-c", configPath, "-restrictedIPsPath", GetBlockedIPsPath())
p.cmd = cmd
stdReader, err := cmd.StdoutPipe()