Documentation ¶
Index ¶
- Constants
- Variables
- func GetSystemEnvironmentVariablesForContainer() map[string]string
- func NewActionLogger(j Job, pupID string, dbx Dogeboxd) *actionLogger
- func PupEnabled(b bool) func(*PupState, *[]Pupdate)
- func ServeUI(config ServerConfig) conductor.Service
- func SetPupBrokenReason(reason string) func(*PupState, *[]Pupdate)
- func SetPupConfig(newFields map[string]string) func(*PupState, *[]Pupdate)
- func SetPupHooks(newHooks []PupHook) func(*PupState, *[]Pupdate)
- func SetPupInstallation(state string) func(*PupState, *[]Pupdate)
- func SetPupProviders(newProviders map[string]string) func(*PupState, *[]Pupdate)
- type Action
- type ActionLogger
- type ActionProgress
- type AddSSHKey
- type BootstrapInstallationMode
- type Buffer
- type Change
- type ConsoleSubLogger
- type DKMErrorResponse
- type DKMErrorResponseMakeDelegate
- type DKMManager
- type DKMRequestMakeDelegate
- type DKMResponseAuthenticate
- type DKMResponseCreateKey
- type DKMResponseInvalidateToken
- type DKMResponseMakeDelegate
- type DisablePup
- type DisableSSH
- type DogeboxState
- type DogeboxStateInitialSetup
- type DogeboxStateSSHConfig
- type DogeboxStateSSHKey
- type Dogeboxd
- type EnablePup
- type EnableSSH
- type EnvEntry
- type InstallPup
- type Job
- type JournalReader
- type LifecycleManager
- type LineWriter
- type LogTailer
- type ManifestSource
- type ManifestSourceConfiguration
- type ManifestSourceList
- type ManifestSourcePup
- type NetworkConnection
- type NetworkConnector
- type NetworkEthernet
- type NetworkManager
- type NetworkPersistor
- type NetworkState
- type NetworkWifi
- type NetworkWifiSSID
- type NixFirewallTemplateValues
- type NixIncludesFileTemplateValues
- type NixManager
- type NixNetworkTemplateValues
- type NixPatch
- type NixPatchApplyOptions
- type NixPupContainerServiceValues
- type NixPupContainerTemplateValues
- type NixStorageOverlayTemplateValues
- type NixSystemContainerConfigTemplatePupRequiresInternet
- type NixSystemContainerConfigTemplatePupTcpConnection
- type NixSystemContainerConfigTemplatePupTcpConnectionOtherPup
- type NixSystemContainerConfigTemplateValues
- type NixSystemTemplateValues
- type ProcStatus
- type PupAsset
- type PupDependencyReport
- type PupHealthStateReport
- type PupHook
- type PupIssues
- type PupLogos
- type PupManager
- type PupManifest
- type PupManifestBuild
- type PupManifestCommand
- type PupManifestConfigFields
- type PupManifestContainer
- type PupManifestDependency
- type PupManifestDependencySource
- type PupManifestExposeConfig
- type PupManifestInterface
- type PupManifestMeta
- type PupManifestMetric
- type PupManifestPermissionGroup
- type PupManifestService
- type PupMetric
- type PupMetrics
- type PupState
- type PupStats
- type PupWebUI
- type Pupdate
- type PurgePup
- type RemoveSSHKey
- type SelectedNetwork
- type SelectedNetworkEthernet
- type SelectedNetworkWifi
- type ServerConfig
- type SourceDetails
- type SourceDetailsPup
- type SourceManager
- type SourceState
- type State
- type StateManager
- type StatsUpdate
- type StoreManager
- type SubLogger
- type SystemDisk
- type SystemDiskSuitability
- type SystemDiskSuitabilityEntry
- type SystemMonitor
- type SystemUpdater
- type TypeStore
- type UIServer
- type UninstallPup
- type Update
- type UpdateMetrics
- type UpdatePendingSystemNetwork
- type UpdatePupConfig
- type UpdatePupHooks
- type UpdatePupProviders
Constants ¶
const ( STATE_INSTALLING string = "installing" STATE_READY string = "ready" STATE_UNREADY string = "unready" STATE_UNINSTALLING string = "uninstalling" STATE_UNINSTALLED string = "uninstalled" STATE_PURGING string = "purging" STATE_BROKEN string = "broken" STATE_STOPPED string = "stopped" STATE_STARTING string = "starting" STATE_RUNNING string = "running" STATE_STOPPING string = "stopping" )
Pup states
const ( BROKEN_REASON_STATE_UPDATE_FAILED string = "state_update_failed" BROKEN_REASON_DOWNLOAD_FAILED string = "download_failed" BROKEN_REASON_NIX_FILE_MISSING string = "nix_file_missing" BROKEN_REASON_NIX_HASH_MISMATCH string = "nix_hash_mismatch" BROKEN_REASON_STORAGE_CREATION_FAILED string = "storage_creation_failed" BROKEN_REASON_DELEGATE_KEY_CREATION_FAILED string = "delegate_key_creation_failed" BROKEN_REASON_DELEGATE_KEY_WRITE_FAILED string = "delegate_key_write_failed" BROKEN_REASON_ENABLE_FAILED string = "enable_failed" BROKEN_REASON_NIX_APPLY_FAILED string = "nix_apply_failed" )
Pup broken reasons
const ( PUP_CHANGED_INSTALLATION int = iota PUP_ADOPTED = iota )
Variables ¶
var ( ErrPupNotFound = errors.New("pup not found") ErrPupAlreadyExists = errors.New("pup already exists") )
PupManager Errors
Functions ¶
func NewActionLogger ¶
func PupEnabled ¶
func ServeUI ¶
func ServeUI(config ServerConfig) conductor.Service
func SetPupBrokenReason ¶
func SetPupHooks ¶
func SetPupInstallation ¶
Types ¶
type Action ¶
type Action any
Actions are passed to the dogeboxd service via its * AddAction method, and represent tasks that need to * be done such as installing a package, starting or * stopping a service etc.
type ActionLogger ¶
type ActionProgress ¶
type ActionProgress struct { ActionID string `json:"actionID"` PupID string `json:pupID` // optional, only if a pup action Progress int `json:"progress"` // 0-100 Step string `json:"step"` // a unique name for the step we're up to, ie: installing Msg string `json:"msg"` // the message line Error bool `json:"error"` // if this represents an error or not StepTaken time.Duration `json:"step_taken"` // time taken from previous step }
Represents some information about an action underway
type BootstrapInstallationMode ¶
type BootstrapInstallationMode string
const ( BootstrapInstallationModeIsInstalled BootstrapInstallationMode = "isInstalled" BootstrapInstallationModeCanInstalled BootstrapInstallationMode = "canInstall" BootstrapInstallationModeMustInstall BootstrapInstallationMode = "mustInstall" BootstrapInstallationModeCannotInstall BootstrapInstallationMode = "cannotInstall" )
type Buffer ¶
func (*Buffer[T]) MarshalJSON ¶
type Change ¶
type Change struct { ID string `json:"id"` Error string `json:"error"` Type string `json:"type"` Update Update `json:"update"` }
A Change can be the result of a Job (same ID) or represent an internal system change originating from elsewhere.
A Change encodes an 'update' (see below) A Change as the result of an Action may carry an 'error' to the frontend for the same Job ID
type ConsoleSubLogger ¶
type ConsoleSubLogger struct { PupID string // contains filtered or unexported fields }
func NewConsoleSubLogger ¶
func NewConsoleSubLogger(pupID string, step string) *ConsoleSubLogger
func (*ConsoleSubLogger) Err ¶
func (t *ConsoleSubLogger) Err(msg string)
func (*ConsoleSubLogger) Errf ¶
func (t *ConsoleSubLogger) Errf(msg string, a ...any)
func (*ConsoleSubLogger) Log ¶
func (t *ConsoleSubLogger) Log(msg string)
func (*ConsoleSubLogger) LogCmd ¶
func (t *ConsoleSubLogger) LogCmd(cmd *exec.Cmd)
func (*ConsoleSubLogger) Logf ¶
func (t *ConsoleSubLogger) Logf(msg string, a ...any)
func (*ConsoleSubLogger) Progress ¶
func (t *ConsoleSubLogger) Progress(p int) SubLogger
type DKMErrorResponse ¶
type DKMManager ¶
type DKMManager interface { CreateKey(password string) ([]string, error) // Returns "" as a token if the password supplied is invalid. Authenticate(password string) (string, error, error) RefreshToken(old string) (string, bool, error) InvalidateToken(token string) (bool, error) MakeDelegate(id string, token string) (DKMResponseMakeDelegate, error) }
func NewDKMManager ¶
func NewDKMManager() DKMManager
type DKMRequestMakeDelegate ¶
type DKMResponseAuthenticate ¶
type DKMResponseCreateKey ¶
type DKMResponseCreateKey struct {
SeedPhrase []string `json:"seedphrase"`
}
type DKMResponseInvalidateToken ¶
type DKMResponseInvalidateToken struct{}
type DKMResponseMakeDelegate ¶
type DisableSSH ¶
type DisableSSH struct{}
type DogeboxState ¶
type DogeboxState struct { InitialState DogeboxStateInitialSetup Hostname string KeyMap string SSH DogeboxStateSSHConfig StorageDevice string }
type DogeboxStateSSHConfig ¶
type DogeboxStateSSHConfig struct { Enabled bool `json:"enabled"` Keys []DogeboxStateSSHKey `json:"keys"` }
type DogeboxStateSSHKey ¶
type Dogeboxd ¶
type Dogeboxd struct { Pups PupManager SystemUpdater SystemUpdater SystemMonitor SystemMonitor JournalReader JournalReader NetworkManager NetworkManager Changes chan Change // contains filtered or unexported fields }
func NewDogeboxd ¶
func NewDogeboxd( stateManager StateManager, pups PupManager, updater SystemUpdater, monitor SystemMonitor, journal JournalReader, networkManager NetworkManager, sourceManager SourceManager, nixManager NixManager, logtailer LogTailer, ) Dogeboxd
func (Dogeboxd) AddAction ¶
Add an Action to the Action queue, returns a unique ID which can be used to match the outcome in the Event queue
func (Dogeboxd) GetLogChannel ¶
type InstallPup ¶
Install a pup on the system
type Job ¶
type Job struct { A Action ID string Err string Success any Start time.Time // set when the job is first created, for calculating duration Logger *actionLogger State *PupState // nilable, check before use! }
A Job is created when an Action is recieved by the system. Jobs are passed through the Dogeboxd service and result in a Change being send to the client via websockets.
type JournalReader ¶
type JournalReader interface {
GetJournalChan(string) (context.CancelFunc, chan string, error)
}
actively listen for systemd journal entries for a given systemd service, close channel when done
type LifecycleManager ¶
type LifecycleManager interface { Shutdown() Reboot() }
type LineWriter ¶
type LineWriter struct {
// contains filtered or unexported fields
}
func NewLineWriter ¶
func NewLineWriter(receiver func(string)) *LineWriter
implements io.Writer and calls a function for each line
type LogTailer ¶
type LogTailer interface {
GetChan(string) (context.CancelFunc, chan string, error)
}
type ManifestSource ¶
type ManifestSource interface { ValidateFromLocation(location string) (ManifestSourceConfiguration, error) Config() ManifestSourceConfiguration List(ignoreCache bool) (ManifestSourceList, error) Download(diskPath string, remoteLocation map[string]string) error }
type ManifestSourceList ¶
type ManifestSourceList struct { Config ManifestSourceConfiguration LastChecked time.Time Pups []ManifestSourcePup }
type ManifestSourcePup ¶
type NetworkConnection ¶
type NetworkConnection interface {
// contains filtered or unexported methods
}
type NetworkConnector ¶
type NetworkConnector interface {
Connect(network SelectedNetwork) error
}
type NetworkEthernet ¶
type NetworkManager ¶
type NetworkManager interface { GetAvailableNetworks() []NetworkConnection SetPendingNetwork(selectedNetwork SelectedNetwork, j Job) error TryConnect(nixPatch NixPatch) error GetLocalIP() (net.IP, error) }
type NetworkPersistor ¶
type NetworkPersistor interface {
Persist(nixPatch NixPatch, network SelectedNetwork)
}
type NetworkState ¶
type NetworkState struct { CurrentNetwork SelectedNetwork PendingNetwork SelectedNetwork }
type NetworkWifi ¶
type NetworkWifi struct { Type string `json:"type"` Interface string `json:"interface"` Ssids []NetworkWifiSSID `json:"ssids"` }
type NetworkWifiSSID ¶
type NixManager ¶
type NixManager interface { // NixPatch passthrough helpers. InitSystem(patch NixPatch, dbxState DogeboxState) UpdateIncludesFile(patch NixPatch, pups PupManager) WritePupFile(patch NixPatch, state PupState, dbxState DogeboxState) RemovePupFile(patch NixPatch, pupId string) UpdateSystemContainerConfiguration(patch NixPatch) UpdateFirewallRules(patch NixPatch, dbxState DogeboxState) UpdateNetwork(patch NixPatch, values NixNetworkTemplateValues) UpdateSystem(patch NixPatch, values NixSystemTemplateValues) UpdateStorageOverlay(patch NixPatch, partitionName string) RebuildBoot(log SubLogger) error Rebuild(log SubLogger) error NewPatch(log SubLogger) NixPatch }
type NixPatch ¶
type NixPatch interface { State() string Apply() error ApplyCustom(options NixPatchApplyOptions) error Cancel() error UpdateSystemContainerConfiguration(values NixSystemContainerConfigTemplateValues) UpdateFirewall(values NixFirewallTemplateValues) UpdateSystem(values NixSystemTemplateValues) UpdateNetwork(values NixNetworkTemplateValues) UpdateIncludesFile(values NixIncludesFileTemplateValues) WritePupFile(pupId string, values NixPupContainerTemplateValues) RemovePupFile(pupId string) UpdateStorageOverlay(values NixStorageOverlayTemplateValues) }
type NixPatchApplyOptions ¶
type NixPupContainerTemplateValues ¶
type NixPupContainerTemplateValues struct { DATA_DIR string CONTAINER_LOG_DIR string PUP_ID string PUP_ENABLED bool INTERNAL_IP string PUP_PORTS []struct { PORT int PUBLIC bool } STORAGE_PATH string PUP_PATH string NIX_FILE string SERVICES []NixPupContainerServiceValues PUP_ENV []EnvEntry GLOBAL_ENV []EnvEntry }
type NixSystemContainerConfigTemplatePupTcpConnection ¶
type NixSystemContainerConfigTemplatePupTcpConnection struct { NAME string ID string IP string OTHER_PUPS []NixSystemContainerConfigTemplatePupTcpConnectionOtherPup }
type NixSystemContainerConfigTemplateValues ¶
type NixSystemContainerConfigTemplateValues struct { DOGEBOX_HOST_IP string DOGEBOX_CONTAINER_CIDR string PUPS_REQUIRING_INTERNET []NixSystemContainerConfigTemplatePupRequiresInternet PUPS_TCP_CONNECTIONS []NixSystemContainerConfigTemplatePupTcpConnection }
type NixSystemTemplateValues ¶
type NixSystemTemplateValues struct { SYSTEM_HOSTNAME string KEYMAP string SSH_ENABLED bool SSH_KEYS []DogeboxStateSSHKey }
type ProcStatus ¶
SystemMonitor issues these for monitored PUPs
type PupDependencyReport ¶
type PupDependencyReport struct { Interface string `json:"interface"` Version string `json:"version"` Optional bool `json:"optional"` CurrentProvider string `json:"currentProvider"` InstalledProviders []string `json:"installedProviders"` InstallableProviders []PupManifestDependencySource `json:"InstallableProviders"` DefaultSourceProvider PupManifestDependencySource `json:"DefaultProvider"` }
type PupHealthStateReport ¶
type PupManager ¶
type PupManager interface { // Run starts the PupManager as a service. Run(started, stopped chan bool, stop chan context.Context) error // GetUpdateChannel returns a channel for receiving pup updates. GetUpdateChannel() chan Pupdate // GetStatsChannel returns a channel for receiving pup stats. GetStatsChannel() chan []PupStats // GetStateMap returns a map of all pup states. GetStateMap() map[string]PupState // GetStatsMap returns a map of all pup stats. GetStatsMap() map[string]PupStats // GetAssetsMap returns a map of pup assets like logos. GetAssetsMap() map[string]PupAsset // AdoptPup adds a new pup from a manifest. It returns the PupID and an error if any. AdoptPup(m PupManifest, source ManifestSource) (string, error) // UpdatePup updates the state of a pup with provided update functions. UpdatePup(id string, updates ...func(*PupState, *[]Pupdate)) (PupState, error) // PurgePup removes a pup and its state from the manager. PurgePup(pupId string) error // GetPup retrieves the state and stats for a specific pup by ID. GetPup(id string) (PupState, PupStats, error) // FindPupByIP retrieves a pup by its assigned IP address. FindPupByIP(ip string) (PupState, PupStats, error) // GetAllFromSource retrieves all pups from a specific source. GetAllFromSource(source ManifestSourceConfiguration) []*PupState // GetPupFromSource retrieves a specific pup by name from a source. GetPupFromSource(name string, source ManifestSourceConfiguration) *PupState // GetMetrics retrieves the metrics for a specific pup. GetMetrics(pupId string) map[string]interface{} // UpdateMetrics updates the metrics for a pup based on provided data. UpdateMetrics(u UpdateMetrics) // CanPupStart checks if a pup can start based on its current state and dependencies. CanPupStart(pupId string) (bool, error) // CalculateDeps calculates the dependencies for a pup. CalculateDeps(pupID string) ([]PupDependencyReport, error) // SetSourceManager sets the SourceManager for the PupManager. SetSourceManager(sourceManager SourceManager) // FastPollPup initiates a rapid polling of a specific pup for debugging or immediate updates. FastPollPup(pupId string) GetPupSpecificEnvironmentVariablesForContainer(pupID string) map[string]string }
The PupManager is responsible for all aspects of the pup lifecycle * see pkg/pup/manager.go
type PupManifest ¶
type PupManifest struct { // The version of the actual manifest. This differs from the "version" // of the pup, and the version of the deployed software for this pup. // Valid values: 1 ManifestVersion int `json:"manifestVersion"` Meta PupManifestMeta `json:"meta"` Config PupManifestConfigFields `json:"config"` Container PupManifestContainer `json:"container"` Interfaces []PupManifestInterface `json:"interfaces"` Dependencies []PupManifestDependency `json:"dependencies"` Metrics []PupManifestMetric `json:"metrics"` }
PupManifest represents a Nix installed process * running inside the Dogebox Runtime Environment. * These are defined in pup.json files.
func (*PupManifest) Validate ¶
func (m *PupManifest) Validate() error
type PupManifestBuild ¶
type PupManifestBuild struct { // The location of the nix file used for building this pups environment. NixFile string `json:"nixFile"` // The SHA256 hash of the nix file. NixFileSha256 string `json:"nixFileSha256"` }
PupManifestBuild holds information about the target nix * package that is to be built for this pup.
type PupManifestCommand ¶
type PupManifestCommand struct { // Required. The whole executable string, including any arguments that need to be passed. Exec string `json:"exec"` // Optional. The working directory specified for a systemd service. CWD string `json:"cwd"` // Optional. Any environment variables that need to be set. ENV map[string]string `json:"env"` }
Represents the command to run inside this PUP * Container.
type PupManifestConfigFields ¶
type PupManifestConfigFields struct { Sections []struct { Name string `json:"name"` Label string `json:"label"` // TODO: we probably need a list of valid field types // Fields []map[string]interface{} `json:"fields"` Fields []struct { Label string `json:"label"` Name string `json:"name"` Type string `json:"type"` Required bool `json:"required"` Options []struct { Label string `json:"label"` Value string `json:"value"` } `json:"options,omitempty"` Min int `json:"min,omitempty"` Max int `json:"max,omitempty"` Step int `json:"step,omitempty"` } `json:"fields"` } `json:"sections"` }
Represents fields that are user settable, which provide the values * for templates (Args, ENV, ConfigFiles), we only care about Name
type PupManifestContainer ¶
type PupManifestContainer struct { Build PupManifestBuild `json:"build"` // A single nix build file can provide multiple services, which all // may need to be started separately. Each "service" should be provided // as an artifact here with the correct execution configuration. Services []PupManifestService `json:"services"` Exposes []PupManifestExposeConfig `json:"exposes"` // This pup requires internet access to function. RequiresInternet bool `json:"requiresInternet"` }
PupManfiestV1Container contains information about the * execution environment of the pup, including both build * and runtime details of whatever is to be executed.
type PupManifestDependency ¶
type PupManifestDependency struct { InterfaceName string `json:"interfaceName"` // interface that we depend on InterfaceVersion string `json:"interfaceVersion"` // semver expression PermissionGroups []string `json:"permissionGroups"` // list of permission groups from that interface we want DefaultSource PupManifestDependencySource `json:"source"` // optional, default package that provides this interface Optional bool `json:"optional"` }
Dependency specifies that this pup requires * another pup to be running, and what permission * groups from that pup need to be available.
type PupManifestDependencySource ¶
type PupManifestDependencySource struct { SourceLocation string `json:"sourceLocation"` PupName string `json:"pupName"` PupVersion string `json:"pupVersion"` PupLogoBase64 string `json:"pupLogoBase64"` }
A DependencySource specifies the location of a * dependency that needs to be installed. We list it in the manifest * so that if a user doesn't already have this source set up we * can still resolve this dependency tree.
type PupManifestExposeConfig ¶
type PupManifestExposeConfig struct { Name string `json:"name"` // Freeform field used to refer to this port in the frontend. Type string `json:"type"` // Must be one of: http, tcp Port int `json:"port"` // The port that is being listened on inside the container. Interfaces []string `json:"interfaces"` // Designates that certain interfaces can be accessed on this port ListenOnHost bool `json:"listenOnHost"` // If true, the port will be accessible on the host network, otherwise it will listen on a private internal network interface. WebUI bool `json:"webUI"` // If true, will be proxied from an available port to the dPanel user }
Allow the user to expose certain ports in their container.
type PupManifestInterface ¶
type PupManifestInterface struct { Name string `json:"name"` // the globally unique name for this interface Version string `json:"version"` // Semver ie: 0.1.1 PermissionGroups []PupManifestPermissionGroup `json:"permissionGroups"` // The permission groups that make up this interface }
type PupManifestMeta ¶
type PupManifestMeta struct { Name string `json:"name"` // The version of the pup. // nb. This can differ from the version of the software deployed // by this pup, as we may change this pup manifest to expose // additional configuration options for the same software version. Version string `json:"version"` // Optional. A path to a logo for this pup. LogoPath string `json:"logoPath"` // A short description, single line. ShortDescription string `json:"shortDescription"` // Optional, longer description. Used for store listings. LongDescription string `json:"longDescription"` // A key value pair of upstream versions that this pup ships with. UpstreamVersions map[string]string `json:"upstreamVersions"` }
PupManifestMeta holds meta information about this pup * such as its name, version, any imagery that needs to be shown.
type PupManifestMetric ¶
type PupManifestPermissionGroup ¶
type PupManifestPermissionGroup struct { Name string `json:"name"` // ie: admin, wallet-read-only, etc. Description string `json:"description"` // What does this permission group do (shown to user) Severity int `json:"severity"` // 1-3, 1: critical/danger, 2: makes changes, 3: read only stuff Routes []string `json:"routes"` // http routes accessible for this group Port int `json:"port"` // port accessible for this group }
PermissionGroups define how other * pups can request access to this pup's * APIs and resources, via their Dependencies
type PupManifestService ¶
type PupManifestService struct { Name string `json:"name"` Command PupManifestCommand `json:"command"` }
type PupMetrics ¶
type PupState ¶
type PupState struct { ID string `json:"id"` LogoBase64 string `json:"logoBase64"` Source ManifestSourceConfiguration `json:"source"` Manifest PupManifest `json:"manifest"` Config map[string]string `json:"config"` Providers map[string]string `json:"providers"` // providers of interface dependencies Hooks []PupHook `json:"hooks"` // webhooks Installation string `json:"installation"` // see table above and constants BrokenReason string `json:"brokenReason"` // reason for being in a broken state Enabled bool `json:"enabled"` // Is this pup supposed to be running? NeedsConf bool `json:"needsConf"` // Has all required config been provided? NeedsDeps bool `json:"needsDeps"` // Have all dependencies been met? IP string `json:"ip"` // Internal IP for this pup Version string `json:"version"` WebUIs []PupWebUI `json:"webUIs"` }
PupState is persisted to disk
type PupStats ¶
type PupStats struct { ID string `json:"id"` Status string `json:"status"` SystemMetrics []PupMetrics[any] `json:"systemMetrics"` Metrics []PupMetrics[any] `json:"metrics"` Issues PupIssues `json:"issues"` }
PupStats is not persisted to disk, and holds the running stats for the pup process, ie: disk, CPU, etc.
type PurgePup ¶
type PurgePup struct {
PupID string
}
Purging a pup will remove the container storage.
type RemoveSSHKey ¶
type RemoveSSHKey struct {
ID string
}
type SelectedNetwork ¶
type SelectedNetwork interface {
// contains filtered or unexported methods
}
type SelectedNetworkEthernet ¶
type SelectedNetworkEthernet struct { SelectedNetwork Interface string `json:"interface"` }
type SelectedNetworkWifi ¶
type ServerConfig ¶
type SourceDetails ¶
type SourceDetails struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Pups []SourceDetailsPup `json:"pups"` }
type SourceDetailsPup ¶
type SourceDetailsPup struct {
Location string `json:"location"`
}
type SourceManager ¶
type SourceManager interface { GetAll(ignoreCache bool) (map[string]ManifestSourceList, error) GetSourceManifest(sourceId, pupName, pupVersion string) (PupManifest, ManifestSource, error) GetSourcePup(sourceId, pupName, pupVersion string) (ManifestSourcePup, error) GetSource(name string) (ManifestSource, error) AddSource(location string) (ManifestSource, error) RemoveSource(id string) error DownloadPup(diskPath, sourceId, pupName, pupVersion string) error GetAllSourceConfigurations() []ManifestSourceConfiguration }
type SourceState ¶
type SourceState struct {
SourceConfigs []ManifestSourceConfiguration
}
type State ¶
type State struct { Network NetworkState Dogebox DogeboxState Sources SourceState }
type StateManager ¶
type StateManager interface { Get() State SetNetwork(s NetworkState) error SetDogebox(s DogeboxState) error SetSources(s SourceState) error }
type StatsUpdate ¶
type StatsUpdate struct {
Stats []PupStats `json:"stats"`
}
StatsUpdate represents one or more PupStats updates
type StoreManager ¶
func NewStoreManager ¶
func NewStoreManager(dbPath string) (*StoreManager, error)
type SystemDisk ¶
type SystemDisk struct { Name string `json:"name"` Size int64 `json:"size"` SizePretty string `json:"sizePretty"` Suitability SystemDiskSuitability `json:"suitability"` BootMedia bool `json:"bootMedia"` }
type SystemDiskSuitability ¶
type SystemDiskSuitability struct { Install SystemDiskSuitabilityEntry `json:"install"` Storage SystemDiskSuitabilityEntry `json:"storage"` }
type SystemMonitor ¶
type SystemMonitor interface { GetMonChannel() chan []string GetStatChannel() chan map[string]ProcStatus GetFastMonChannel() chan string GetFastStatChannel() chan map[string]ProcStatus }
monitors systemd services and returns stats
type SystemUpdater ¶
type SystemUpdater interface { AddJob(Job) GetUpdateChannel() chan Job // These ideally should not be on here, but we currently don't // have a way to wait for a SystemUpdater event to finish. AddSSHKey(key string, l SubLogger) error EnableSSH(l SubLogger) error ListSSHKeys() ([]DogeboxStateSSHKey, error) }
handle jobs on behalf of Dogeboxd and return them via it's own update channel.
type TypeStore ¶
func GetTypeStore ¶
func GetTypeStore[T any](sm *StoreManager) *TypeStore[T]
type UninstallPup ¶
type UninstallPup struct {
PupID string
}
Uninstalling a pup will remove container configuration, but keep storage.
type Update ¶
type Update any
Updates are responses to Actions or simply
* internal state changes that the frontend needs, * these are wrapped in a 'change' and sent via * websocket to the client. * * Updates need to be json-marshalable types
type UpdateMetrics ¶
updates the custom metrics for a pup
type UpdatePendingSystemNetwork ¶
type UpdatePendingSystemNetwork struct {
Network SelectedNetwork
}
type UpdatePupConfig ¶
Updates the config values in a PUPState object
type UpdatePupHooks ¶
Updates hooks for this pup
type UpdatePupProviders ¶
Updates the providers of dependant interfaces for this pup