config

package
v0.4.3-beta Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

This is the whole configurations needed for the server-manager to run. It includes the servers, and variables.

Index

Constants

View Source
const (
	// SessionCookieName is the name of the cookie, the session id will be stored in.
	// Using this to make sure the cookies are not named explicitly to avoid from adavasaries
	// attempt of stealing cookies.
	SessionCookieName string = "lothoneId"

	// SessionPublic is the value of the values that is stored as the public session used for
	// logining in for and such. Value of NaN is consider public session for session id keys.
	SessionPublic string = "NaN"

	// Name of the form field the csrf token will be.
	CSRFFormFieldName string = "token"

	// Name of the header the csrf token will be stored in.
	// Using this to make sure the cookies are not named explicityly to avoid from advasaries
	// attempt of stealing cookies.
	CSRFHeaderFieldName string = "token"

	// Maximum allowed failed attempts for user authentications.
	MaxFailedAttempts int = 5

	// version number of this server.
	Version string = "v0.4.3-beta"
)

Variables

View Source
var (
	WebHost          *string
	WebHostRegion    *string
	WebHostIP        *string
	Admins           *string
	WebPort          *string
	WebCert          *string
	WebKey           *string
	V2rayPort        *string
	UserFile         *string
	ConfigFile       *string
	SessionDuration  *int
	LockOutDuration  *int
	GotifyServer     *string
	GotifyAPIKeys    []string
	TemplateBasePath string = "web/templates/"

	CsrfSecret      string
	CsrfSecretBytes []byte
)

Functions

func InitEmbedTemplates

func InitEmbedTemplates() (*template.Template, map[string]*template.Template)

Initialize templates from embedded filesystem

func InitHTTPSServer

func InitHTTPSServer() (*http.ServeMux, *http.Server)

InitServer initizlie the HTTPS server returning a multiplexor and the server

func InitHTTPServer

func InitHTTPServer() (*http.ServeMux, *http.Server)

InitServer initizlie the HTTP server returning a multiplexor and the server that will run on port 80

func InitStaticServer

func InitStaticServer() http.Handler

Initialize static file server from embedded filesystem

func InitTemplates

func InitTemplates() map[string]*template.Template

initTemplates function is for initializing the configured templates and storing it inside a map and return it

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳