-
Notifications
You must be signed in to change notification settings - Fork 93
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
Open
skatsavos
wants to merge
12
commits into
jaroslawhartman:master
Choose a base branch
from
skatsavos:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eb3838c
Add files via upload
skatsavos bc32074
Update README.md
skatsavos ea25656
Add files via upload
skatsavos 71da33a
Delete Dockerfile
skatsavos 3222bf5
Delete .gitignore
skatsavos c1f3fcc
Delete setup.py
skatsavos 12a0d44
Delete withings_sync directory
skatsavos b29e682
Delete .github/workflows directory
skatsavos 939917f
Delete contrib directory
skatsavos 2186488
Delete MANIFEST.in
skatsavos e3ec588
Create withings_app.json
skatsavos a311625
Update requirements.txt
skatsavos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,21 +25,19 @@ $ pip install withings-sync | |
## Usage | ||
|
||
``` | ||
usage: withings-sync [-h] [--garmin-username GARMIN_USERNAME] [--garmin-password GARMIN_PASSWORD] [--trainerroad-username TRAINERROAD_USERNAME] [--trainerroad-password TRAINERROAD_PASSWORD] [--fromdate DATE] | ||
usage: withings-sync [-h] [--withings-userid WITHINGS_USERID] [--garmin-upload] [--trainerroad-upload] [--fromdate DATE] | ||
[--todate DATE] [--to-fit] [--to-json] [--output BASENAME] [--no-upload] [--verbose] | ||
|
||
A tool for synchronisation of Withings (ex. Nokia Health Body) to Garmin Connect and Trainer Road or to provide a json string. | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
--garmin-username GARMIN_USERNAME, --gu GARMIN_USERNAME | ||
username to log in to Garmin Connect. | ||
--garmin-password GARMIN_PASSWORD, --gp GARMIN_PASSWORD | ||
password to log in to Garmin Connect. | ||
--trainerroad-username TRAINERROAD_USERNAME, --tu TRAINERROAD_USERNAME | ||
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 | ||
API userid to use for Withings. | ||
--garmin-upload, --gu | ||
upload to Garmin Connect. | ||
--trainerroad-upload, --tu | ||
upload to TrainerRoad. | ||
--fromdate DATE, -f DATE | ||
--todate DATE, -t DATE | ||
--to-fit, -F Write output file in FIT format. | ||
|
@@ -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 commentThe 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. |
||
|
||
You can use the following environment variables for providing the Garmin and/or Trainerroad credentials: | ||
|
||
- `GARMIN_USERNAME` | ||
- `GARMIN_PASSWORD` | ||
- `TRAINERROAD_USERNAME` | ||
- `TRAINERROAD_PASSWORD` | ||
|
||
### Providing credentials via secrets files | ||
|
||
You can also populate the following 'secrets' files to provide the Garmin and/or Trainerroad credentials: | ||
|
||
- `/run/secrets/garmin_username` | ||
- `/run/secrets/garmin_password` | ||
- `/run/secrets/trainerroad_username` | ||
- `/run/secrets/trainerroad_password` | ||
|
||
Secrets are useful in an orchestrated container context — see the [Docker Swarm](https://docs.docker.com/engine/swarm/secrets/) or [Rancher](https://rancher.com/docs/rancher/v1.6/en/cattle/secrets/) docs for more information on how to securely inject secrets into a container. | ||
|
||
### Order of priority for credentials | ||
|
||
In the case of credentials being available via multiple means (e.g. [environment variables](#providing-credentials-via-environment-variables) and [secrets files](#providing-credentials-via-secrets-files)), the order of resolution for determining which credentials to use is as follows, with later methods overriding credentials supplied by an earlier method: | ||
|
||
1. Read secrets file(s) | ||
2. Read environment variable(s) | ||
3. Use command invocation arugment(s) | ||
|
||
### Obtaining Withings Authorization Code | ||
|
||
When running for a very first time, you need to obtain Withings authorization: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?