mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/1Panel-dev/1Panel.git
synced 2026-09-20 08:03:55 +08:00
feat: refactor auth and xpack integration
This commit is contained in:
committed by
zhengkunwang223
parent
69906046e8
commit
a917ca00a1
@@ -1,11 +0,0 @@
|
||||
//go:build xpack
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
xpack "github.com/1Panel-dev/1Panel/core/xpack"
|
||||
)
|
||||
|
||||
func InitOthers() {
|
||||
xpack.Init()
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user