Skip to content

Commit ba2c23d

Browse files
authored
Merge pull request #14 from nightscout/master
update
2 parents e6b64cc + 21e0591 commit ba2c23d

File tree

133 files changed

+7115
-7892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+7115
-7892
lines changed

.browserslistrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Browsers we support
2+
# See https://github.com/browserslist/browserslist for details
3+
4+
> 0.25%
5+
ios_saf 9.3
6+
ios_saf 10.3
7+
ios_saf 13.7
8+
ios_saf 14.8
9+
not dead
10+
not and_uc 12.12
11+
not ie 11
12+

.github/workflows/codeql-analysis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
branches: [ dev ]
1818
pull_request:
1919
# The branches below must be a subset of the branches above
20-
branches: [ master ]
20+
branches: [ dev ]
2121
schedule:
2222
- cron: '43 23 * * 3'
2323

@@ -37,11 +37,11 @@ jobs:
3737

3838
steps:
3939
- name: Checkout repository
40-
uses: actions/checkout@v2
40+
uses: actions/checkout@v3
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v1
44+
uses: github/codeql-action/init@v2
4545
with:
4646
languages: ${{ matrix.language }}
4747
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -52,7 +52,7 @@ jobs:
5252
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5353
# If this step fails, then you should remove it and run the build manually (see below)
5454
- name: Autobuild
55-
uses: github/codeql-action/autobuild@v1
55+
uses: github/codeql-action/autobuild@v2
5656

5757
# ℹ️ Command-line programs to run using the OS shell.
5858
# 📚 https://git.io/JvXDl
@@ -66,4 +66,4 @@ jobs:
6666
# make release
6767

6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v1
69+
uses: github/codeql-action/analyze@v2

.github/workflows/main.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
node-version: [12.x, 14.x, 16.x]
20-
mongodb-version: [4.2, 4.4]
19+
node-version: [14.x, 16.x]
20+
mongodb-version: [4.4, 5.0, 6.0]
2121

2222
steps:
2323
- name: Git Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525

2626
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v1
27+
uses: actions/setup-node@v3
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030

@@ -60,7 +60,7 @@ jobs:
6060
password: ${{ secrets.DOCKER_PASS }}
6161
- name: Clean git Checkout
6262
if: success()
63-
uses: actions/checkout@v2
63+
uses: actions/checkout@v3
6464
- name: Build, tag and push the dev Docker image
6565
if: success() && github.ref == 'refs/heads/dev'
6666
uses: docker/build-push-action@v2

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.15.3
1+
16.16.0

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14.15.3-alpine
1+
FROM node:16.16.0-alpine
22

33
LABEL maintainer="Nightscout Contributors"
44

README.md

+129-31
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Nightscout Web Monitor (a.k.a. cgm-remote-monitor)
2-
======================================
2+
==================================================
33

44
![nightscout horizontal](https://cloud.githubusercontent.com/assets/751143/8425633/93c94dc0-1ebc-11e5-99e7-71a8f464caac.png)
55

@@ -9,8 +9,6 @@ Nightscout Web Monitor (a.k.a. cgm-remote-monitor)
99
[![Codacy Badge][codacy-img]][codacy-url]
1010
[![Discord chat][discord-img]][discord-url]
1111

12-
[![Deploy to Heroku][heroku-img]][heroku-url] [![Update your site][update-img]][update-fork]
13-
1412
This acts as a web-based CGM (Continuous Glucose Monitor) to allow
1513
multiple caregivers to remotely view a patient's glucose data in
1614
real time. The server reads a MongoDB which is intended to be data
@@ -105,8 +103,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
105103
- [`treatmentnotify` (Treatment Notifications)](#treatmentnotify-treatment-notifications)
106104
- [`basal` (Basal Profile)](#basal-basal-profile)
107105
- [`bolus` (Bolus Rendering)](#bolus-bolus-rendering)
108-
- [`bridge` (Share2Nightscout bridge)](#bridge-share2nightscout-bridge)
109-
- [`mmconnect` (MiniMed Connect bridge)](#mmconnect-minimed-connect-bridge)
106+
- [`connect` (Nightscout Connect)](#connect-nightscout-connect)
107+
- [`bridge` (Share2Nightscout bridge)](#bridge-share2nightscout-bridge), _deprecated_
108+
- [`mmconnect` (MiniMed Connect bridge)](#mmconnect-minimed-connect-bridge), _deprecated_
110109
- [`pump` (Pump Monitoring)](#pump-pump-monitoring)
111110
- [`openaps` (OpenAPS)](#openaps-openaps)
112111
- [`loop` (Loop)](#loop-loop)
@@ -132,40 +131,38 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
132131

133132
## Supported configurations:
134133

135-
If you plan to use Nightscout, we recommend using [Heroku](https://nightscout.github.io/nightscout/new_user/) as this is free and easy to use.
136-
We used to recommend hostig at Azure, but the resource needs of Nightscout have grown over the years and Azure won't comfortably run Nightscout
137-
anymore in the free tier. If you're hosting in Azure and looking to update your site, we recommend you
138-
[switch from Azure to Heroku](http://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/nightscout-setup.html#switching-from-azure-to-heroku)
139-
as you're likely to hit issues in the process of updating the site.
140-
141-
- [Nightscout Setup with Heroku](https://nightscout.github.io/nightscout/new_user/) (recommended)
134+
- [Nightscout Setup](https://nightscout.github.io/nightscout/new_user/) (recommended)
142135

143136
While you can install Nightscout on a virtual server or a Raspberry Pi, we do not recommend this unless you have at least some
144-
experience hosting Node applications and development using the toolchain in use with Nightscout. Heroku automates all of the
145-
hosting for you and even many of the dvelopers run their production sites in Heroku due to convenience.
137+
experience hosting Node applications and development using the toolchain in use with Nightscout.
146138

147-
If you're a hosting provider and want to provide our users additional free hosting options,
139+
If you're a hosting provider and want to provide our users additional hosting options,
148140
you're welcome to issue a documentation pull request with instructions on how to setup Nightscout on your system.
149141

150142
## Recommended minimum browser versions for using Nightscout:
151143

152-
Older versions of the browsers might work, but are untested.
144+
Our [browserslist](https://github.com/browserslist/browserslist) policy is documented in `.browserlistrc`.
145+
We currently support approximately [91%](https://browsersl.ist/?q=%3E+0.25%25%2C+ios_saf+9.3%2C+ios_saf+10.3%2C+ios_saf+13.7%2C+ios_saf+14.8%2C+not+dead%2C+not+and_uc+12.12%2C+not+ie+11%0A) of all browsers globally used. These include:
146+
147+
- Android Chrome: 104 or later (`and_chr`)
148+
- Google Chrome: 101 or later (`chrome`)
149+
- Microsoft Edge: 103 or later (`edge`)
150+
- Mozilla Firefox: 102 or later (`firefox`)
151+
- Apple Safari on iOS: 15.5 or later (`ios_saf`)
152+
- Opera Mini on Android: 63 or later (`op_mini`)
153+
- Opera: 88 or later (`opera`)
154+
- Apple Safari for macOS 10.15 Catalina or later: : 15.5 or later (`safari`)
155+
- Samsung Internet on Android: 17.0 or later (`samsung`)
156+
- Internet Explorer 11 : not supported
153157

154-
- Android 4
155-
- iOS 6
156-
- Chrome 35
157-
- Edge 17
158-
- Firefox 61
159-
- Opera 12.1
160-
- Safari 6 (macOS 10.7)
161-
- Internet Explorer: not supported
158+
Older versions or other browsers might work, but are untested and unsupported. We'll try to to keep Nightscout compatible with older iPads (e.g. Safari on iOS 10.3.4), but note that those devices are not supported by Apple anymore and have known security issues. Debugging these old devices gets harder due to Apple not supporting debugging the old devices on Macs that have been updated. Some features may not work with devices/browsers on the older end of these requirements.
162159

163-
Some features may not work with devices/browsers on the older end of these requirements.
164160

165-
## Windows installation software requirements:
166161

167-
- [Node.js](http://nodejs.org/) Latest Node 12 LTS. Node versions that do not have the latest security patches will not work. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `bin/setup.sh`)
168-
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 3.x or later. MongoDB 2.4 is only supported for Raspberry Pi.
162+
## Installation software requirements:
163+
164+
- [Node.js](http://nodejs.org/) Latest Node v14 or v16 LTS. Node versions that do not have the latest security patches will not be supported. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `bin/setup.sh`)
165+
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 4.2 or 4.4.
169166

170167
As a non-root user clone this repo then install dependencies into the root of the project:
171168

@@ -184,7 +181,7 @@ $ npm install
184181

185182
- If deploying the software to Microsoft Azure, you must set ** in the app settings for *WEBSITE_NODE_DEFAULT_VERSION* and *SCM_COMMAND_IDLE_TIMEOUT* **before** you deploy the latest Nightscout or the site deployment will likely fail. Other hosting environments do not require this setting. Additionally, if using the Azure free hosting tier, the installation might fail due to resource constraints imposed by Azure on the free hosting. Please set the following settings to the environment in Azure:
186183
```
187-
WEBSITE_NODE_DEFAULT_VERSION=10.15.2
184+
WEBSITE_NODE_DEFAULT_VERSION=16.16.0
188185
SCM_COMMAND_IDLE_TIMEOUT=300
189186
```
190187
- See [install MongoDB, Node.js, and Nightscouton a single Windows system](https://github.com/jaylagorio/Nightscout-on-Windows-Server). if you want to host your Nightscout outside of the cloud. Although the instructions are intended for Windows Server the procedure is compatible with client versions of Windows such as Windows 7 and Windows 10.
@@ -232,7 +229,7 @@ Once you've installed Nightscout, you can access API documentation by loading `/
232229
* Boluses over 2U: `http://localhost:1337/api/v1/treatments.json?find[insulin][$gte]=2`
233230

234231
The API is Swagger enabled, so you can generate client code to make working with the API easy.
235-
To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or review [swagger.yaml](swagger.yaml).
232+
To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or review [swagger.yaml](lib/server/swagger.yaml).
236233

237234
## Environment
238235

@@ -256,6 +253,14 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or
256253
* `IMPORT_CONFIG` - Used to import settings and extended settings from a url such as a gist. Structure of file should be something like: `{"settings": {"theme": "colors"}, "extendedSettings": {"upbat": {"enableAlerts": true}}}`
257254
* `TREATMENTS_AUTH` (`on`) - possible values `on` or `off`. Deprecated, if set to `off` the `careportal` role will be added to `AUTH_DEFAULT_ROLES`
258255

256+
#### Data Rights
257+
258+
These are useful to help protect your rights to portability and
259+
autonomy for your data:
260+
* `OBSCURED` - list, identical to `ENABLE`, a list of plugins to
261+
obscure.
262+
* `OBSCURE_DEVICE_PROVENANCE` - Required, a string visible to the [companies deciding to filter based on your data](https://help.sugarmate.io/en/articles/4673402-adding-a-nightscout-data-source). For example, `my-data-rights`.
263+
259264
### Alarms
260265

261266
These alarm setting affect all delivery methods (browser, Pushover, IFTTT, etc.). Values and settings entered here will be the defaults for new browser views, but will be overridden if different choices are made in the settings UI.
@@ -484,8 +489,98 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or
484489
* `BOLUS_RENDER_FORMAT` (`default`) - Possible values are `hidden`, `default` (with leading zero and U), `concise` (with U, without leading zero), and `minimal` (without leading zero and U).
485490
* `BOLUS_RENDER_FORMAT_SMALL` (`default`) - Possible values are `hidden`, `default` (with leading zero and U), `concise` (with U, without leading zero), and `minimal` (without leading zero and U).
486491

492+
##### `connect` (Nightscout Connect)
493+
494+
Connect common diabetes cloud resources to Nightscout.
495+
Include the keyword `connect` in the `ENABLE` list.
496+
Nightscout connection uses extended settings using the environment variable prefix `CONNECT_`.
497+
* `CONNECT_SOURCE` - The name for the source of one of the supported inputs. one of `nightscout`, `dexcomshare`, etc...
498+
###### Nightscout
499+
500+
> Work in progress
501+
502+
To sync from another Nightscout site, include `CONNECT_SOURCE_ENDPOINT` and
503+
`CONNECT_SOURCE_API_SECRET`.
504+
* `CONNECT_SOURCE=nightscout`
505+
* `CONNECT_SOURCE_ENDPOINT=<URL>`
506+
* `CONNECT_SOURCE_API_SECRET=<OPTIONAL_API_SECRET>`
507+
508+
The `CONNECT_SOURCE_ENDPOINT` must be a fully qualified URL and may contain a
509+
`?token=<subject>` query string to specify an accessToken.
510+
The `CONNECT_SOURCE_API_SECRET`, if provided, will be used to create a token
511+
called `nightscout-connect-reader`. This information or the token provided in
512+
the query will be used to read information from Nightscout and is optional if
513+
the site is readable by default.
514+
515+
Select this driver by setting `CONNECT_SOURCE` equal to `nightscout`.
516+
517+
518+
519+
###### Dexcom Share
520+
To synchronize from Dexcom Share use the following variables.
521+
* `CONNECT_SOURCE=dexcomshare`
522+
* `CONNECT_SHARE_ACCOUNT_NAME=`
523+
* `CONNECT_SHARE_PASSWORD=`
524+
525+
Optional, `CONNECT_SHARE_REGION` and `CONNECT_SHARE_SERVER` do the same thing, only specify one.
526+
* `CONNECT_SHARE_REGION=` `ous` or `us`. `us` is the default if nothing is
527+
provided. Selecting `us` sets `CONNECT_SHARE_SERVER` to `share2.dexcom.com`.
528+
Selecting `ous` here sets `CONNECT_SHARE_SERVER` to `shareous1.dexcom.com`.
529+
* `CONNECT_SHARE_SERVER=` set the server domain to use.
530+
531+
532+
###### Glooko
533+
534+
> Note: Experimental.
535+
536+
To synchronize from Glooko use the following variables.
537+
* `CONNECT_SOURCE=glooko`
538+
* `CONNECT_GLOOKO_EMAIL=`
539+
* `CONNECT_GLOOKO_PASSWORD=`
540+
541+
By default, `CONNECT_GLOOKO_SERVER` is set to `api.glooko.com` because the
542+
default value for `CONNECT_GLOOKO_ENV` is `default`.
543+
* `CONNECT_GLOOKO_ENV` is the word `default` by defalt. Other values are
544+
`development`, `production`, for `api.glooko.work`, and
545+
`externalapi.glooko.com`, respectively.
546+
* `CONNECT_GLOOKO_SERVER` the hostname server to use - `api.glooko.com` by `default`.
547+
548+
If both, `CONNECT_GLOOKO_SERVER` and `CONNECT_GLOOKO_ENV` are set, only
549+
`CONNECT_GLOOKO_SERVER` will be used.
550+
551+
###### Libre Link Up
552+
To synchronize from Libre Link Up use the following variables.
553+
* `CONNECT_SOURCE=linkup`
554+
* `CONNECT_LINK_UP_USERNAME=`
555+
* `CONNECT_LINK_UP_PASSWORD=`
556+
557+
By default, `CONNECT_LINK_UP_SERVER` is set to `api-eu.libreview.io` because the
558+
default value for `CONNECT_LINK_UP_REGION` is `EU`.
559+
Other available values for `CONNECT_LINK_UP_REGION`:
560+
* `US`, `EU`, `DE`, `FR`, `JP`, `AP`, `AU`, `AE`
561+
562+
For folks connected to many patients, you can provide the patient ID by setting
563+
the `CONNECT_LINK_UP_PATIENT_ID` variable.
564+
565+
###### Minimed Carelink
566+
567+
To synchronize from Medtronic Minimed Carelink, set the following
568+
environment variables.
569+
* `CONNECT_SOURCE=minimedcarelink`
570+
* `CONNECT_CARELINK_USERNAME`
571+
* `CONNECT_CARELINK_PASSWORD`
572+
* `CONNECT_CARELINK_REGION` Either `eu` to set `CONNECT_CARELINK_SERVER` to
573+
`carelink.minimed.eu` or `us` to use `carelink.minimed.com`.
574+
575+
For folks using the new Many to Many feature, please provide the username of the
576+
patient to follow using `CONNECT_CARELINK_PATIENT_USERNAME` variable.
577+
578+
487579
##### `bridge` (Share2Nightscout bridge)
488-
Glucose reading directly from the Dexcom Share service, uses these extended settings:
580+
581+
> **Deprecated** Please consider using the `connect` plugin instead.
582+
583+
Fetch glucose reading directly from the Dexcom Share service, uses these extended settings:
489584
* `BRIDGE_USER_NAME` - Your username for the Share service.
490585
* `BRIDGE_PASSWORD` - Your password for the Share service.
491586
* `BRIDGE_INTERVAL` (`150000` *2.5 minutes*) - The time (in milliseconds) to wait between each update.
@@ -496,6 +591,9 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or
496591
* `BRIDGE_SERVER` (``) - The default blank value is used to fetch data from Dexcom servers in the US. Set to (`EU`) to fetch from European servers instead.
497592

498593
##### `mmconnect` (MiniMed Connect bridge)
594+
595+
> **Deprecated** Please consider using the `connect` plugin instead.
596+
499597
Transfer real-time MiniMed Connect data from the Medtronic CareLink server into Nightscout ([read more](https://github.com/mddub/minimed-connect-to-nightscout))
500598
* `MMCONNECT_USER_NAME` - Your user name for CareLink Connect.
501599
* `MMCONNECT_PASSWORD` - Your password for CareLink Connect.

app.json

+5
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@
151151
"description": "Default setting for new browser views, for the time mode. ('12' or '24')",
152152
"value": "12",
153153
"required": false
154+
},
155+
"USE_NPM_INSTALL": {
156+
"description": "You need to have this set for deployment to work in Heroku",
157+
"value": "true",
158+
"required": true
154159
}
155160
},
156161
"addons": [

azuredeploy.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
},
219219
"WEBSITE_NODE_DEFAULT_VERSION": {
220220
"type": "string",
221-
"defaultValue": "8.11.1"
221+
"defaultValue": "16.16.0"
222222
}
223223
},
224224
"resources": [{

bundle/bundle.source.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ require('../node_modules/flot/jquery.flot.time');
1818
require('../node_modules/flot/jquery.flot.pie');
1919
require('../node_modules/flot/jquery.flot.fillbetween');
2020

21-
window.moment = require('moment-timezone');
21+
const moment = require('moment-timezone');
22+
23+
window.moment = moment;
2224

2325
window.Nightscout = window.Nightscout || {};
2426

27+
var ctx = {
28+
moment: moment
29+
};
30+
2531
window.Nightscout = {
2632
client: require('../lib/client'),
2733
units: require('../lib/units')(),
28-
admin_plugins: require('../lib/admin_plugins/')()
34+
admin_plugins: require('../lib/admin_plugins/')(ctx)
2935
};
3036

3137
window.Nightscout.report_plugins_preinit = require('../lib/report_plugins/');

docker-compose.yml

+10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
version: '3'
22

3+
x-logging:
4+
&default-logging
5+
options:
6+
max-size: '10m'
7+
max-file: '5'
8+
driver: json-file
9+
310
services:
411
mongo:
512
image: mongo:4.4
613
volumes:
714
- ${NS_MONGO_DATA_DIR:-./mongo-data}:/data/db:cached
15+
logging: *default-logging
816

917
nightscout:
1018
image: nightscout/cgm-remote-monitor:latest
@@ -19,6 +27,7 @@ services:
1927
- 'traefik.http.routers.nightscout.rule=Host(`localhost`)'
2028
- 'traefik.http.routers.nightscout.entrypoints=websecure'
2129
- 'traefik.http.routers.nightscout.tls.certresolver=le'
30+
logging: *default-logging
2231
environment:
2332
### Variables for the container
2433
NODE_ENV: production
@@ -74,3 +83,4 @@ services:
7483
volumes:
7584
- './letsencrypt:/letsencrypt'
7685
- '/var/run/docker.sock:/var/run/docker.sock:ro'
86+
logging: *default-logging

0 commit comments

Comments
 (0)