dockconman

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Idx        int
	ChannelIdx int
	Conn       *ssh.ServerConn
	Chans      <-chan ssh.NewChannel
	Reqs       <-chan *ssh.Request
	Server     *Server
	Pty, Tty   *os.File
	Config     *ClientConfig
	ClientID   string
}

func NewClient

func NewClient(conn *ssh.ServerConn, chans <-chan ssh.NewChannel, reqs <-chan *ssh.Request, server *Server) *Client

func (*Client) HandleChannel

func (c *Client) HandleChannel(newChannel ssh.NewChannel) error

func (*Client) HandleChannelRequests

func (c *Client) HandleChannelRequests(channel ssh.Channel, requests <-chan *ssh.Request)

func (*Client) HandleChannels

func (c *Client) HandleChannels() error

func (*Client) HandleRequests

func (c *Client) HandleRequests() error

type ClientConfig

type ClientConfig struct {
	ContainerName          string                `json:"image-name,omitempty"`
	RemoteUser             string                `json:"remote-user,omitempty"`
	Env                    envhelper.Environment `json:"env,omitempty"`
	Command                []string              `json:"command,omitempty"`
	DockerRunArgs          []string              `json:"docker-run-args,omitempty"`
	DockerExecArgs         []string              `json:"docker-exec-args,omitempty"`
	User                   string                `json:"user,omitempty"`
	Keys                   []string              `json:"keys,omitempty"`
	AuthenticationMethod   string                `json:"authentication-method,omitempty"`
	AuthenticationComment  string                `json:"authentication-coment,omitempty"`
	EntryPoint             string                `json:"entrypoint,omitempty"`
	AuthenticationAttempts int                   `json:"authentication-attempts,omitempty"`
	Allowed                bool                  `json:"allowed,omitempty"`
	IsLocal                bool                  `json:"is-local,omitempty"`
	UseTTY                 bool                  `json:"use-tty,omitempty"`
}

type Server

type Server struct {
	SshConfig     *ssh.ServerConfig
	ClientConfigs map[string]*ClientConfig

	DefaultShell    string
	DockerContainer string
	DockerExecArgs  string
	Banner          string
	User            string
	Password        string
	// contains filtered or unexported fields
}

func NewServer

func NewServer() (*Server, error)

func (*Server) AddHostKey

func (s *Server) AddHostKey(keystring string) error

func (*Server) Handle

func (s *Server) Handle(netConn net.Conn) error

func (*Server) Init

func (s *Server) Init() error

Jump to

Keyboard shortcuts

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