+ config: "web_session_ttl" setting

This commit is contained in:
Simon Zolin
2019-11-12 14:23:00 +03:00
parent 0d4dce5c79
commit c9a6e4e018
4 changed files with 25 additions and 18 deletions

View File

@@ -91,6 +91,10 @@ type configuration struct {
Language string `yaml:"language"` // two-letter ISO 639-1 language code
RlimitNoFile uint `yaml:"rlimit_nofile"` // Maximum number of opened fd's per process (0: default)
// TTL for a web session (in hours)
// An active session is automatically refreshed once a day.
WebSessionTTLHours uint32 `yaml:"web_session_ttl"`
DNS dnsConfig `yaml:"dns"`
TLS tlsConfig `yaml:"tls"`
Filters []filter `yaml:"filters"`
@@ -210,6 +214,8 @@ func initConfig() {
Transport: config.transport,
}
config.WebSessionTTLHours = 30 * 24
if runtime.GOARCH == "mips" || runtime.GOARCH == "mipsle" {
// Use plain DNS on MIPS, encryption is too slow
defaultDNS = []string{"1.1.1.1", "1.0.0.1"}