homeboot

package
v0.0.0-...-796e579 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package homeboot provides a command line tool that creates a private key identity and enrolls it.

Index

Constants

View Source
const CoreMount = "/opt/jarvis/var"

CoreMount is the mount point of jarvis volume.

Variables

This section is empty.

Functions

func BuildEmpty

func BuildEmpty(client *dock.Client, name string) error

BuildEmpty builds the homedrv/empty image. This image is only used for processing volumes.

func BuildEmptyIfNotExist

func BuildEmptyIfNotExist(client *dock.Client, name string) error

BuildEmptyIfNotExist builds the homedrv/empty image if the image does not exist yet.

func CheckSystemDock

func CheckSystemDock() error

CheckSystemDock checks if system docker exists. It returns NotFound error if not.

func FetchBuildRelease

func FetchBuildRelease(c *httputil.Client, b string) (*drvapi.Release, error)

FetchBuildRelease fetches the a particular build.

func FetchChannelRelease

func FetchChannelRelease(c *httputil.Client, ch string) (
	*drvapi.Release, error,
)

FetchChannelRelease fetch the release from a particular channel.

func FetchSSHKeys

func FetchSSHKeys(c *InitConfig) ([]string, error)

FetchSSHKeys fetches the SSH keys specified by the config.

func InitFiles

func InitFiles(c *InitConfig) ([]*bosinit.WriteFile, error)

InitFiles generates init files for a new homedrive.

func Main

func Main()

Main is the main entrance of the command line.

func StartCore

func StartCore(client *dock.Client, config *CoreConfig) (string, error)

StartCore starts the core.homedrv container.

Types

type BootConfig

type BootConfig struct {
	Drive        *drvcfg.Config
	Code         string
	Download     bool `json:",omitempty"`
	LegacyNaming bool
}

BootConfig is a JSON marshallable file that is saved on the file system, often as /opt/homedrv/boot.jsonx It specifies the flags used by homeinstall.

type CoreConfig

type CoreConfig struct {
	Drive *drvcfg.Config
	Image string
	Files *tarutil.Stream

	BindSysDock bool // bind system-docker.sock
}

CoreConfig specifies how to start a core.

type DownloadConfig

type DownloadConfig struct {
	Release *drvapi.Release
	Channel string
	Build   string

	Naming *drvcfg.Naming // Naming conventions.

	// Download the core only; only used in homeboot for bootstraping.
	CoreOnly bool

	// Only downloads the latest one from the ladder.
	LatestOnly bool

	// If set, ignore major versions that are lower than this.
	CurrentSemVersions map[string]string
}

DownloadConfig is the install config. This is the configuration for downloading and installing.

type DownloadSource

type DownloadSource struct {
	// Build gets the release by name.
	Build func(b string) (*drvapi.Release, error)

	// Channel gets the release of a channel.
	Channel func(ch string) (*drvapi.Release, error)

	// OpenObject opens an object by name.
	OpenObject func(name string) (io.ReadCloser, error)

	// OpenDocker is the legacy way to download a docker image.
	OpenDocker func(name, hash string) (io.ReadCloser, error)
}

DownloadSource is a source for downloading a release.

func OfficialDownloadSource

func OfficialDownloadSource(c *httputil.Client) *DownloadSource

OfficialDownloadSource creates a downloader downloading from HomeDrive official website.

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

Downloader is a downloader for downloading docker images.

func NewDownloader

func NewDownloader(src *DownloadSource, dock *dock.Client) *Downloader

NewDownloader creates a new downloader.

func NewOfficialDownloader

func NewOfficialDownloader(
	c *httputil.Client, dock *dock.Client,
) *Downloader

NewOfficialDownloader creates a new downloader that downloads from the official source.

func (*Downloader) DownloadRelease

func (d *Downloader) DownloadRelease(c *DownloadConfig) (
	*drvapi.Release, error,
)

DownloadRelease downloads an entire release.

func (*Downloader) FetchBuild

func (d *Downloader) FetchBuild(b string) (*drvapi.Release, error)

FetchBuild fetches a particular build.

type InitConfig

type InitConfig struct {
	HomeBoot string

	Boot *BootConfig

	GitHubKeys string
	UserKeys   string
}

InitConfig is the configuration to initialize a homedrive.

func NewInitConfig

func NewInitConfig() *InitConfig

NewInitConfig creates a new init config for creating a new HomeDrive instance.

func (*InitConfig) DeclareFlags

func (c *InitConfig) DeclareFlags(flags *flagutil.FlagSet)

DeclareFlags declares command line flags.

Jump to

Keyboard shortcuts

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