Macker

Two processes: the client reads GPS fixes from gpsd in the car, and the VPS server receives them and serves a live location page. Requires Go 1.27 and a running gpsd on the car.

From this repository on the VPS:

go build -o /tmp/macker-server ./server
/tmp/macker-server -ingest :2948 -http :8080

On the car, from this repository:

go build -o /tmp/macker-client ./client
/tmp/macker-client -addr YOUR_VPS_HOST -port 2948 -interval 5s -batch 25

Open http://YOUR_VPS_HOST:8080. Allow the car to reach TCP port 2948 and the browser to reach the web port. For operation across the public internet, use a private tunnel (such as WireGuard) between car and VPS and bind -ingest to the VPS tunnel address. Put the web listener behind an HTTPS reverse proxy with authentication if the location should be private. The application's TCP ingestion and web endpoints have no built-in authentication or encryption.

The browser polls every two seconds. Speed comes from gpsd in metres per second and is shown in mph and km/h. The current gpsd dependency represents omitted speed as zero, so a GPS report without speed can appear stationary. Reports without a position fix are ignored. “Last update” uses the GPS fix time, falling back to server receipt time when absent. After 30 seconds, the page marks the fix stale and hides current speed. Delayed timestamped fixes cannot replace newer fixes.

The map shades an estimated GPS uncertainty circle around each fix. Its radius is hypot(LatErr, LongErr) in metres, enclosing the reported north–south and east–west error ranges. The circle moves and resizes with each fix and is hidden when either estimate is missing, zero, negative, or non-finite. A stale fix retains its last reported circle; it does not predict movement since the fix. This is an estimate, not a guaranteed confidence boundary: gpsd notes that error confidence varies by receiver.

The server retains only the latest fix in memory; a restart clears it. There is no route history or durable client queue. The client compresses each JSON batch into an in-memory ZIP containing points.json, then sends the ZIP bytes inside the existing gob framing. The server unzips in memory, validates the archive and checksum, and accepts at most 4 MiB compressed and 16 MiB expanded. No temporary files are created. Upgrade the server first: it also accepts legacy uncompressed JSON batches. Then rebuild and restart the client to enable compression. Browser access to unpkg.com and tile.openstreetmap.org is required for the map. Map integration follows the Leaflet quick start; OpenStreetMap attribution is included.

Checks:

go test -race ./client/... ./server/... ./datapoint/...
S
Description
Matrix-integrated car tracker
Readme GPL-3.0
35 MiB
Languages
Go 83.6%
HTML 14.6%
Shell 1.8%