Skip to content

Commit

Permalink
Node and npm update (nightscout#4412)
Browse files Browse the repository at this point in the history
* npmupdate, update webpack, webpack-bundle-analyzer, swagger-ui-dist, jsonwebtoken, helmet, flot

* update to version 0.11.2-dev-20190224

* also test on latest Node (currently 11), but don't fail Travis build if it fails.

implement cclauss suggestion on openaps/oref0#1203 (comment)

* fix travis

* Node minor security upgrade

Node.js 8.15.1 (LTS "Carbon")
Node.js 10.15.2 (LTS "Dubnium")
Node.js 11.10.1 (Current)

https://nodejs.org/en/blog/vulnerability/february-2019-security-releases/

* fix typo

* npm update

* update npm-shrinkwrap.json
  • Loading branch information
PieterGit authored and sulkaharo committed Mar 5, 2019
1 parent ad338bf commit d437b56
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 236 deletions.
53 changes: 29 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
language: node_js
sudo: required
dist: xenial
node_js:
- "10"
- "8"
#os:
# - osx
before_install:
- if [[ `npm --version` != "6.4.1" ]]; then npm install -g npm@latest; npm --version; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
# https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
# "brew install" can succeed but return 1 if it has "caveats".
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install mongodb || true; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew services start mongodb; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docker || true; fi

node_js-steps: &node_js-steps
language: node_js
before_install:
- if [[ `npm --version` != "6.4.1" ]]; then npm install -g npm@latest; npm --version; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
# https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
# "brew install" can succeed but return 1 if it has "caveats".
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install mongodb || true; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew services start mongodb; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docker || true; fi
script: make travis
after_success:
- nvm version
- if [[ ! -z "$DOCKER_USER" ]]; then docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && git checkout -- . && git clean -fd . && make docker_release; fi
after_script: make report
services:
- mongodb
- docker
matrix:
fast_finish: true
services:
- mongodb
- docker
script: make travis
after_success:
- nvm version
- if [[ ! -z "$DOCKER_USER" ]]; then docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && git checkout -- . && git clean -fd . && make docker_release; fi
after_script: make report
allow_failures:
node_js: "node"
include:
- node_js: "8"
<<: *node_js-steps
- node_js: "10"
<<: *node_js-steps
- node_js: "node" # Latest Node is not supported, and recommend, but we'll test it to know incompatibility issues
<<: *node_js-steps
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Minimum browser requirements for viewing the site:

Windows installation software requirements:

- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.15.0 or later) or Node 10 LTS (Node 10.15.1 or later; Node 10.14.1 works for Azure). Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.15.1 or later) or Node 10 LTS (Node 10.15.2 or later; Node 10.14.1 works for Azure). Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `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.

As a non-root user clone this repo then install dependencies into the root of the project:
Expand Down
22 changes: 14 additions & 8 deletions lib/server/bootevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,36 @@ function boot (env, language) {
// Check Node version.
// Latest Node 8 LTS and Latest Node 10 LTS are recommended and supported.
// Latest Node version on Azure is tolerated, but not recommended
// Latest Node (non LTS) version works, but not recommended
// Other versions will not start
// More explicit:
// < 8 does not work, not supported
// >= 8.15.0 works, supported and recommended
// >= 8.15.1 works, supported and recommended
// == 9.x does not work, not supported
// == 10.14.1 works, not fully supported and not recommended (Azure version)
// == 10.14.2 does not work, not supported and not recommended,
// >= 10.15.1 works, supported and recommended
// >= 11.6.0 does not work, not recommended, will not be supported. We only support Node LTS releases
// >= 10.15.2 works, supported and recommended
// >= 11.10.1 does work, not recommended, will not be supported. We only support Node LTS releases
///////////////////////////////////////////////////
function checkNode (ctx, next) {
function checkNodeVersion (ctx, next) {
var semver = require('semver');
var nodeVersion = process.version;

if ( semver.satisfies(nodeVersion, '^8.15.0') || semver.satisfies(nodeVersion, '^10.15.1')) {
if ( semver.satisfies(nodeVersion, '^8.15.1') || semver.satisfies(nodeVersion, '^10.15.2')) {
//Latest Node 8 LTS and Latest Node 10 LTS are recommended and supported.
console.debug('Node version ' + nodeVersion + ' is supported');
console.debug('Node LTS version ' + nodeVersion + ' is supported');
next();
}
else if ( semver.eq(nodeVersion, '10.14.1')) {
else if ( semver.eq(nodeVersion, '10.14.1')) {
//Latest Node version on Azure is tolerated, but not recommended
console.log('WARNING: Node version v10.14.1 and Microsoft Azure are not recommended.');
console.log('WARNING: Please migrate to another hosting provider. Your Node version is outdated and insecure');
next();
}
else if ( semver.satisfies(nodeVersion, '^11.10.1')) {
//Latest Node version
console.debug('Node version ' + nodeVersion + ' is not a LTS version. Not recommended. Not supported');
next();
} else {
// Other versions will not start
console.log( 'ERROR: Node version ' + nodeVersion + ' is not supported. Please upgrade your Node');
Expand Down Expand Up @@ -264,7 +270,7 @@ function boot (env, language) {
}

return require('bootevent')( )
.acquire(checkNode)
.acquire(checkNodeVersion)
.acquire(checkEnv)
.acquire(augmentSettings)
.acquire(setupStorage)
Expand Down
Loading

0 comments on commit d437b56

Please sign in to comment.