Versioning of UI and grpc-agent for passing version (#324)

Send Desktop UI client version as user-agent to daemon

This is sent on every login request to the management

Parse the GRPC context on the system package and 
retrieves the user-agent

Management receives the new UIVersion field and 
store in the Peer's system meta
This commit is contained in:
shatoboar
2022-05-25 23:25:02 +02:00
committed by GitHub
parent 5e3eceb0d6
commit 94fbfcdb85
20 changed files with 264 additions and 154 deletions

View File

@@ -1,11 +1,12 @@
package server
import (
log "github.com/sirupsen/logrus"
"net"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/netbirdio/netbird/management/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -20,6 +21,7 @@ type PeerSystemMeta struct {
Platform string
OS string
WtVersion string
UIVersion string
}
type PeerStatus struct {
@@ -393,7 +395,13 @@ func (am *DefaultAccountManager) UpdatePeerMeta(peerKey string, meta PeerSystemM
}
peerCopy := peer.Copy()
// Avoid overwriting UIVersion if the update was triggered sole by the CLI client
if meta.UIVersion == "" {
meta.UIVersion = peerCopy.Meta.UIVersion
}
peerCopy.Meta = meta
err = am.Store.SavePeer(account.Id, peerCopy)
if err != nil {
return err