Open delameter opened 1 year ago
um...
dup-traefik | IPChecking: 2023/06/08 20:21:34 restricted.go:51: ║24║192.168.1.3 is not a valid IP or IP/Net
dup-traefik | IPChecking: 2023/06/08 20:21:34 restricted.go:51: Error: ║24║192.168.1.3 not valid
dup-traefik | IPChecking: 2023/06/08 20:23:05 restricted.go:51: ║24║1.1.1.1 is not a valid IP or IP/Net
dup-traefik | IPChecking: 2023/06/08 20:23:05 restricted.go:51: Error: ║24║1.1.1.1 not valid
maybe I'm doing something wrong
Hello @delameter,
Thanks for your interest in this Traefik plugin!
This is not due to how this Plugin parses IPs, but more on how Traefik deserialize yaml. Instead of using an IP list, can you try just to give it as a string list?
From:
whitelist:
ip:
- 192.168.1.0/24
To:
whitelist:
ip: 192.168.1.0/24
Does that fixes your issue?
That helped, thanks.
Maybe consider updating the docs then? I took the configuration example from there and this one also didnt work properly.
testData:
blacklist:
files:
- "tests/test-ipfile.txt"
ip:
- "::1"
- "127.0.0.1"
Yes, you are right. This should be fixed!
Hello. Plugin's config reading fails with an error "not valid".
Prerequisites:
Traefik version 2.9.5 fail2ban version v0.6.6
middlewares.yml:
The result:
Suggestions
After looking through
ipChecking.go
I can assume that the problem is around line 46 -- according to docs,net.ParseIP
does not expect a subnet in an input string, that's whatnet.ParseCIDR
is for.