Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev - post release 14.2.6 #7567

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1a83292
Remove unused OTP field from Remote Override form.
gestrich Aug 14, 2022
a5fcc84
Merge branch 'dev' into bugfix/remove-remote-override-otp
bewest Aug 14, 2022
3213835
Merge branch 'dev' into bugfix/remove-remote-override-otp
bewest Aug 14, 2022
fb4d467
update Node requirements. This is a follow up from https://github.com…
PieterGit Aug 15, 2022
0a81915
drop Node 18 support for now
PieterGit Aug 15, 2022
652baed
update all webpack related plugins to latest version
PieterGit Aug 15, 2022
b7ee1bf
upgrade mocha to 8.4.0 and nodemon to 2.0.19 and recreate package-loc…
PieterGit Aug 16, 2022
4a64be2
remove two critical vulnerabilities in npm packages. Remove codacy-co…
PieterGit Aug 16, 2022
3c516d5
support > 0.25% of browerslist, see if we can support iOS 9.3.x as we…
PieterGit Aug 16, 2022
7b01d49
Experimenting around changing build artefact location to go to node_m…
sulkaharo Aug 28, 2022
37a2a0d
Try .cache in node_modules
sulkaharo Aug 29, 2022
a6eb156
Fix app.js
sulkaharo Aug 29, 2022
ec3cf94
* Fix tests
sulkaharo Aug 30, 2022
6c03dcd
Remove mkdir from package.json and change key generation to a post sc…
sulkaharo Aug 30, 2022
6978a90
Fix package running the post script
sulkaharo Aug 30, 2022
2e4551e
Merge branch 'dev' into new_cache_location
sulkaharo Aug 30, 2022
2e7f695
initialize new dev area post-release
bewest Sep 30, 2022
9f622c2
Merge branch 'dev20220815' of github.com:PieterGit/cgm-remote-monitor…
bewest Oct 1, 2022
64d93e6
allow any LTS version
bewest Oct 1, 2022
a8da747
Merge pull request #7568 from nightscout/wip/bewest/PieterGit-dev2022…
bewest Oct 1, 2022
aed9998
Merge branch 'dev' into new_cache_location
bewest Oct 1, 2022
8706658
Merge pull request #7526 from sulkaharo/new_cache_location
bewest Oct 1, 2022
2e1ee38
inject text instead of HTML name
bewest Oct 1, 2022
1db4047
avoid HTML injection
bewest Oct 1, 2022
74ce49c
Merge pull request #7569 from nightscout/wip/bewest/code-ql-analysis
bewest Oct 1, 2022
dbce9db
codeql text/html injection in food.js
bewest Oct 1, 2022
09c9f81
Merge pull request #7570 from nightscout/wip/bewest/code-ql-analysis
bewest Oct 1, 2022
0fd05c2
fix webpack 5 in Lerna
k2s Oct 29, 2022
e78a63f
fix formatting of empty spaces
k2s Oct 29, 2022
ed7fdf7
fix don't print error about IMPORT_CONFIG if not defined
k2s Oct 29, 2022
2c6ba28
Merge pull request #7647 from k2s/fix-empty-import-config
bewest Nov 1, 2022
bcfe437
Merge branch 'dev' into bugfix/remove-remote-override-otp
bewest Nov 16, 2022
4aa0657
Merge pull request #7513 from gestrich/bugfix/remove-remote-override-otp
bewest Nov 16, 2022
8594a2d
Regenerated package-lock with newer NPM and fixed a unit test that br…
sulkaharo Dec 30, 2022
bd40046
Change the SHA1 validation to be case insensitive (#7780)
sulkaharo Dec 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Browsers we support
# See https://github.com/browserslist/browserslist for details

> 0.25%
ios_saf 9.3
ios_saf 10.3
ios_saf 13.7
ios_saf 14.8
not dead
not and_uc 12.12
not ie 11

2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x]
mongodb-version: [4.2, 4.4]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.15.3
16.16.0
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Nightscout Web Monitor (a.k.a. cgm-remote-monitor)
======================================
==================================================

![nightscout horizontal](https://cloud.githubusercontent.com/assets/751143/8425633/93c94dc0-1ebc-11e5-99e7-71a8f464caac.png)

Expand Down Expand Up @@ -149,23 +149,28 @@ you're welcome to issue a documentation pull request with instructions on how to

## Recommended minimum browser versions for using Nightscout:

Older versions of the browsers might work, but are untested.
Our [browserslist](https://github.com/browserslist/browserslist) policy is documented in `.browserlistrc`.
We currently support approximately [91%](https://browsersl.ist/?q=%3E+0.25%25%2C+ios_saf+9.3%2C+ios_saf+10.3%2C+ios_saf+13.7%2C+ios_saf+14.8%2C+not+dead%2C+not+and_uc+12.12%2C+not+ie+11%0A) of all browsers globally used. These include:

- Android 4
- iOS 6
- Chrome 35
- Edge 17
- Firefox 61
- Opera 12.1
- Safari 6 (macOS 10.7)
- Internet Explorer: not supported
- Android Chrome: 104 or later (`and_chr`)
- Google Chrome: 101 or later (`chrome`)
- Microsoft Edge: 103 or later (`edge`)
- Mozilla Firefox: 102 or later (`firefox`)
- Apple Safari on iOS: 15.5 or later (`ios_saf`)
- Opera Mini on Android: 63 or later (`op_mini`)
- Opera: 88 or later (`opera`)
- Apple Safari for macOS 10.15 Catalina or later: : 15.5 or later (`safari`)
- Samsung Internet on Android: 17.0 or later (`samsung`)
- Internet Explorer 11 : not supported

Some features may not work with devices/browsers on the older end of these requirements.
Older versions or other browsers might work, but are untested and unsupported. We'll try to to keep Nightscout compatible with older iPads (e.g. Safari on iOS 10.3.4), but note that those devices are not supported by Apple anymore and have known security issues. Debugging these old devices gets harder due to Apple not supporting debugging the old devices on Macs that have been updated. Some features may not work with devices/browsers on the older end of these requirements.

## Windows installation software requirements:

- [Node.js](http://nodejs.org/) Latest Node 12 LTS. 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 `bin/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.

## Installation software requirements:

- [Node.js](http://nodejs.org/) Latest Node v14 or v16 LTS. Node versions that do not have the latest security patches will not be supported. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `bin/setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 4.2 or 4.4.

As a non-root user clone this repo then install dependencies into the root of the project:

Expand All @@ -184,7 +189,7 @@ $ npm install

- 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=10.15.2
WEBSITE_NODE_DEFAULT_VERSION=16.16.0
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.
Expand Down
2 changes: 1 addition & 1 deletion azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
},
"WEBSITE_NODE_DEFAULT_VERSION": {
"type": "string",
"defaultValue": "8.11.1"
"defaultValue": "16.16.0"
}
},
"resources": [{
Expand Down
2 changes: 1 addition & 1 deletion lib/client/hashauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ hashauth.init = function init (client, $) {
client.browserUtils.reload();
}

// clear eveything just in case
// clear everything just in case
hashauth.apisecret = null;
hashauth.apisecrethash = null;
hashauth.authenticated = false;
Expand Down
8 changes: 4 additions & 4 deletions lib/food/food.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ client.init(function loaded () {
.append($('<img>').attr('title',translate('Edit record')).attr('src',icon_edit).attr('index',i).attr('class','fe_editimg'))
.append($('<img>').attr('title',translate('Delete record')).attr('src',icon_remove).attr('index',i).attr('class','fe_removeimg'))
)
.append($('<span>').addClass('width200px').append(foodlist[i].name))
.append($('<span>').addClass('width200px').text(foodlist[i].name))
.append($('<span>').addClass('width150px').css('text-align','center').append(foodlist[i].portion))
.append($('<span>').addClass('width50px').css('text-align','center').append(foodlist[i].unit))
.append($('<span>').addClass('width50px').css('text-align','center').text(foodlist[i].unit))
.append($('<span>').addClass('width100px').css('text-align','center').append(foodlist[i].carbs))
.append($('<span>').addClass('width100px').css('text-align','center').append(foodlist[i].gi))
.append($('<span>').addClass('width150px').append(foodlist[i].category))
.append($('<span>').addClass('width150px').append(foodlist[i].subcategory))
.append($('<span>').addClass('width150px').text(foodlist[i].category))
.append($('<span>').addClass('width150px').text(foodlist[i].subcategory))
.append($('<span>').addClass('width100px').append(foodlist[i].fat))
.append($('<span>').addClass('width100px').append(foodlist[i].protein))
.append($('<span>').addClass('width100px').append(foodlist[i].energy))
Expand Down
1 change: 0 additions & 1 deletion lib/plugins/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ function init (ctx) {
, split: false
, targets: false
, reasons: reasonconf
, otp: true
, submitHook: postLoopNotification
},
{
Expand Down
4 changes: 2 additions & 2 deletions lib/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function create (env, ctx) {
}

// Production bundling
const tmpFiles = express.static(resolvePath('/tmp/public'), {
const tmpFiles = express.static(resolvePath('/node_modules/.cache/_ns_cache/public'), {
maxAge: maxAge
});

Expand All @@ -343,7 +343,7 @@ function create (env, ctx) {
, coffee_match: /coffeescript/
, json_match: /json/
, cssmin: myCssmin
, cache: resolvePath('/tmp/public')
, cache: resolvePath('/node_modules/.cache/_ns_cache/public')
, onerror: undefined
, }));

Expand Down
25 changes: 15 additions & 10 deletions lib/server/bootevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function boot (env, language) {

//////////////////////////////////////////////////
// Check Node version.
// Latest Node 10 to 14 LTS are recommended and supported.
// Latest Node LTS releases are recommended and supported.
// Current Node releases MAY work, but are not recommended. Will be tested in CI
// Older Node versions or Node versions with known security issues will not work.
///////////////////////////////////////////////////
function checkNodeVersion (ctx, next) {
Expand All @@ -34,10 +35,10 @@ function boot (env, language) {
var nodeVersion = process.version;

const isLTS = process.release.lts ? true : false;
if (isLTS && (semver.satisfies(nodeVersion, '^16.0.0') || semver.satisfies(nodeVersion, '^14.0.0') || semver.satisfies(nodeVersion, '^12.0.0') || semver.satisfies(nodeVersion, '^10.0.0'))) {
//Latest Node 10 LTS and Node 12 LTS are recommended and supported.
//Require at least Node 8 LTS and Node 10 LTS without known security issues

if (isLTS && (semver.satisfies(nodeVersion, '^16.0.0') || semver.satisfies(nodeVersion, '^14.0.0'))) {
//Latest Node 14 LTS and Node 16 LTS are recommended and supported.
//Require at least Node 14 without known security issues
console.debug('Node LTS version ' + nodeVersion + ' is supported');
next();
return;
Expand Down Expand Up @@ -71,11 +72,15 @@ function boot (env, language) {
var configURL = env.IMPORT_CONFIG || null;
var url = require('url');
var href = null;
try {
href = url.parse(configURL).href;
} catch (e) {
console.error('Parsing config URL from IMPORT_CONFIG failed');

if (configURL) {
try {
href = url.parse(configURL).href;
} catch (e) {
console.error('Parsing config URL from IMPORT_CONFIG failed');
}
}

if(configURL && href) {
var request = require('request');
console.log('Getting settings from', href);
Expand Down Expand Up @@ -266,7 +271,7 @@ function boot (env, language) {
function setupListeners (ctx, next) {

console.log('Executing setupListeners');

if (hasBootErrors(ctx)) {
return next();
}
Expand Down
8 changes: 4 additions & 4 deletions lib/server/enclave.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const init = function init () {
let apiKeySet = false;

function readKey (filename) {
let filePath = path.resolve(__dirname + '/../../tmp/' + filename);
let filePath = path.resolve(__dirname + '/../../node_modules/.cache/_ns_cache/' + filename);
if (fs.existsSync(filePath)) {
return fs.readFileSync(filePath).toString().trim();
}
Expand All @@ -32,7 +32,7 @@ const init = function init () {
function genHash(data, algorihtm) {
const hash = crypto.createHash(algorihtm);
data = hash.update(data, 'utf-8');
return data.digest('hex');
return data.digest('hex').toLowerCase();
}

enclave.setApiKey = function setApiKey (keyValue) {
Expand All @@ -48,7 +48,7 @@ const init = function init () {
}

enclave.isApiKey = function isApiKey (keyValue) {
return keyValue == secrets[apiKeySHA1] || keyValue == secrets[apiKeySHA512];
return keyValue.toLowerCase() == secrets[apiKeySHA1] || keyValue == secrets[apiKeySHA512];
}

enclave.setJWTKey = function setJWTKey (keyValue) {
Expand All @@ -72,7 +72,7 @@ const init = function init () {
var shasum = crypto.createHash('sha1');
shasum.update(secrets[apiKeySHA1]);
shasum.update(id);
return shasum.digest('hex');
return shasum.digest('hex').toLowerCase();
}

return enclave;
Expand Down
Loading