From 3200af6299c584a826623713c4e2809e84fc47f3 Mon Sep 17 00:00:00 2001 From: Sulka Haro Date: Thu, 18 Feb 2021 18:10:50 +0200 Subject: [PATCH 01/14] * Bump dev to 14.2.2 * Add ADMIN_NOTIFIES_ENABLED feature flag * Skip setting language code if language value is not null --- lib/adminnotifies.js | 5 +++++ lib/language.js | 1 + lib/server/bootevent.js | 1 + lib/server/swagger.json | 2 +- lib/server/swagger.yaml | 2 +- lib/settings.js | 2 ++ package-lock.json | 2 +- package.json | 2 +- 8 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/adminnotifies.js b/lib/adminnotifies.js index b035779d672..7c3603609f6 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 d02fe358c8b..43752869783 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 171ac75b3fd..bb2d29afd7d 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 abfc23371e8..bc5589b786e 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 cb559a46bab..dc4594c3133 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 fc3b71d9757..32cf888e8c0 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 6bacd52d00a..a05aeb3f7c7 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 e795ee0b00e..68967772ae7 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", From d73de56b5baf39b4e9334526296c65a05511bd43 Mon Sep 17 00:00:00 2001 From: Sulka Haro Date: Thu, 18 Feb 2021 18:23:40 +0200 Subject: [PATCH 02/14] Fix adminnotifies test --- tests/adminnotifies.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/adminnotifies.test.js b/tests/adminnotifies.test.js index 27473dd7969..86655708d26 100644 --- a/tests/adminnotifies.test.js +++ b/tests/adminnotifies.test.js @@ -8,6 +8,8 @@ const ctx = {}; ctx.bus = {}; ctx.bus.on = function mockOn(channel, f) { }; +ctx.settings = {}; +ctx.settings.adminNotifiesEnabled = true; const mockJqueryResults = {}; const mockButton = {}; From 22f4336e7f044969e0050ccaba5827eb1e68a4ba Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 09:05:15 -0800 Subject: [PATCH 03/14] re-install server.js at root This continues to allow using server.js programmatically from the root of the project. --- server.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 server.js diff --git a/server.js b/server.js new file mode 100644 index 00000000000..a1375ff75c7 --- /dev/null +++ b/server.js @@ -0,0 +1,3 @@ + +require('./lib/server/server'); + From be183f5d1b436ca06e556c374a941045da41e372 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 09:09:02 -0800 Subject: [PATCH 04/14] include standard header for server.js at root. --- server.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/server.js b/server.js index a1375ff75c7..d1c3f30897b 100644 --- a/server.js +++ b/server.js @@ -1,3 +1,26 @@ +/* +* cgm-remote-monitor - web app to broadcast cgm readings +* Copyright (C) 2014 Nightscout contributors. See the COPYRIGHT file +* at the root directory of this distribution and at +* https://github.com/nightscout/cgm-remote-monitor/blob/master/COPYRIGHT +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as published +* by the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see . +*/ + +// Description: Basic web server to display data from Dexcom G4. Requires a database that contains +// the Dexcom SGV data. +'use strict'; require('./lib/server/server'); From a42408b0a789a02b90dcc69fa091c57ea67e19e6 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 09:46:29 -0800 Subject: [PATCH 05/14] task: clean repo root This change seeks to continue tidying up the repo. * The database_configuration.json file is not used and has not been used since the project was published on github. We remove the ability to look at files inside the source tree for database credentials. * Move example-profiles.md to the relevant documentation for plugins area and update the link to match. --- README.md | 2 +- database_configuration.json | 4 ---- example-profiles.md => docs/plugins/example-profiles.md | 0 lib/server/env.js | 5 +---- 4 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 database_configuration.json rename example-profiles.md => docs/plugins/example-profiles.md (100%) diff --git a/README.md b/README.md index d7c272787b4..3a94250f5b1 100644 --- a/README.md +++ b/README.md @@ -670,7 +670,7 @@ For remote overrides, the following extended settings must be configured: * `target_high` - Upper target for correction boluses. * `target_low` - Lower target for correction boluses. - Some example profiles are [here](example-profiles.md). + Some example profiles are [here](docs/plugins/example-profiles.md). ## Setting environment variables Easy to emulate on the commandline: diff --git a/database_configuration.json b/database_configuration.json deleted file mode 100644 index d768358bbb1..00000000000 --- a/database_configuration.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": null, - "collection": null -} diff --git a/example-profiles.md b/docs/plugins/example-profiles.md similarity index 100% rename from example-profiles.md rename to docs/plugins/example-profiles.md diff --git a/lib/server/env.js b/lib/server/env.js index c05581f206e..afb53d51332 100644 --- a/lib/server/env.js +++ b/lib/server/env.js @@ -130,10 +130,7 @@ function setStorage () { env.food_collection = readENV('MONGO_FOOD_COLLECTION', 'food'); env.activity_collection = readENV('MONGO_ACTIVITY_COLLECTION', 'activity'); - // TODO: clean up a bit - // Some people prefer to use a json configuration file instead. - // This allows a provided json config to override environment variables - var DB = require('../../database_configuration.json') + var DB = { url: null, collection: null } , DB_URL = DB.url ? DB.url : env.storageURI , DB_COLLECTION = DB.collection ? DB.collection : env.entries_collection; env.storageURI = DB_URL; From 3bb4f6be01d1a5e317860e072f8f686bea5b8e19 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 09:52:11 -0800 Subject: [PATCH 06/14] move script for repo maintenance aside This script is used to help prep release branches and tags. Since it's not crucial to the business of remote monitoring and only useful as a maintenance tool, we're moving it away from the project root. --- prep_repo_release.sh => bin/prep_repo_release.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename prep_repo_release.sh => bin/prep_repo_release.sh (100%) diff --git a/prep_repo_release.sh b/bin/prep_repo_release.sh similarity index 100% rename from prep_repo_release.sh rename to bin/prep_repo_release.sh From 5ae162cc6bbcdde04fb5f25f52c4ceba75fc5818 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 09:55:47 -0800 Subject: [PATCH 07/14] task: clean project root Move update image into docs folder, away from project root. --- README.md | 2 +- update.png => docs/update.png | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename update.png => docs/update.png (100%) diff --git a/README.md b/README.md index 3a94250f5b1..cbaecb5f4ab 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) [discord-url]: https://discord.gg/rTKhrqz [heroku-img]: https://www.herokucdn.com/deploy/button.png [heroku-url]: https://heroku.com/deploy?template=https://github.com/nightscout/cgm-remote-monitor -[update-img]: update.png +[update-img]: docs/update.png [update-fork]: http://nightscout.github.io/pages/update-fork/ [original]: https://github.com/rnpenguin/cgm-remote-monitor diff --git a/update.png b/docs/update.png similarity index 100% rename from update.png rename to docs/update.png From 5953f082df9fddb631cf8f872d44a9784546d88b Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 09:59:15 -0800 Subject: [PATCH 08/14] remove empty file from project root --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test diff --git a/test b/test deleted file mode 100644 index e69de29bb2d..00000000000 From 3149bf8b9562521015c17cda12d2b13e35cc9614 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 10:02:00 -0800 Subject: [PATCH 09/14] task: clean project root setup.sh appears to be a developer utility to assist in bootstrapping a debian based system. It is intended to help install the dependencies needed to run node, and not used in any automated deploy pipeline. Instructions have been updated to suite this change which simply moves the developer tool out of the project repo and into the bin subdirectory. --- README.md | 6 +++--- setup.sh => bin/setup.sh | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename setup.sh => bin/setup.sh (100%) diff --git a/README.md b/README.md index cbaecb5f4ab..767d954eeca 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ Some features may not work with devices/browsers on the older end of these requi ## 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 `setup.sh`) +- [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. As a non-root user clone this repo then install dependencies into the root of the project: @@ -690,13 +690,13 @@ Your hosting provider probably has a way to set these through their GUI. ### Vagrant install Optionally, use [Vagrant](https://www.vagrantup.com/) with the -included `Vagrantfile` and `setup.sh` to install OS and node packages to +included `Vagrantfile` and `bin/setup.sh` to install OS and node packages to a virtual machine. ```bash host$ vagrant up host$ vagrant ssh -vm$ setup.sh +vm$ ./bin/setup.sh ``` The setup script will install OS packages then run `npm install`. diff --git a/setup.sh b/bin/setup.sh similarity index 100% rename from setup.sh rename to bin/setup.sh From 52cca32bf38a2e6ec9f6aab04742f57e6a8a964e Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 10:08:34 -0800 Subject: [PATCH 10/14] task: tidy project root This change moves the azure deployment script from the root of the project into the bin subdirectory with a name that makes its purpose more clear. .deployment file has been updated to execute the new path. --- .deployment | 2 +- deploy.sh => bin/azure-deploy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename deploy.sh => bin/azure-deploy.sh (98%) diff --git a/.deployment b/.deployment index 1e42f16cade..7d94259b916 100644 --- a/.deployment +++ b/.deployment @@ -1,2 +1,2 @@ [config] -command = bash deploy.sh \ No newline at end of file +command = bash bin/azure-deploy.sh diff --git a/deploy.sh b/bin/azure-deploy.sh similarity index 98% rename from deploy.sh rename to bin/azure-deploy.sh index 710cbb14d3f..5ffbee022ab 100755 --- a/deploy.sh +++ b/bin/azure-deploy.sh @@ -103,7 +103,7 @@ echo "\"$SCM_COMMIT_ID\"" > $DEPLOYMENT_SOURCE/scm-commit-id.json # 1. KuduSync if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then - "$KUDU_SYNC_CMD" -v 50 -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh" + "$KUDU_SYNC_CMD" -v 50 -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;bin/azure-deploy.sh" exitWithMessageOnError "Kudu Sync failed" fi From aa4dca7cc7ad889ef31b0b241f5560c1c21e2874 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 10:39:44 -0800 Subject: [PATCH 11/14] task: tidy project root: webpack This change attempts to tidy the project root by moving webpack configuration into it's own subdirectory. The metadata has been updated to match this information. In addition, the configuration file itself is simplified for future maintainers in some ways. Now the configuration to a projectRoot which is calculated exactly once, instead of introspecting from __dirname each time. --- package.json | 8 ++++---- webpack.config.js => webpack/webpack.config.js | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) rename webpack.config.js => webpack/webpack.config.js (96%) diff --git a/package.json b/package.json index 68967772ae7..01bdb0efe80 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,10 @@ "test-single": "env-cmd -f ./my.test.env mocha --require ./tests/hooks.js --exit ./tests/$TEST.test.js", "test-ci": "env-cmd -f ./ci.test.env nyc --reporter=lcov --reporter=text-summary mocha --require ./tests/hooks.js --exit ./tests/*.test.js", "env": "env", - "postinstall": "webpack --mode production --config webpack.config.js && npm run-script generate-keys", - "bundle": "webpack --mode production --config webpack.config.js && npm run-script generate-keys", - "bundle-dev": "webpack --mode development --config webpack.config.js && npm run-script generate-keys", - "bundle-analyzer": "webpack --mode development --config webpack.config.js --profile --json > stats.json && webpack-bundle-analyzer stats.json", + "postinstall": "webpack --mode production --config webpack/webpack.config.js && npm run-script generate-keys", + "bundle": "webpack --mode production --config webpack/webpack.config.js && npm run-script generate-keys", + "bundle-dev": "webpack --mode development --config webpack/webpack.config.js && npm run-script generate-keys", + "bundle-analyzer": "webpack --mode development --config webpack/webpack.config.js --profile --json > stats.json && webpack-bundle-analyzer stats.json", "generate-keys": "node bin/generateRandomString.js >tmp/randomString", "coverage": "cat ./coverage/lcov.info | env-cmd -f ./ci.test.env codacy-coverage", "dev": "env-cmd -f ./my.env nodemon --inspect lib/server/server.js 0.0.0.0", diff --git a/webpack.config.js b/webpack/webpack.config.js similarity index 96% rename from webpack.config.js rename to webpack/webpack.config.js index 0193fedc859..66ab433bd9f 100644 --- a/webpack.config.js +++ b/webpack/webpack.config.js @@ -4,6 +4,7 @@ const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); const pluginArray = []; const sourceMapType = 'source-map'; const MomentTimezoneDataPlugin = require('moment-timezone-data-webpack-plugin'); +const projectRoot = path.resolve(__dirname, '..'); /* if (process.env.NODE_ENV === 'development') { @@ -94,7 +95,7 @@ const rules = [ options: { babelrc: true, cacheDirectory: true, - extends: path.join(__dirname + '/.babelrc') + extends: path.join(projectRoot, '/.babelrc') } } }, @@ -148,16 +149,16 @@ if (process.env.NODE_ENV === 'development') { const optimization = {}; + module.exports = { mode, - context: __dirname, - context: path.resolve(__dirname, '.'), + context: projectRoot, entry: { app: appEntry, clock: clockEntry }, output: { - path: path.resolve(__dirname, './tmp/public'), + path: path.resolve(projectRoot, './tmp/public'), publicPath, filename: 'js/bundle.[name].js', sourceMapFilename: 'js/bundle.[name].js.map', From 24dfa43aa779f5ef3ad06e57d16410751910b825 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 10:53:31 -0800 Subject: [PATCH 12/14] task: tidy example environment template Move this away from project root and into docs area. CONTRIBUTING file updated to match. --- CONTRIBUTING.md | 5 +++-- my.env.template => docs/example-template.env | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename my.env.template => docs/example-template.env (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 97204edff44..ddc20c1620e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,7 @@ [coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=master [discord-img]: https://img.shields.io/discord/629952586895851530?label=discord%20chat [discord-url]: https://discord.gg/rTKhrqz +[example-env-template]: docs/example-template.env ## Translations @@ -49,7 +50,7 @@ Nightscout is a Node.js application. The basic installation of the software for dependency installation has to be done using a non-root user - _do not use root_ for development and hosting the software! 3. Get a Mongo database by either installing Mongo locally, or get a free cloud account from mLab or MongoDB Atlas. -4. Configure Nightscout by copying `my.env.template` to `my.env` and run it - see the next chapter in the instructions +4. Configure Nightscout by copying [`docs/example-template.env`][example-env-template] to `my.env` and run it - see the next chapter in the instructions ## Develop on `dev` @@ -57,7 +58,7 @@ We develop on the `dev` branch. All new pull requests should be targeted to `dev You can get the `dev` branch checked out using `git checkout dev`. -Once checked out, install the dependencies using `npm install`, then copy the included `my.env.template`file to `my.env` and edit the file to include your settings (like the Mongo URL). Leave the `NODE_ENV=development` line intact. Once set, run the site using `npm run dev`. This will start Nightscout in the development mode, with different code packaging rules and automatic restarting of the server using nodemon, when you save changed files on disk. The client also hot-reloads new code in, but it's recommended to reload the website after changes due to the way the plugin sandbox works. +Once checked out, install the dependencies using `npm install`, then copy the included [`docs/example-template.env`][example-env-template] to `my.env` file to `my.env` and edit the file to include your settings (like the Mongo URL). Leave the `NODE_ENV=development` line intact. Once set, run the site using `npm run dev`. This will start Nightscout in the development mode, with different code packaging rules and automatic restarting of the server using nodemon, when you save changed files on disk. The client also hot-reloads new code in, but it's recommended to reload the website after changes due to the way the plugin sandbox works. Note the template sets `INSECURE_USE_HTTP` to `true` to enable the site to work over HTTP in local development. diff --git a/my.env.template b/docs/example-template.env similarity index 100% rename from my.env.template rename to docs/example-template.env From f45e7b8d6b54cef7c950cefc0529f169d4fa41f1 Mon Sep 17 00:00:00 2001 From: Ben West Date: Thu, 18 Feb 2021 11:15:45 -0800 Subject: [PATCH 13/14] task: tidy ci test env away from project root This change moves the ci.test.env file into the tests/ subdirectory in an effort to reduce the number of files in the project root. The package.json metadata is updated to enable continuous integration tools to continue to work as expected. --- package.json | 4 ++-- ci.test.env => tests/ci.test.env | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ci.test.env => tests/ci.test.env (100%) diff --git a/package.json b/package.json index 01bdb0efe80..44eeb3a985d 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,14 @@ "start": "node lib/server/server.js", "test": "env-cmd -f ./my.test.env mocha --require ./tests/hooks.js -exit ./tests/*.test.js", "test-single": "env-cmd -f ./my.test.env mocha --require ./tests/hooks.js --exit ./tests/$TEST.test.js", - "test-ci": "env-cmd -f ./ci.test.env nyc --reporter=lcov --reporter=text-summary mocha --require ./tests/hooks.js --exit ./tests/*.test.js", + "test-ci": "env-cmd -f ./tests/ci.test.env nyc --reporter=lcov --reporter=text-summary mocha --require ./tests/hooks.js --exit ./tests/*.test.js", "env": "env", "postinstall": "webpack --mode production --config webpack/webpack.config.js && npm run-script generate-keys", "bundle": "webpack --mode production --config webpack/webpack.config.js && npm run-script generate-keys", "bundle-dev": "webpack --mode development --config webpack/webpack.config.js && npm run-script generate-keys", "bundle-analyzer": "webpack --mode development --config webpack/webpack.config.js --profile --json > stats.json && webpack-bundle-analyzer stats.json", "generate-keys": "node bin/generateRandomString.js >tmp/randomString", - "coverage": "cat ./coverage/lcov.info | env-cmd -f ./ci.test.env codacy-coverage", + "coverage": "cat ./coverage/lcov.info | env-cmd -f ./tests/ci.test.env codacy-coverage", "dev": "env-cmd -f ./my.env nodemon --inspect lib/server/server.js 0.0.0.0", "dev-test": "env-cmd -f ./my.devtest.env nodemon --inspect lib/server/server.js 0.0.0.0", "prod": "env-cmd -f ./my.prod.env node lib/server/server.js 0.0.0.0", diff --git a/ci.test.env b/tests/ci.test.env similarity index 100% rename from ci.test.env rename to tests/ci.test.env From ad3fc3c72e0761674e60c7949082dd20405b2b71 Mon Sep 17 00:00:00 2001 From: Sulka Haro Date: Fri, 19 Feb 2021 13:59:35 +0200 Subject: [PATCH 14/14] * Fix running the site in dev mode * Fix Pump Battery Age plugin name localization --- lib/plugins/batteryage.js | 2 +- lib/server/app.js | 2 +- translations/en/en.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/plugins/batteryage.js b/lib/plugins/batteryage.js index 22f25705aa3..466c4faa77a 100644 --- a/lib/plugins/batteryage.js +++ b/lib/plugins/batteryage.js @@ -9,7 +9,7 @@ function init(ctx) { var bage = { name: 'bage' - , label: 'Pump Battery Change' + , label: 'Pump Battery Age' , pluginType: 'pill-minor' }; diff --git a/lib/server/app.js b/lib/server/app.js index 553ac48a646..74153138ba1 100644 --- a/lib/server/app.js +++ b/lib/server/app.js @@ -305,7 +305,7 @@ function create (env, ctx) { app.locals.bundle = '/devbundle'; const webpack = require('webpack'); - var webpack_conf = require('../../webpack.config'); + const webpack_conf = require('../../webpack/webpack.config'); const middleware = require('webpack-dev-middleware'); const compiler = webpack(webpack_conf); diff --git a/translations/en/en.json b/translations/en/en.json index cc4f95ea41e..13782a2f503 100644 --- a/translations/en/en.json +++ b/translations/en/en.json @@ -223,6 +223,7 @@ ,"View all treatments":"View all treatments" ,"Enable Alarms":"Enable Alarms" ,"Pump Battery Change":"Pump Battery Change" + ,"Pump Battery Age":"Pump Battery Age" ,"Pump Battery Low Alarm":"Pump Battery Low Alarm" ,"Pump Battery change overdue!":"Pump Battery change overdue!" ,"When enabled an alarm may sound.":"When enabled an alarm may sound."