Legacy GeoLite City provides incorrect country - geoip

(I'm using MaxMind's databases)
I'm using SourceMod which is a game server management addon for Source Engine, which provides plugin support.
Two months ago, I have added a plugin that does the following:
Check if the connecting user is from Israel. (Where I host the server, you're required to speak Hebrew in order to play)
If the user is not from Israel, check if his IP address is whitelisted. If it isn't, disallow the connection.
Now recently, one of the Israeli ISPs got new IP addresses (all starting with 77.138.*.*) which GeoLite shows as if they're French. So far I've got to whitelist 12 IP addresses because of this.
SourceMod has a third-party API that lets me use GeoLite2 City, GeoLite City (free ones) and GeoIPCity/GeoIPISP if I own them. For now I've tried using both of the free databases, sadly, no success.
I know MaxMind will update GeoLite again in 6 days. What I'm afraid of, is that I'm not going to achieve anything because MaxMind doesn't offer support for GeoLite, so I might be stuck with outdated databases that provide incorrect information.
What is a recently updated alternative that uses the same format as GeoLite (either legacy or new), or, is it 100% confirmed that those incorrect locations for IPs will be updated soon for GeoLite? I really don't feel like spending cash monthly just for GeoIP.

Related

Firebase migration for China [duplicate]

I am now developing a social application. But recently I noticed that Firebase is blocked in China. So I want to make sure whether firebase can be used in China?
* EDIT 24 January 2020 *
Some of the information here might be out of date.
Firebase has a China service at https://firebase.google.cn/ which is not blocked in the PRC. (Thanks to #c-an for bringing this up.)
That said, *.google.com and *.googleapis.com are still blocked in China. I'll change/update this as I get more information.
Original Answer
For now Firebase is blocked and can't be used in China, along with other Google services, because the PRC has blocked all URIs with *.google.com and *.googleapis.com.
This also means, for example, that the Play app store can't be accessed from China. If you don't know what's going on between Google and the PRC, here's a primer.
Also, according to Chinese law, user data of Chinese citizens must be stored inside of the PRC. You might be able to get away with only addressing this once you have a significant number of users, but the trend has been for the CCP to crack down more and more on foreign information, even busting VPNs and declaring them illegal despite complaints of academics who say that they need, you know, real information.
As we're now in the run-up to the 19th Party Congress this autumn, we can expect the situation to get worse before it gets better. Maybe 2018 will leave room for relaxation?
For now, very sadly, forget anything Google in China, and be prepared to store user data of PRC citizens on servers located inside the Great Firewall. Also be prepared for seemingly random degradations of your service within China, or to be blocked altogether, along with these other blocked services.
Update 2017-11-23: The 19th Party Congress has come and gone and, if anything, Google services look less likely than ever to become available in China. The great firewall is likely to continue to be strengthened as the Chinese Communist Party extends its role into corporations, and foreign firms are generally disadvantaged.
Update 2018-08-05: Google plans to open a censored version of its search in China, according to leaked documents. It seems reasonable to assume that if a censored Google Search becomes available in the PRC, then Firebase and other Google Cloud products may as well. The censored search plan, code-named Dragonfly, has reportedly been in the works since December 2017, possibly a result of meetings that month between Google CEO Sundar Pichai and an unnamed top Chinese official when they met at the World Internet Conference in Wuzhen, China, where PRC General Secretary and President Xi Jinping gave a speech.
Update 2018-12-23: It appears that Google's Project Dragonfly is now on hold if not outright abandoned. This implies that the outlook for Firebase in China has worsened.
You can build your own Rest API server outside of China, and make the server talks to Firebase rest api endpoints of Realtime db or Authentication, https://firebase.google.com/docs/reference/rest/database. So you web app talks to your rest api server (accessible from China), and your rest api server talks to Firebase.
The answer is NO :
Using a huge part of Firebase services, I contacted the support, this is the answer :
I'm glad you are considering Firebase for your project. However, in
accordance with current U.S. policies, it is not possible to use
Firebase from within certain countries. For more information about
these restrictions, please refer to the U.S. Department of the
Treasury website. The current list is of blocked countries is listed
here. If you have end-users located within China, it's quite difficult
to access Firebase there since the use of Firebase requires Google
Play Services, which most of the devices in China don't have. We
understand that access to our products has been problematic from
within mainland China. We believe it may have been caused by
networking conditions in China, rather than Google's own services.
Since access to services is determined by the respective country's
government and they don't report to Google, the Transparency Report is
the most authoritative it can be.
I just tested and I am able to access my realtime database hosted on the Singapore region in China mainland. No need to modify anything. Whatever works overseas, works in China. Tested in Beijing.
Facing the same problem, if you are in china, install Astrill VPN and change from openweb to StealthVPN, connect to a server like USA for china one and login to firebase. It will work successfully.

How can I set up a from home hosted website without buying a static IP?

So I know that somesites allow you to host web content for you, but they can start to charge an arm and a leg based on how much you want to update it, how much you have, and other things. Pretty much what I want to do is host a personal site for and about me. Essentially access things I need like RPG characters and references, cosplay stuff, gaming stuff, and all that ilk.
I'm going to be investing in a small box that is more or less always on and always online, unless I loose internet for some reason or have to restart a router etc, but I'm running into the issue of I need to buy a static IP which is around $60 a month. That's $60 I don't have or want to spend on a little pet project. And before you suggest or ask, no I don't want just a site like blogger or w/e to do it for me.
My question is, and I know that I've been told this before by a friend I just can't seem to remember what he said, is there a way this can be done without using a static IP address and hosting the site from home still?
Oh I should also add that I'd eventually like this to be something I can host my own RESTful webservice on for small little one off personal apps I'd use for myself too.
Actually you live in an elastic cloud century, there is no need to buy any static IP. You can try these things as follows.
Amazon Web Service. You can get 1 year free trial, EC2 is really wonderful to host whatever you want.
Openshift. You can freely create 3 gears to host your application. The environment is very easy to configure. If you want
to deploy symphony, laravel and some other frameworks, openshift
should be the best choice.
Free web service.
You could use a Dynamic DNS service. You create an account (it often costs money, but there are some plans where it's free if you log in every month), and then install a piece of software on a computer/connect it to your router, and you get a subdomain like network63.example.com, which you can have a CNAME in your Domain's dns records to. Then whenever your IP changes, the software detects it and sends a request to their servers to update the record. I'm actually considering starting one myself. These are generally a lot cheaper than getting another IP address.
I host a few things from home (A gitea server and an ownCloud server), and I haven't needed this as although I don't have a static IP, it doesn't change very often, and it's easy enough to update the record after my router restarts or there is an outage (very rare), although this probably varies by ISP.

How to find historical geolocation for an IP address, perhaps using maxmind?

I was wondering if there is any way to find historical geolocation IP information? Everything I've been able to find discusses current data, but I've been unable to find any way to query a service or DB to, for example, look for information on an IP from a few years ago.
I found this article titled 'How to perform historical IP geolocation lookups' and it does mention maxmind as a potential tool for availability of historical versions but it doesn't mention how to access this data.
Looking through the maxmind api docs I can't seem to find any way to query by date either.
How could one go about finding the location of an IP at a given time in the past? (Extreme accuracy not necessary, an example would be Find the country of this IP address in 2012)
Perhaps there is an easier solution, but it seems that you can download quite a few (not all) old versions of the MaxMind database via the Wayback Machine. For example, this shows the snapshots they have of the binary database. For the CSV files, you'd need to look up the snapshots for specific filenames, and manually change the filenames to the desired 1st-of-month date. For example, here's one.
That said, these posts seem to suggest that IP ranges aren't reassigned to different geographies very often--might not be necessary to worry about getting old versions of the database:
https://serverfault.com/questions/286025/historical-ip-geo-location
https://serverfault.com/questions/59167/how-often-do-ip-blocks-get-reassigned-to-different-regions

Is there a Software package or API available for street address completion?

Does anyone know of a service (free or paid) or software that I can host for street address completion? I'm interested in providing a list of possible completions for an address string, not geocoding an address.
For example, if a user types "120 An", the service might provide 10 possible completions for that address string (i.e. "120 Anne Way NYC NY, 120 Anteater St. Seattle WA... etc.")
Ideally I would be able to constrain the list of returned addresses to a particular region.
Openstreetmaps had "Name finder" a while ago but it doesn't look like it exists anymore.
I should mention I'm open to hosting the service myself. I believe I can extract the list of region specific addresses from Openstreetmap data, I need an API to put them in though...
There is a Google Places autocomplete API .
SmartyStreets just finished a new autocomplete feature, and it's totally free with an API subscription (which is also free, to a point). I work at SmartyStreets and helped to develop it.
You can put it on your website with the jQuery plugin. It works very well for US addresses. For international, Google might be your best bet, where license restrictions don't get in the way.

how to get country name and/or code by IP address?

Sorry for so noobish question but how can I do it with C++? I need to get country names and their 2-letter or 3-letter ISO codes (or whatever it's called) using a given IP address. Is there any way to do this easily?
The only two ways I found are to use GeoIP C library or to download a free database but is there something more dynamic? I mean, is there a free web-service with up-to-date db I can utilize for my purpose using curl or something?
Thanks in advance.
MaxMind.com exposes a set of web services for geolocation. They're not free, but cheap per lookup.
One of my clients uses their city-level lookup service, with each result cached for a reasonable period (from memory, 2 or 3 weeks), since IP address blocks don't change location that often.
The application also counts the number of actual lookups to send an admin notification when the number remaining in the subscription gets low, so it can be topped up manually.
I also use the downloadable database in several applications, with a scheduled update process to keep it up to date.
http://www.hostip.info provides an API.