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

fix #463 in HostlistsRegistry: remove internal IPs #1646

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

Sergey-Lyapin
Copy link
Contributor

@Alex-302
Copy link
Member

Alex-302 commented Mar 7, 2024

It is related to #1224 and should be handled by HostlistCompiler

@Sergey-Lyapin
Copy link
Contributor Author

@Alex-302
But can we exclude these rules temporarily until that task is completed?

@Alex-302
Copy link
Member

Alex-302 commented Mar 11, 2024

Better use regexps.
I created few regexps for private IP ranges:
https://regex101.com/r/eW4OBB/1
https://regex101.com/r/kGYkDI/1

! 10.0.0.0 – 10.255.255.255
(?:^\|\|?|^)(10\.[\d\.*]+)\|{0,1}
! 127.0.0.0 – 127.255.255.255
(?:^\|\|?|^)(127\.[\d\.*]+)\|{0,1}
! 172.16.0.0 – 172.31.255.255
(?:^\|\|?|^)(172\.(?:1[6-9]|2[0-9]|3[0-1])\.[\d\.*]+)\|{0,1}
! 192.168.0.0 – 192.168.255.255
(?:^\|\|?|^)(192\.168\.[\d\.*]+)\|{0,1}

Note - in exclusions.txt expressions must be wrapped - /regexp/

You can add test rules and run local build to check result.

@AdamWr @piquark6046 Please also take a look, maybe regexps can be improved.

@piquark6046
Copy link
Member

#1646 (comment)

https://regex101.com/r/qXOcCP/1
Is the above case included?

@Alex-302
Copy link
Member

Is the above case included?

What is it?) Just invalid IP?

@AdamWr
Copy link
Member

AdamWr commented Mar 11, 2024

If I'm not wrong, rule like this:

||10.32.17.182espn.hb.tt.omtrdc.net^

will be also excluded by this regex, or not?

If so, maybe something like this:

(?:^\|\|?|^)(10\.[\d\.*\^\|]+)(?:\|\^){0,1}$

can be used?

@piquark6046
Copy link
Member

piquark6046 commented Mar 11, 2024

#1646 (comment)

{0,1} can be replaced with ?.

@Alex-302
Copy link
Member

@piquark6046 replaced. In general ok?

@piquark6046
Copy link
Member

#1646 (comment)
I think so.

@Alex-302
Copy link
Member

@Sergey-Lyapin Please update PR according to #1646 (comment)

@Sergey-Lyapin
Copy link
Contributor Author

@Alex-302 updated

@Alex-302 Alex-302 merged commit fb39cd8 into master Mar 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants