This is the support thread for the Nightscout docker template available via the Community Applications plugin.
The template pulls the official docker image build by the Nightscout team from their Docker hub. Nightscout is the front end to a remote blood glucouse monitoring system which can be used by diabetics or relatives of diabetics to monitor, log and evaluate their blood glucouse values. You can learn more over here: http://www.nightscout.info/
Setting the container up:
Install dependencies: The Nightscout container relies on a MongoDB instance for its database. You can install MongoDB from the CA plugin.
Set up database: Please refer to the official MongoDB documentation on how to set up a database and user. The user neads ReadWrite access to the database. Your db needs the following collections: activity, auth_subjects, devicestatus, entries, food, profile, settings, treatments.
You can also import an existing MongoDB database from another deployment by using mongodump and mongorestore. To get the dump of the remote database, enter the console of your local MongoDB container. Use this to get a local dump of the database (you can get the URI from Nightscout's configuration variable):
mongodump --uri="<yourmongodb-uri>" -o <output-dir>
Then use this to import the data from the dump:
mongorestore --db <new_database_name> <path_to_dump>
You still need to create a user that has RW permission on the new database.
Install Nightscout: Download and install the template. Fill in the MongoDB URI according to the given pattern and link it to the IP address and port of the MongoDB container. Note that Nightscouts behaviour is entirely controlled by variables that can be passed through by Docker. As there are many options, only the most relevant are predefined and exposed in the template. Use the "Add another Path, Port, Variable, Label or Device" feature to add additiononal variables. Please refer to this for an extensive list of variables and possible values.
Optional: Pass through reverse proxy: If you use a reverse proxy setup (e.g. swag), you can use Nightscout with it. There is no preconfiguered Nightscout sample in swag, but I had good success adapting the Nextcloud sample code simply by changing the names in the file. You also need to set the INSECURE_USE_HTTP variable in the Nightscout container to true. This is fine as it affects only traffic on the Docker network inside your server. Edit: While this is still a valid approach, the better one would be to set the X-Forwarded-Proto header inside your nightscout proxy-conf, so Nightscout knows it runs on https behind a secure proxy:
location / {
...
proxy_set_header X-Forwarded-Proto $scheme;
}
Note that Nightscout itself has no real authentification scheme for the main page by default, although it can be made to ask for the API secret before showing the page. This might brake some features though, so exposing it on the internet might be unwanted (although it might be necessary for e.g. proper remote monitoring).
For further documentation of Nightscout refer to this: https://github.com/nightscout/cgm-remote-monitor
Have fun and feel free to post suggestions or reach out for help in this thread,
opal_06