Hi
I have been playing around with OwnTracks (OT), and have managed to successfully set up Recorder and a FrontEnd using HTTP mode, using a Portainer stack (EVERYTHING works.
[Portainer stack at the END of my message if anybody wants to use it]
After installing the Google phone app (Pixel6Pro), I pointed it to http://my_internal_ip:8083/pub
, and just like magic it stared recording my location! (Everything works!)
I then installed the Hubitat app + driver, did the OAUTH thing, got my Hubitat URL access token, created a location, and changed to phone app to point to the Hubitat URL. And just like magic I had a new presence device! (Everything works!)
Now (finally) for my question...
I have taken a look at @bptworld's app [Beta] OwnTracker - Map your location with OwnTracks!. I did NOT implement it. Right now, what puts me off it, is:
- Bryan is no longer supporting/developing it (not an issue if something is rock solid)
- But mostly because the Google maps API costs are apparently prohibitive (based on the comments in that app's post thread)
- And to a lesser degree, I LIKE the front-end from my container!
THE MILLION DOLLAR QUESTION IS HOW DO I UPDATE BOTH ENDPOINTS AT THE SAME TIME???
Well, out of the box it is not doable with the phone client... BUT, BUT, but
- this app, the Hubitat OwnTracks Presence app/device, already gets the exact same packet the native recorder would get, in other words, all the info is already available...
So, what would it take to do a POST request from the hub [read: this app], using the exact same packet received, back to http://my_internal_ip:8083/pub
?
- There is a DISTINCT security advantage in doing so... I would NOT need to open any ports on my router, NOT do any forwarding, or have a need for something like a reverse proxy!! Everything is internal to my system, as the phone app already securely communicates with the hub, and the Hub and the Recorder are both behind my firewall [read: internal network]
Note: I am not a programmer. To me, Groovy is something that happened in the 70's. But I did look at the code, and eveything appears to be already there to make a POST happen. I just don't know the how-to's.
Any enterprising folks out there want to implement a change? I'll be the guinea-pig...
Thanks
J
Portainer Container:
---
version: '3'
services:
#https://www.reddit.com/r/selfhosted/comments/raade4/quick_owntracksrecorderindocker_dummies_guide/
owntracks-recorder:
container_name: otrecorder
image: owntracks/recorder
#command: "--port 0" # Seems to be needed to disable MQTT # Old method, do not use.
environment:
- OTR_PORT=0 # disables MQTT
- TZ=America/Edmonton
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/lib/docker/volumes/portainer_data/owntracks/config:/config
- /var/lib/docker/volumes/portainer_data/owntracks/store:/store
ports:
- 8083:8083
restart: unless-stopped
#https://hub.docker.com/r/owntracks/frontend
owntracks-ui:
container_name: otui
image: owntracks/frontend
ports:
- 89:80
volumes:
- /var/lib/docker/volumes/portainer_data/owntracks/config/config.js:/usr/share/nginx/html/config/config.js
environment:
- SERVER_HOST=otrecorder
- SERVER_PORT=8083
restart: unless-stopped