mirror of
https://github.com/netbirdio/netbird.git
synced 2025-07-01 07:00:46 +02:00
feat: add support for custom device hostname (#789)
Configure via --hostname (or -n) flag in the `up` and `login` commands --------- Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
This commit is contained in:
@ -43,6 +43,15 @@ func extractUserAgent(ctx context.Context) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// extractDeviceName extracts device name from context or returns the default system name
|
||||
func extractDeviceName(ctx context.Context, defaultName string) string {
|
||||
v, ok := ctx.Value(DeviceNameCtxKey).(string)
|
||||
if !ok {
|
||||
return defaultName
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// GetDesktopUIUserAgent returns the Desktop ui user agent
|
||||
func GetDesktopUIUserAgent() string {
|
||||
return "netbird-desktop-ui/" + version.NetbirdVersion()
|
||||
|
Reference in New Issue
Block a user