HomeITAdmin / nextcloud_geoblocker

GNU Affero General Public License v3.0
39 stars 2 forks source link

Login via Spanish SIM refused: "from blocked country 'US'" #102

Closed anibtro closed 1 year ago

anibtro commented 2 years ago

Situation: My mobile is a dual SIM Android phone with SIM1: German (Vodafone Germany) and SIM2: Spanish (Vodafone Spain). Nextcloud 24.01 is running on Ubuntu server as snap. Geoblocker ist set to block all countries except Germany (DE and Spain (ES). Provider is RIRData (local).

Problem: I'm in Germany at the moment. When SIM1 is activated as data SIM, everything works well. When SIM2 is activated as data SIM, Geoblocker refuses the access to Nextcloud News app, telling the login was from US. Which is untrue, since SIM2 is roaming with Vodafone Germany. But even in Spain it should work, since ES is on the whitelist. Strange thing is, this only happens with Andoid "Nextcloud News" app. All other apps work well with SIM1 and SIM2.

Thanks in advance for any ideas or help.

HomeITAdmin commented 1 year ago

Hi, this really sounds strange. Anything different with the Nextcloud News configuration. Maybe using a proxy or VPN only for that? The Geoblocker app is just hooked into the Login flow, not caring, which app it is using. Do not see a point at the moment, where this could be coming from.

For the wrong country it would be interesting, if the RIRData is really saying, that you IP was from US or if the algorithm finding the IP in the Data is wrong. Could you check this?

anibtro commented 1 year ago

@HomeITAdmin

First of all, many thanks for your reply and sorry for my late reaction. I was on holidays for 10 days and offline. :-)

Second, I made a mistake: It's not "Nextcloud News", but Android "Notes"-App that seems to cause the errors.

Third, I decided to temporarily switch off GeoBlocker. I'll turn it on again and retry when I have more time to investigate.

Fourth, "For the wrong country it would be interesting, if the RIRData is really saying, that you IP was from US or if the algorithm finding the IP in the Data is wrong. Could you check this?" --> I'd very much like to help and check this, but don't know how?

Again, many thanks and keep up the good work!

HomeITAdmin commented 1 year ago

Hi, you must look if the ipv4 or ipv6 block containing your IP can be found in the American file https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest If it should be in Germany or Spain it should be in the Europe file https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-latest If you give me your IP, I can also help with that.

anibtro commented 1 year ago

So I activated it again and tested. Again the same behaviour: When my spanish SIM ist active, the access from Android to my private Nextcloud via apps as well as via Chromium is refused by GeoBlocker, saying it was an attempt from US. I looked into both of your links, but my spanish ipv4 is not in either of them. As soon as I switch to my german SIM everything works as intended. I updated to the new version that came today, but still the same result. 1 Spanish IP 2 Geoblocker-Settings 3 Fehlerprotokoll 4 Talk-Login 5 Chromium-Login

HomeITAdmin commented 1 year ago

Hi, that is interesting. Looks like RIR data is really wrong here. The ip block that address is part of is assigned to the US since 2012: arin|US|ipv4|47.60.0.0|262144|20120515|allocated|63328e60229dd08ae554d530b8d987fd

Maxmind is assigning this IP to Spain. Looks like they have better information.

So you could switch to Maxmind to solve the issue. The app is just an interface to the data provider. Not much that I can do if the data is wrong. :-(

anibtro commented 1 year ago

So RIR data appears to be faulty. That's a pity. :-( The Maxmind-install-procedure is too complicated for my level of knowledge, as well as the others. So I'll skip Geoblocker. Thanks anyway for investigating and for your help.