sshserver

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package sshserver provides the SSH server and TUI integration for centaurx.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureHostKey

func EnsureHostKey(path string) (ssh.Signer, error)

EnsureHostKey ensures the SSH host key exists at path and returns the signer.

Types

type CommandHandler

type CommandHandler interface {
	Handle(ctx context.Context, userID schema.UserID, tabID schema.TabID, input string) (bool, error)
}

CommandHandler routes slash commands.

type Config

type Config struct {
	Addr         string
	HostKeyPath  string
	IdlePrompt   string
	KeyStorePath string
	KeyDir       string
}

Config defines SSH server settings.

type LoginAuthStore

type LoginAuthStore interface {
	HasLoginPubKey(userID schema.UserID, key ssh.PublicKey) (bool, error)
	ValidateTOTP(username string, totpCode string) error
	ChangePassword(username, currentPassword, totpCode, newPassword string) error
}

LoginAuthStore validates SSH login credentials and supports password changes.

type Server

type Server struct {
	Addr        string
	HostKeyPath string
	Listener    net.Listener
	Service     core.Service
	Handler     CommandHandler
	IdlePrompt  string
	AuthStore   LoginAuthStore
	EventBus    *eventbus.Bus
	// contains filtered or unexported fields
}

Server exposes centaurx over SSH.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) error

ListenAndServe starts the SSH server and shuts down on context cancellation.

Jump to

Keyboard shortcuts

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