This is a simple docker container that proxies data from Nightscout to a bucket on S3.
You may be self hosting your Nightscout instance, but you may want to use the data in other places outside your network. If you don't have your services exposed to the internet and use a VPN to get to them instead, this can make it problematic for other services to access your Nightscout data.
For example, maybe you're using GlucoTracker to get your glucose number on your Apple Watch as a complication. Well, GlucoTracker can't access your Nightscout instance because it's not exposed to the internet. By using this project, you can automaticlaly upload your Nightscout data to S3 and point GlucoTracker at the S3 bucket instead.
Using this project will expose your Nightscout data to the internet. If you're not comfortable with that, you should not use this project.
I'm personally comfortable with this for a couple of reasons:
- I don't think anyone will guess the URL, privacy through obscurity isn't great, but it's a thing.
- I personally am not worried about a couple of blood glucose values being out there.
- It's better than exposing my self hosted services to the internet.
Nightscout S3 Proxy reads entries from your Nightscout instance every 60 seconds (by default) and uploads the data to S3 at the bucket you've
specified. It creates a file at this path: /api/v1/entries.json
. This corrresponds to the API endpoint for Nightscout entries. This way apps that use the Nightscout API can use this data.
This project uses Docker to run. Here are some examples of getting it running.
ENV VAR | Description | Required | Default |
---|---|---|---|
NIGHTSCOUT_HOST | The URL to your Nightscout instance | Yes | |
NIGHTSCOUT_TOKEN | An access token for your Nightscout instance | Yes | |
AWS_S3_BUCKET | The S3 bucket you want to send to | Yes | |
AWS_ACCESS_KEY_ID | Your AWS Access Key | Yes | |
AWS_SECRET_ACCESS_KEY | Your AWS Secret Access Key | Yes | |
WAIT_IN_SECONDS | Number of seconds between uploading data to S3 | No | 60 |
+docker run \
--name nightscout-s3-proxy \
-e NIGHTSCOUT_HOST=http://192.168.2.411:1337 \
-e NIGHTSCOUT_TOKEN=XXXXXXXXXXXX \
-e AWS_S3_BUCKET=your-bucket-name \
-e AWS_ACCESS_KEY_ID=XXXXXXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXX \
jonmaddox/nightscout-s3-proxy
version: "3.1"
services:
nightscout-s3-proxy:
image: jonmaddox/nightscout-s3-proxy
container_name: nightscout-s3-proxy
environment:
NIGHTSCOUT_HOST: "http://192.168.2.411:1337"
NIGHTSCOUT_TOKEN: "XXXXXXXXXXXX"
AWS_S3_BUCKET: "your-bucket-name"
AWS_ACCESS_KEY_ID: "XXXXXXXXXXXX"
AWS_SECRET_ACCESS_KEY: "XXXXXXXXXXXX"