Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fixing AbuseIP DB update script to only include valid IPs #6

Merged

Conversation

spaaleks
Copy link
Member

The used IP DB list now contains per line comments which breaks the Caddy configuration.

E.g.:

1.0.87.120       # JP  AS18144   Enecom,Inc.
1.0.211.179      # TH  AS23969   TOT Public Company Limited
1.0.211.200      # TH  AS23969   TOT Public Company Limited
1.2.188.61       # TH  AS23969   TOT Public Company Limited

results in

remote_ip 1.0.87.120
remote_ip #
remote_ip JP
remote_ip AS18144
remote_ip Enecom,Inc.
remote_ip 1.0.211.179
remote_ip #
remote_ip TH
remote_ip AS23969
remote_ip TOT
remote_ip Public
remote_ip Company
remote_ip Limited
remote_ip 1.0.211.200
[...]

This MR fixes the issue by doing a simple regex check on 4 times 3 numbers separated by a dot.

@spaaleks spaaleks force-pushed the bugfix/ratelimiting-update-script-validate-ips branch from 0b2eb8e to 80ac5b9 Compare November 18, 2024 12:25
@spaaleks spaaleks added the bug Something isn't working label Nov 18, 2024
@christoph-bessei christoph-bessei merged commit 8ba9525 into main Nov 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants