startup

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRequestedRuntimeIdentity

func ApplyRequestedRuntimeIdentity(ctx context.Context, cfg *RuntimeIdentityConfig) error

ApplyRequestedRuntimeIdentity switches the current process to the configured runtime UID/GID before the rest of the app initializes.

This whole bootstrap flow stays on os.* rather than acfs: it creates and chowns the data/config roots before any confinement root exists, and acfs has no chown API.

func CleanupOrphanedVolumeHelpers

func CleanupOrphanedVolumeHelpers(ctx context.Context, cleanupFunc func(context.Context) (int, error))

func CleanupUnknownSettings

func CleanupUnknownSettings(ctx context.Context, settingsMgr SettingsPruner)

func EnsureEncryptionKey

func EnsureEncryptionKey(ctx context.Context, cfg *RuntimeConfig, ensureKeyFunc func(context.Context) (string, error))

func InitializeAutoLogin

func InitializeAutoLogin(ctx context.Context, cfg *RuntimeConfig)

func InitializeDefaultSettings

func InitializeDefaultSettings(ctx context.Context, cfg *RuntimeConfig, settingsMgr SettingsManager)

func InitializeNonAgentFeatures

func InitializeNonAgentFeatures(
	ctx context.Context,
	cfg *RuntimeConfig,
	ensureBuiltInRolesFunc func(context.Context) error,
	createAdminFunc func(context.Context) error,
	reconcileDefaultAdminAPIKeyFunc func(context.Context) error,
	autoLoginInitFunc func(context.Context) error,
)

func LoadAgentToken

func LoadAgentToken(ctx context.Context, cfg *RuntimeConfig, getSettingFunc func(context.Context, string, string) string)

func TestDockerConnection

func TestDockerConnection(ctx context.Context, testFunc func(context.Context) error)

Types

type RuntimeConfig

type RuntimeConfig struct {
	AgentMode         bool
	AgentToken        string
	Environment       string
	EncryptionKey     string
	AutoLoginUsername string
	AdminStaticAPIKey string
}

type RuntimeIdentityConfig

type RuntimeIdentityConfig struct {
	PUID              string
	PGID              string
	DockerHost        string
	DockerConfig      string
	DatabaseURL       string
	ProjectsDirectory string
}

RuntimeIdentityConfig contains the config-backed environment values used to switch the process runtime identity before the application initializes.

type SettingsManager

type SettingsManager interface {
	PersistEnvSettingsIfMissing(ctx context.Context) error
	SetBoolSetting(ctx context.Context, key string, value bool) error
	EnsureDefaultSettings(ctx context.Context) error
}

type SettingsPruner

type SettingsPruner interface {
	PruneUnknownSettings(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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