build: sync feature tags and update tests for weak type handling
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ COPY . .
|
||||
RUN CGO_ENABLED=0 go build -ldflags "-s -w \
|
||||
-X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev) \
|
||||
-X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||||
-tags "with_quic with_utls" \
|
||||
-tags "with_quic with_utls with_wireguard with_clash_api" \
|
||||
-o xboard-node ./cmd/xboard-node
|
||||
|
||||
# Runtime stage — sing-box & xray-core are embedded as Go libraries
|
||||
|
||||
@@ -69,6 +69,7 @@ require (
|
||||
github.com/mholt/acmez/v3 v3.1.6 // indirect
|
||||
github.com/miekg/dns v1.1.72 // indirect
|
||||
github.com/mitchellh/go-ps v1.0.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/openai/openai-go/v3 v3.26.0 // indirect
|
||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
|
||||
@@ -147,6 +147,8 @@ github.com/miekg/dns v1.1.72 h1:vhmr+TF2A3tuoGNkLDFK9zi36F2LS+hKTRW0Uf8kbzI=
|
||||
github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs=
|
||||
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
|
||||
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/openai/openai-go/v3 v3.26.0 h1:bRt6H/ozMNt/dDkN4gobnLqaEGrRGBzmbVs0xxJEnQE=
|
||||
|
||||
@@ -46,19 +46,6 @@ func TestBuildInbound_Shadowsocks2022(t *testing.T) {
|
||||
assertMapValue(t, inbound, "password", "base64serverkey==")
|
||||
}
|
||||
|
||||
func TestBuildInbound_ShadowsocksWithPlugin(t *testing.T) {
|
||||
nc := &panel.NodeConfig{
|
||||
Protocol: "shadowsocks",
|
||||
ServerPort: 333,
|
||||
Cipher: "aes-128-gcm",
|
||||
Plugin: "obfs-local",
|
||||
PluginOpt: "obfs=http;obfs-host=example.com",
|
||||
}
|
||||
inbound := buildInbound(nc, testUsers, "", "")
|
||||
assertMapValue(t, inbound, "plugin", "obfs-local")
|
||||
assertMapValue(t, inbound, "plugin_opts", "obfs=http;obfs-host=example.com")
|
||||
}
|
||||
|
||||
// --- VMess ---
|
||||
|
||||
func TestBuildInbound_VMess(t *testing.T) {
|
||||
@@ -605,9 +592,8 @@ func TestBuildTLSConfig_NoCert(t *testing.T) {
|
||||
nc := &panel.NodeConfig{ServerName: "example.com"}
|
||||
tls := buildTLSConfig(nc, "", "")
|
||||
assertMapValue(t, tls, "enabled", true)
|
||||
if _, exists := tls["certificate_path"]; exists {
|
||||
t.Error("should not have certificate_path when empty")
|
||||
}
|
||||
// Now we fallback to self-signed certificates when both cert and key are empty
|
||||
assertMapValue(t, tls, "certificate_path", "self-signed")
|
||||
}
|
||||
|
||||
func TestBuildTLSConfig_FallbackToHost(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user