-
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
Add support for multiple users #84
base: master
Are you sure you want to change the base?
Conversation
Added support for multiple users
Hi @skatsavos , why do you want to remove the ENV variables? |
It doesn't make sense to have env variable for Garmin credentials if you want to support multiple user/credentials. We may only leave it for backwards compatibility as single user, but it will need a lot of checks. I do know it will affect docker, as i only use the pip package variant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the effort! I like the idea of working multiuser within the tool. I also see an issue where it comes to migration / docker exectuion.
To adress thoose issue, I think we could
- write a migration routine.
- better describe how the config file structure should look like (or even give a generate config file possibility
- still support single user (which will lead to the issue @skatsavos mentioned before.
@@ -50,34 +48,6 @@ optional arguments: | |||
--verbose, -v Run verbosely | |||
``` | |||
|
|||
### Providing credentials via environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could describe, that username and password are requested during first run.
username to log in to TrainerRoad. | ||
--trainerroad-password TRAINERROAD_PASSWORD, --tp TRAINERROAD_PASSWORD | ||
password to log in to TrainerRoad. | ||
--withings-userid WITHINGS_USERID, --wuid WITHINGS_USERID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, from the describtion its not quite clear:
Is this a withings specific user id or is it just a valu i want for this user? Should I geht this from the api or can I just use 42?
def get_garmin_username(self): | ||
"""get Garmin username""" | ||
if not self.withings.user_config[self.api_user_id].get("garmin_username"): | ||
garmin_username = input("Garmin username : ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question (for this and following input's): Can we use something like input with timemout?
Completely removing single user support and break Docker sounds like a bad idea to me. It is trivial to run multiple docker containers (one for each user), just make sure they don't share the As far as I can see, this version still only sync one single account on each run, so you would still need to run one session for each user. So I don't really see the benefit of removing the environment and docker secrets handling. For none-docker installs, you could just add multiple entries to This sounds like a much less intrusive and non breaking change. |
This PR does so much more than just adding support for multiple users. I love the idea that you can make this work with multiple withings users mapped to one withings account, but breaking every other installation in the process is really not a good way forward. The restructure to different files, addition of all the extra options that can be synced etc. are all fine, but should probably be separate PRs. Removing Docker support completely does not make any sense at all to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sould probably not post your client-id and secret to a public github repo...
NM. I see that this file is already in the repo. Still not a good idea though...
I was thinking about this. I think it would be useful if the configuration info between Withings, Garmin, and even TrainerRoad were located in the same file. I.e. combining Then |
Added support for multiple users