config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	DatasetPrefix string `toml:"dataset_prefix" env:"PIXELS_CHECKPOINT_DATASET_PREFIX"`
}

type Config

type Config struct {
	TrueNAS    TrueNAS        `toml:"truenas"`
	Defaults   Defaults       `toml:"defaults"`
	SSH        SSH            `toml:"ssh"`
	Checkpoint Checkpoint     `toml:"checkpoint"`
	Provision  Provision      `toml:"provision"`
	Network    Network        `toml:"network"`
	RawEnv     map[string]any `toml:"env"`

	// Resolved env vars (not from TOML directly).
	Env        map[string]string `toml:"-"` // image vars → /etc/environment
	EnvForward map[string]string `toml:"-"` // session vars → SSH SetEnv
}

func Load

func Load() (*Config, error)

type Defaults

type Defaults struct {
	Image   string   `toml:"image"    env:"PIXELS_DEFAULT_IMAGE"`
	CPU     string   `toml:"cpu"      env:"PIXELS_DEFAULT_CPU"`
	Memory  int64    `toml:"memory"   env:"PIXELS_DEFAULT_MEMORY"` // MiB
	Pool    string   `toml:"pool"     env:"PIXELS_DEFAULT_POOL"`
	NICType string   `toml:"nic_type"` // "macvlan" or "bridged"
	Parent  string   `toml:"parent"`   // parent interface (e.g. "eno1", "br0")
	Network string   `toml:"network"`  // Incus network name (e.g. "incusbr0")
	DNS     []string `toml:"dns"`      // nameservers to write into containers
}

type Network

type Network struct {
	Egress string   `toml:"egress" env:"PIXELS_NETWORK_EGRESS"`
	Allow  []string `toml:"allow"`
}

func (*Network) IsRestricted

func (n *Network) IsRestricted() bool

type Provision

type Provision struct {
	Enabled  *bool `toml:"enabled"  env:"PIXELS_PROVISION_ENABLED"`
	DevTools *bool `toml:"devtools" env:"PIXELS_PROVISION_DEVTOOLS"`
}

func (*Provision) DevToolsEnabled

func (p *Provision) DevToolsEnabled() bool

func (*Provision) IsEnabled

func (p *Provision) IsEnabled() bool

type SSH

type SSH struct {
	User string `toml:"user" env:"PIXELS_SSH_USER"`
	Key  string `toml:"key"  env:"PIXELS_SSH_KEY"`
}

type TrueNAS

type TrueNAS struct {
	Host               string `toml:"host"                env:"PIXELS_TRUENAS_HOST"`
	Port               int    `toml:"port"                env:"PIXELS_TRUENAS_PORT"`
	Username           string `toml:"username"            env:"PIXELS_TRUENAS_USERNAME"`
	APIKey             string `toml:"api_key"             env:"PIXELS_TRUENAS_API_KEY"`
	InsecureSkipVerify *bool  `toml:"insecure_skip_verify" env:"PIXELS_TRUENAS_INSECURE"`
}

func (*TrueNAS) InsecureSkipVerifyValue

func (t *TrueNAS) InsecureSkipVerifyValue() bool

InsecureSkipVerify returns whether TLS verification should be skipped. Defaults to true (skip) when not explicitly set, since most TrueNAS boxes use self-signed certs.

Jump to

Keyboard shortcuts

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