config

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PODMAN_SOCKET_PATH    = "/var/run/podman/podman.sock"
	DOCKER_SOCKET_SYMLINK = "/var/run/docker.sock"
	BlueprintPath         = "/etc/k8shell/blueprint.yaml"
	InitScriptsDir        = "/usr/local/k8shell/system"
)
View Source
const (
	DEFAULT_MAX_PACKET_SIZE = 1 << 15 // 32 KB
)

Maximum packet size for streaming data

Variables

View Source
var (
	K8SHELLD_VERSION = "0.0.0"
	K8SHELLD_COMMIT  = "0000000"
)

Functions

func BlueprintApps

func BlueprintApps(bpApps map[string]commonmodels.AppSpec) map[string]*commonmodels.AppSpec

BlueprintApps converts the blueprint's value-map of AppSpec to the pointer-map used internally by AppManager. It also sets the Name field from the map key.

func ExpandSplash

func ExpandSplash(splash, shellUsername string) string

ExpandSplash executes the splash string as a Go template with the supplied variables and normalises newlines to \r\n for correct PTY rendering. If template parsing or execution fails the original splash string is returned unchanged so a misconfigured template never breaks the shell startup.

func LoadBlueprint

func LoadBlueprint(path string) (*commonmodels.Blueprint, error)

LoadBlueprint reads and unmarshals the blueprint YAML at the given path. The file is expected to have the structure:

metadata: ...
blueprint:
  <blueprint fields>

Types

type Config

type Config = k8shelld.Config

Config is now identical to k8shelld.Config. Splash, Podman, EnableApps and Apps are no longer in the daemon config — they come from the blueprint.

type SplashVars

type SplashVars struct {
	// Version is the running k8shelld version (e.g. "1.2.3").
	Version string
	// Commit is the short git commit hash baked in at build time.
	Commit string
	// Username is the primary OS user configured for this instance.
	Username string
	// ShellUsername is the OS user that the current shell session runs as.
	// This may differ from Username when the caller requested a different user.
	ShellUsername string
	// Hostname is the hostname of the container / machine.
	Hostname string
	// Date is today's date formatted as YYYY-MM-DD.
	Date string
}

SplashVars holds all values that can be referenced inside the splash template. Use Go template syntax in the splash YAML field, e.g.:

splash: "k8shelld {{.Version}} | user: {{.Username}} | host: {{.Hostname}}"

To add a new variable in the future, simply add a field here and populate it in ExpandSplash — no changes are needed anywhere else.

Jump to

Keyboard shortcuts

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