Docker container for your home server, shell script for your clients. Geoclue2 can be extremely accurate with WiFi-based location tracking (20m range).
- Clone the repository onto your server
- Adjust values in .env and docker-compose.yml, if desired. You should probably add your network/proxy configuration now.
docker compose builddocker compose up -d(may need to restart web container once)- Install geoclue on client computer
- Download the ClientPOST.sh script and
chmod +xit. You may need to switch (guide) the wifi provier to beacondb in/etc/geoclue/geoclue.confnow that Mozilla Location Services has closed. Consider contributing to the beacondb project with nearby device information. Google Maps API is another option, but seems like it's paid after a certain number of requests each month. - Execute the script (preferably, with a cron job) to send location data to server
Test your server configuration is working with the following command:
curl -X POST https://geo.example.com/location \
-H "Content-Type: application/json" \
-d '{
"latitude": "20.123456",
"longitude": "-20.123456",
"accuracy": "20.0",
"speed": "0.5",
"heading": "180.0",
"timestamp": "2024-09-20 21:22:23"
}'