From 7f527bf4d277de0ea76b2403c6d4f58a938cf8d5 Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 2 Oct 2019 09:06:24 +0800 Subject: [PATCH] update ot-recorder --- ot-recorder/README.md | 58 ++++++++++++++++++++++++---------- ot-recorder/docker-compose.yml | 4 +-- 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/ot-recorder/README.md b/ot-recorder/README.md index a3f37fe..9f8c028 100644 --- a/ot-recorder/README.md +++ b/ot-recorder/README.md @@ -7,29 +7,53 @@ location data published via MQTT (or HTTP) by the OwnTracks apps. ## docker-compose.yml ```yaml -ot-recorder: - image: vimagick/ot-recorder - ports: - - "8083:8083" - volumes: - - ./data:/var/spool/owntracks/recorder/store - environment: - - OTR_HOST=iot.eclipse.org - - OTR_PORT=8883 - - OTR_USER=username - - OTR_PASS=password - - OTR_CAFILE=/etc/ssl/certs/DST_Root_CA_X3.pem - - OTR_TOPICS=owntracks/# - - OTR_BROWSERAPIKEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - - OTR_OPTIONS=--qos 0 - restart: always +version: "3.7" + +services: + + recorder: + image: vimagick/ot-recorder + ports: + - "8083:8083" + volumes: + - ./data:/var/spool/owntracks/recorder/store + environment: + - OTR_HOST=iot.eclipse.org + - OTR_PORT=1883 + - OTR_USER=username + - OTR_PASS=password + - OTR_TOPICS=owntracks/# + # OTR_CAFILE=/etc/ssl/certs/DST_Root_CA_X3.pem + # OTR_BROWSERAPIKEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + # OTR_OPTIONS=--debug + restart: unless-stopped + + frontend: + image: owntracks/frontend + ports: + - 8080:80 + environment: + - SERVER_HOST=recorder + - SERVER_PORT=8083 + restart: unless-stopped ``` -:warning: Some variables don't work (`OTR_QOS`) as [document][3] said. +:warning: Some variables don't work (`OTR_QOS`, `OTR_CAFILE`) as [document][3] said. You can pass any options to process via `OTR_OPTIONS` environment variable. Click [this][2] to generate a google map api key. +## up and running + +```bash +$ docker-compse up -d +$ tree data +$ docker-compose exec recorder bash +>>> ocat --list +{"results":["foo"]} +>>> ocat --user foo --device bar +``` + [1]: https://github.com/owntracks/recorder [2]: https://developers.google.com/maps/documentation/javascript/?authuser=1 [3]: https://github.com/owntracks/recorder#configuration-file diff --git a/ot-recorder/docker-compose.yml b/ot-recorder/docker-compose.yml index 33dd5b9..698b2ad 100644 --- a/ot-recorder/docker-compose.yml +++ b/ot-recorder/docker-compose.yml @@ -10,11 +10,11 @@ services: - ./data:/var/spool/owntracks/recorder/store environment: - OTR_HOST=iot.eclipse.org - - OTR_PORT=8883 + - OTR_PORT=1883 - OTR_USER=username - OTR_PASS=password - OTR_TOPICS=owntracks/# - - OTR_CAFILE=/etc/ssl/certs/DST_Root_CA_X3.pem + # OTR_CAFILE=/etc/ssl/certs/DST_Root_CA_X3.pem # OTR_BROWSERAPIKEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # OTR_OPTIONS=--debug restart: unless-stopped