tim

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: EUPL-1.2 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataNodeRequired   = errors.New("datanode is required")
	ErrConfigIsNil        = errors.New("config is nil")
	ErrPasswordRequired   = errors.New("password is required for encryption")
	ErrInvalidStimPayload = errors.New("invalid stim payload")
	ErrDecryptionFailed   = errors.New("decryption failed (wrong password?)")
)
View Source
var (
	ExecCommand = exec.Command
)

Functions

func Run

func Run(timPath string) error

func RunEncrypted added in v0.0.2

func RunEncrypted(stimPath, password string) error

RunEncrypted runs an encrypted .stim file. It decrypts the file, extracts the contents to a temporary directory, and runs the container using runc.

Types

type Cache added in v0.0.2

type Cache struct {
	Dir      string
	Password string
}

Cache provides encrypted storage for TIM containers. It stores TIMs as .stim files in a directory, encrypted with ChaCha20-Poly1305 using a shared password.

func NewCache added in v0.0.2

func NewCache(dir, password string) (*Cache, error)

NewCache creates a cache in the given directory. The directory will be created if it doesn't exist.

func (*Cache) Delete added in v0.0.2

func (c *Cache) Delete(name string) error

Delete removes a TIM from the cache.

func (*Cache) Exists added in v0.0.2

func (c *Cache) Exists(name string) bool

Exists checks if a TIM exists in the cache.

func (*Cache) List added in v0.0.2

func (c *Cache) List() ([]string, error)

List returns all cached TIM names.

func (*Cache) Load added in v0.0.2

func (c *Cache) Load(name string) (*TerminalIsolationMatrix, error)

Load retrieves and decrypts a TIM from the cache.

func (*Cache) Run added in v0.0.2

func (c *Cache) Run(name string) error

Run loads and executes a TIM from the cache using runc.

func (*Cache) Size added in v0.0.2

func (c *Cache) Size(name string) (int64, error)

Size returns the size of a cached TIM in bytes.

func (*Cache) Store added in v0.0.2

func (c *Cache) Store(name string, m *TerminalIsolationMatrix) error

Store encrypts and saves a TIM to the cache.

type TerminalIsolationMatrix

type TerminalIsolationMatrix struct {
	Config []byte
	RootFS *datanode.DataNode
}

TerminalIsolationMatrix represents a runc bundle.

func FromDataNode

func FromDataNode(dn *datanode.DataNode) (*TerminalIsolationMatrix, error)

FromDataNode creates a new TerminalIsolationMatrix from a DataNode.

func FromSigil added in v0.0.2

func FromSigil(data []byte, password string) (*TerminalIsolationMatrix, error)

FromSigil decrypts and deserializes a .stim file into a TerminalIsolationMatrix.

func FromTar added in v0.0.2

func FromTar(data []byte) (*TerminalIsolationMatrix, error)

FromTar creates a TerminalIsolationMatrix from a tarball. The tarball must contain config.json and a rootfs/ directory.

func New

New creates a new, empty TerminalIsolationMatrix.

func (*TerminalIsolationMatrix) ToSigil added in v0.0.2

func (m *TerminalIsolationMatrix) ToSigil(password string) ([]byte, error)

ToSigil serializes and encrypts the TIM to .stim format using ChaChaPolySigil. Config and RootFS are encrypted separately. The output format is a Trix container with "STIM" magic containing: - Header: {"encryption_algorithm": "chacha20poly1305", "tim": true} - Payload: [config_size(4 bytes)][encrypted_config][encrypted_rootfs]

func (*TerminalIsolationMatrix) ToTar

func (m *TerminalIsolationMatrix) ToTar() ([]byte, error)

ToTar serializes the TerminalIsolationMatrix to a tarball.

Jump to

Keyboard shortcuts

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