Merge branch 'main' into fix/ice-handshake

This commit is contained in:
Zoltán Papp
2025-08-13 10:47:54 +02:00
119 changed files with 2002 additions and 1176 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/netbirdio/netbird/client/system"
"github.com/netbirdio/netbird/management/server/activity"
"github.com/netbirdio/netbird/management/server/groups"
"github.com/netbirdio/netbird/management/server/integrations/port_forwarding"
"github.com/netbirdio/netbird/management/server/permissions"
"github.com/netbirdio/netbird/management/server/settings"
@@ -111,7 +112,9 @@ func startManagement(t *testing.T) (*grpc.Server, net.Listener) {
t.Fatal(err)
}
secretsManager := mgmt.NewTimeBasedAuthSecretsManager(peersUpdateManager, config.TURNConfig, config.Relay, settingsMockManager)
groupsManager := groups.NewManagerMock()
secretsManager := mgmt.NewTimeBasedAuthSecretsManager(peersUpdateManager, config.TURNConfig, config.Relay, settingsMockManager, groupsManager)
mgmtServer, err := mgmt.NewServer(context.Background(), config, accountManager, settingsMockManager, peersUpdateManager, secretsManager, nil, nil, nil, mgmt.MockIntegratedValidator{})
if err != nil {
t.Fatal(err)

View File

@@ -503,7 +503,7 @@ func (c *GrpcClient) Logout() error {
return fmt.Errorf("get server public key: %w", err)
}
mgmCtx, cancel := context.WithTimeout(c.ctx, time.Second*5)
mgmCtx, cancel := context.WithTimeout(c.ctx, time.Second*15)
defer cancel()
message := &proto.Empty{}

View File

@@ -162,6 +162,12 @@ components:
description: Enables or disables network traffic logging. If enabled, all network traffic events from peers will be stored.
type: boolean
example: true
network_traffic_logs_groups:
description: Limits traffic logging to these groups. If unset all peers are enabled.
type: array
items:
type: string
example: ch8i4ug6lnn4g9hqv7m0
network_traffic_packet_counter_enabled:
description: Enables or disables network traffic packet counter. If enabled, network packets and their size will be counted and reported. (This can have an slight impact on performance)
type: boolean
@@ -169,6 +175,7 @@ components:
required:
- peer_approval_enabled
- network_traffic_logs_enabled
- network_traffic_logs_groups
- network_traffic_packet_counter_enabled
AccountRequest:
type: object

View File

@@ -260,6 +260,9 @@ type AccountExtraSettings struct {
// NetworkTrafficLogsEnabled Enables or disables network traffic logging. If enabled, all network traffic events from peers will be stored.
NetworkTrafficLogsEnabled bool `json:"network_traffic_logs_enabled"`
// NetworkTrafficLogsGroups Limits traffic logging to these groups. If unset all peers are enabled.
NetworkTrafficLogsGroups []string `json:"network_traffic_logs_groups"`
// NetworkTrafficPacketCounterEnabled Enables or disables network traffic packet counter. If enabled, network packets and their size will be counted and reported. (This can have an slight impact on performance)
NetworkTrafficPacketCounterEnabled bool `json:"network_traffic_packet_counter_enabled"`

View File

@@ -1,3 +1,3 @@
package tls
const nbalpn = "nb-quic"
const NBalpn = "nb-quic"

View File

@@ -20,7 +20,7 @@ func ClientQUICTLSConfig() *tls.Config {
return &tls.Config{
InsecureSkipVerify: true, // Debug mode allows insecure connections
NextProtos: []string{nbalpn}, // Ensure this matches the server's ALPN
NextProtos: []string{NBalpn}, // Ensure this matches the server's ALPN
RootCAs: certPool,
}
}

View File

@@ -19,7 +19,7 @@ func ClientQUICTLSConfig() *tls.Config {
}
return &tls.Config{
NextProtos: []string{nbalpn},
NextProtos: []string{NBalpn},
RootCAs: certPool,
}
}

View File

@@ -23,7 +23,7 @@ func ServerQUICTLSConfig(originTLSCfg *tls.Config) (*tls.Config, error) {
}
cfg := originTLSCfg.Clone()
cfg.NextProtos = []string{nbalpn}
cfg.NextProtos = []string{NBalpn}
return cfg, nil
}
@@ -74,6 +74,6 @@ func generateTestTLSConfig() (*tls.Config, error) {
return &tls.Config{
Certificates: []tls.Certificate{tlsCert},
NextProtos: []string{nbalpn},
NextProtos: []string{NBalpn},
}, nil
}

View File

@@ -12,6 +12,6 @@ func ServerQUICTLSConfig(originTLSCfg *tls.Config) (*tls.Config, error) {
return nil, fmt.Errorf("valid TLS config is required for QUIC listener")
}
cfg := originTLSCfg.Clone()
cfg.NextProtos = []string{nbalpn}
cfg.NextProtos = []string{NBalpn}
return cfg, nil
}