Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAndSubmitReflectorData(config dogeboxd.ServerConfig, networkManager dogeboxd.NetworkManager) error
- func DidEnterRecovery(dogeboxDataDir string) error
- func DoSystemUpdate(pkg string, updateVersion string, logger dogeboxd.SubLogger) error
- func ForceRecoveryNextBoot(dataDir string) error
- func GetBuildType() (string, error)
- func GetInstallationState(t dogeboxd.Dogeboxd, config dogeboxd.ServerConfig, ...) (dogeboxd.BootstrapInstallationBootMedia, dogeboxd.BootstrapInstallationState, ...)
- func GetKeymap() (string, error)
- func GetSystemDisks() ([]dogeboxd.SystemDisk, error)
- func GetTimezone() (string, error)
- func HasForceRecoveryFile(dataDir string) bool
- func InitStorageDevice(dbxState dogeboxd.DogeboxState) (string, error)
- func InstallToDisk(t dogeboxd.Dogeboxd, config dogeboxd.ServerConfig, ...) error
- func IsDiskNixRoot(disk dogeboxd.SystemDisk) bool
- func IsInstalled(t dogeboxd.Dogeboxd, config dogeboxd.ServerConfig, ...) (bool, error)
- func IsRecoveryMode(dogeboxDataDir string, sm dogeboxd.StateManager) bool
- func NewStateManager(store *dogeboxd.StoreManager) dogeboxd.StateManager
- func SaveReflectorTokenForReboot(config dogeboxd.ServerConfig, host, token string) error
- func ShouldEnterRecovery(dogeboxDataDir string, sm dogeboxd.StateManager) bool
- func UnforceRecoveryNextBoot(dataDir string) error
- type DefaultRepoTagsFetcher
- type InvalidUpdatePackageError
- type JournalReader
- type Keymap
- type LogTailer
- type NixValidationError
- type ReflectorFileData
- type RepoTagsFetcher
- type RepositoryTag
- type StateManager
- func (s *StateManager) CloseDB() error
- func (s *StateManager) Get() dogeboxd.State
- func (s *StateManager) OpenDB() error
- func (s *StateManager) SetDogebox(dbs dogeboxd.DogeboxState) error
- func (s *StateManager) SetNetwork(ns dogeboxd.NetworkState) error
- func (s *StateManager) SetSources(state dogeboxd.SourceState) error
- type SystemMonitor
- func (t SystemMonitor) GetFastMonChannel() chan string
- func (t SystemMonitor) GetFastStatChannel() chan map[string]dogeboxd.ProcStatus
- func (t SystemMonitor) GetMonChannel() chan []string
- func (t SystemMonitor) GetStatChannel() chan map[string]dogeboxd.ProcStatus
- func (t SystemMonitor) Run(started, stopped chan bool, stop chan context.Context) error
- type SystemUpdater
- func (t SystemUpdater) AddBinaryCache(j dogeboxd.AddBinaryCache, log dogeboxd.SubLogger) error
- func (t SystemUpdater) AddJob(j dogeboxd.Job)
- func (t SystemUpdater) AddSSHKey(key string, l dogeboxd.SubLogger) error
- func (t SystemUpdater) DisableSSH(l dogeboxd.SubLogger) error
- func (t SystemUpdater) EnableSSH(l dogeboxd.SubLogger) error
- func (t SystemUpdater) GetSnapshot(pupID string) (*dogeboxd.PupVersionSnapshot, error)
- func (t SystemUpdater) GetUpdateChannel() chan dogeboxd.Job
- func (t SystemUpdater) HasSnapshot(pupID string) bool
- func (t SystemUpdater) ListSSHKeys() ([]dogeboxd.DogeboxStateSSHKey, error)
- func (t SystemUpdater) RemoveSSHKey(id string, l dogeboxd.SubLogger) error
- func (t SystemUpdater) Run(started, stopped chan bool, stop chan context.Context) error
- func (t SystemUpdater) SaveCustomNix(content string, l dogeboxd.SubLogger) error
- func (t SystemUpdater) UpdateSystemConfig(dbxState dogeboxd.DogeboxState, log dogeboxd.SubLogger) error
- func (t SystemUpdater) ValidateNix(content string) error
- type Timezone
- type UpdateVersionUnavailableError
- type UpgradableRelease
Constants ¶
const DBXRootSecret = "yes-i-will-destroy-everything-on-this-disk"
const (
MONITOR_INTERVAL time.Duration = 10 * time.Second
)
Variables ¶
var RELEASE_REPOSITORY = "https://github.com/dogebox-wg/os.git"
var SUDO_COMMAND = "sudo"
var VALID_RECOVERY_FILES = []string{"RECOVERY", "RECOVERY.TXT"}
Functions ¶
func CheckAndSubmitReflectorData ¶
func CheckAndSubmitReflectorData(config dogeboxd.ServerConfig, networkManager dogeboxd.NetworkManager) error
func DidEnterRecovery ¶
func DoSystemUpdate ¶ added in v0.8.0
func ForceRecoveryNextBoot ¶
func GetBuildType ¶
func GetInstallationState ¶
func GetInstallationState(t dogeboxd.Dogeboxd, config dogeboxd.ServerConfig, dbxState dogeboxd.DogeboxState) (dogeboxd.BootstrapInstallationBootMedia, dogeboxd.BootstrapInstallationState, error)
Dogebox OS installation state based on boot drive type is either: From Installation Media (Read-Only mode): - No Installed OS - BootstrapInstallationStateNotInstalled - Installed, Unconfigured OS - BootstrapInstallationStateUnconfigured - Installed, Configured OS - BootstrapInstallationStateConfigured From Installed Location (not Read-Only mode): - Installed, Unconfigured - BootstrapInstallationStateUnconfigured - Installed, Configured - BootstrapInstallationStateConfigured
func GetSystemDisks ¶
func GetSystemDisks() ([]dogeboxd.SystemDisk, error)
func GetTimezone ¶ added in v0.9.0
func HasForceRecoveryFile ¶
func InitStorageDevice ¶
func InitStorageDevice(dbxState dogeboxd.DogeboxState) (string, error)
func InstallToDisk ¶
func InstallToDisk(t dogeboxd.Dogeboxd, config dogeboxd.ServerConfig, dbxState dogeboxd.DogeboxState, name string) error
func IsDiskNixRoot ¶
func IsDiskNixRoot(disk dogeboxd.SystemDisk) bool
func IsInstalled ¶
func IsInstalled(t dogeboxd.Dogeboxd, config dogeboxd.ServerConfig, dbxState dogeboxd.DogeboxState) (bool, error)
func IsRecoveryMode ¶
func IsRecoveryMode(dogeboxDataDir string, sm dogeboxd.StateManager) bool
func NewStateManager ¶
func NewStateManager(store *dogeboxd.StoreManager) dogeboxd.StateManager
func SaveReflectorTokenForReboot ¶
func SaveReflectorTokenForReboot(config dogeboxd.ServerConfig, host, token string) error
func ShouldEnterRecovery ¶
func ShouldEnterRecovery(dogeboxDataDir string, sm dogeboxd.StateManager) bool
This function should do detection on whether or not we should enter our "Recovery Mode". This can always be overriden by a CLI flag if necessary. This will not return true if the current instance of dogeboxd has booted in recovery. Use `IsRecoveryMode()` for that.
func UnforceRecoveryNextBoot ¶
Types ¶
type DefaultRepoTagsFetcher ¶ added in v0.8.0
type DefaultRepoTagsFetcher struct{}
DefaultRepoTagsFetcher implements RepoTagsFetcher using the actual git implementation
func (*DefaultRepoTagsFetcher) GetRepoTags ¶ added in v0.8.0
func (d *DefaultRepoTagsFetcher) GetRepoTags(repo string) ([]RepositoryTag, error)
type InvalidUpdatePackageError ¶ added in v0.8.0
type InvalidUpdatePackageError struct {
Package string
}
func (InvalidUpdatePackageError) Error ¶ added in v0.8.0
func (e InvalidUpdatePackageError) Error() string
type JournalReader ¶
type JournalReader struct {
// contains filtered or unexported fields
}
func NewJournalReader ¶
func NewJournalReader(config dogeboxd.ServerConfig) JournalReader
func (JournalReader) GetJournalChannel ¶ added in v0.8.0
func (t JournalReader) GetJournalChannel(service string) (context.CancelFunc, chan string, error)
type Keymap ¶
func GetKeymaps ¶
type LogTailer ¶
type LogTailer struct {
// contains filtered or unexported fields
}
func NewLogTailer ¶
func NewLogTailer(config dogeboxd.ServerConfig) LogTailer
func (LogTailer) GetChannel ¶ added in v0.8.0
type NixValidationError ¶ added in v0.9.0
type NixValidationError struct {
Output string
}
NixValidationError represents a nix validation error
func (*NixValidationError) Error ¶ added in v0.9.0
func (e *NixValidationError) Error() string
type ReflectorFileData ¶
type RepoTagsFetcher ¶ added in v0.8.0
type RepoTagsFetcher interface {
GetRepoTags(repo string) ([]RepositoryTag, error)
}
RepoTagsFetcher interface for mocking getRepoTags
type RepositoryTag ¶ added in v0.8.0
type RepositoryTag struct {
Tag string
}
type StateManager ¶
type StateManager struct {
// contains filtered or unexported fields
}
func (*StateManager) CloseDB ¶
func (s *StateManager) CloseDB() error
func (*StateManager) Get ¶
func (s *StateManager) Get() dogeboxd.State
func (*StateManager) OpenDB ¶
func (s *StateManager) OpenDB() error
func (*StateManager) SetDogebox ¶
func (s *StateManager) SetDogebox(dbs dogeboxd.DogeboxState) error
func (*StateManager) SetNetwork ¶
func (s *StateManager) SetNetwork(ns dogeboxd.NetworkState) error
func (*StateManager) SetSources ¶
func (s *StateManager) SetSources(state dogeboxd.SourceState) error
type SystemMonitor ¶
type SystemMonitor struct {
// contains filtered or unexported fields
}
func NewSystemMonitor ¶
func NewSystemMonitor(config dogeboxd.ServerConfig) SystemMonitor
func (SystemMonitor) GetFastMonChannel ¶
func (t SystemMonitor) GetFastMonChannel() chan string
func (SystemMonitor) GetFastStatChannel ¶
func (t SystemMonitor) GetFastStatChannel() chan map[string]dogeboxd.ProcStatus
func (SystemMonitor) GetMonChannel ¶
func (t SystemMonitor) GetMonChannel() chan []string
func (SystemMonitor) GetStatChannel ¶
func (t SystemMonitor) GetStatChannel() chan map[string]dogeboxd.ProcStatus
type SystemUpdater ¶
type SystemUpdater struct {
// contains filtered or unexported fields
}
func NewSystemUpdater ¶
func NewSystemUpdater(config dogeboxd.ServerConfig, networkManager dogeboxd.NetworkManager, nixManager dogeboxd.NixManager, sourceManager dogeboxd.SourceManager, pupManager dogeboxd.PupManager, stateManager dogeboxd.StateManager, dkm dogeboxd.DKMManager) SystemUpdater
func (SystemUpdater) AddBinaryCache ¶
func (t SystemUpdater) AddBinaryCache(j dogeboxd.AddBinaryCache, log dogeboxd.SubLogger) error
func (SystemUpdater) AddJob ¶
func (t SystemUpdater) AddJob(j dogeboxd.Job)
func (SystemUpdater) AddSSHKey ¶
func (t SystemUpdater) AddSSHKey(key string, l dogeboxd.SubLogger) error
func (SystemUpdater) DisableSSH ¶
func (t SystemUpdater) DisableSSH(l dogeboxd.SubLogger) error
func (SystemUpdater) GetSnapshot ¶ added in v0.9.0
func (t SystemUpdater) GetSnapshot(pupID string) (*dogeboxd.PupVersionSnapshot, error)
GetSnapshot retrieves a snapshot for a pup if it exists
func (SystemUpdater) GetUpdateChannel ¶
func (t SystemUpdater) GetUpdateChannel() chan dogeboxd.Job
func (SystemUpdater) HasSnapshot ¶ added in v0.9.0
func (t SystemUpdater) HasSnapshot(pupID string) bool
HasSnapshot checks if a snapshot exists for a pup (for rollback)
func (SystemUpdater) ListSSHKeys ¶
func (t SystemUpdater) ListSSHKeys() ([]dogeboxd.DogeboxStateSSHKey, error)
func (SystemUpdater) RemoveSSHKey ¶
func (t SystemUpdater) RemoveSSHKey(id string, l dogeboxd.SubLogger) error
func (SystemUpdater) Run ¶
func (t SystemUpdater) Run(started, stopped chan bool, stop chan context.Context) error
func (SystemUpdater) SaveCustomNix ¶ added in v0.9.0
func (t SystemUpdater) SaveCustomNix(content string, l dogeboxd.SubLogger) error
SaveCustomNix validates and saves the custom.nix content, then triggers a system rebuild.
func (SystemUpdater) UpdateSystemConfig ¶ added in v0.9.0
func (t SystemUpdater) UpdateSystemConfig(dbxState dogeboxd.DogeboxState, log dogeboxd.SubLogger) error
func (SystemUpdater) ValidateNix ¶ added in v0.9.0
func (t SystemUpdater) ValidateNix(content string) error
ValidateNix validates nix content using nix-instantiate --parse. Returns nil if valid, otherwise returns the error message.
type Timezone ¶ added in v0.9.0
func GetTimezones ¶ added in v0.9.0
type UpdateVersionUnavailableError ¶ added in v0.8.0
type UpdateVersionUnavailableError struct {
}
func (UpdateVersionUnavailableError) Error ¶ added in v0.8.0
func (e UpdateVersionUnavailableError) Error() string
type UpgradableRelease ¶ added in v0.8.0
func GetUpgradableReleases ¶ added in v0.8.0
func GetUpgradableReleases(includePreReleases bool) ([]UpgradableRelease, error)
func GetUpgradableReleasesWithFetcher ¶ added in v0.8.0
func GetUpgradableReleasesWithFetcher(includePreReleases bool, fetcher RepoTagsFetcher) ([]UpgradableRelease, error)