mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-29 15:59:10 +01:00
refactor function
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
"github.com/netbirdio/netbird/client/internal"
|
||||
"github.com/netbirdio/netbird/version"
|
||||
)
|
||||
|
||||
@@ -53,6 +54,17 @@ type Info struct {
|
||||
ServerSSHAllowed bool
|
||||
}
|
||||
|
||||
// GetInfo retrieves and parses the system information
|
||||
func GetInfo(ctx context.Context, config internal.Config) *Info {
|
||||
info := getInfo(ctx)
|
||||
info.RosenpassEnabled = config.RosenpassEnabled
|
||||
info.RosenpassPermissive = config.RosenpassPermissive
|
||||
if config.ServerSSHAllowed != nil {
|
||||
info.ServerSSHAllowed = *config.ServerSSHAllowed
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
// extractUserAgent extracts Netbird's agent (client) name and version from the outgoing context
|
||||
func extractUserAgent(ctx context.Context) string {
|
||||
md, hasMeta := metadata.FromOutgoingContext(ctx)
|
||||
|
||||
Reference in New Issue
Block a user