system

package
v0.0.0-...-127b3d7 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrFailedToBuildSeedGetRequest = "failed to build get request for seed"

	// Currently only a single interface is supported and defaults to this value. In the future we
	// will probably want to support multiple interfaces (e.g. one for trusted mobile clients and another for federated servers)
	DefaultWireguardInterface = "wg0"
	DefaultSTUNServerAddress  = "locator1.home-cloud.io:3478"
	DefaultLocatorAddress     = "https://locator1.home-cloud.io"
	DefaultDaemonAddress      = "http://daemon.home-cloud-system"
)
View Source
const (
	DefaultAutoUpdateSystemSchedule = "0 1 * * *"
	LatestReleaseManifestURL        = "https://github.com/home-cloud-io/core/releases/latest/download/manifest.yaml"

	ErrDeviceAlreadySetup     = "device already setup"
	ErrFailedToCreateSettings = "failed to create device settings"
	ErrFailedToGetSettings    = "failed to get device settings"
	ErrFailedToSetSettings    = "failed to save device settings"
)
View Source
const (
	ErrFailedToGenPubKey     = "failed to generate public key"
	ErrFailedToGenPrivKey    = "failed to generate private key"
	ErrFailedToSetPeerConfig = "failed to save peer config to key/val store"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Containers

type Containers interface {
	// GetContainerLogs will return all logs for all containers in the cluster.
	GetContainerLogs(ctx context.Context, logger chassis.Logger, sinceSeconds int64) ([]*dv1.Log, error)
}

type Controller

type Controller interface {
	Containers
	Daemon
	Device
	Locators
	OS
	Peering
}

func NewController

func NewController(logger chassis.Logger, kclient k8sclient.System, actl apps.Controller) Controller

type Daemon

type Daemon interface {
	// ShutdownHost will shutdown the host machine running Home Cloud.
	ShutdownHost(ctx context.Context) error
	// RestartHost will restart the host machine running Home Cloud
	RestartHost(ctx context.Context) error
}

type Device

type Device interface {
	// GetServerSettings returns the current server settings after filtering out the
	// admin username and password.
	GetServerSettings(ctx context.Context, logger chassis.Logger) (*v1.DeviceSettings, error)
	// SetServerSettings updates the settings on the server with the given values
	SetServerSettings(ctx context.Context, logger chassis.Logger, settings *v1.DeviceSettings) error
	// AutoUpdate will check for and install the latest Home Cloud version on a schedule
	AutoUpdate(ctx context.Context, logger chassis.Logger, schedule string)
	// Update will check for and install the latest Home Cloud version once
	Update(ctx context.Context, logger chassis.Logger) error
	// GetComponentVersions returns all the versions of system components (server, daemon, etc.)
	GetComponentVersions(ctx context.Context, logger chassis.Logger) (*v1.GetComponentVersionsResponse, error)
}

type Locators

type Locators interface {
	AddLocator(ctx context.Context, wgInterfaceName string, locatorAddress string) (err error)
	RemoveLocator(ctx context.Context, wgInterfaceName string, locatorAddress string) error
}

type OS

type OS interface {
	// SystemStats calls the daemon and returns the reported system stats (CPU, RAM, etc.)
	SystemStats(ctx context.Context, loger chassis.Logger) (*dv1.SystemStats, error)
	// EnableWireguard will initialize the Wireguard server
	EnableWireguard(ctx context.Context, logger chassis.Logger) error
	// DisableWireguard will disable the Wireguard server
	DisableWireguard(ctx context.Context, logger chassis.Logger) error
}

type Peering

type Peering interface {
	RegisterPeer(ctx context.Context, logger chassis.Logger) (*v1.RegisterPeerResponse, error)
	DeregisterPeer(ctx context.Context, logger chassis.Logger, req *v1.DeregisterPeerRequest) error
}

Jump to

Keyboard shortcuts

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