feat: refactor auth and xpack integration

This commit is contained in:
ssongliu
2026-04-23 17:00:50 +08:00
committed by zhengkunwang223
parent 69906046e8
commit a917ca00a1
175 changed files with 5676 additions and 3734 deletions

View File

@@ -1,11 +0,0 @@
//go:build xpack
package server
import (
xpack "github.com/1Panel-dev/1Panel/core/xpack"
)
func InitOthers() {
xpack.Init()
}

View File

@@ -1,13 +0,0 @@
//go:build xpackee
package server
import (
xpack "github.com/1Panel-dev/1Panel/core/xpack"
xpackEE "github.com/1Panel-dev/1Panel/core/xpack-ee"
)
func InitOthers() {
xpack.Init()
xpackEE.Init()
}

View File

@@ -83,7 +83,8 @@ func Start() {
type tcpKeepAliveListener struct {
*net.TCPListener
}
if global.CONF.Conn.SSL == constant.StatusEnable {
switch global.CONF.Conn.SSL {
case constant.StatusEnable:
constant.CertStore.Store(loadCert())
server.TLSConfig = &tls.Config{
@@ -96,8 +97,7 @@ func Start() {
if err := server.ServeTLS(tcpKeepAliveListener{ln.(*net.TCPListener)}, "", ""); err != nil {
panic(err)
}
return
} else if global.CONF.Conn.SSL == constant.StatusMux {
case constant.StatusMux:
constant.CertStore.Store(loadCert())
server.TLSConfig = &tls.Config{
@@ -144,13 +144,11 @@ func Start() {
if err := m.Serve(); err != nil {
panic(err)
}
return
} else {
default:
global.LOG.Infof("listen at http://%s:%s [%s]", global.CONF.Conn.BindAddress, global.CONF.Conn.Port, tcpItem)
if err := server.Serve(tcpKeepAliveListener{ln.(*net.TCPListener)}); err != nil {
panic(err)
}
return
}
}
@@ -216,5 +214,4 @@ func handleMuxHttpConn(conn net.Conn) {
resp.Header.Set("Connection", "close")
_ = resp.Write(conn)
return
}