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
diff options
context:
space:
mode:
-rw-r--r--util/random/random.go7
-rw-r--r--web/job/check_client_ip_job.go6
-rw-r--r--web/service/outbound.go1
3 files changed, 7 insertions, 7 deletions
diff --git a/util/random/random.go b/util/random/random.go
index b1dd2e09..1dd47ec9 100644
--- a/util/random/random.go
+++ b/util/random/random.go
@@ -2,7 +2,6 @@ package random
import (
"math/rand"
- "time"
)
var numSeq [10]rune
@@ -13,8 +12,6 @@ var numUpperSeq [36]rune
var allSeq [62]rune
func init() {
- rand.Seed(time.Now().UnixNano())
-
for i := 0; i < 10; i++ {
numSeq[i] = rune('0' + i)
}
@@ -41,3 +38,7 @@ func Seq(n int) string {
}
return string(runes)
}
+
+func Num(n int) int {
+ return rand.Intn(n)
+}
diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go
index 51a09db8..d48bc8eb 100644
--- a/web/job/check_client_ip_job.go
+++ b/web/job/check_client_ip_job.go
@@ -118,7 +118,7 @@ func (j *CheckClientIpJob) checkFail2BanInstalled() {
err := exec.Command(cmd, args...).Run()
if err != nil {
- logger.Error("fail2ban is not installed. IP limiting may not work properly.")
+ logger.Warning("fail2ban is not installed. IP limiting may not work properly.")
}
}
@@ -126,12 +126,12 @@ func (j *CheckClientIpJob) processLogFile() {
accessLogPath := xray.GetAccessLogPath()
if accessLogPath == "none" {
- logger.Error("Access log is set to 'none' check your Xray Configs")
+ logger.Warning("Access log is set to 'none' check your Xray Configs")
return
}
if accessLogPath == "" {
- logger.Error("Access log doesn't exist in your Xray Configs")
+ logger.Warning("Access log doesn't exist in your Xray Configs")
return
}
diff --git a/web/service/outbound.go b/web/service/outbound.go
index 244d7a14..05791f69 100644
--- a/web/service/outbound.go
+++ b/web/service/outbound.go
@@ -10,7 +10,6 @@ import (
)
type OutboundService struct {
- xrayApi xray.XrayAPI
}
func (s *OutboundService) AddTraffic(traffics []*xray.Traffic, clientTraffics []*xray.ClientTraffic) (error, bool) {