diff --git a/lib/adminnotifies.js b/lib/adminnotifies.js index b035779d..7c360360 100644 --- a/lib/adminnotifies.js +++ b/lib/adminnotifies.js @@ -7,6 +7,11 @@ function init (ctx) { const adminnotifies = {}; adminnotifies.addNotify = function addnotify (notify) { + if (!ctx.settings.adminNotifiesEnabled) { + console.log('Admin notifies disabled, skipping notify', notify); + return; + } + if (!notify) return; notify.title = notify.title || 'No title'; diff --git a/lib/language.js b/lib/language.js index d02fe358..43752869 100644 --- a/lib/language.js +++ b/lib/language.js @@ -150,6 +150,7 @@ function init (fs) { } language.set = function set (newlang) { + if (!newlang) return; language.lang = newlang; language.languages.forEach(function(l) { diff --git a/lib/server/bootevent.js b/lib/server/bootevent.js index 171ac75b..bb2d29af 100644 --- a/lib/server/bootevent.js +++ b/lib/server/bootevent.js @@ -10,6 +10,7 @@ function boot (env, language) { console.log('Executing startBoot'); ctx.runtimeState = 'booting'; + ctx.settings = env.settings; ctx.bus = require('../bus')(env.settings, ctx); ctx.adminnotifies = require('../adminnotifies')(ctx); if (env.notifies) { diff --git a/lib/server/swagger.json b/lib/server/swagger.json index abfc2337..bc5589b7 100755 --- a/lib/server/swagger.json +++ b/lib/server/swagger.json @@ -8,7 +8,7 @@ "info": { "title": "Nightscout API", "description": "Own your DData with the Nightscout API", - "version": "14.2.1", + "version": "14.2.2", "license": { "name": "AGPL 3", "url": "https://www.gnu.org/licenses/agpl.txt" diff --git a/lib/server/swagger.yaml b/lib/server/swagger.yaml index cb559a46..dc4594c3 100755 --- a/lib/server/swagger.yaml +++ b/lib/server/swagger.yaml @@ -4,7 +4,7 @@ servers: info: title: Nightscout API description: Own your DData with the Nightscout API - version: 14.2.1 + version: 14.2.2 license: name: AGPL 3 url: 'https://www.gnu.org/licenses/agpl.txt' diff --git a/lib/settings.js b/lib/settings.js index fc3b71d9..32cf888e 100644 --- a/lib/settings.js +++ b/lib/settings.js @@ -69,6 +69,7 @@ function init () { , frameName7: '' , frameName8: '' , authFailDelay: 5000 + , adminNotifiesEnabled: true }; var secureSettings = [ @@ -105,6 +106,7 @@ function init () { , bgTargetTop: mapNumber , bgTargetBottom: mapNumber , authFailDelay: mapNumber + , adminNotifiesEnabled: mapTruthy }; function filterObj(obj, secureKeys) { diff --git a/package-lock.json b/package-lock.json index 6bacd52d..a05aeb3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "14.2.0", + "version": "14.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e795ee0b..68967772 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "14.2.1", + "version": "14.2.2", "description": "Nightscout acts as a web-based CGM (Continuous Glucose Montinor) to allow multiple caregivers to remotely view a patients glucose data in realtime.", "license": "AGPL-3.0", "author": "Nightscout Team",