containers

package
v0.0.0-...-8d7cf1a Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupStaleContainers

func CleanupStaleContainers()

CleanupStaleContainers stops containers that exceed their time limits.

func ContainerDir

func ContainerDir(ctName string) string

ContainerDir returns the host path to a container's download directory.

func CreateContainer

func CreateContainer(sessionID string) (string, string, error)

CreateContainer creates a new container for a session with a per-container download directory.

func CreateRemnuxContainer

func CreateRemnuxContainer(fileID string, fileBytes []byte) (string, error)

CreateRemnuxContainer creates a REMnux analysis container with the file copied in.

func EnsureRemnuxNetwork

func EnsureRemnuxNetwork(ctx context.Context, cli *client.Client) error

EnsureRemnuxNetwork creates the isolated network for REMnux containers.

func GetContainerInternalAddress

func GetContainerInternalAddress(ctName string) (string, error)

GetContainerInternalAddress returns the address for reaching a download container. Uses the published host port, which works whether the server is on the host or in a container.

func GetContainerWebURL

func GetContainerWebURL(ctName string) (string, error)

GetContainerWebURL returns the HTTP URL for the container's web interface via its published port.

func ListSessionContainers

func ListSessionContainers(sessionID string) ([]string, error)

ListSessionContainers returns container names for a session.

func PullImage

func PullImage() error

PullImage pulls the container image.

func ReadDownload

func ReadDownload(ctName, filename string) ([]byte, error)

ReadDownload reads a file from the container's download directory.

func RecordActivity

func RecordActivity(ctName string)

RecordActivity records that a user is actively using the container (called on each file list/submit request).

func RecordConnectionClosed

func RecordConnectionClosed(ctName string)

RecordConnectionClosed decrements the active connection count and records the disconnection time when no more connections remain.

func RecordConnectionOpened

func RecordConnectionOpened(ctName string)

RecordConnectionOpened increments the active connection count for a container.

func StartCleanupLoop

func StartCleanupLoop()

StartCleanupLoop runs a background goroutine that periodically checks for stale containers.

func StartSystem

func StartSystem()

StartSystem initializes the container system (starts idle cleanup loop).

func StopContainer

func StopContainer(ctName string) error

StopContainer stops, removes the container, and cleans up its download directory.

func StopRemnuxContainer

func StopRemnuxContainer(ctName string) error

StopRemnuxContainer stops and removes a REMnux container.

Types

type FileEntry

type FileEntry struct {
	Name    string `json:"name"`
	Size    int64  `json:"size"`
	ModTime string `json:"mod_time"`
}

FileEntry represents a file in the download directory.

func ListDownloads

func ListDownloads(ctName string) ([]FileEntry, error)

ListDownloads returns file entries in the container's download directory.

Jump to

Keyboard shortcuts

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