All apps · 0 apps
nightscout-librelink-up-uploader
Docker app from GuillermoMG's Repository
Overview
From: https://github.com/timoschlueter/nightscout-librelink-up
"Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout. The upload should work with at least Freestyle Libre 2 (FGM) and Libre 3 CGM sensors."
This container will upload LibreLink Up (FreeStyle Libre 2/3) CGM data to your NightScout instance.
Prerequesites:
- Working NightScout instance
- NightScout subject and access token for this uploader (https://github.com/timoschlueter/nightscout-librelink-up/issues/64#issuecomment-1252018083)
- LibreLink Up follower account already setup. I'd recommend you create a new follower just for this uploader, you risk locking up your account temporarily while you troubleshoot any problems with the uploader's configuration. Ask me how I know.
Notes:
- The access token must be hashed with SHA1 (you can use https://codebeautify.org/sha1-hash-generator).
Readme
View on GitHubNightscout LibreLink Up Uploader/Sidecar
Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout. The upload should work with at least Freestyle Libre 2 (FGM) and Libre 3 CGM sensors.
Configuration
The script takes the following environment variables:
| Variable | Description | Example | Required |
|---|---|---|---|
| LINK_UP_USERNAME | LibreLink Up Login Email | mail@example.com | X |
| LINK_UP_PASSWORD | LibreLink Up Login Password | mypassword | X |
| LINK_UP_CONNECTION | LibreLink Up Patient-ID. Can be received from the console output if multiple connections are available. | 123456abc-abcd-efgh-7891def | |
| LINK_UP_TIME_INTERVAL | The time interval (in minutes) of requesting values from libre link up. | 5 | |
| LINK_UP_REGION | Your region. Used to determine the correct LibreLinkUp service (Possible values: AE, AP, AU, CA, DE, EU, EU2, FR, JP, US, LA, RU, CN) | EU | |
| LINK_UP_VERSION | LibreLink Up App Version. This may need to be updated if you are using a newer version of the LibreLink Up App. | 4.16.0 | |
| NIGHTSCOUT_URL | Hostname of the Nightscout instance (without https://) | nightscout.yourdomain.com | X |
| NIGHTSCOUT_API_TOKEN | SHA1 Hash of Nightscout access token | 162f14de46149447c3338a8286223de407e3b2fa | X |
| NIGHTSCOUT_DISABLE_HTTPS | Disables the HTTPS requirement for Nightscout URLs | true | |
| NIGHTSCOUT_DEVICE_NAME | Sets the device name used in Nightscout | nightscout-librelink-up | |
| LOG_LEVEL | The setting of verbosity for logging, should be one of info or debug | info | |
| SINGLE_SHOT | Disables the scheduler and runs the script just once | true | |
| ALL_DATA | Upload all available data from LibreLink Up instead of just data newer than last upload. LibreLinkUp sometimes lags behind in reporting recent historical data, so it is advised to run the script with ALL_DATA set to true at least once a day. | true | |
| RETRY_ATTEMPTS | Number of times to retry download from LibreLinkUp / upload to Nightscout if an error happens - default: 0 (do not attempt to retry on failure). | 2 | |
| RETRY_INTERVAL_SECONDS | Interval (in seconds) between retry attempts. | 30 |
These variables can be set in your environment or in a .env file in the root directory of the project - see .env.example for an example (copy this file to .env and adjust the values accordingly).
Usage
There are different options for using this script.
Variant 1: On Digital Ocean App Platform
- Click on
- Login to Digital Ocean if not already happened (Register first if you don't have an account (referral link))
- Provide proper values for the
Environment variables - Click
Create appto deploy the app
Variant 2: On Heroku
- Click on
- 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
- Click
Deployto deploy the app
Variant 3: On Render
- Click on
- Login to Render if not already happened
- Provide proper values for the
Environment variables - Important: make sure that yor Nightscout API token is hashed with SHA1
- Click
Deploy Background Workerto deploy the app
Variant 4: Local
The installation process can be started by running npm install in the root directory.
To start the script, either:
- Copy
.env.examplefile to.envand adjust the values accordingly, then runnpm start
or
- Create a bash script with the set environment variables (
start.sh), then execute the script and check the console output:
#!/bin/bash
export LINK_UP_USERNAME="mail@example.com"
export LINK_UP_PASSWORD="mypassword"
export LINK_UP_TIME_INTERVAL="5"
export NIGHTSCOUT_URL="nightscout.yourdomain.com"
# use `shasum` instead of `sha1sum` on Mac
export NIGHTSCOUT_API_TOKEN=$(echo -n "librelinku-123456789abcde" | sha1sum | cut -d ' ' -f 1)
export LOG_LEVEL="info"
npm start
Variant 5: Docker
The easiest way to use this is to use the latest docker image:
docker run -e LINK_UP_USERNAME="mail@example.com" \
-e LINK_UP_PASSWORD="mypassword" \
-e LINK_UP_TIME_INTERVAL="5" \
-e LINK_UP_REGION="EU" \
-e NIGHTSCOUT_URL="nightscout.yourdomain.com" \
-e NIGHTSCOUT_API_TOKEN=$(echo -n "librelinku-123456789abcde" | sha1sum | cut -d ' ' -f 1) \
-e LOG_LEVEL="info" \
timoschlueter/nightscout-librelink-up
Variant 6: Docker Compose
If you are already using a dockerized Nightscout instance, this image can be easily added to your existing docker-compose file. In this example, the region is set for germany ("DE"):
version: '3.7'
services:
nightscout-libre-link:
image: timoschlueter/nightscout-librelink-up
container_name: nightscout-libre-link
environment:
LINK_UP_USERNAME: "mail@example.com"
LINK_UP_PASSWORD: "mypassword"
LINK_UP_TIME_INTERVAL: "5"
LINK_UP_REGION: "DE"
NIGHTSCOUT_URL: "nightscout.yourdomain.com"
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
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
Sponsoring and affiliate links
If you enjoy using this project and would like to support its ongoing development, I would be truly grateful. You can help keep things moving forward by becoming a GitHub sponsor or by using one of the referral links for the hosting providers below.
Your support means a lot — thank you!
Install nightscout-librelink-up-uploader on Unraid in a few clicks.
Find nightscout-librelink-up-uploader in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.
Categories
Download Statistics
Total Downloads Over Time
Related apps
Explore more like this
Explore allLinks
Details
timoschlueter/nightscout-librelink-upRuntime arguments
- Network
bridge- Shell
sh- Privileged
- false
Template configuration
This will be the account email for your LibreLink Up follower account, NOT your LibreView account.
- Target
- LINK_UP_USERNAME
- Value
- librelinkUp@email.com
This will be the password for your LibreLink Up follower account, NOT your LibreView account.
- Target
- LINK_UP_PASSWORD
- Value
- librelinkupPassword
- Target
- LINK_UP_TIME_INTERVAL
- Value
- 5
Your region. Used to determine the correct LibreLinkUp service (Possible values: AE, AP, AU, CA, DE, EU2, EU2, FR, JP, US)
- Target
- LINK_UP_REGION
- Value
- EU
This may need to be updated if you are using a newer version of the LibreLink Up App
- Target
- LINK_UP_VERSION
- Default
- 4.16.0
- Value
- 4.16.0
- Target
- NIGHTSCOUT_URL
- Value
- 0.0.0.0:1337
Token must be hashed. https://github.com/timoschlueter/nightscout-librelink-up/issues/64#issuecomment-1252018083
- Target
- NIGHTSCOUT_API_TOKEN
- Target
- LOG_LEVEL
- Default
- info
- Value
- info
Change to true if you're running a local instalation of NightScout wihout https
- Target
- NIGHTSCOUT_DISABLE_HTTPS
- Default
- false
- Value
- false
Will execute once and close. Useful to troubleshoot problems with the configuration.
- Target
- SINGLE_SHOT
- Default
- false
- Value
- false
- Target
- TZ
- Default
- Europe/Madrid
- Value
- Europe/Madrid
Upload all available data from LibreLink Up instead of just data newer than last upload. LibreLinkUp sometimes lags behind in reporting recent historical data, so it is advised to run the script with ALL_DATA set to true at least once a day.
- Target
- ALL_DATA
- Default
- true
- Value
- true