-
Notifications
You must be signed in to change notification settings - Fork 89
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
Storing garth session in ./garmin_session
causes problems when syncing multiple users
#141
Comments
Doh... Did not consider this... |
I need to take a look on how multiple users are handled for withings and come up with a nice solution. |
Would it be acceptable to add an additional parameter / env-variable |
So the workflow for multiple users would look something like this:
|
How about storing it as ex. /root/{username}.session ? |
What about the withings user info? do we need to describe which user matches with which login? Given tree users They will have 3 different withings accounts and also 3 different garmin accounts This topic was raised some time ago, see https://github.com/jaroslawhartman/withings-sync/pull/84/files |
I created a quick draft for multiple garmin users, where the session storage location can be set by the Regarding multi-user support in general: In your approach the |
I like the idea of having multi-user support by using different directories. Nowadays a lot of applications are using the XDG Base Directory Specification. So possibly |
That's also my point with this naming schema. Is it the withings user id? Or the garmin / trainerroad id? Or is it something entierly different? Otherwise I like the idea of the XDG directory. |
TL;DR Sorry for the long text, but I try to merge all the inputs. I really appreciate the efforts all you guys put in. IMHO
This is clearly because we can solve this issues with the one or other way. Here is what i find looking into the /root/.withings_user.json file:
I like the approach of having everything configurable and flexibel.
My conclusion:
|
I missed For the definition of Furthermore, although the |
I don't understand why you are all talking about keeping A clean (and proven) way to handle configuration / data directories in python is by using platformdirs. Of course only if you are OK with an additional dependency. |
It was an example, as this is (currently) the way the docker image is set up. Imho the default should still be ~ |
Fix for #141: Support for multiple garmin users
From my point of view this issue can be closed. The introduced GARMIN_SESSION environment variable enables me to switch the session for the individual family members. Works perfect since last week. BTW: I'm so glad that the session is reused. I was forced to enabled 2FA in my Garmin account because of ECG. With 2FA each sync would require to provide a security code as part of the log in procedure. |
Commit 64d8ec1 introduced storing the garth session in the directory
./garmin_session
which in principle is a nice addition. But sadly this causes problems in my setup. I'm syncing the measurements of all family members from Withings to Garmin by repeatedly calling withings-sync with changed environment variablesWITHINGS_USER
,GARMIN_USERNAME
andGARMIN_PASSWORD
.By introducing the session saving all Withings data is pushed to the Garmin account that had the first successful login.
It would be nice if the session information is stored in the already existing json file specified with
WITHINGS_USER
using thedumps
andloads
functions of garth. Alternatively an extra environment variable and/or an argument could be introduced to specify the location of the session data.FYI @jrast @matin
The text was updated successfully, but these errors were encountered: