server

package
v0.74.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: BSD-3-Clause Imports: 54 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceNotUp = errors.New("service is not up")

Functions

func ParseLogLevel added in v0.27.10

func ParseLogLevel(level string) proto.LogLevel

Types

type Server

type Server struct {
	proto.UnimplementedDaemonServiceServer
	// contains filtered or unexported fields
}

Server for service control.

func New

func New(ctx context.Context, logFile string, configFile string, profilesDisabled bool, updateSettingsDisabled bool, captureEnabled bool, networksDisabled bool) *Server

New server instance constructor.

func (*Server) AddProfile added in v0.52.0

AddProfile adds a new profile to the daemon.

func (*Server) CleanState added in v0.34.0

CleanState handles cleaning of states (performing cleanup operations)

func (*Server) DebugBundle added in v0.27.4

func (s *Server) DebugBundle(_ context.Context, req *proto.DebugBundleRequest) (resp *proto.DebugBundleResponse, err error)

DebugBundle creates a debug bundle and returns the location.

func (*Server) DeleteState added in v0.34.0

DeleteState handles deletion of states without cleanup

func (*Server) DeselectNetworks added in v0.35.0

DeselectNetworks deselects specific networks based on the client request.

func (*Server) Down

Down engine work in the daemon.

func (*Server) ExposeService added in v0.66.0

ExposeService exposes a local port via the NetBird reverse proxy.

func (*Server) ForwardingRules added in v0.38.0

func (*Server) GetActiveProfile added in v0.52.0

GetActiveProfile returns the active profile in the daemon. The ProfileName field carries the display name for backwards compatibility with UI clients, new callers should prefer Id.

func (*Server) GetConfig

GetConfig of the daemon.

func (*Server) GetFeatures added in v0.54.2

GetFeatures returns the features supported by the daemon.

func (*Server) GetInstallerResult added in v0.61.0

func (*Server) GetLogLevel added in v0.27.10

GetLogLevel gets the current logging level for the server.

func (*Server) GetPeerSSHHostKey added in v0.60.0

GetPeerSSHHostKey retrieves SSH host key for a specific peer

func (*Server) ListNetworks added in v0.35.0

ListNetworks returns a list of all available networks.

func (*Server) ListProfiles added in v0.52.0

ListProfiles lists all profiles in the daemon.

func (*Server) ListStates added in v0.34.0

ListStates returns a list of all saved states

func (*Server) Login

func (s *Server) Login(callerCtx context.Context, msg *proto.LoginRequest) (*proto.LoginResponse, error)

Login uses setup key to prepare configuration for the daemon.

func (*Server) Logout added in v0.53.0

func (*Server) RemoveProfile added in v0.52.0

RemoveProfile removes a profile from the daemon.

func (*Server) RenameProfile added in v0.73.0

func (*Server) RequestJWTAuth added in v0.60.0

func (s *Server) RequestJWTAuth(
	ctx context.Context,
	msg *proto.RequestJWTAuthRequest,
) (*proto.RequestJWTAuthResponse, error)

RequestJWTAuth initiates JWT authentication flow for SSH

func (*Server) SelectNetworks added in v0.35.0

SelectNetworks selects specific networks based on the client request.

func (*Server) SetConfig added in v0.52.0

func (s *Server) SetConfig(callerCtx context.Context, msg *proto.SetConfigRequest) (*proto.SetConfigResponse, error)

Login uses setup key to prepare configuration for the daemon.

func (*Server) SetLogLevel added in v0.27.4

SetLogLevel sets the logging level for the server.

func (*Server) SetSyncResponsePersistence added in v0.53.0

SetSyncResponsePersistence sets the sync response persistence for the server.

func (*Server) Start

func (s *Server) Start() error

func (*Server) StartBundleCapture added in v0.70.5

StartBundleCapture begins capturing packets to a server-side temp file for inclusion in the next debug bundle. Not gated by --enable-capture since the output stays on the server (same trust level as CPU profiling).

A timeout auto-stops the capture as a safety net if StopBundleCapture is never called (e.g. CLI crash).

func (*Server) StartCPUProfile added in v0.64.1

StartCPUProfile starts CPU profiling in the daemon.

func (*Server) StartCapture added in v0.70.5

StartCapture streams a pcap or text packet capture over gRPC. Gated by the --enable-capture service flag.

func (*Server) Status

func (s *Server) Status(
	ctx context.Context,
	msg *proto.StatusRequest,
) (*proto.StatusResponse, error)

Status returns the daemon status

func (*Server) StopBundleCapture added in v0.70.5

StopBundleCapture stops the running bundle capture. Idempotent.

func (*Server) StopCPUProfile added in v0.64.1

StopCPUProfile stops CPU profiling in the daemon.

func (*Server) SubscribeEvents added in v0.37.0

func (*Server) SwitchProfile added in v0.52.0

func (s *Server) SwitchProfile(callerCtx context.Context, msg *proto.SwitchProfileRequest) (*proto.SwitchProfileResponse, error)

SwitchProfile switches the active profile in the daemon.

func (*Server) TracePacket added in v0.36.6

func (*Server) TriggerUpdate added in v0.67.0

TriggerUpdate initiates installation of the pending enforced version. It is called when the user clicks the install button in the UI (Mode 2 / enforced update).

func (*Server) Up

func (s *Server) Up(callerCtx context.Context, msg *proto.UpRequest) (*proto.UpResponse, error)

Up starts engine work in the daemon.

func (*Server) WaitJWTToken added in v0.60.0

func (s *Server) WaitJWTToken(
	ctx context.Context,
	req *proto.WaitJWTTokenRequest,
) (*proto.WaitJWTTokenResponse, error)

WaitJWTToken waits for JWT authentication completion

func (*Server) WaitSSOLogin

func (s *Server) WaitSSOLogin(callerCtx context.Context, msg *proto.WaitSSOLoginRequest) (*proto.WaitSSOLoginResponse, error)

WaitSSOLogin uses the userCode to validate the TokenInfo and waits for the user to continue with the login on a browser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL