config

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Title = "HellPot"

Title is the name of the application used throughout the configuration process.

Variables

View Source
var (
	// Trace is the value of our trace (extra verbose)  on/off toggle as per the current configuration.
	Trace bool
	// Debug is the value of our debug (verbose) on/off toggle as per the current configuration.
	Debug bool
	// Filename returns the current location of our toml config file.
	Filename string
)

exported generic vars

View Source
var (
	// BannerOnly when toggled causes HellPot to only print the banner and version then exit.
	BannerOnly = false
	// GenConfig when toggled causes HellPot to write its default config to the cwd and then exit.
	GenConfig = false
	// NoColor when true will disable the banner and any colored console output.
	NoColor bool
	// DockerLogging when true will disable the banner and any colored console output, as well as disable the log file.
	// Assumes NoColor == true.
	DockerLogging bool
	// MakeRobots when false will not respond to requests for robots.txt.
	MakeRobots bool
	// CatchAll when true will cause HellPot to respond to all paths.
	// Note that this will override MakeRobots.
	CatchAll bool
	// ConsoleTimeFormat sets the time format for the console. The string is passed to time.Format() down the line.
	ConsoleTimeFormat string
)
View Source
var (
	// HTTPBind is defined via our toml configuration file. It is the address that HellPot listens on.
	HTTPBind string
	// HTTPPort is defined via our toml configuration file. It is the port that HellPot listens on.
	HTTPPort string
	// HeaderName is defined via our toml configuration file. It is the HTTP Header containing the original IP of the client,
	// in traditional reverse Proxy deplyoments.
	HeaderName string

	// Paths are defined via our toml configuration file. These are the paths that HellPot will present for "robots.txt"
	//       These are also the paths that HellPot will respond for. Other paths will throw a warning and will serve a 404.
	Paths []string

	// UseUnixSocket determines if we will listen for HTTP connections on a unix socket.
	UseUnixSocket bool

	// UnixSocketPath is defined via our toml configuration file. It is the path of the socket HellPot listens on
	// if UseUnixSocket, also defined via our toml configuration file, is set to true.
	UnixSocketPath        = ""
	UnixSocketPermissions uint32

	// UseragentBlacklistMatchers contains useragent matches checked for with strings.Contains() that
	// prevent HellPot from firing off.
	// See: https://github.com/yunginnanet/HellPot/issues/23
	UseragentBlacklistMatchers []string
)

"http"

View Source
var (
	RestrictConcurrency bool
	MaxWorkers          int
)

"performance"

View Source
var CLI = help{
	// contains filtered or unexported fields
}
View Source
var (
	// CurrentLogFile is used for accessing the location of the currently used log file across packages.
	CurrentLogFile string
)
View Source
var (
	// FakeServerName is our configured value for the "Server: " response header when serving HTTP clients
	FakeServerName string
)

"deception"

View Source
var Version = "dev"

Functions

func GetLogger

func GetLogger() *zerolog.Logger

GetLogger retrieves our global logger object.

func Init

func Init()

Init will initialize our toml configuration engine and define our default configuration values which can be written to a new configuration file if desired

func StartLogger

func StartLogger(pretty bool, targets ...io.Writer) zerolog.Logger

StartLogger instantiates an instance of our zerolog loggger so we can hook it in our main package. While this does return a logger, it should not be used for additional retrievals of the logger. Use GetLogger().

Types

This section is empty.

Jump to

Keyboard shortcuts

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