Ladsgroup / CheckUserHelper

Javascript gadget to help checkusers
GNU General Public License v3.0
2 stars 2 forks source link

Calculate CIDRs for IPs #4

Open Huji opened 4 years ago

Huji commented 4 years ago

For each IP in the results, the CIDR should be fetched (we already have a Labs tool with an API). Show CIDRs instead of all of those IPs.

Huji commented 4 years ago

This version of my copy of the tool can retrieve the CIDRs. The problem is it will repeatedly query various IPs from the same CIDR. What we need is a Patricia trie of CIDRs (similar to what this python script uses). I'm guessing that there are existing libraries we could reuse but I am open to writing one as well (in case you don't want to depend on an external library).

Huji commented 4 years ago

As of this version, my copy of the tool does all the async calls. Note that it does not use the toolforge API anymore, because it is slow. Instead, it uses RIPE's API which is free and much faster.

@Ladsgroup can you please rewrite the copyText function such that it can generate a new table once CIDR data is pulled?

Ladsgroup commented 4 years ago

My plate is pretty full at the moment. I can take a look at Friday onwards (given that it's a holiday here). Would that work?

Huji commented 4 years ago

Sure.

Huji commented 4 years ago

Any chance you could review this? The upstream code is diverging ....

Ladsgroup commented 4 years ago

I really want to help if the drama in fawiki lets me... Let's start with rebasing your changes on top of the master. Let me make a PR

Ladsgroup commented 4 years ago

Houston, we have a problem. Making requests to third party websites violates privacy policy and it will be blocked by CSP (hopefully soon). It's not that it violates the users privacy by sending them IPs of users we check (because IPs alone are useless) but this violates privacy of our CUs. Imagine you know how to attack RIPE (or be a middleman), you will have referrer (which which wiki you are CU at), the IP, and the timestamp of the request and easily say find out who's behind a CU username. If I set up a similar service in AWS/Digital Ocean, I guarantee that I can get IP of all CUs. We have to stick to labs, either making it faster or bug people until they make it fast.

Ladsgroup commented 4 years ago

I added #7 and rebased it on top of master which luckily was a clean rebase \o/

Huji commented 4 years ago

I will review the rebased version. I agree with switching back to labs. Gladly, https://github.com/whym/whois-gateway/issues/11 was fixed so we can go back to using it.

Huji commented 4 years ago

I will work on this once the patch for #8 and #9 is merged.