Skip to content

Commit

Permalink
Merge ff9bfec into 52e1ff0
Browse files Browse the repository at this point in the history
  • Loading branch information
Miki23 committed Jun 29, 2018
2 parents 52e1ff0 + ff9bfec commit 5dee47a
Show file tree
Hide file tree
Showing 84 changed files with 12,245 additions and 5,643 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.9.1
8.11.x
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ language: node_js
sudo: required
dist: trusty
node_js:
- "8.9.1"
- "8"
before_install: if [[ `npm --version` != "5.8.0" ]]; then npm install -g npm@latest; npm --version; fi
matrix:
fast_finish: true
services:
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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)
- [Plugins](#plugins)
- [Default Plugins](#default-plugins)
- [`delta` (BG Delta)](#delta-bg-delta)
Expand Down Expand Up @@ -105,7 +106,8 @@ Community maintained fork of the

Requirements:

- [Node.js](http://nodejs.org/) 8.9.0 LTS (use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or `setup.sh`)
- [Node.js](http://nodejs.org/) 8.11.3 LTS or later or [Node.js](http://nodejs.org/) 10.5.0 or later. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or `setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 3.x. MongoDB 2.4 is only supported for Raspberry Pi.

Clone this repo then install dependencies into the root of the project:

Expand Down Expand Up @@ -214,6 +216,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `MONGO_DEVICESTATUS_COLLECTION`(`devicestatus`) - The collection used to store device status information such as uploader battery
* `MONGO_PROFILE_COLLECTION`(`profile`) - The collection used to store your profiles
* `MONGO_FOOD_COLLECTION`(`food`) - The collection used to store your food database
* `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
Expand All @@ -228,7 +231,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `NIGHT_MODE` (`off`) - possible values `on` or `off`
* `SHOW_RAWBG` (`never`) - possible values `always`, `never` or `noise`
* `CUSTOM_TITLE` (`Nightscout`) - Usually name of T1
* `THEME` (`default`) - possible values `default` or `colors`
* `THEME` (`default`) - possible values `default`, `colors`, or `colorblindfriendly`
* `ALARM_TIMEAGO_WARN` (`on`) - possible values `on` or `off`
* `ALARM_TIMEAGO_WARN_MINS` (`15`) - minutes since the last reading to trigger a warning
* `ALARM_TIMEAGO_URGENT` (`on`) - possible values `on` or `off`
Expand All @@ -242,6 +245,13 @@ 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

### 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).

### Plugins

Plugins are used extend the way information is displayed, how notifications are sent, alarms are triggered, and more.
Expand Down Expand Up @@ -377,7 +387,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
Generic Pump Monitoring for OpenAPS, MiniMed Connect, RileyLink, t:slim, with more on the way
* Requires `DEVICESTATUS_ADVANCED="true"` to be set
* `PUMP_ENABLE_ALERTS` (`false`) - Set to `true` to enable notifications for Pump battery and reservoir.
* `PUMP_WARNONSUSPEND` (`false`) - Set to `true` to get an alarm when the pump is suspended.
* `PUMP_WARN_ON_SUSPEND` (`false`) - Set to `true` to get an alarm when the pump is suspended.
* `PUMP_FIELDS` (`reservoir battery`) - The fields to display by default. Any of the following fields: `reservoir`, `battery`, `clock`, `status`, and `device`
* `PUMP_RETRO_FIELDS` (`reservoir battery clock`) - The fields to display in retro mode. Any of the above fields.
* `PUMP_WARN_CLOCK` (`30`) - The number of minutes ago that needs to be exceed before an alert is triggered.
Expand Down
13 changes: 10 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ function create(env, ctx) {
// pebble data
app.get('/pebble', ctx.pebble);

// expose swagger.yaml
app.get('/swagger.yaml', function(req, res) {
res.sendFile(__dirname + '/swagger.yaml');
// expose swagger.json
app.get('/swagger.json', function(req, res) {
res.sendFile(__dirname + '/swagger.json');
});

/*
Expand Down Expand Up @@ -141,6 +141,13 @@ function create(env, ctx) {
// serve the static content
app.use(staticFiles);

var swaggerFiles = express.static(env.swagger_files, {
maxAge: maxAge
});

// serve the static content
app.use('/swagger-ui-dist', swaggerFiles);

var tmpFiles = express.static('tmp', {
maxAge: maxAge
});
Expand Down
52 changes: 21 additions & 31 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"required": true
},
"API_SECRET": {
"description": "REQUIRED: A secret passphrase that must be at least 12 characters long, required to enable POST and PUT; also required for the Care Portal",
"description": "REQUIRED: A secret passphrase that must be at least 12 characters long, required to enable POST and PUT; also required for the Care Portal.",
"value": "",
"required": true
},
Expand All @@ -18,12 +18,12 @@
"required": false
},
"ENABLE": {
"description": "Used to enable optional features, expects a space delimited list, such as: careportal rawbg iob, see https://github.com/nightscout/cgm-remote-monitor/blob/master/README.md for more info",
"description": "Used to enable optional features, expects a space delimited list, such as: careportal rawbg iob, see https://github.com/nightscout/cgm-remote-monitor/blob/master/README.md for more info.",
"value": "",
"required": false
},
"DISABLE": {
"description": "Used to disable default features, expects a space delimited list, such as: direction upbat, see https://github.com/nightscout/cgm-remote-monitor/blob/master/README.md for more info",
"description": "Used to disable default features, expects a space delimited list, such as: direction upbat, see https://github.com/nightscout/cgm-remote-monitor/blob/master/README.md for more info.",
"value": "",
"required": false
},
Expand All @@ -33,22 +33,22 @@
"required": false
},
"BG_HIGH": {
"description": "Urgent high BG alarm. Default null value implies 260. Must be set in mg/dL. Only used with simple alarms.",
"description": "Urgent high BG alarm. Default null value implies 260. Must be set in mg/dL (multiply with 18 if you have a value in mmol/L). Only used with simple alarms.",
"value": "",
"required": false
},
"BG_TARGET_TOP": {
"description": "Non-urgent high BG alarm, the top of your target range. Default null value implies 180. Must be set in mg/dL. Only used with simple alarms.",
"description": "Non-urgent high BG alarm, the top of your target range. Default null value implies 180. Must be set in mg/dL (multiply with 18 if you have a value in mmol/L). Only used with simple alarms.",
"value": "",
"required": false
},
"BG_TARGET_BOTTOM": {
"description": "Non urgent low BG alarm, the bottom of your target range. Default null value implies 80. Must be set in mg/dL. Only used with simple alarms.",
"description": "Non urgent low BG alarm, the bottom of your target range. Default null value implies 80. Must be set in mg/dL (multiply with 18 if you have a value in mmol/L). Only used with simple alarms.",
"value": "",
"required": false
},
"BG_LOW": {
"description": "Urgent Low BG alarm. Default null value implies 55. Must be set in mg/dL. Only used with simple alarms.",
"description": "Urgent Low BG alarm. Default null value implies 55. Must be set in mg/dL (multiply with 18 if you have a value in mmol/L). Only used with simple alarms.",
"value": "",
"required": false
},
Expand All @@ -72,83 +72,73 @@
"value": "",
"required": false
},
"THEME": {
"description": "Possible values default, colors or colorblindfriendly",
"value": "",
"required": false
},
"SHOW_RAWBG": {
"description": "Possible values always, never or noise",
"value": "",
"required": false
},
"BRIDGE_USER_NAME": {
"description": "Share bridge - Your user name for the Share service. ENSURE bridge is in ENABLE if you want to use the share bridge",
"description": "Share bridge - Your user name for the Share service. ENSURE bridge is in ENABLE if you want to use the share bridge.",
"value": "",
"required": false
},
"BRIDGE_PASSWORD": {
"description": "Share bridge - Your password for the Share service. ENSURE bridge is in ENABLE if you want to use the share bridge",
"description": "Share bridge - Your password for the Share service. ENSURE bridge is in ENABLE if you want to use the share bridge.",
"value": "",
"required": false
},
"TIME_FORMAT": {
"description": "Browser default time mode valid settings are 12 or 24",
"description": "Browser default time mode. Valid settings are 12 or 24",
"value": "12",
"required": false
},
"NIGHT_MODE": {
"description": "Browser defaults to night mode valid settings are on or off",
"description": "Browser defaults to night mode. Valid settings are on or off",
"value": "off",
"required": false
},
"SHOW_RAWBG": {
"description": "Browser default raw display mode vaild settings are always never or noise",
"description": "Browser default raw display mode. Valid settings are always, never, or noise",
"value": "never",
"required": false
},
"THEME": {
"description": "Browser default theme setting vaild settings are default or colors",
"description": "Browser default theme setting. Valid settings are default, colors, or colorblindfriendly",
"value": "default",
"required": false
},
"ALARM_URGENT_HIGH": {
"description": "Browser default urgent high alarm enabled vaild settings are on or off",
"description": "Browser default urgent high alarm enabled. Valid settings are on or off",
"value": "on",
"required": false
},
"ALARM_HIGH": {
"description": "Browser default high alarm enabled vaild settings are on or off",
"description": "Browser default high alarm enabled. Valid settings are on or off",
"value": "on",
"required": false
},
"ALARM_LOW": {
"description": "Browser default low alarm enabled vaild settings are on or off",
"description": "Browser default low alarm enabled. Valid settings are on or off",
"value": "on",
"required": false
},
"ALARM_URGENT_LOW": {
"description": "Browser default urgent low alarm enabled vaild settings are on or off",
"description": "Browser default urgent low alarm enabled. Valid settings are on or off",
"value": "on",
"required": false
},
"ALARM_TIMEAGO_WARN": {
"description": "Browser default warn after time of last data exceeds ALARM_TIMEAGO_WARN_MINS alarm enabled vaild settings are on or off",
"description": "Browser default warn after time of last data exceeds ALARM_TIMEAGO_WARN_MINS alarm enabled. Valid settings are on or off",
"value": "on",
"required": false
},
"ALARM_TIMEAGO_WARN_MINS": {
"description": "Browser default minutes since the last reading to trigger a warning",
"description": "Browser default minutes since the last reading to trigger a warning.",
"value": "15",
"required": false
},
"ALARM_TIMEAGO_URGENT": {
"description": "Browser default urgent warning after time of last data exceeds ALARM_TIMEAGO_URGENT_MINS alarm enabled vaild settings are on or off",
"description": "Browser default urgent warning after time of last data exceeds ALARM_TIMEAGO_URGENT_MINS alarm enabled. Valid settings are on or off",
"value": "on",
"required": false
},
"ALARM_TIMEAGO_URGENT_MINS": {
"description": "Browser default minutes since last reading to trigger an urgent alarm",
"description": "Browser default minutes since last reading to trigger an urgent alarm.",
"value": "30",
"required": false
},
Expand Down
17 changes: 0 additions & 17 deletions bower.json

This file was deleted.

4 changes: 2 additions & 2 deletions bundle/bundle.source.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../static/css/drawer.css';
import '../static/css/dropdown.css';
import '../static/css/sgv.css';
import '../node_modules/jquery.tipsy/src/jquery.tipsy.css';
import '../node_modules/jquery.tooltips/css/jquery.tooltips.css';


$ = require("jquery");
Expand All @@ -11,7 +11,7 @@ require('jquery-ui-bundle');
window._ = require('lodash');
window.d3 = require('d3');

require('jquery.tipsy');
require('jquery.tooltips');

window.Storage = require('js-storage');

Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ selectNodeVersion
# 3. Install npm packages
if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then
cd "$DEPLOYMENT_TARGET"
eval $NPM_CMD install --scripts-prepend-node-path --production
eval $NPM_CMD install --production --scripts-prepend-node-path
exitWithMessageOnError "npm failed"
cd - > /dev/null
fi
Expand Down
13 changes: 2 additions & 11 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function config ( ) {
env.HOSTNAME = readENV('HOSTNAME', null);
env.IMPORT_CONFIG = readENV('IMPORT_CONFIG', null);
env.static_files = readENV('NIGHTSCOUT_STATIC_FILES', __dirname + '/static/');
env.swagger_files = readENV('NIGHTSCOUT_SWAGGER_FILES', __dirname + '/node_modules/swagger-ui-dist/');
env.debug = {
minify: readENVTruthy('DEBUG_MINIFY', true)
};
Expand Down Expand Up @@ -79,17 +80,6 @@ function setAPISecret() {

function setVersion() {
var software = require('./package.json');
var git = require('git-rev');

if (readENV('APPSETTING_ScmType') === readENV('ScmType') && readENV('ScmType') === 'GitHub') {
env.head = require('./scm-commit-id.json');
console.log('SCM COMMIT ID', env.head);
} else {
git.short(function record_git_head(head) {
console.log('GIT HEAD', head);
env.head = head || readENV('SCM_COMMIT_ID') || readENV('COMMIT_HASH', '');
});
}
env.version = software.version;
env.name = software.name;
}
Expand All @@ -116,6 +106,7 @@ function setStorage() {
env.profile_collection = readENV('MONGO_PROFILE_COLLECTION', 'profile');
env.devicestatus_collection = readENV('MONGO_DEVICESTATUS_COLLECTION', 'devicestatus');
env.food_collection = readENV('MONGO_FOOD_COLLECTION', 'food');
env.activity_collection = readENV('MONGO_ACTIVITY_COLLECTION', 'activity');

// TODO: clean up a bit
// Some people prefer to use a json configuration file instead.
Expand Down
Loading

0 comments on commit 5dee47a

Please sign in to comment.