Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Friends #517

Open
vegiemane opened this issue Dec 11, 2024 · 5 comments
Open

HTTP Friends #517

vegiemane opened this issue Dec 11, 2024 · 5 comments

Comments

@vegiemane
Copy link

vegiemane commented Dec 11, 2024

Hi. Love owntracks!

Used to use MQTT but switched to HTTP for security reasons (have never used MQTT in my life but am very familiar with NGINX and basic auth/fail2ban).

Have been trying to setup friends with HTTP mode. For the most part on the android app it seems to work great, but the problem is with my users who are on iPhones. I have done the following commands to setup:

docker exec -it ot-recorder sh

ocat -S /store --load=friends <<EOF
user-android ["user2/iphone", "user/android"]
user2-iphone ["user/android", "user2/iphone"]
EOF
Note: these are just the syntax I used, not my actual users with their names

This seems to add friends to my android device, but not to my other users iPhone device.

I have also noticed that the dump command seems to return nothing in the friends, despite doing the load command many times (to no success).

docker exec -it ot-recorder sh

ocat -S /store --dump=friends
*no output*

Any help would be greatly appreciated. And love owntracks!

Edit:
Just a little update.

The iOS device suddenly had the friends working on it. Must have reset after submitting/posting a location.
But the issue still remains with the ocat command.
I also don't seem to have any sort of way to edit the friends database once it has been made, for example: removing a friend from a users device.

/config $ ocat -S /store --load=friends < friends.txt
/config $ ocat -S /store --dump=friends
/config $ ocat -S /store --dump=friends > test
/config $ cat test

Here is what my friends.txt looks like:

/config $ cat friends.txt
myfriend-iphone ["me/android", "myfriend/iphone"]
me-android ["myfriend/iphone", "me/android"]

@jpmens jpmens changed the title HTTP Friends // iOS HTTP Friends Dec 12, 2024
@jpmens
Copy link
Member

jpmens commented Dec 12, 2024

Used to use MQTT but switched to HTTP for security reason

"for security reasons" is a new one for us. There's certainly no need for that: TLS and authentication are available for MQTT as well as for HTTP so I see no difference.

Your issue is basically a duplicate of #507 in which I come to the conclusion that using this with docker can't work. Unless you find a workaround.

@vegiemane
Copy link
Author

Whoops. I probably phrased that wrong. MQTT is definitely secure, but is a piece of software I have never used before. Hence I opted with HTTP only and am not using MQTT. So I'm not 100% confident I could set up MQTT securely. You could set up fail2ban with MQTT as well, but I think that is out of the scope of my skillset :)

I have just read the duplicate thread, and it makes sense as to why it is not working in docker.
Thank you for your help, I seem to have it working without being able to "--dump=friends" so all is well I guess.

Thank you for your support and I hope you keep up the great work!

@jpmens
Copy link
Member

jpmens commented Dec 12, 2024

The iOS device suddenly had the friends working on it.
I seem to have it working without being able to --dump=friends

I am doubting this. It might appear to be working, but if the Recorder has no notion of the Friends, then it won't pass on their positions when a device POSTs their position.

Place two "befriended" OwnTracks devices next to eachother, and alternating, click "publish now" on either device. Do you see the position of device1 directly show on device2 and vice-versa?

I'm thinking this might be an after effect of

Used to use MQTT

@vegiemane
Copy link
Author

I cannot place the devices next to one another as the befriended device is currently cross state. But I can confirm that they are both working with screenshots on both my android device, and my befriended iOS device.
It just seems that the dump command returns nothing, but it is definetly there and working on both OS's.

Can also confirm this is not an after effect of using MQTT. When I switched, I also didn't migrate any of the data/store (since I didn't know how lol).

@vegiemane
Copy link
Author

Have just tested with the devices next to each other. Confirmed friends is working when publishing locations on both devices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants