mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 15:26:40 +00:00
Auto-update logic moved out of the UI into a dedicated updatemanager.Manager service that runs in the connection layer. The UI no longer polls or checks for updates independently. The update manager supports three modes driven by the management server's auto-update policy: No policy set by mgm: checks GitHub for the latest version and notifies the user (previous behavior, now centralized) mgm enforces update: the "About" menu triggers installation directly instead of just downloading the file — user still initiates the action mgm forces update: installation proceeds automatically without user interaction updateManager lifecycle is now owned by daemon, giving the daemon server direct control via a new TriggerUpdate RPC Introduces EngineServices struct to group external service dependencies passed to NewEngine, reducing its argument count from 11 to 4
51 lines
1.0 KiB
Go
51 lines
1.0 KiB
Go
//go:build !windows && !darwin
|
|
|
|
package installer
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
const (
|
|
updaterBinary = "updater"
|
|
)
|
|
|
|
type Installer struct {
|
|
tempDir string
|
|
}
|
|
|
|
// New used by the service
|
|
func New() *Installer {
|
|
return &Installer{}
|
|
}
|
|
|
|
// NewWithDir used by the updater process, get the tempDir from the service via cmd line
|
|
func NewWithDir(tempDir string) *Installer {
|
|
return &Installer{
|
|
tempDir: tempDir,
|
|
}
|
|
}
|
|
|
|
func (u *Installer) TempDir() string {
|
|
return ""
|
|
}
|
|
|
|
func (c *Installer) LogFiles() []string {
|
|
return []string{}
|
|
}
|
|
|
|
func (u *Installer) CleanUpInstallerFiles() error {
|
|
return nil
|
|
}
|
|
|
|
func (u *Installer) RunInstallation(ctx context.Context, targetVersion string) error {
|
|
return fmt.Errorf("unsupported platform")
|
|
}
|
|
|
|
// Setup runs the installer with appropriate arguments and manages the daemon/UI state
|
|
// This will be run by the updater process
|
|
func (u *Installer) Setup(ctx context.Context, dryRun bool, targetVersion string, daemonFolder string) (resultErr error) {
|
|
return fmt.Errorf("unsupported platform")
|
|
}
|