conf

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DownloadMode uint8 = iota
	UploadMode
	CGIMode
	RedirectMode
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	NoInfo     bool
	NoError    bool
	Port       string
	Host       string
	Timeout    time.Duration
	NoDownload bool

	Upload      bool
	UploadFile  bool
	UploadInput bool

	ExitOnFail bool

	ArchiveMethod string

	Mdns bool

	FileName string
	FileExt  string
	FileMime string

	CertFile string
	KeyFile  string
	Sstls    bool

	Username       string
	Password       string
	PasswordFile   string
	PasswordHidden bool

	RawHeaders []string

	Cgi          bool
	CgiStrict    bool // only valid if cgi is true
	ShellCommand bool
	Shell        string // only used if shellCommand != ""

	Redirect       bool
	RedirectStatus int

	ReplaceHeaders bool     // only valid if cgi is true or shellCommand != ""
	EnvVars        []string // only used if cgi is true or shellCommand != ""
	CgiStderr      string   // only used if cgi is true or shellCommand != ""
	Dir            string   // only used if cgi is true or shellCommand != ""

	NoUnixNorm bool

	WaitForEOF bool

	AllowBots bool

	NoCSRFToken     bool
	CustomCSRFToken string

	UploadHTML string
	// contains filtered or unexported fields
}

func NewConf

func NewConf(cmd *cobra.Command) *Conf

func (*Conf) CredFileLoc

func (c *Conf) CredFileLoc() (string, bool)

CredFileLoc returns an empty string and false if randomly generated were never written to disk

func (*Conf) Mode

func (c *Conf) Mode() uint8

func (*Conf) Parse

func (c *Conf) Parse() error

func (*Conf) RandCredentials

func (c *Conf) RandCredentials() (user, password bool)

func (*Conf) SSTLSLoc

func (c *Conf) SSTLSLoc() (string, bool)

SSTLSLoc returns an empty string and false if self signed tls cert is not being used

func (*Conf) SetFlags

func (c *Conf) SetFlags(cmd *cobra.Command)

func (*Conf) SetupCertAndKey

func (c *Conf) SetupCertAndKey(fs *pflag.FlagSet) (location string, err error)

setupCertAndKey checks to see if we need to self-sign any certificates, and if so it returns their location

func (*Conf) SetupCredentials

func (c *Conf) SetupCredentials() error

func (*Conf) SetupServer

func (c *Conf) SetupServer(srvr *server.Server, args []string, ips []string) error

func (*Conf) StdinBufferLocation

func (c *Conf) StdinBufferLocation() string

Jump to

Keyboard shortcuts

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