diff --git a/.babelrc b/.babelrc
new file mode 100644
index 00000000000..ff3059c3f09
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": ["@babel/preset-env"]
+}
\ No newline at end of file
diff --git a/.bowerrc b/.bowerrc
deleted file mode 100644
index c2587b247fc..00000000000
--- a/.bowerrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "directory": "./static/bower_components"
-}
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 00000000000..4bb1e696f5a
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,14 @@
+module.exports = {
+ "plugins": [ ],
+ "extends": [
+ "eslint:recommended"
+ ],
+ "parser": "babel-eslint",
+ "env": {
+ "browser": true,
+ "commonjs": true,
+ "es6": true,
+ "node": true,
+ "jquery": true
+ }
+ };
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/--bug-report.md b/.github/ISSUE_TEMPLATE/--bug-report.md
index 45319eb87b5..b0d61217880 100644
--- a/.github/ISSUE_TEMPLATE/--bug-report.md
+++ b/.github/ISSUE_TEMPLATE/--bug-report.md
@@ -1,6 +1,7 @@
---
name: "\U0001F41BBug report"
about: Create a report to help us improve things
+label: bug
---
diff --git a/.jsbeautifyrc b/.jsbeautifyrc
new file mode 100644
index 00000000000..1c15d3872ce
--- /dev/null
+++ b/.jsbeautifyrc
@@ -0,0 +1,16 @@
+{
+ "indent_size": 2
+ , "indent_char": " "
+ , "comma_first": true
+ , "keep-array-indentation": true
+ , "space_after_named_function": true
+ , "space_after_anon_function": true
+ , "end_with_newline": true
+ , "brace_style": "collapse,preserve-inline"
+ , "space_in_brace": true
+ , "space-in-paren": false
+ , "break-chained-methods": false
+ , "max-preserve-newlines": 2
+ , "space-after-anon-function": false
+ , "indent-empty-lines": false
+}
diff --git a/.nvmrc b/.nvmrc
index ed13033b848..89da89da65c 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-8.11.x
+10.16.0
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index d8ff4c865ff..90331521284 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,23 +1,30 @@
-language: node_js
-os: osx
-node_js:
- - "8"
-before_install:
- - if [[ `npm --version` != "5.8.0" ]]; then npm install -g npm@latest; npm --version; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- # https://github.com/Homebrew/homebrew-core/issues/26358
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
- # "brew install" can succeed but return 1 if it has "caveats".
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install mongodb || true; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew services start mongodb; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docker || true; fi
+sudo: required
+dist: xenial
+
+node_js-steps: &node_js-steps
+ language: node_js
+ before_install:
+ - if [[ `npm --version` != "6.4.1" ]]; then npm install -g npm@latest; npm --version; fi
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
+ # https://github.com/Homebrew/homebrew-core/issues/26358
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
+ # "brew install" can succeed but return 1 if it has "caveats".
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install mongodb || true; fi
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew services start mongodb; fi
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docker || true; fi
+ script: make travis
+ after_success:
+ - nvm version
+ - if [[ ! -z "$DOCKER_USER" ]]; then docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && git checkout -- . && git clean -fd . && make docker_release; fi
+ after_script: make report
+ services:
+ - mongodb
+ - docker
matrix:
- fast_finish: true
-services:
- - mongodb
- - docker
-script: make travis
-after_success:
- - nvm version
- - if [[ ! -z "$DOCKER_USER" ]]; then docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && git checkout -- . && git clean -fd . && make docker_release; fi
-after_script: make report
+ allow_failures:
+ node_js: "node"
+ include:
+ - node_js: "10"
+ <<: *node_js-steps
+ - node_js: "node" # Latest Node is not supported, and recommend, but we'll test it to know incompatibility issues
+ <<: *node_js-steps
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5be3a99d625..e2e71049f4c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,18 +3,23 @@
**Table of Contents**
- [Contributing to cgm-remote-monitor](#contributing-to-cgm-remote-monitor)
- - [Design](#design)
+ - [Design & new features](#design--new-features)
- [Develop on `dev`](#develop-on-dev)
- [Style Guide](#style-guide)
- [Create a prototype](#create-a-prototype)
- [Submit a pull request](#submit-a-pull-request)
+ - [Bug fixing](#bug-fixing)
- [Comments and issues](#comments-and-issues)
- [Co-ordination](#co-ordination)
- [Other Dev Tips](#other-dev-tips)
+ - [List of Contributors](#list-of-contributors)
+ - [Core developers, contributing developers, coordinators and documentation writers](#core-developers-contributing-developers-coordinators-and-documentation-writers)
+ - [Plugin contributors](#plugin-contributors)
+ - [Translators](#translators)
+ - [List of all contributors](#list-of-all-contributors)
-
# Contributing to cgm-remote-monitor
[![Build Status][build-img]][build-url]
@@ -36,23 +41,54 @@
[waffle]: https://waffle.io/nightscout/cgm-remote-monitor
[progress-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=in+progress&title=In+Progress
-## Design
+## Installation for development
+
+Nightscout is a Node.js application. The basic installation of the software for local purposes is:
-Participate in the design process by creating an issue to discuss your
-design.
+1. Clone the software to your local machine using git
+2. Install Node from https://nodejs.org/en/download/
+2. Use `npm` to install Nightscout dependencies by invokin `npm install` in the project directory. Note the
+ dependency installation has to be done usign a non-root user - _do not use root_ for development and hosting
+ the software!
+3. Get a Mongo database by either installing Mongo locally, or get a free cloud account from mLab or Mongodb Atlas.
+4. Configure nightscout by copying `my.env.template` to `my.env` and run it - see the next chapter in the instructions
## Develop on `dev`
-We develop on the `dev` branch.
-You can get the dev branch checked out using `git checkout dev`.
+We develop on the `dev` branch. All new pull requests should be targeted to `dev`. The `master` branch is only used for distributing the latest version of the tested sources.
+
+You can get the `dev` branch checked out using `git checkout dev`.
+
+Once checked out, install the dependencies using `npm install`, then copy the included `my.env.template`file to `my.env` and edit the file to include your settings (like the Mongo URL). Leave the `NODE_ENV=development` line intact. Once set, run the site using `npm run dev`. This will start Nigthscout in the development mode, with different code packaging rules and automatic restarting of the server using nodemon, when you save changed files on disk. The client also hot-reloads new code in, but it's recommended to reload the the website after changes due to the way the plugin sandbox works.
+
+Note the template sets `INSECURE_USE_HTTP` to `true` to enable the site to work over HTTP in local development.
+
+If you want to additionaly test the site in production mode, create a file called `my.prod.env` that's a copy of the dev file but with `NODE_ENV=production` and start the site using `npm run prod`.
+
+## REST API
+
+Nightscout implements a REST API for data syncronization. The API is documented using Swagger. To access the documentation
+for the API, run Nightscout locally and load the documentation from /api-docs (or read the associated swagger.json and swagger.yaml
+files locally).
+
+Note all dates used to access the API and dates stored in the objects are expected to comply with the ISO-8601 format and
+be deserializable by the Javascript Date class. Of note here is the dates can contain a plus sign which has a special meaning in
+URL encoding, so when issuing requests that place dates to the URL, take special care to ensure the data is properly URL
+encoded.
+
+## Design & new features
+
+If you intend to add a new feature, please allow the community to participate in the design process by creating an issue to discuss your design. For new features, the issue should describe what use cases the new feature intends to solve, or which existing use cases are being improved.
+
+Note Nighscout has a plugin architecture for adding new features. We expect most code for new features live inside a Plugin, so the code retains a clear separation of concerns. If the Plugin API doesn't implement all features you need to implement your feature, please discuss with us on adding those features to the API. Note new features should under almost no circumstances require changes to the existing plugins.
## Style Guide
-Some simple rules, that will make it easier to maintain our codebase:
+Some simple rules that will make it easier to maintain our codebase:
-* All indenting should use 2 space where possible (js, css, html, etc)
-* A space before function parameters, such as: `function boom (name, callback) { }`, this makes searching for calls easier
-* Name your callback functions, such as `boom('the name', function afterBoom ( result ) { }`
+* All indenting should use 2 space where possible (js, css, html, etc).
+* Include a space before function parameters, such as: `function boom (name, callback) { }`, this makes searching for function calls easier.
+* Name your callback functions, such as `boom('the name', function afterBoom ( result ) { }`.
* Don't include author names in the header of your files, if you need to give credit to someone else do it in the commit comment.
* Use single quotes.
* Use the comma first style, for example:
@@ -65,58 +101,185 @@ Some simple rules, that will make it easier to maintain our codebase:
};
```
+If in doubt, format your code with `js-beautify --indent-size 2 --comma-first --keep-array-indentation`
+
## Create a prototype
-Fork cgm-remote-monitor and create a branch.
-You can create a branch using `git checkout -b wip/add-my-widget`.
-This creates a new branch called `wip/add-my-widget`. The `wip`
-stands for work in progress and is a common prefix so that when know
-what to expect when reviewing many branches.
+Fork cgm-remote-monitor and create a branch. You can create a branch using `git checkout -b wip/add-my-widget`. This creates a new branch called `wip/add-my-widget`. The `wip` stands for work in progress and is a common prefix so that when know what to expect when reviewing many branches.
## Submit a pull request
-When you are done working with your prototype, it can be tempting to
-post on popular channels such as Facebook. We encourage contributors
-to submit their code for review, debate, and release before announcing
-features on social media.
+When you are done working with your prototype, it can be tempting to post on popular channels such as Facebook. We encourage contributors to submit their code for review, debate, and release before announcing features on social media.
+
+This can be done by checking your code `git commit -avm 'my improvements are here'`, the branch you created back to your own fork. This will probably look something like `git push -u origin wip/add-my-widget`.
+
+Now that the commits are available on github, you can click on the compare buttons on your fork to create a pull request. Make sure to select [Nightscout's `dev` branch](https://github.com/nightscout/cgm-remote-monitor/tree/dev).
+
+We assume all new Pull Requests are at least smoke tested by the author and all code in the PR actually works.
+Please include a description of what the features do and rationalize why the changes are needed.
+
+If you add any new NPM module dependencies, you have to rationalize why there are needed - we prefer pull requests that reduce dependencies, not add them.
+Before releasing a a new version, we check with `npm audit` if our dependencies don't have known security issues.
-This can be done by checking your code `git commit -avm 'my
-improvements are here'`, the branch you created back to your own
+When adding new features that add configuration options, please ensure the `README` document is amended with information on the new configuration.
+
+## Bug fixing
+
+If you've fixed a bug, please consider adding a unit test to the `/tests` folder that reproduces the original bug without the change.
+
+Try to identify the root cause of the issue and fix the issue. Pull requests that simply add null checks to hide issues are unlikely to be accepted.
+
+This can be done by committing your code `git commit -avm 'my
+improvements are here'`, and pushing it to the branch you created on your own
fork. This will probably look something like
`git push -u origin wip/add-my-widget`.
-Now that the commits are available on github, you can click on the
-compare buttons on your fork to create a pull request. Make sure to
-select [Nightscout's `dev` branch](https://github.com/nightscout/cgm-remote-monitor/tree/dev).
+Please include instructions how to test the changes.
## Comments and issues
-We encourage liberal use of the comments, including images where
-appropriate.
+We encourage liberal use of the comments, including images where appropriate.
## Co-ordination
-Most cgm-remote-monitor hackers use github's ticketing system, along with Facebook cgm-in-the-cloud, and
-gitter.
+Most cgm-remote-monitor hackers use github's ticketing system, along with Facebook cgm-in-the-cloud, and gitter.
-We use git-flow, with `master` as our production, stable branch, and
-`dev` is used to queue up for upcoming releases. Everything else is
-done on branches, hopefully with names that indicate what to expect.
+We use git-flow, with `master` as our production, stable branch, and `dev` is used to queue up for upcoming releases. Everything else is done on branches, hopefully with names that indicate what to expect.
-Once `dev` has been reviewed and people feel it's time to release, we
-follow the git-flow release process, which creates a new tag and bumps
-the version correctly. See sem-ver for versioning strategy.
+Once `dev` has been reviewed and people feel it's time to release, we follow the git-flow release process, which creates a new tag and bumps the version correctly. See sem-ver for versioning strategy.
-Every commit is tested by travis. We encourage adding tests to
-validate your design. We encourage discussing your use cases to help
-everyone get a better understanding of your design.
+Every commit is tested by travis. We encourage adding tests to validate your design. We encourage discussing your use cases to help everyone get a better understanding of your design.
## Other Dev Tips
* Join the [Gitter chat][gitter-url]
-* Get a local dev environment setup if you haven't already
-* Try breaking up big features/improvements into small parts. It's much easier to accept small PR's
-* Create tests for your new code, and for the old code too. We are aiming for a full test coverage.
-* If your going to be working in old code that needs lots of reformatting consider doing the clean as a separate PR.
-* If you can find others to help test your PR is will help get them merged in sooner.
+* Get a local dev environment setup if you haven't already.
+* Try breaking up big features/improvements into small parts. It's much easier to accept small PR's.
+* Create tests for your new code as well as the old code. We are aiming for a full test coverage.
+* If you're going to be working in old code that needs lots of reformatting, consider doing it as a separate PR.
+* If you can find others to help test your PR, it will help get them merged in sooner.
+## List of Contributors
+
+We welcome new contributors. We do not only need core contributors. Regular or one time contributors are welcomed as well.
+Also if you can't code, it's possible to contribute by improving the documentation or by translating Nightscout in your own language
+
+### Core developers, contributing developers, coordinators and documentation writers
+
+[@andrew-warrington]: https://github.com/andrew-warrington
+[@apanasef]: https://github.com/apanasef
+[@bewest]: https://github.com/bewest
+[@danamlewis]: https://github.com/danamlewis
+[@diabetlum]: https://github.com/diabetlum
+[@herzogmedia]: https://github.com/herzogmedia
+[@jamieowendexcom ]: https://github.com/jamieowendexcom
+[@janrpn]: https://github.com/janrpn
+[@jasoncalabrese]: https://github.com/jasoncalabrese
+[@jizhongwen]: https://github.com/jizhongwen
+[@jpcunningh]: https://github.com/jpcunningh
+[@jweismann]: https://github.com/jweismann
+[@komarserjio]: https://github.com/komarserjio
+[@LuminaryXion]: https://github.com/LuminaryXion
+[@mcdafydd]: https://github.com/mcdafydd
+[@mdomox]: https://github.com/mdomox
+[@MilosKozak]: https://github.com/MilosKozak
+[@oteroos]: https://github.com/oteroos
+[@PieterGit]: https://github.com/PieterGit
+[@rarneson]: https://github.com/rarneson
+[@rickfriele]: https://github.com/rickfriele
+[@scottleibrand]: https://github.com/scottleibrand
+[@sulkaharo]: https://github.com/sulkaharo
+[@tynbendad]: https://github.com/tynbendad
+[@unsoluble]: https://github.com/unsoluble
+[@viderehh]: https://github.com/viderehh
+[@OpossumGit]: https://github.com/OpossumGit
+
+| Contribution area | List of contributors |
+| ------------------------------------- | ---------------------------------- |
+| Core developers: | [@jasoncalabrese] [@MilosKozak] [@PieterGit] [@sulkaharo] |
+| Former Core developers: (not active): | [@bewest] |
+| Contributing developers: | [@jpcunningh] [@scottleibrand] [@komarserjio] [@jweismann] |
+| Release coordination 0.10.x: | [@PieterGit] [@sulkaharo] |
+| Release coordination 0.11.x: | [@PieterGit] |
+| Issue/Pull request coordination: | Please volunteer |
+| Cleaning up git fork spam: | Please volunteer |
+| Documentation writers: | [@andrew-warrington][@unsoluble] [@tynbendad] [@danamlewis] [@rarneson] |
+
+### Plugin contributors
+
+| Contribution area | List of developers | List of testers
+| ------------------------------------- | -------------------- | -------------------- |
+| [`alexa` (Amazon Alexa)](README.md#alexa-amazon-alexa)| Please volunteer | Please volunteer |
+| [`ar2` (AR2 Forecasting)](README.md#ar2-ar2-forecasting)| Please volunteer | Please volunteer |
+| [`basal` (Basal Profile)](README.md#basal-basal-profile)| Please volunteer | Please volunteer |
+| [`boluscalc` (Bolus Wizard)](README.md#boluscalc-bolus-wizard)| Please volunteer | Please volunteer |
+| [`bridge` (Share2Nightscout bridge)](README.md#bridge-share2nightscout-bridge)| Please volunteer | Please volunteer |
+| [`bwp` (Bolus Wizard Preview)](README.md#bwp-bolus-wizard-preview)| Please volunteer | Please volunteer |
+| [`cage` (Cannula Age)](README.md#cage-cannula-age)| [@jpcunningh] | Please volunteer |
+| [`careportal` (Careportal)](README.md#careportal-careportal)| Please volunteer | Please volunteer |
+| [`cob` (Carbs-on-Board)](README.md#cob-carbs-on-board)| Please volunteer | Please volunteer |
+| [`cors` (CORS)](README.md#cors-cors)| Please volunteer | Please volunteer |
+| [`delta` (BG Delta)](README.md#delta-bg-delta)| Please volunteer | Please volunteer |
+| [`devicestatus` (Device Status)](README.md#devicestatus-device-status)| Please volunteer | Please volunteer |
+| [`direction` (BG Direction)](README.md#direction-bg-direction)| Please volunteer | Please volunteer |
+| [`errorcodes` (CGM Error Codes)](README.md#errorcodes-cgm-error-codes)| Please volunteer | Please volunteer |
+| [`food` (Custom Foods)](README.md#food-custom-foods)| Please volunteer | Please volunteer |
+| [`googlehome` (Google Home)](README.md#google-home) |[@mdomox] [@rickfriele] | [@mcdafydd] [@oteroos] [@jamieowendexcom] |
+| [`iage` (Insulin Age)](README.md#iage-insulin-age)| Please volunteer | Please volunteer |
+| [`iob` (Insulin-on-Board)](README.md#iob-insulin-on-board)| Please volunteer | Please volunteer |
+| [`loop` (Loop)](README.md#loop-loop)| Please volunteer | Please volunteer |
+| [`mmconnect` (MiniMed Connect bridge)](README.md#mmconnect-minimed-connect-bridge)| Please volunteer | Please volunteer |
+| [`openaps` (OpenAPS)](README.md#openaps-openaps)| Please volunteer | Please volunteer |
+| [`profile` (Treatment Profile)](README.md#profile-treatment-profile)| Please volunteer | Please volunteer |
+| [`pump` (Pump Monitoring)](README.md#pump-pump-monitoring)| Please volunteer | Please volunteer |
+| [`rawbg` (Raw BG)](README.md#rawbg-raw-bg)| [@jpcunningh] | Please volunteer |
+| [`sage` (Sensor Age)](README.md#sage-sensor-age)| @jpcunningh | Please volunteer |
+| [`simplealarms` (Simple BG Alarms)](README.md#simplealarms-simple-bg-alarms)| Please volunteer | Please volunteer |
+| [`speech` (Speech)](README.md#speech-speech) | [@sulkaharo] | Please volunteer |
+| [`timeago` (Time Ago)](README.md#timeago-time-ago)| Please volunteer | Please volunteer |
+| [`treatmentnotify` (Treatment Notifications)](README.md#treatmentnotify-treatment-notifications)| Please volunteer | Please volunteer |
+| [`upbat` (Uploader Battery)](README.md#upbat-uploader-battery)| [@jpcunningh] | Please volunteer |
+| [`xdrip-js` (xDrip-js)](README.md#xdrip-js-xdrip-js)| [@jpcunningh] | Please volunteer |
+
+### Translators
+
+See `/translations` of your Nightscout, to view the current translation coverage and the missing items.
+Languages with less than 90% coverage will be removed in a future Nightscout versions.
+
+| Language | List of translators | Status
+| ------------- | -------------------- |-------------------- |
+| Български (`bg`) |Please volunteer| OK |
+| Čeština (`cs`) |Please volunteer|OK |
+| Deutsch (`de`) |[@viderehh] [@herzogmedia] |OK |
+| Dansk (`dk`) | [@janrpn] |OK |
+| Ελληνικά `(el`)|Please volunteer|Needs attention: 68.5%|
+| English (`en`)|Please volunteer|OK|
+| Español (`es`) |Please volunteer|OK|
+| Suomi (`fi`)|[@sulkaharo] |OK|
+| Français (`fr`)|Please volunteer|OK|
+| עברית (`he`)|Please volunteer|OK|
+| Hrvatski (`hr`)|[@OpossumGit]|Needs attention: 47.8% - committed 100% to dev|
+| Italiano (`it`)|Please volunteer|OK|
+| 日本語 (`ja`)|[@LuminaryXion]|Working on this|
+| 한국어 (`ko`)|Please volunteer|Needs attention: 80.6%|
+| Norsk (Bokmål) (`nb`)|Please volunteer|OK|
+| Nederlands (`nl`)|[@PieterGit]|OK|
+| Polski (`pl`)|Please volunteer|OK|
+| Português (Brasil) (`pt`)|Please volunteer|OK|
+| Română (`ro`)|Please volunteer|OK|
+| Русский (`ru`)|[@apanasef]|OK|
+| Slovenčina (`sk`)|Please volunteer|OK|
+| Svenska (`sv`)|Please volunteer|OK|
+| Türkçe (`tr`)|[@diabetlum]|OK|
+| 中文(简体) (`zh_cn`) | [@jizhongwen]|OK|
+| 中文(繁體) (`zh_tw`) | [@jizhongwen]|Needs attention: 25.0%
+| 日本語 (`ja_jp`) | [@LuminaryXion]|
+
+
+### List of all contributors
+| Contribution area | List of contributors |
+| ------------------------------------- | -------------------- |
+| All active developers: | [@jasoncalabrese] [@jpcunningh] [@jweismann] [@komarserjio] [@mdomox] [@MilosKozak] [@PieterGit] [@rickfriele] [@sulkaharo]
+| All active testers/documentors: | [@danamlewis] [@jamieowendexcom] [@mcdafydd] [@oteroos] [@rarneson] [@tynbendad] [@unsoluble]
+| All active translators: | [@apanasef] [@jizhongwen] [@viderehh] [@herzogmedia] [@LuminaryXion] [@OpossumGit]
+
diff --git a/Dockerfile.example b/Dockerfile.example
index d4c13c0ecd9..89a43f43c15 100644
--- a/Dockerfile.example
+++ b/Dockerfile.example
@@ -1,17 +1,17 @@
-FROM node:8.9.1
+FROM node:10-alpine
MAINTAINER Nightscout Contributors
-RUN apt-get update && \
- apt-get -y dist-upgrade
-
RUN mkdir -p /opt/app
ADD . /opt/app
WORKDIR /opt/app
+RUN chown -R node:node /opt/app
+USER node
RUN npm install && \
npm run postinstall && \
- npm run env
+ npm run env && \
+ npm audit fix
EXPOSE 1337
diff --git a/Makefile b/Makefile
index 7829258bd58..bf87aaed1c1 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,8 @@ MOCHA=./node_modules/mocha/bin/_mocha
# Pinned from dependency list.
ISTANBUL=./node_modules/.bin/istanbul
ANALYZED=./coverage/lcov.info
-export CODACY_REPO_TOKEN=e29ae5cf671f4f918912d9864316207c
+# Following token deprecated
+# export CODACY_REPO_TOKEN=e29ae5cf671f4f918912d9864316207c
DOCKER_IMAGE=nightscout/cgm-remote-monitor-travis
diff --git a/README.md b/README.md
index 93dd92d17fd..917be293303 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Nightscout Web Monitor (a.k.a. cgm-remote-monitor)
[![Codacy Badge][codacy-img]][codacy-url]
[![Gitter chat][gitter-img]][gitter-url]
-[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) [![Deploy to Heroku][heroku-img]][heroku-url]
+[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) [![Deploy to Heroku][heroku-img]][heroku-url] [![Update your site][update-img]][update-fork]
This acts as a web-based CGM (Continuous Glucose Monitor) to allow
multiple caregivers to remotely view a patient's glucose data in
@@ -39,6 +39,8 @@ Community maintained fork of the
[gitter-url]: https://gitter.im/nightscout/public
[heroku-img]: https://www.herokucdn.com/deploy/button.png
[heroku-url]: https://heroku.com/deploy
+[update-img]: update.png
+[update-fork]: http://nightscout.github.io/pages/update-fork/
[original]: https://github.com/rnpenguin/cgm-remote-monitor
@@ -46,6 +48,11 @@ Community maintained fork of the
**Table of Contents**
- [Install](#install)
+ - [Supported configurations:](#supported-configurations)
+ - [Minimum browser requirements for viewing the site:](#minimum-browser-requirements-for-viewing-the-site)
+ - [Windows installation software requirements:](#windows-installation-software-requirements)
+ - [Installation notes for users with nginx or Apache reverse proxy for SSL/TLS offloading:](#installation-notes-for-users-with-nginx-or-apache-reverse-proxy-for-ssltls-offloading)
+ - [Installation notes for Microsoft Azure, Windows:](#installation-notes-for-microsoft-azure-windows)
- [Usage](#usage)
- [Updating my version?](#updating-my-version)
- [What is my mongo string?](#what-is-my-mongo-string)
@@ -58,7 +65,7 @@ Community maintained fork of the
- [Alarms](#alarms)
- [Core](#core)
- [Predefined values for your browser settings (optional)](#predefined-values-for-your-browser-settings-optional)
- - [Views](#views)
+ - [Predefined values for your server settings (optional)](#predefined-values-for-your-server-settings-optional)
- [Plugins](#plugins)
- [Default Plugins](#default-plugins)
- [`delta` (BG Delta)](#delta-bg-delta)
@@ -70,7 +77,7 @@ Community maintained fork of the
- [`ar2` (AR2 Forecasting)](#ar2-ar2-forecasting)
- [`simplealarms` (Simple BG Alarms)](#simplealarms-simple-bg-alarms)
- [`profile` (Treatment Profile)](#profile-treatment-profile)
- - [Advanced Plugins](#advanced-plugins)
+ - [Advanced Plugins:](#advanced-plugins)
- [`careportal` (Careportal)](#careportal-careportal)
- [`boluscalc` (Bolus Wizard)](#boluscalc-bolus-wizard)
- [`food` (Custom Foods)](#food-custom-foods)
@@ -81,6 +88,7 @@ Community maintained fork of the
- [`cage` (Cannula Age)](#cage-cannula-age)
- [`sage` (Sensor Age)](#sage-sensor-age)
- [`iage` (Insulin Age)](#iage-insulin-age)
+ - [`bage` (Battery Age)](#bage-battery-age)
- [`treatmentnotify` (Treatment Notifications)](#treatmentnotify-treatment-notifications)
- [`basal` (Basal Profile)](#basal-basal-profile)
- [`bridge` (Share2Nightscout bridge)](#bridge-share2nightscout-bridge)
@@ -88,8 +96,10 @@ Community maintained fork of the
- [`pump` (Pump Monitoring)](#pump-pump-monitoring)
- [`openaps` (OpenAPS)](#openaps-openaps)
- [`loop` (Loop)](#loop-loop)
+ - [`override` (Override Mode)](#override-override-mode)
- [`xdrip-js` (xDrip-js)](#xdrip-js-xdrip-js)
- [`alexa` (Amazon Alexa)](#alexa-amazon-alexa)
+ - [`speech` (Speech)](#speech-speech)
- [`cors` (CORS)](#cors-cors)
- [Extended Settings](#extended-settings)
- [Pushover](#pushover)
@@ -104,19 +114,32 @@ Community maintained fork of the
# Install
-Supported configurations:
+## Supported configurations:
-If you plan to use Nightscout, we recommend using [Heroku](http://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/nightscout-setup.html#nightscout-setup-with-heroku), as Nightscout can reach the usage limits of the free Azure plan and cause it to shut down for hours or days. If you end up needing a paid tier, the $7/mo Heroku plan is also much cheaper than the first paid tier of Azure. Currently, the only added benefit to choosing the $7/mo Heroku plan vs the free Heroku plan is a section showing site use metrics for performance (such as response time). This has limited benefit to the average Nightscout user. In short, Heroku is the free and best option for Nightscout hosting.
+If you plan to use Nightscout, we recommend using [Heroku](http://www.nightscout.info/wiki/welcome/set-up-nightscout-using-heroku), as Nightscout can reach the usage limits of the free Azure plan and cause it to shut down for hours or days. If you end up needing a paid tier, the $7/mo Heroku plan is also much cheaper than the first paid tier of Azure. Currently, the only added benefit to choosing the $7/mo Heroku plan vs the free Heroku plan is a section showing site use metrics for performance (such as response time). This has limited benefit to the average Nightscout user. In short, Heroku is the free and best option for Nightscout hosting.
-- [Nightscout Setup with Heroku] (http://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/nightscout-setup.html#nightscout-setup-with-heroku) (recommended)
-- [Nightscout Setup with Microsoft Azure] (http://www.nightscout.info/wiki/faqs-2/azure-2) (not recommended, please
+- [Nightscout Setup with Heroku](http://www.nightscout.info/wiki/welcome/set-up-nightscout-using-heroku) (recommended)
+- [Nightscout Setup with Microsoft Azure](http://www.nightscout.info/wiki/faqs-2/azure-2) (not recommended, please
[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) )
- Linux based install (Debian, Ubuntu, Raspbian) install with own Node.JS and MongoDB install (see software requirements below)
- Windows based install with own Node.JS and MongoDB install (see software requirements below)
-Software requirements:
+## Recommended minimum browser versions for using Nightscout:
+
+Older versions of the browsers might work, but are untested.
+
+- Android 4
+- Chrome 68
+- Edge 17
+- Firefox 61
+- Internet Explorer: not supported
+- iOS 11
+- Opera 54
+- Safari 10 (macOS 10.12)
+
+## Windows installation software requirements:
-- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.11.3 or later). Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
+- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.15.1 or later) or Node 10 LTS (Node 10.16.0 or later; Node 10.15.2 works for Azure). 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 `setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 3.x or later. MongoDB 2.4 is only supported for Raspberry Pi.
As a non-root user clone this repo then install dependencies into the root of the project:
@@ -125,26 +148,35 @@ As a non-root user clone this repo then install dependencies into the root of th
$ npm install
```
-Installation notes for Microsoft Azure, Windows and Node 10:
+## Installation notes for users with nginx or Apache reverse proxy for SSL/TLS offloading:
-- 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. Please use:
+- Your site redirects insecure connections to `https` by default. If you use a reverse proxy like nginx or Apache to handle the connection security for you, make sure it sets the `X-Forwarded-Proto` header. Otherwise nightscout will be unable to know if it was called through a secure connection and will try to redirect you to the https version. If you're unable to set this Header, you can change the `INSECURE_USE_HTTP` setting in nightscout to true in order to allow insecure connections without being redirected.
+- In case you use a proxy. Do not use an external network interfaces for hosting Nightscout. Make sure the unsecure port is not available from a remote network connection
+- HTTP Strict Transport Security (HSTS) headers are enabled by default, use settings `SECURE_HSTS_HEADER` and `SECURE_HSTS_HEADER_*`
+- See [Predefined values for your server settings](#predefined-values-for-your-server-settings-optional) for more details
+
+## Installation notes for Microsoft Azure, Windows:
+
+- 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:
```
-WEBSITE_NODE_DEFAULT_VERSION=8.11.1
+WEBSITE_NODE_DEFAULT_VERSION=10.15.2
SCM_COMMAND_IDLE_TIMEOUT=300
```
- 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.
-- If you deploy to Windows and want to develop or test you need to install [Cygwin] (https://www.cygwin.com/) (use [setup-x86_64.exe] (https://www.cygwin.com/setup-x86_64.exe) and make sure to install `build-essential` package. Test your configuration by executing `make` and check if all tests are ok.
-- There may be some issues with Node 10.6.0 or later with Nightscout. Node 10 support will be in the 0.11 release. Please don't use Nightscout with (Node 9 or) Node 10 at this moment.
+- If you deploy to Windows and want to develop or test you need to install [Cygwin](https://www.cygwin.com/) (use [setup-x86_64.exe](https://www.cygwin.com/setup-x86_64.exe) and make sure to install `build-essential` package. Test your configuration by executing `make` and check if all tests are ok.
+
+# Development
+
+Wanna help with development, or just see how Nigthscout works? Great! See [CONTRIBUTING.md](CONTRIBUTING.md) for development related documentation.
# Usage
The data being uploaded from the server to the client is from a
-MongoDB server such as [mongolab][mongodb].
+MongoDB server such as [mLab][mLab].
-[mongodb]: https://mongolab.com
+[mLab]: https://mlab.com/
[autoconfigure]: https://nightscout.github.io/pages/configure/
[mongostring]: https://nightscout.github.io/pages/mongostring/
-[update-fork]: http://nightscout.github.io/pages/update-fork/
## Updating my version?
The easiest way to update your version of cgm-remote-monitor to our latest
@@ -161,7 +193,6 @@ mongo string. You can copy and paste the text in the gray box into your
Use the [autoconfigure tool][autoconfigure] to sync an uploader to your config.
-
## Nightscout API
The Nightscout API enables direct access to your DData without the need for direct Mongo access.
@@ -171,6 +202,8 @@ The server status and settings are available from `/api/v1/status.json`.
By default the `/entries` and `/treatments` APIs limit results to the the most recent 10 values from the last 2 days.
You can get many more results, by using the `count`, `date`, `dateString`, and `created_at` parameters, depending on the type of data you're looking for.
+Once you've installed Nightscout, you can access API documentation by loading `/api-docs/` URL in your instance.
+
#### Example Queries
(replace `http://localhost:1337` with your base url, YOUR-SITE)
@@ -182,8 +215,7 @@ You can get many more results, by using the `count`, `date`, `dateString`, and `
* Boluses over 2U: `http://localhost:1337/api/v1/treatments.json?find[insulin][$gte]=2`
The API is Swagger enabled, so you can generate client code to make working with the API easy.
-To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.html or review [swagger.yaml](swagger.yaml).
-
+To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or review [swagger.yaml](swagger.yaml).
## Environment
@@ -206,7 +238,6 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `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}}}`
* `TREATMENTS_AUTH` (`on`) - possible values `on` or `off`. Deprecated, if set to `off` the `careportal` role will be added to `AUTH_DEFAULT_ROLES`
-
### Alarms
These alarm setting effect all delivery methods (browser, pushover, maker, etc), some settings can be overridden per client (web browser)
@@ -238,11 +269,12 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `MONGO_ACTIVITY_COLLECTION`(`activity`) - The collection used to store activity data
* `PORT` (`1337`) - The port that the node.js application will listen on.
* `HOSTNAME` - The hostname that the node.js application will listen on, null by default for any hostname for IPv6 you may need to use `::`.
- * `SSL_KEY` - Path to your ssl key file, so that ssl(https) can be enabled directly in node.js
- * `SSL_CERT` - Path to your ssl cert file, so that ssl(https) can be enabled directly in node.js
- * `SSL_CA` - Path to your ssl ca file, so that ssl(https) can be enabled directly in node.js
+ * `SSL_KEY` - Path to your ssl key file, so that ssl(https) can be enabled directly in node.js. If using Let's Encrypt, make this variable the path to your privkey.pem file (private key).
+ * `SSL_CERT` - Path to your ssl cert file, so that ssl(https) can be enabled directly in node.js. If using Let's Encrypt, make this variable the path to fullchain.pem file (cert + ca).
+ * `SSL_CA` - Path to your ssl ca file, so that ssl(https) can be enabled directly in node.js. If using Let's Encrypt, make this variable the path to chain.pem file (chain).
* `HEARTBEAT` (`60`) - Number of seconds to wait in between database checks
* `DEBUG_MINIFY` (`true`) - Debug option, setting to `false` will disable bundle minification to help tracking down error and speed up development
+ * `DE_NORMALIZE_DATES`(`true`) - The Nightscout REST API normalizes all entered dates to UTC zone. Some Nightscout clients have broken date deserialization logic and expect to received back dates in zoned formats. Setting this variable to `true` causes the REST API to serialize dates sent to Nightscout in zoned format back to zoned format when served to clients over REST.
### Predefined values for your browser settings (optional)
@@ -265,12 +297,21 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* The `log-dynamic` is similar to the default `log` options, but uses the same dynamic range and the `linear` scale.
* `EDIT_MODE` (`on`) - possible values `on` or `off`. Enable or disable icon allowing enter treatments edit mode
+### Predefined values for your server settings (optional)
+ * `INSECURE_USE_HTTP` (`false`) - Redirect unsafe http traffic to https. Possible values `false`, or `true`. Your site redirects to `https` by default. If you don't want that from Nightscout, but want to implement that with a Nginx or Apache proxy, set `INSECURE_USE_HTTP` to `true`. Note: This will allow (unsafe) http traffic to your Nightscout instance and is not recommended.
+ * `SECURE_HSTS_HEADER` (`true`) - Add HTTP Strict Transport Security (HSTS) header. Possible values `false`, or `true`.
+ * `SECURE_HSTS_HEADER_INCLUDESUBDOMAINS` (`false`) - includeSubdomains options for HSTS. Possible values `false`, or `true`.
+ * `SECURE_HSTS_HEADER_PRELOAD` (`false`) - ask for preload in browsers for HSTS. Possible values `false`, or `true`.
+ * `SECURE_CSP` (`false`) - Add Content Security Policy headers. Possible values `false`, or `true`.
+ * `SECURE_CSP_REPORT_ONLY` (`false`) - If set to `true` allows to experiment with policies by monitoring (but not enforcing) their effects. Possible values `false`, or `true`.
+
### Views
- There are a few alternate web views available that display a simplified BG stream. Append any of these to your Nightscout URL:
- * `/clock.html` - Shows current BG. Grey text on a black background.
- * `/bgclock.html` - Shows current BG, trend arrow, and time of day. Grey text on a black background.
- * `/clock-color.html` - Shows current BG and trend arrow. White text on a background that changes color to indicate current BG threshold (green = in range; blue = below range; yellow = above range; red = urgent below/above).
+ There are a few alternate web views available from the main menu that display a simplified BG stream. (If you launch one of these in a fullscreen view in iOS, you can use a left-to-right swipe gesture to exit the view.)
+ * `Clock` - Shows current BG, trend arrow, and time of day. Grey text on a black background.
+ * `Color` - Shows current BG and trend arrow. White text on a background that changes color to indicate current BG threshold (green = in range; blue = below range; yellow = above range; red = urgent below/above).
+ * `Simple` - Shows current BG. Grey text on a black background.
+ * Optional configuration: set `SHOW_CLOCK_CLOSEBUTTON` to `false` to never show the small X button in clock views. For bookmarking a clock view without the close box but have it appear when navigating to a clock from the Nightscout menu, don't change the settng, but remove the `showClockClosebutton=true` parameter from the clock view URL.
### Plugins
@@ -339,7 +380,11 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
An option plugin to enable adding foods from database in Bolus Wizard and enable .
##### `rawbg` (Raw BG)
- Calculates BG using sensor and calibration records from and displays an alternate BG values and noise levels.
+ Calculates BG using sensor and calibration records from and displays an alternate BG values and noise levels. Defaults that can be adjusted with [extended setting](#extended-settings)
+ * `DISPLAY` (`unsmoothed`) - Allows the user to control which algorithm is used to calculate the displayed raw BG values using the most recent calibration record.
+ * `unfiltered` - Raw BG is calculated by applying the calibration to the glucose record's unfiltered value.
+ * `filtered` - Raw BG is calculated by applying the calibration to the glucose record's filtered value. The glucose record's filtered values are generally produced by the CGM by a running average of the unfiltered values to produce a smoothed value when the sensor noise is high.
+ * `unsmoothed` - Raw BG is calculated by first finding the ratio of the calculated filtered value (the same value calculated by the `filtered` setting) to the reported glucose value. The displayed raw BG value is calculated by dividing the calculated unfiltered value (the same value calculated by the `unfiltered` setting) by the ratio. The effect is to exagerate changes in trend direction so the trend changes are more noticeable to the user. This is the legacy raw BG calculation algorithm.
##### `iob` (Insulin-on-Board)
Adds the IOB pill visualization in the client and calculates values that used by other plugins. Uses treatments with insulin doses and the `dia` and `sens` fields from the [treatment profile](#treatment-profile).
@@ -376,6 +421,14 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `IAGE_WARN` (`48`) - If time since last `Insulin Change` matches `IAGE_WARN`, user will be alarmed to to change the insulin reservoir
* `IAGE_URGENT` (`72`) - If time since last `Insulin Change` matches `IAGE_URGENT`, user will be issued a persistent warning of overdue change.
+##### `bage` (Battery Age)
+ Calculates the number of days and hours since the last `Pump Battery Change` treatment that was recorded.
+ * `BAGE_ENABLE_ALERTS` (`false`) - Set to `true` to enable notifications to remind you of upcoming pump battery change.
+ * `BAGE_DISPLAY` (`days`) - Set to `hours` to display time since last `Pump Battery Change` in hours only.
+ * `BAGE_INFO` (`312`) - If time since last `Pump Battery Change` matches `BAGE_INFO` hours, user will be warned of upcoming pump battery change (default of 312 hours is 13 days).
+ * `BAGE_WARN` (`336`) - If time since last `Pump Battery Change` matches `BAGE_WARN` hours, user will be alarmed to to change the pump battery (default of 336 hours is 14 days).
+ * `BAGE_URGENT` (`360`) - If time since last `Pump Battery Change` matches `BAGE_URGENT` hours, user will be issued a persistent warning of overdue change (default of 360 hours is 15 days).
+
##### `treatmentnotify` (Treatment Notifications)
Generates notifications when a treatment has been entered and snoozes alarms minutes after a treatment. Default snooze is 10 minutes, and can be set using the `TREATMENTNOTIFY_SNOOZE_MINS` [extended setting](#extended-settings).
@@ -402,6 +455,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `MMCONNECT_SGV_LIMIT` (`24`) - Maximum number of recent sensor glucose values to send to Nightscout on each request.
* `MMCONNECT_VERBOSE` - Set this to "true" to log CareLink request information to the console.
* `MMCONNECT_STORE_RAW_DATA` - Set this to "true" to store raw data returned from CareLink as `type: "carelink_raw"` database entries (useful for development).
+ * `MMCONNECT_SERVER` - Set this to `EU` if you're using the European Medtronic services
##### `pump` (Pump Monitoring)
Generic Pump Monitoring for OpenAPS, MiniMed Connect, RileyLink, t:slim, with more on the way
@@ -427,6 +481,13 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `OPENAPS_URGENT` (`60`) - The number of minutes since the last loop that needs to be exceed before an urgent alarm is triggered
* `OPENAPS_FIELDS` (`status-symbol status-label iob meal-assist rssi`) - The fields to display by default. Any of the following fields: `status-symbol`, `status-label`, `iob`, `meal-assist`, `freq`, and `rssi`
* `OPENAPS_RETRO_FIELDS` (`status-symbol status-label iob meal-assist rssi`) - The fields to display in retro mode. Any of the above fields.
+ * `OPENAPS_PRED_IOB_COLOR` (`#1e88e5`) - The color to use for IOB prediction lines. Colors can be in either `#RRGGBB` or `#RRGGBBAA` format.
+ * `OPENAPS_PRED_COB_COLOR` (`#FB8C00FF`) - The color to use for COB prediction lines. Same format as above.
+ * `OPENAPS_PRED_ACOB_COLOR` (`#FB8C0080`) - The color to use for ACOB prediction lines. Same format as above.
+ * `OPENAPS_PRED_ZT_COLOR` (`#00d2d2`) - The color to use for ZT prediction lines. Same format as above.
+ * `OPENAPS_PRED_UAM_COLOR` (`#c9bd60`) - The color to use for UAM prediction lines. Same format as above.
+ * `OPENAPS_COLOR_PREDICTION_LINES` (`true`) - Enables / disables the colored lines vs the classic purple color.
+
Also see [Pushover](#pushover) and [IFTTT Maker](#ifttt-maker).
@@ -438,6 +499,10 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `LOOP_URGENT` (`60`) - The number of minutes since the last loop that needs to be exceeded before an urgent alarm is triggered
* Add `loop` to `SHOW_FORECAST` to show forecasted BG.
+##### `override` (Override Mode)
+ Additional monitoring for DIY automated insulin delivery systems to display real-time overrides such as Eating Soon or Exercise Mode:
+ * Requires `DEVICESTATUS_ADVANCED="true"` to be set
+
##### `xdrip-js` (xDrip-js)
Integrated xDrip-js monitoring, uses these extended settings:
* Requires `DEVICESTATUS_ADVANCED="true"` to be set
@@ -446,7 +511,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `XDRIP-JS_WARN_BAT_V` (`300`) - The voltage of either transmitter battery, a warning will be triggered when dropping below this threshold.
##### `alexa` (Amazon Alexa)
- Integration with Amazon Alexa, [detailed setup instructions](lib/plugins/alexa-plugin.md)
+ Integration with Amazon Alexa, [detailed setup instructions](docs/plugins/alexa-plugin.md)
##### `speech` (Speech)
Speech synthesis plugin. When enabled, speaks out the blood glucose values, IOB and alarms. Note you have to set the LANGUAGE setting on the server to get all translated alarms.
@@ -459,7 +524,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
Some plugins support additional configuration using extra environment variables. These are prefixed with the name of the plugin and a `_`. For example setting `MYPLUGIN_EXAMPLE_VALUE=1234` would make `extendedSettings.exampleValue` available to the `MYPLUGIN` plugin.
Plugins only have access to their own extended settings, all the extended settings of client plugins will be sent to the browser.
-
+
* `DEVICESTATUS_ADVANCED` (`true`) - Defaults to true. Users who only have a single device uploading data to Nightscout can set this to false to reduce the data use of the site.
#### Pushover
@@ -480,29 +545,28 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `PUSHOVER_ANNOUNCEMENT_KEY` - An optional Pushover user/group key, will be used for system wide user generated announcements. If not defined this will fallback to `PUSHOVER_USER_KEY` or `PUSHOVER_ALARM_KEY`. This also support a space delimited list of keys. To disable Announcement pushes set this to `off`.
* `BASE_URL` - Used for pushover callbacks, usually the URL of your Nightscout site, use https when possible.
* `API_SECRET` - Used for signing the pushover callback request for acknowledgments.
-
+
If you never want to get info level notifications (treatments) use `PUSHOVER_USER_KEY="off"`
If you never want to get an alarm via pushover use `PUSHOVER_ALARM_KEY="off"`
If you never want to get an announcement via pushover use `PUSHOVER_ANNOUNCEMENT_KEY="off"`
-
+
If only `PUSHOVER_USER_KEY` is set it will be used for all info notifications, alarms, and announcements
-
+
For testing/development try [localtunnel](http://localtunnel.me/).
#### IFTTT Maker
- In addition to the normal web based alarms, and pushover, there is also integration for [IFTTT Maker](https://ifttt.com/maker).
+ In addition to the normal web based alarms, and pushover, there is also integration for [IFTTT Webhooks](https://ifttt.com/maker_webhooks).
- With Maker you are able to integrate with all the other [IFTTT Channels](https://ifttt.com/channels). For example you can send a tweet when there is an alarm, change the color of hue light, send an email, send and sms, and so much more.
+ With Maker you are able to integrate with all the other [IFTTT Services](https://ifttt.com/services). For example you can send a tweet when there is an alarm, change the color of hue light, send an email, send and sms, and so much more.
1. Setup IFTTT account: [login](https://ifttt.com/login) or [create an account](https://ifttt.com/join)
- 2. Find your secret key on the [maker page](https://ifttt.com/maker)
- 3. Configure Nightscout by setting these environment variables:
- * `ENABLE` - `maker` should be added to the list of plugin, for example: `ENABLE="maker"`.
- * `MAKER_KEY` - Set this to your secret key that you located in step 2, for example: `MAKER_KEY="abcMyExampleabc123defjt1DeNSiftttmak-XQb69p"` This also support a space delimited list of keys.
- * `MAKER_ANNOUNCEMENT_KEY` - An optional Maker key, will be used for system wide user generated announcements. If not defined this will fallback to `MAKER_KEY`. A possible use for this is sending important messages and alarms to a CWD that you don't want to send all notification too. This also support a space delimited list of keys.
- 4. [Create a recipe](https://ifttt.com/myrecipes/personal/new) or see [more detailed instructions](lib/plugins/maker-setup.md#create-a-recipe)
-
- Plugins can create custom events, but all events sent to maker will be prefixed with `ns-`. The core events are:
+ 2. Follow the [Detailed IFTTT setup Instructions](docs/plugins/maker-setup.md)
+ 3. Configure Nightscout by setting these webpage environment variables:
+ * `ENABLE` - `maker` should be added to the list of plugins, for example: `ENABLE="maker"`.
+ * `MAKER_KEY` - Set this to your secret key (see [[Detailed Instructions](docs/plugins/maker-setup.md) ) `MAKER_KEY="abcMyExampleabc123defjt1DeNSiftttmak-XQb69p"` This also supports a space delimited list of keys.
+ * `MAKER_ANNOUNCEMENT_KEY` - An optional Maker key, will be used for system wide user generated announcements. If not defined this will fallback to `MAKER_KEY`. A possible use for this is sending important messages and alarms to another device that you don't want to send all notification too. This also support a space delimited list of keys.
+
+ Plugins can create custom events, but all events sent to IFTTT webhooks will be prefixed with `ns-`. The core events are:
* `ns-event` - This event is sent to the maker service for all alarms and notifications. This is good catch all event for general logging.
* `ns-allclear` - This event is sent to the maker service when an alarm has been ack'd or when the server starts up without triggering any alarms. For example, you could use this event to turn a light to green.
* `ns-info` - Plugins that generate notifications at the info level will cause this event to also be triggered. It will be sent in addition to `ns-event`.
@@ -577,16 +641,16 @@ License
Copyright (C) 2017 Nightscout contributors. See the COPYRIGHT file
at the root directory of this distribution and at
https://github.com/nightscout/cgm-remote-monitor/blob/master/COPYRIGHT
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
diff --git a/views/bgclock.html b/views/bgclock.html deleted file mode 100644 index 903a395d56a..00000000000 --- a/views/bgclock.html +++ /dev/null @@ -1,142 +0,0 @@ - - -
- - - -
- - - - - - - - - - - - - - - -
-