config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// C stores the actual configured values, defaults shown below
	C = Config{
		Bind:            ":8080",
		BridgeInterface: "br0",
		Bootstrap: Bootstrap{
			ContainerRegistry: "docker.io",
			VMBaseImage:       "https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-generic-amd64-daily.qcow2",
		},
		ControlNetworkPort: "rhyzome0",
		DiskStoragePool:    "default",
		ImageDir:           "/var/lib/libvirt/images",
		ImageHost:          "http://image-host.fruit-0.entanglement.garden",
		StaticInstances:    "/etc/rhyzome/static-instances",
		ImageCache:         fmt.Sprintf("%s/.cache/rhyzome/images/", os.Getenv("HOME")),
		MetadataURL:        "http://169.254.169.254",
		HTTPBind:           ":8080",
		GRPCPort:           9090,
		SqlitePath:         "rhyzome-libvirt.db",
		MACPrefix:          "52:54:00",
		SharedDir:          "/var/run/rhyzome-libvirt",
	}
)

Functions

func Load

func Load()

Load loads the configuration off the disk

Types

type Bootstrap

type Bootstrap struct {
	ExitOnSuccess     bool     `json:"exit_on_success,omitempty"`     // used for CI, will also cause VM serial output to come out in our logs
	BootstrapCluster  bool     `json:"bootstrap_cluster,omitempty"`   // set to true to run cluster bootstrapping
	ContainerRegistry string   `json:"container_registry,omitempty"`  // the container registry to use for the bootstrap cluster
	Domain            string   `json:"domain,omitempty"`              // the root domain of the cluster
	SSHAuthorizedKeys []string `json:"ssh_authorized_keys,omitempty"` // SSH keys to add to the service VM
	VMBaseImage       string   `json:"vm_base_image,omitempty"`       // the base image to use for the service VM
	WANInterfaceMAC   string   `json:"wan_mac,omitempty"`             // if the WAN interface is blank in the config, it will be set to the interface name with this MAC
}

type Config

type Config struct {
	Bind               string                  `json:"bind,omitempty"`                 // Bind is the address (and port) to bind the GRPC server to
	BridgeInterface    string                  `json:"bridge_interface,omitempty"`     // BridgeInterface was the bridge that all network interfaces are added to and is still used for some things
	Bootstrap          Bootstrap               `json:"bootstrap,omitempty"`            // Bootstrap tells us how to bootstrap the a new cluster (and if we should)
	ControlNetworkPort string                  `json:"control_network_port,omitempty"` // OVSBriControlNetworkPort is the local network interface for the control network
	WANBridge          string                  `json:"wan_interface,omitempty"`        // WANBridge is the bridge interface on the host to use for WAN interfaces on routers. Ignored if WANNetwork is specified.
	WANNetwork         string                  `json:"wan_network,omitempty"`          // WANNetwork is the libvirt network to use as the WAN interface for routers. If specified, WANBridge is ignored.
	DiskStoragePool    string                  `json:"disk_storage_pool,omitempty"`    // DiskStoragePool is the name of the storage pool to use
	ImageDir           string                  `json:"image_dir,omitempty"`            // ImageDir is the path to the local image pool
	ImageCache         string                  `json:"image_cache,omitempty"`          // ImageCache is the path on the local disk to a folder where images should be cached
	ImageHost          string                  `json:"imagehost,omitempty"`            // ImageHost is the base URL for the disk image server
	PKI                grpcx.PKI               `json:"pki,omitempty"`
	MetadataURL        string                  `json:"metadata_url,omitempty"`
	APIServer          string                  `json:"apiserver,omitempty"`        // The host:port of the gRPC server to connect to
	StaticInstances    string                  `json:"static_instances,omitempty"` // path to directory to read static instances from
	HTTPBind           string                  `json:"http_bind,omitempty"`
	GRPCPort           int                     `json:"grpc_port,omitempty"`
	JWTValidator       middleware.JWTValidator `json:"jwt_validator,omitempty"`
	MACPrefix          string                  `json:"mac_prefix,omitempty"`
	SqlitePath         string                  `json:"sqlite_path,omitempty"` // SqlitePath is the path to the sqlite database file
	SharedDir          string                  `json:"shared_dir,omitempty"`  // SharedDir must be accessible by the rhyzome-libvirt agent as well as the libvirt hooks
	SystemCredentials  string                  `json:"system_credentials,omitempty"`
}

Config describes all configurable keys

Jump to

Keyboard shortcuts

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