From 3dbd96b17227386d4dc0a63ab110f58a4bf645f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Mon, 1 Jun 2026 19:23:41 +0200 Subject: [PATCH] Add Version service exposing GUI version to frontend --- client/ui/services/version.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 client/ui/services/version.go diff --git a/client/ui/services/version.go b/client/ui/services/version.go new file mode 100644 index 000000000..ca25630c7 --- /dev/null +++ b/client/ui/services/version.go @@ -0,0 +1,26 @@ +//go:build !android && !ios && !freebsd && !js + +package services + +import ( + "context" + + "github.com/netbirdio/netbird/version" +) + +// Version is the Wails-bound facade exposing build/version metadata to the +// frontend. Today it only reports the GUI's own version (the daemon version is +// surfaced separately through the status feed's DaemonVersion field). +type Version struct{} + +// NewVersion constructs the Version service. +func NewVersion() *Version { + return &Version{} +} + +// GUI returns the version of the running UI binary, baked in at build time via +// the version package's ldflags. Falls back to "development" for un-stamped +// builds (see version.NetbirdVersion). +func (v *Version) GUI(_ context.Context) string { + return version.NetbirdVersion() +}