-
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from outlyer-net/pr/api-token-doc-update
API token handling clarification
- Loading branch information
Showing
1 changed file
with
21 additions
and
3 deletions.
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 |
---|---|---|
|
@@ -35,7 +35,7 @@ There are different options for using this script. | |
- Click on [][heroku] | ||
- Login to Heroku if not already happened | ||
- Provide proper values for the `environment variables` | ||
- **Important: make sure that yor Nightscout API token is hashed with SHA1** | ||
- **Important: make sure that yor Nightscout API token is [hashed with SHA1](#hashing-api-token)** | ||
- Click `Deploy` to deploy the app | ||
|
||
### Variant 2: Local | ||
|
@@ -69,7 +69,7 @@ docker run -e LINK_UP_USERNAME="[email protected]" \ | |
-e LINK_UP_TIME_INTERVAL="5" \ | ||
-e LINK_UP_REGION="EU" \ | ||
-e NIGHTSCOUT_URL="nightscout.yourdomain.com" \ | ||
-e NIGHTSCOUT_API_TOKEN="librelinku-123456789abcde" \ | ||
-e NIGHTSCOUT_API_TOKEN=$(echo -n "foo-bar-baz" | sha1sum | cut -d ' ' -f 1) \ | ||
-e LOG_LEVEL="info" \ | ||
timoschlueter/nightscout-librelink-up | ||
``` | ||
|
@@ -92,10 +92,28 @@ services: | |
LINK_UP_TIME_INTERVAL: "5" | ||
LINK_UP_REGION: "DE" | ||
NIGHTSCOUT_URL: "nightscout.yourdomain.com" | ||
NIGHTSCOUT_API_TOKEN: "librelinku-123456789abcde" | ||
NIGHTSCOUT_API_TOKEN: "14c779d01a34ad1337ab59c2168e31b141eb2de6" | ||
LOG_LEVEL: "info" | ||
``` | ||
### Hashing API token | ||
`NIGHTSCOUT_API_TOKEN` must be a SHA1 hash of an Access Token from Nightscout (_Add new subject_ first in Nightscout's _Admin Tools_ if required), e.g. your Access Token for a subject named _LibreLinkUp_ might be `librelinku-123456789abcde`. | ||
|
||
Obtain your hash with | ||
|
||
```shell | ||
echo -n "librelinku-123456789abcde" | sha1sum | cut -d ' ' -f 1 | ||
``` | ||
(use `shasum` instead of `sha1sum` on Mac) | ||
|
||
which will print the hash (40 characters in length): | ||
``` | ||
14c779d01a34ad1337ab59c2168e31b141eb2de6 | ||
``` | ||
|
||
You might also use an online tool to generate your hash, e.g. https://codebeautify.org/sha1-hash-generator | ||
|
||
## ToDo | ||
|
||
- **Integration into Nightscout**: I have not yet looked into the plugin architecture of Nightscout. Maybe this should | ||
|