sandbox

package
v0.0.0-...-63ae334 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

func Args(cmd Command) ([]string, error)

Args builds the bubblewrap arguments for cmd.

func ResolveExecutable

func ResolveExecutable(executable string, settings accesssettings.Settings) (string, string, error)

ResolveExecutable finds executable for a sandboxed agent process. When the sandbox hides the home directory and the executable lives there (for example under a Node version manager), it also returns the directory that must be mounted read-only so the executable and its runtime stay reachable.

func WrapCommand

func WrapCommand(cmd Command) (string, []string, error)

WrapCommand returns an executable and arguments that run cmd through bwrap.

Types

type Bind

type Bind struct {
	Source string
	Target string
}

Bind maps a host path to a different path inside the sandbox.

type Command

type Command struct {
	Executable string
	Args       []string
	Workdir    string
	Settings   accesssettings.Settings
	// Binds expose host paths at other paths inside the sandbox, read-write.
	// They are applied after every grant, so they win over a grant that
	// covers their target.
	Binds []Bind
}

Command describes an executable that should run inside a sandbox profile.

Jump to

Keyboard shortcuts

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