Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectionErrorHints(server string, logger *logger.Logger, err error) error
- func DetectTransparentProxy(serverURL string) (proxy string, allHeaders string, error error)
- func ParseTunnelAllowed(input string) (*net.IPNet, string, error)
- func PrepareDirs(c *ClientConfigHolder) error
- func TunnelIsAllowed(tunnelAllowed []string, remote string) (bool, error)
- type CapacityBuffer
- type Client
- func (c *Client) Close() error
- func (c *Client) CloseConnection() error
- func (c *Client) HandleRunCmdRequest(ctx context.Context, reqPayload []byte) (*comm.RunCmdResponse, error)
- func (c *Client) Run(ctx context.Context) (err error)
- func (c *Client) Start(ctx context.Context) error
- func (c *Client) ToUTF8(b []byte, decoder *encoding.Decoder) string
- func (c *Client) Wait(ctx context.Context) (err error)
- type ClientConfigHolder
- func (c *ClientConfigHolder) GetProtectedUploadDirs() []string
- func (c *ClientConfigHolder) GetScriptsDir() string
- func (c *ClientConfigHolder) GetUploadDir() string
- func (c *ClientConfigHolder) IsFileReceptionEnabled() bool
- func (c *ClientConfigHolder) ParseAndValidate(skipScriptsDirValidation bool) error
- func (c *ClientConfigHolder) ParseAndValidateConnection() error
- func (c *ClientConfigHolder) ParseAndValidateFilePushConfig() error
- func (c *ClientConfigHolder) ParseAndValidateMonitoring() error
- type LimitedWriter
- type OptionsProvider
- type SSHFileProvider
- type SftpSession
- type SourceFileProvider
- type SummaryBuffer
- type UploadManager
- type Watchdog
Constants ¶
View Source
const ( WatchdogStateReconnecting = "reconnecting" WatchdogStateConnected = "connected" WatchdogStateInit = "initialized" )
View Source
const AuthTimeout = 30 * time.Second
View Source
const BackoffOnServerTimeoutMaxDuration = 1 * time.Second
View Source
const DefaultDataDir = "/var/lib/rport"
View Source
const DefaultMonitoringInterval = 60 * time.Second
View Source
const DialTimeout = 5 * 60 * time.Second
View Source
const InitialConnectionRequestSendDelayJitterMilliseconds = 10000
View Source
const MaxConnectionBackoffWaitTime = 10 * 60 * time.Second
View Source
const MaxKeepAliveJitterMilliseconds = 5000
View Source
const MinConnectionBackoffWaitTime = 5 * time.Second
View Source
const MinSendRequestRetryWaitTime = 1 * time.Second
View Source
const SendRequestTimeout = 30 * time.Second
View Source
const ServerReconnectRequestBackoffTime = 3 * 60 * time.Second
Variables ¶
View Source
var FileReceptionGlobs = []string{
"/bin", "/sbin", "/boot", "/usr/bin", "/usr/sbin", "/dev", "/lib*", "/run",
}
Functions ¶
func ConnectionErrorHints ¶
func DetectTransparentProxy ¶
func PrepareDirs ¶
func PrepareDirs(c *ClientConfigHolder) error
Types ¶
type CapacityBuffer ¶
type CapacityBuffer struct {
// contains filtered or unexported fields
}
func (*CapacityBuffer) Bytes ¶
func (b *CapacityBuffer) Bytes() []byte
func (*CapacityBuffer) GetOverflowMessage ¶
func (b *CapacityBuffer) GetOverflowMessage() string
func (*CapacityBuffer) HasOverflow ¶
func (b *CapacityBuffer) HasOverflow() bool
func (*CapacityBuffer) String ¶
func (b *CapacityBuffer) String() string
type Client ¶
Client represents a client instance
func NewClient ¶
func NewClient(config *ClientConfigHolder, filesAPI files.FileAPI) (*Client, error)
NewClient creates a new client instance
func (*Client) CloseConnection ¶
func (*Client) HandleRunCmdRequest ¶
type ClientConfigHolder ¶
type ClientConfigHolder struct {
*clientconfig.Config
}
func (*ClientConfigHolder) GetProtectedUploadDirs ¶
func (c *ClientConfigHolder) GetProtectedUploadDirs() []string
func (*ClientConfigHolder) GetScriptsDir ¶
func (c *ClientConfigHolder) GetScriptsDir() string
func (*ClientConfigHolder) GetUploadDir ¶
func (c *ClientConfigHolder) GetUploadDir() string
func (*ClientConfigHolder) IsFileReceptionEnabled ¶
func (c *ClientConfigHolder) IsFileReceptionEnabled() bool
func (*ClientConfigHolder) ParseAndValidate ¶
func (c *ClientConfigHolder) ParseAndValidate(skipScriptsDirValidation bool) error
func (*ClientConfigHolder) ParseAndValidateConnection ¶
func (c *ClientConfigHolder) ParseAndValidateConnection() error
func (*ClientConfigHolder) ParseAndValidateFilePushConfig ¶
func (c *ClientConfigHolder) ParseAndValidateFilePushConfig() error
func (*ClientConfigHolder) ParseAndValidateMonitoring ¶
func (c *ClientConfigHolder) ParseAndValidateMonitoring() error
type LimitedWriter ¶
type OptionsProvider ¶
type SSHFileProvider ¶
type SSHFileProvider struct {
// contains filtered or unexported fields
}
func (SSHFileProvider) Open ¶
func (sfp SSHFileProvider) Open(path string) (io.ReadCloser, error)
type SftpSession ¶
type SftpSession struct { RemoteFile io.ReadCloser SftpCl *sftp.Client }
func (*SftpSession) Close ¶
func (ss *SftpSession) Close() error
type SourceFileProvider ¶
type SourceFileProvider interface {
Open(path string) (io.ReadCloser, error)
}
type SummaryBuffer ¶
SummaryBuffer extracts everything between <summary> and </summary> from io.Writer stream
func NewSummaryBuffer ¶
func NewSummaryBuffer() *SummaryBuffer
func (*SummaryBuffer) GetSummary ¶
func (s *SummaryBuffer) GetSummary() []byte
func (*SummaryBuffer) Stop ¶
func (s *SummaryBuffer) Stop()
Stop closes and waits for writing to finish
type UploadManager ¶
type UploadManager struct { *logger.Logger FilesAPI files.FileAPI OptionsProvider OptionsProvider SourceFileProvider SourceFileProvider SysUserLookup system.SysUserLookup }
func NewSSHUploadManager ¶
func NewSSHUploadManager( l *logger.Logger, filesAPI files.FileAPI, optionsProvider OptionsProvider, sshConn ssh.Conn, sysUserLookup system.SysUserLookup, ) *UploadManager
func (*UploadManager) HandleUploadRequest ¶
func (um *UploadManager) HandleUploadRequest(reqPayload []byte) (*models.UploadResponse, error)
type Watchdog ¶
type Watchdog struct {
// contains filtered or unexported fields
}
func NewWatchdog ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.