Skip to content

Commit

Permalink
Merge pull request #1 from nightscout/dev
Browse files Browse the repository at this point in the history
Upgrade
  • Loading branch information
jaylagorio committed Apr 30, 2016
2 parents 7c126b1 + 7ae9a23 commit ce02a43
Show file tree
Hide file tree
Showing 63 changed files with 2,949 additions and 579 deletions.
19 changes: 17 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
language: node_js
sudo: false
node_js:
- "0.10"
- "0.12"
- 0.10
- 0.12
- 4
- 5
matrix:
fast_finish: true
allow_failures:
- node_js: 4
- node_js: 5
services: mongodb
script: make travis
after_script: make report
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Nightscout Web Monitor (a.k.a. cgm-remote-monitor)
[![Stories in Ready][ready-img]][waffle]
[![Stories in Progress][progress-img]][waffle]

[![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]

This acts as a web-based CGM (Continuous Glucose Monitor) to allow
multiple caregivers to remotely view a patient's glucose data in
Expand Down Expand Up @@ -224,6 +224,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `ALARM_TIMEAGO_URGENT` (`on`) - possible values `on` or `off`
* `ALARM_TIMEAGO_URGENT_MINS` (`30`) - minutes since the last reading to trigger a urgent alarm
* `SHOW_PLUGINS` - enabled plugins that should have their visualizations shown, defaults to all enabled
* `SHOW_FORECAST` (`ar2`) - plugin forecasts that should be shown by default, supports space delimited values such as `"ar2 openaps"`
* `LANGUAGE` (`en`) - language of Nightscout. If not available english is used
* `SCALE_Y` (`log`) - The type of scaling used for the Y axis of the charts system wide.
* The default `log` (logarithmic) option will let you see more detail towards the lower range, while still showing the full CGM range.
Expand Down Expand Up @@ -375,6 +376,8 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `OPENAPS_ENABLE_ALERTS` (`false`) - Set to `true` to enable notifications when OpenAPS isn't looping. If OpenAPS is going to offline for a period of time, you can add an `OpenAPS Offline` event for the expected duration from Careportal to avoid getting alerts.
* `OPENAPS_WARN` (`30`) - The number of minutes since the last loop that needs to be exceed before an alert is triggered
* `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.


Also see [Pushover](#pushover) and [IFTTT Maker](#ifttt-maker).
Expand Down
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

var express = require('express');
var compression = require('compression');
var bodyParser = require('body-parser');

function create (env, ctx) {
///////////////////////////////////////////////////
// api and json object variables
Expand All @@ -13,6 +15,11 @@ function create (env, ctx) {
app.set('title', appInfo);
app.enable('trust proxy'); // Allows req.secure test on heroku https connections.

if (ctx.bootErrors && ctx.bootErrors.length > 0) {
app.get('*', require('./lib/booterror')(ctx));
return app;
}

app.use(compression({filter: function shouldCompress(req, res) {
//TODO: return false here if we find a condition where we don't want to compress
// fallback to standard filter function
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"required": false
},
"THEME": {
"description": "Possible values default or colors",
"description": "Possible values default, colors or colorblindfriendly",
"value": "",
"required": false
},
Expand Down
315 changes: 315 additions & 0 deletions azuredeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"type": "string"
},
"hostingPlanName": {
"type": "string"
},
"siteLocation": {
"type": "string"
},
"sku": {
"type": "string",
"allowedValues": [
"Free",
"Shared",
"Basic",
"Standard"
],
"defaultValue": "Free"
},
"workerSize": {
"type": "string",
"allowedValues": [
"0",
"1",
"2"
],
"defaultValue": "0"
},
"repoUrl": {
"type": "string"

},
"branch": {
"type": "string"
},
"mongoConnection": {
"type": "string"
},
"displayUnits": {
"type": "string",
"allowedValues": [
"mg/dl",
"mmol"
],
"defaultValue": "mg/dl"
},
"apiSecret": {
"type": "string",
"minLength": "12",
"defaultValue": "Enter an API secret. Must be at least 12 characters"
},
"treatment_auth": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "on"
},
"theme": {
"type": "string",
"allowedValues": [
"default",
"colors",
"colorblindfriendly"
],
"defaultValue": "colors",
},
"time_format": {
"type": "string",
"allowedValues": [
"12",
"24"
],
"defaultValue": "24",
},
"language": {
"type": "string",
"allowedValues": [
"bg",
"cs",
"dk",
"de",
"en",
"es",
"fr",
"he",
"hr",
"it",
"nb",
"pl",
"pt",
"ro",
"sv",
"fi"
],
"defaultValue": "en",
},
"custom_title": {
"type": "string",
"defaultValue": "Nightscout",
},
"alarm_high": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"alarm_low": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"alarm_timeago_urgent": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"alarm_timeago_warn": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"alarm_urgent_high": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"alarm_urgent_low": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"basal_render": {
"type": "string",
"allowedValues": [
"default",
"icicle"
],
"defaultValue": "default",
},
"enable": {
"type": "string",
"defaultValue": "basal bwp cage careportal cob openaps pump rawbg sage treatmentnotify",
},
"night_mode": {
"type": "string",
"allowedValues": [
"on",
"off"
],
"defaultValue": "off",
},
"show_plugins": {
"type": "string",
"defaultValue": "basal bwp cage careportal cob openaps pump rawbg sage",
},
"show_rawbg": {
"type": "string",
"allowedValues": [
"always",
"never",
"noise"
],
"defaultValue": "never",
}
},
"resources": [
{
"apiVersion": "2015-04-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverFarms",
"location": "[parameters('siteLocation')]",
"properties": {
"sku": "[parameters('sku')]",
"workerSize": "[parameters('workerSize')]",
"numberOfWorkers": 1
}
},
{
"apiVersion": "2015-08-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/Sites",
"location": "[parameters('siteLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty"
},
"properties": {
"serverFarmId": "[parameters('hostingPlanName')]",
"siteConfig": {
"appSettings": [
{
"name": "MONGO_CONNECTION",
"value": "[parameters('mongoConnection')]"
},
{
"name": "DISPLAY_UNITS",
"value": "[parameters('displayUnits')]"
},
{
"name": "API_SECRET",
"value": "[parameters('apiSecret')]"
},
{
"name": "TREATMENT_AUTH",
"value": "[parameters('TREATMENT_AUTH')]"
},
{
"name": "THEME",
"value": "[parameters('theme')]"
},
{
"name": "TIME_FORMAT",
"value": "[parameters('time_format')]"
},

{
"name": "LANGUAGE",
"value": "[parameters('language')]"
},
{
"name": "CUSTOM_TITLE",
"value": "[parameters('custom_title')]"
},
{
"name": "ALARM_HIGH",
"value": "[parameters('alarm_high')]"
},
{
"name": "ALARM_LOW" ,
"value": "[parameters('alarm_low')]"
},
{
"name": "ALARM_TIMEAGO_URGENT" ,
"value": "[parameters('alarm_timeago_urgent')]"
},
{
"name": "ALARM_TIMEAGO_WARN" ,
"value": "[parameters('alarm_timeago_warn')]"
},
{
"name": "ALARM_URGENT_HIGH" ,
"value": "[parameters('alarm_urgent_high')]"
},
{
"name": "ALARM_URGENT_LOW",
"value": "[parameters('alarm_urgent_low')]"
},
{
"name": "BASAL_RENDER" ,
"value": "[parameters('basal_render')]"
},
{
"name": "ENABLE" ,
"value": "[parameters('enable')]"
},
{
"name": "NIGHT_MODE" ,
"value": "[parameters('night_mode')]"
},
{
"name": "SHOW_PLUGINS" ,
"value": "[parameters('show_plugins')]"
},
{
"name": "SHOW_RAWBG" ,
"value": "[parameters('show_rawbg')]"
}


]
}
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
],
"properties": {
"RepoUrl": "[parameters('repoUrl')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
}
]
}
Loading

0 comments on commit ce02a43

Please sign in to comment.