Fix #265 and refers to #256

- Logs a message about auth failure for PIA v4 servers
This commit is contained in:
Quentin McGaw
2020-10-22 00:36:12 +00:00
parent bf92008e45
commit d4813ba21c
2 changed files with 7 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ func PostProcessLine(s string) (filtered string, level logging.Level) {
level = logging.ErrorLevel
case s == "openvpn: Initialization Sequence Completed":
return color.HiGreenString(s), logging.InfoLevel
case s == "openvpn: AUTH: Received control message: AUTH_FAILED":
filtered = s + "\n\n (IF YOU ARE USING PIA V4 servers, MAYBE CHECK OUT https://github.com/qdm12/gluetun/issues/265)\n" //nolint:lll
level = logging.ErrorLevel
default:
filtered = s
level = logging.InfoLevel

View File

@@ -104,6 +104,10 @@ func Test_PostProcessLine(t *testing.T) {
"openvpn: Initialization Sequence Completed",
"openvpn: Initialization Sequence Completed",
logging.InfoLevel},
"openvpn auth failed": {
"openvpn: AUTH: Received control message: AUTH_FAILED",
"openvpn: AUTH: Received control message: AUTH_FAILED\n\n (IF YOU ARE USING PIA V4 servers, MAYBE CHECK OUT https://github.com/qdm12/gluetun/issues/265)\n", //nolint:lll
logging.ErrorLevel},
}
for name, tc := range tests {
tc := tc