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

find a good geolocation service (https) #2469

Open
tessus opened this issue Feb 8, 2020 · 2 comments · May be fixed by #2503
Open

find a good geolocation service (https) #2469

tessus opened this issue Feb 8, 2020 · 2 comments · May be fixed by #2503
Assignees

Comments

@tessus
Copy link
Collaborator

@tessus tessus commented Feb 8, 2020

Joplin curently uses ip-api.com (80) as the geolocation service. Additionally it uses api.ipify.org (443) to retrieve the IP address, which is then fed into ip-api.com (80).

There were reports that the geolocation service does not always provide accurate results.

This change involves 2 parts:

  • use a more accurate API, which is free and uses https
  • maybe get rid of the separate request to api.ipify.org (443)

The files involved are:

ReactNativeClient/lib/geolocation-node.js
ReactNativeClient/lib/net-utils.js
ReactNativeClient/lib/shim.js
@tessus

This comment has been minimized.

Copy link
Collaborator Author

@tessus tessus commented Feb 9, 2020

@laurent22 I've been looking into this and here are the results:

ip-api.com is actually quite precise. I suspect the person who had an issue either used a VPN or there was a glitch in the geo database. However, I'm really concerned about unencrypted traffic on port 80. To use SSL with that provider one has to buy a pro account, which we couldn't use in Joplin anyway, because the API key would be for everyone to read in the code.

I found another provider that looks promising: freegeoip.app They allow 15,000 request per hour. Thus, even if 150 people behind a company LAN were to use Joplin, they would have to create 100 new notes per hour to reach the limit. They also support SSL out of the box.

I suggest the following: A setting where people can choose between freegeoip.app (443) (default) and ip-api.com (80).
While the setting is not absolutely necessary, it makes it easier to add or replace a geo provider in the future. (e.g. the returned json uses different keys for longitude and latitude).

Please let me know what you think. I can either get this done tomorrow or on Monday.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

@tessus tessus commented Feb 13, 2020

@laurent22 what's the plan? Is it ok to create a setting for the geo location service (it would only show up, when people check the Save geo-location with notes.

tessus added a commit to tessus/joplin that referenced this issue Feb 14, 2020
- freegeoip.app (443)
- ip-api.com (80)

removed unnecessary request to `api.ipify.org`

closes laurent22#2469
@tessus tessus linked a pull request that will close this issue Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.