2023-03-30 20:06:58 +03:00
2023-03-24 16:29:39 +02:00
2023-03-01 11:41:01 +02:00
2022-11-17 22:23:40 +02:00
2022-09-29 22:25:52 +02:00
2023-03-30 20:06:58 +03:00
2023-03-24 16:29:39 +02:00
2023-03-24 16:29:39 +02:00
2023-03-30 20:06:58 +03:00

Offline Location Service

A prototype HTTP location service with Mozilla Location Service (MLS) compatible API. Not a web service, but a device-local server with caching databases and the aim of minimizing network access and information leakage. Designed to be run on Linux with GeoClue but may also work on other platforms.

Requirements

Python 3.11 (for asyncio cancel scopes). See requirements.txt for module requirements.

Data sources

Currently OLS can use data from the following sources:

  • Wigle.net wifi and cell location backend with a local database cache and offline location resolution for cache hits. API keys are required, the free API keys unfortunately allow only a low number of daily queries.
  • Pass-through web backend to MLS or Google geolocation API. These need API keys.
  • Offline cell id database with data from the likes of opencellid.org and MLS cell ID database

Obsolete:

  • Offline M8B file backend. Unfortunately the minimum resolution here is 1 km and the M8B data available from wigle.net is very old.

Installation

Packages are currently not available. You can run OLS from the source tree as a Python module

python3 -m ols -d debug -C ols.toml

Alternatively, you can make a local install from the source tree with pipx

pipx install ./

The ols executable should then be at $HOME/.local/bin.

For permanent use, it's recommended to run OLS as a systemd user unit (or with superd). See the example service file ols/data/ols-example-user.service in sources.

Configuration and usage

The recommended setup is the clustering locator with the wigle.net wifi and cell resolver. The example config at ols/data/ols-example-conf.toml does this. You need to add the apiuser and apitoken from your wigle.net account.

Geoclue configuration

In order to make Geoclue use results from OLS instead of MLS, the configuration file at /etc/geoclue/geoclue.conf needs to be edited to make the wifi source URL point to the local OLS server. These lines should work with the default port configuration:

[wifi]
enable=true
url=http://localhost:8088/v1/geolocate

The Geoclue demo application can be now used to test the locator:

/usr/libexec/geoclue-2.0/demos/where-am-i -a 6

If you are running OLS with the debug logging enabled (-d debug), OLS should now output a lot of log messages and the demo app should print your location.

Description
Languages
Python 100%