Merge remote-tracking branch 'origin/main' into multi-tenant

This commit is contained in:
TsMask
2024-08-12 11:14:27 +08:00
77 changed files with 2078 additions and 1339 deletions

View File

@@ -11,7 +11,7 @@ logger:
pprof:
enabled: true
addr: :36060
addr: :33060
# rest agent listen ipv4/v6 and port, support multiple routines
# ip: 0.0.0.0 or ::0, support IPv4/v6

View File

@@ -1,7 +1,7 @@
# Makefile for rest agent project
PROJECT = OMC
VERSION = 2.2407.5
VERSION = 2.2408.2
PLATFORM = amd64
ARMPLATFORM = aarch64
BUILDDIR = ../../build

View File

@@ -255,7 +255,7 @@ func main() {
// register feature service gin.Engine
features.InitServiceEngine(app)
var listenLocalhost bool = false
// var listenLocalhost bool = false
for _, rest := range conf.Rest {
// ipv4 goroutines
if rest.IPv4 != "" {
@@ -266,16 +266,16 @@ func main() {
go HttpListen(listen, app)
}
}
if rest.IPv4 != "0.0.0.0" && !listenLocalhost {
listenLocalhost = true
// 默认启动localhost侦听
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
if strings.ToLower(rest.Scheme) == "https" {
go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, rest.ClientAuthType, app)
} else {
go HttpListen(listenLocal, app)
}
}
// if rest.IPv4 != "0.0.0.0" && !listenLocalhost {
// listenLocalhost = true
// // 默认启动localhost侦听
// listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
// if strings.ToLower(rest.Scheme) == "https" {
// go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, rest.ClientAuthType, app)
// } else {
// go HttpListen(listenLocal, app)
// }
// }
// ipv6 goroutines
if rest.IPv6 != "" {
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))