diff --git a/app.js b/app.js index 05f1d8ff694..1461266bbf1 100644 --- a/app.js +++ b/app.js @@ -18,12 +18,12 @@ function create (env, ctx) { if (!insecureUseHttp) { console.info('Redirecting http traffic to https because INSECURE_USE_HTTP=', insecureUseHttp); app.use((req, res, next) => { - if (req.header('x-forwarded-proto') == 'https' || req.secure) { + if (req.header('x-forwarded-proto') === 'https' || req.secure) { next(); } else { res.redirect(307, `https://${req.header('host')}${req.url}`); } - }) + }); if (secureHstsHeader) { // Add HSTS (HTTP Strict Transport Security) header console.info('Enabled SECURE_HSTS_HEADER (HTTP Strict Transport Security)'); const helmet = require('helmet'); @@ -61,7 +61,7 @@ function create (env, ctx) { })); app.use(helmet.referrerPolicy({ policy: 'no-referrer' })); app.use(helmet.featurePolicy({ features: { payment: ["'none'"], } })); - app.use(bodyParser.json({ type: ['json', 'application/csp-report'] })) + app.use(bodyParser.json({ type: ['json', 'application/csp-report'] })); app.post('/report-violation', (req, res) => { if (req.body) { console.log('CSP Violation: ', req.body) @@ -84,7 +84,11 @@ function create (env, ctx) { let cacheBuster = 'developmentMode'; if (process.env.NODE_ENV !== 'development') { - cacheBuster = fs.readFileSync(process.cwd() + '/tmp/cacheBusterToken').toString().trim(); + if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { + cacheBuster = fs.readFileSync(process.cwd() + '/tmp/cacheBusterToken').toString().trim(); + } else { + cacheBuster = fs.readFileSync(__dirname + '/tmp/cacheBusterToken').toString().trim(); + } } app.locals.cachebuster = cacheBuster; @@ -254,9 +258,16 @@ function create (env, ctx) { } // Production bundling - var tmpFiles = express.static('tmp', { - maxAge: maxAge - }); + var tmpFiles; + if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { + tmpFiles = express.static('tmp', { + maxAge: maxAge + }); + } else { + tmpFiles = express.static(__dirname + '/tmp', { + maxAge: maxAge + }); + } // serve the static content app.use('/bundle', tmpFiles); diff --git a/lib/client/browser-settings.js b/lib/client/browser-settings.js index d7782170b2a..4f990eb57f3 100644 --- a/lib/client/browser-settings.js +++ b/lib/client/browser-settings.js @@ -104,7 +104,7 @@ function init (client, serverSettings, $) { showPluginsSettings.toggle(hasPluginsToShow); - const bs = $('.browserSettings'); + const bs = $('#browserSettings'); const toggleCheckboxes = []; if (pluginPrefs.length > 0) { diff --git a/lib/report_plugins/daytoday.js b/lib/report_plugins/daytoday.js index 3445973402c..72eaf0de3a0 100644 --- a/lib/report_plugins/daytoday.js +++ b/lib/report_plugins/daytoday.js @@ -738,7 +738,6 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio var label = ' ' + treatment.carbs + ' g'; if (treatment.protein) label += ' / ' + treatment.protein + ' g'; if (treatment.fat) label += ' / ' + treatment.fat + ' g'; - label += ' (' + client.utils.toFixedMin((treatment.carbs / ic), 2) + 'U)'; context.append('rect') .attr('y', yCarbsScale(treatment.carbs)) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f54cc8fa3b3..6a92d7e95ee 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "0.12.3-dev", + "version": "0.12.4-dev", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5adf81960af..ffd8ac9e2f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "0.12.3", + "version": "0.12.4-dev", "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", diff --git a/static/profile/js/profileeditor.js b/static/profile/js/profileeditor.js index c57dd4c7eae..c1443e5cade 100644 --- a/static/profile/js/profileeditor.js +++ b/static/profile/js/profileeditor.js @@ -671,13 +671,6 @@ adjustedRecord.defaultProfile = currentprofile; adjustedRecord.units = client.settings.units; - if (record.convertedOnTheFly) { - var result = window.confirm(translate('Profile is going to be saved in newer format used in Nightscout 0.9.0 and above and will not be usable in older versions anymore.\nAre you sure?')); - if (!result) { - return; - } - } - delete record.convertedOnTheFly; delete adjustedRecord.convertedOnTheFly; diff --git a/swagger.json b/swagger.json index 1daf2c45a38..0d07a0bf128 100755 --- a/swagger.json +++ b/swagger.json @@ -8,7 +8,7 @@ "info": { "title": "Nightscout API", "description": "Own your DData with the Nightscout API", - "version": "0.12.3", + "version": "0.12.4-dev", "license": { "name": "AGPL 3", "url": "https://www.gnu.org/licenses/agpl.txt" diff --git a/swagger.yaml b/swagger.yaml index 4591239d8d8..e2555db7460 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -4,7 +4,7 @@ servers: info: title: Nightscout API description: Own your DData with the Nightscout API - version: 0.12.3 + version: 0.12.4-dev license: name: AGPL 3 url: 'https://www.gnu.org/licenses/agpl.txt' diff --git a/views/clockviews/shared.html b/views/clockviews/shared.html index f7d5f78cd25..247d1d46bb7 100644 --- a/views/clockviews/shared.html +++ b/views/clockviews/shared.html @@ -33,6 +33,7 @@
+