shell

package
v0.0.0-...-0186d81 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShellLeaseExpired = errors.New("shell lease no longer exists")
View Source
var Keys = &keys{}

Functions

func ClearContainerTTL

func ClearContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error

func ContainerIDForStub

func ContainerIDForStub(stubId string) string

func GenerateShellCredentials

func GenerateShellCredentials() (string, string, error)

GenerateShellCredentials returns credentials that are independent from the caller's API token. A compromised or replaced SSH daemon must never receive a reusable Beam/Beta9 bearer token during password authentication.

func IsStandaloneContainer

func IsStandaloneContainer(containerId string) bool

func RefreshContainerTTL

func RefreshContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error

RefreshContainerTTL extends an existing connected-shell lease without resurrecting a lease that has already expired.

func RefreshPendingContainerTTL

func RefreshPendingContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error

RefreshPendingContainerTTL grants time for a user to run a returned shell command. The shorter connected lease starts only once the HTTP tunnel opens.

func SetInitialContainerTTL

func SetInitialContainerTTL(ctx context.Context, rdb *common.RedisClient, containerId string) error

SetInitialContainerTTL marks a shell container as pending; the shell service stops the container when the TTL lapses without a client keepalive.

func StandaloneEntryPoint

func StandaloneEntryPoint() []string

StandaloneEntryPoint is the dropbear-based startup used by standalone shells: provision the SSH user, then run the SSH server in the foreground.

Types

type SSHShellService

type SSHShellService struct {
	pb.UnimplementedShellServiceServer
	// contains filtered or unexported fields
}

func (*SSHShellService) CreateStandaloneShell

type ShellService

func NewSSHShellService

func NewSSHShellService(
	ctx context.Context,
	opts ShellServiceOpts,
) (ShellService, error)

type ShellServiceOpts

type ShellServiceOpts struct {
	Config         types.AppConfig
	RedisClient    *common.RedisClient
	BackendRepo    repository.BackendRepository
	ComputeRepo    repository.ComputeRepository
	WorkspaceRepo  repository.WorkspaceRepository
	ContainerRepo  repository.ContainerRepository
	WorkerRepo     repository.WorkerRepository
	WorkerPoolRepo repository.WorkerPoolRepository
	Scheduler      *scheduler.Scheduler
	RouteGroup     *echo.Group
	Tailscale      *network.Tailscale
	EventRepo      repository.EventRepository
}

Jump to

Keyboard shortcuts

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