sandbox

package
v0.0.138 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(args []string) error

Handle is the production entry for kool sandbox.

func RunEmbedded

func RunEmbedded(sealed []byte, args []string) int

RunEmbedded decrypts a sealed pack payload, materializes files under a session directory, applies packed env + SANDBOX_ROOT, executes the guest command with cwd at the materialize root, then removes the session directory.

When the pack has HomeLinked set, the runner captures the host real home once, seeds top-level absolute symlinks into the session root, overlays packed files with explode-on-demand for intermediate symlinks, and forces guest HOME to the session root (packed HOME is policed).

Optional --load-devbox ABS (repeatable, StopOnFirstArg) merges additional sealed sandbox binaries (Files later-wins overlay + hard env conflict merge).

args are the sealed binary's argv after the program name (os.Args[1:]). Returns the guest process exit code (or a non-zero code on runner errors).

Types

type PackBlob

type PackBlob struct {
	Version           int               `json:"version"`
	Name              string            `json:"name"`
	CreatedAt         time.Time         `json:"created_at"`
	ExpiresAt         *time.Time        `json:"expires_at,omitempty"`
	Comment           string            `json:"comment,omitempty"`
	HomeLinked        bool              `json:"home_linked,omitempty"`
	RuntimeLoadDevbox []string          `json:"runtime_load_devbox,omitempty"`
	Files             []PackFile        `json:"files"`
	Env               map[string]string `json:"env"`
}

PackBlob is the cleartext payload sealed into a sandbox binary.

type PackFile

type PackFile struct {
	Path    string `json:"path"`
	Mode    uint32 `json:"mode"`
	Content []byte `json:"content"`
}

PackFile is one packed file entry.

Jump to

Keyboard shortcuts

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