launch

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package launch builds and execs the sandboxed command ("sim <cmd>").

Index

Constants

View Source
const SessionDir = ".local/state/sim/sessions"

SessionDir is the per-session podman state location under virtual_home.

View Source
const SessionsLock = "lock"

SessionsLock is the flock-locked liveness file inside a session dir.

View Source
const SimImagesDir = ".cache/sim/podman-images"

SimImagesDir is the image-tar location under virtual_home (visible at $HOME).

Variables

View Source
var CwdGitModes = []string{"ro", "ro_try", "rw", "rw_try", "none"}

CwdGitModes are the accepted cwd_git_mode values, in message order.

Functions

func Build

func Build(args []string, p Params) ([]string, error)

Build assembles the command to exec, performing the same host-side side effects as the Python implementation (session pruning, passwd/group seeding, image export) so behavior is observable.

func Main

func Main(args []string) int

Main is the "sim <command>" entry point.

func UUID7

func UUID7() string

UUID7 builds a version-7 UUID (hand-rolled; the stdlib one needs Go 1.28).

Types

type Bind

type Bind struct {
	Mode BindMode
	Src  string
	Dest string
}

Bind is a resolved bind: mode plus source and destination.

type BindMode

type BindMode string

BindMode is a bwrap bind flag.

const (
	RO    BindMode = "--ro-bind"
	ROTry BindMode = "--ro-bind-try"
	RW    BindMode = "--bind"
	RWTry BindMode = "--bind-try"
)

type Params

type Params struct {
	Cwd  string
	Cfg  *config.Config
	UID  int
	GID  int
	Home string
	User string
	// Self is the absolute path to this binary, bound into the sandbox and
	// re-exec'd as the entrypoint. Empty means os.Executable().
	Self          string
	XDGRuntimeDir string
}

Params carries everything Build needs from the process environment. It is a struct (rather than reading the process directly) so tests can drive it.

Jump to

Keyboard shortcuts

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