Documentation ¶
Overview ¶
Package configs contains Readeck configuration.
Index ¶
- Variables
- func BuildTime() time.Time
- func CookieBlockKey() []byte
- func CookieHashKey() []byte
- func CsrfKey() []byte
- func ExtractorDeniedIPs() []*net.IPNet
- func GenerateKey(minLen, maxLen int) string
- func HashValue(s []byte) []byte
- func InitConfiguration()
- func JwtPk() ed25519.PublicKey
- func JwtSk() ed25519.PrivateKey
- func LoadConfiguration(configPath string) error
- func Version() string
- func WriteConfig(filename string) error
Constants ¶
This section is empty.
Variables ¶
var Config = config{ Main: configMain{ LogLevel: "info", DevMode: false, DataDirectory: "data", }, Server: configServer{ Host: "127.0.0.1", Port: 8000, Session: configSession{ CookieName: "sxid", MaxAge: 86400 * 30, }, }, Database: configDB{}, Email: configEmail{ Port: 25, }, Worker: configWorker{ DSN: "memory://", NumWorkers: max(1, runtime.NumCPU()-1), StartWorker: true, }, Extractor: configExtractor{ NumWorkers: runtime.NumCPU(), ContentScripts: []string{"data/content-scripts"}, DeniedIPs: []configIPNet{ newConfigIPNet("127.0.0.0/8"), newConfigIPNet("::1/128"), }, ProxyMatch: []configProxyMatch{}, }, Metrics: configMetrics{ Host: "127.0.0.1", Port: 0, }, }
Config holds the configuration data from configuration files or flags.
This variable sets some default values that might be overwritten by a configuration file.
Functions ¶
func BuildTime ¶
BuildTime returns the build time or, if empty, the time when the application started.
func CookieBlockKey ¶
func CookieBlockKey() []byte
CookieBlockKey returns the key used by session cookies.
func CookieHashKey ¶
func CookieHashKey() []byte
CookieHashKey returns the key used by session cookies.
func ExtractorDeniedIPs ¶
ExtractorDeniedIPs returns the value of Config.Extractor.DeniedIPs as a slice of *net.IPNet.
func InitConfiguration ¶
func InitConfiguration()
InitConfiguration applies some default computed values on the configuration.
func LoadConfiguration ¶
LoadConfiguration loads the configuration file.
func WriteConfig ¶
WriteConfig writes configuration to a file.
Types ¶
This section is empty.