Add trusted_proxies config
This commit is contained in:
parent
f2671025c8
commit
cf50063e57
|
@ -51,6 +51,7 @@ var (
|
|||
KVMaxValueSizeMB int
|
||||
UnixSocketPermissions uint32
|
||||
UseUnixSocket bool
|
||||
TrustedProxies []string
|
||||
)
|
||||
|
||||
var usage = fmt.Sprintf(`
|
||||
|
@ -271,6 +272,10 @@ func processOpts() {
|
|||
"admin.key": &AdminKey,
|
||||
}
|
||||
|
||||
stringSliceOpt := map[string]*[]string{
|
||||
"http.trusted_proxies": &TrustedProxies,
|
||||
}
|
||||
|
||||
if !strings.HasSuffix(BaseURL, "/") {
|
||||
BaseURL += "/"
|
||||
}
|
||||
|
@ -307,6 +312,9 @@ func processOpts() {
|
|||
for key, opt := range uint32Opt {
|
||||
*opt = snek.GetUint32(key)
|
||||
}
|
||||
for key, opt := range stringSliceOpt {
|
||||
*opt = snek.GetStringSlice(key)
|
||||
}
|
||||
}
|
||||
|
||||
func associateExportedVariables() {
|
||||
|
|
|
@ -31,6 +31,7 @@ func initDefaults() {
|
|||
"unix_socket_permissions": uint32(0644),
|
||||
"bind_addr": "127.0.0.1",
|
||||
"bind_port": "8080",
|
||||
"trusted_proxies": []string{"127.0.0.1"},
|
||||
},
|
||||
"data": {
|
||||
"directory": home + "/.local/share/tcp.ac/data",
|
||||
|
|
Loading…
Reference in New Issue