owntracks / quicksetup

A (mostly) automated installer for OwnTracks Recorder, Frontend with MQTT and Let's Encrypt
https://owntracks.org/booklet/guide/quicksetup/
12 stars 3 forks source link

Avoid clobbering passwords / otrc files when multiple devices in configuration.yaml have the same username / device #21

Closed jpmens closed 7 months ago

jpmens commented 7 months ago

OwnTracks supports username/devicename, but during creation of quicksetup we assumed a user would have one device only.

Test whether this is a problem. After reviewing the mkpasswords filter, i don't actually think so ...

jpmens commented 7 months ago
TASK [system: create password files in userdata] ************************************
ok: [localhost] => (item=jane)
ok: [localhost] => (item=bbb)
ok: [localhost] => (item=simu)
ok: [localhost] => (item=simu)
jpmens commented 7 months ago

Passwords are not an issue, we do this correctly.

What is a problem are the .otrc (and thus also URL encode) files which we create per/user but which should be per user/device.

We can easily store user-device.otrc, but this will mean adding intelligence to index.php so that it pics up all .otrc for user-device

jpmens commented 7 months ago
TASK [system: generate user .otrc files in userdata] ********************************
changed: [localhost] => (item=jane-nokia)
changed: [localhost] => (item=bbb-nokia)
changed: [localhost] => (item=simu-pixel)
changed: [localhost] => (item=simu-pixelnop)
$ diff /usr/local/owntracks/userdata/simu-*.otrc
6c6
<     "clientId": "simu-Pixel",
---
>     "clientId": "simu-PixelNop",
8c8
<     "deviceId": "Pixel",
---
>     "deviceId": "PixelNop",
27c27
<     "pubTopicBase": "owntracks/simu/Pixel",
---
>     "pubTopicBase": "owntracks/simu/PixelNop",
32,33c32,33
<     "subTopic": "owntracks/+/+ owntracks/+/+/event owntracks/+/+/info owntracks/simu/Pixel/cmd",
<     "tid": "p7",
---
>     "subTopic": "owntracks/+/+ owntracks/+/+/event owntracks/+/+/info owntracks/simu/PixelNop/cmd",
>     "tid": "p8",
jpmens commented 7 months ago
jpmens commented 7 months ago

Solved for .otrc file downloads (user can select their devices) and for URLconfig.