Tinyproxy log level parameter fix #77
This commit is contained in:
@@ -147,7 +147,7 @@ docker run --rm --network=container:pia alpine:3.10 wget -qO- https://ipinfo.io
|
||||
| `PORT_FORWARDING` | `off` | Set to `on` to forward a port on PIA server |
|
||||
| `PORT_FORWARDING_STATUS_FILE` | `/forwarded_port` | File path to store the forwarded port number |
|
||||
| `TINYPROXY` | `on` | `on` or `off`, to enable the internal HTTP proxy tinyproxy |
|
||||
| `TINYPROXY_LOG` | `Info` | `Info`, `Warning`, `Error` or `Critical` |
|
||||
| `TINYPROXY_LOG` | `Info` | `Info`, `Connect`, `Notice`, `Warning`, `Error` or `Critical` |
|
||||
| `TINYPROXY_PORT` | `8888` | `1024` to `65535` internal port for HTTP proxy |
|
||||
| `TINYPROXY_USER` | | Username to use to connect to the HTTP proxy |
|
||||
| `TINYPROXY_PASSWORD` | | Passsword to use to connect to the HTTP proxy |
|
||||
|
||||
@@ -7,6 +7,10 @@ import (
|
||||
const (
|
||||
// TinyProxyInfoLevel is the info log level for TinyProxy
|
||||
TinyProxyInfoLevel models.TinyProxyLogLevel = "Info"
|
||||
// TinyProxyConnectLevel is the info log level for TinyProxy
|
||||
TinyProxyConnectLevel models.TinyProxyLogLevel = "Connect"
|
||||
// TinyProxyNoticeLevel is the info log level for TinyProxy
|
||||
TinyProxyNoticeLevel models.TinyProxyLogLevel = "Notice"
|
||||
// TinyProxyWarnLevel is the warning log level for TinyProxy
|
||||
TinyProxyWarnLevel models.TinyProxyLogLevel = "Warning"
|
||||
// TinyProxyErrorLevel is the error log level for TinyProxy
|
||||
|
||||
@@ -30,10 +30,10 @@ func (p *paramsReader) GetTinyProxyLog() (models.TinyProxyLogLevel, error) {
|
||||
return models.TinyProxyLogLevel(s), err
|
||||
} else if len(s) != 0 {
|
||||
p.logger.Warn("You are using the old environment variable PROXY_LOG_LEVEL, please consider changing it to TINYPROXY_LOG")
|
||||
s, err = p.envParams.GetValueIfInside("PROXY_LOG_LEVEL", []string{"info", "warning", "error", "critical"}, libparams.Compulsory())
|
||||
s, err = p.envParams.GetValueIfInside("PROXY_LOG_LEVEL", []string{"Info", "Connect", "Notice", "Warning", "Error", "Critical"}, libparams.Compulsory())
|
||||
return models.TinyProxyLogLevel(s), err
|
||||
}
|
||||
s, err = p.envParams.GetValueIfInside("TINYPROXY_LOG", []string{"Info", "Warning", "Error", "Critical"}, libparams.Default("info"))
|
||||
s, err = p.envParams.GetValueIfInside("TINYPROXY_LOG", []string{"Info", "Connect", "Notice", "Warning", "Error", "Critical"}, libparams.Default("Connect"))
|
||||
return models.TinyProxyLogLevel(s), err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user