Skip to content

Commit 3eeacc3

Browse files
authored
Merge pull request #6650 from nightscout/dev
Release 14.1.0
2 parents 695e98b + 46e4d17 commit 3eeacc3

File tree

146 files changed

+20891
-17923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+20891
-17923
lines changed

.github/workflows/main.yml

Lines changed: 86 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,93 @@
1-
name: CI test
1+
name: CI test and publish Docker image
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
pull_request:
9+
branches:
10+
- master
11+
- dev
412

513
jobs:
6-
build:
7-
8-
runs-on: ubuntu-16.04
9-
14+
test:
15+
name: Run Tests
16+
runs-on: ubuntu-latest
1017
strategy:
1118
matrix:
12-
node-version: [12.x]
19+
node-version: [12.x, 14.x]
20+
mongodb-version: [4.2, 4.4]
21+
22+
steps:
23+
- name: Git Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
31+
- name: Start MongoDB ${{ matrix.mongodb-version }}
32+
uses: supercharge/mongodb-github-action@1.3.0
33+
with:
34+
mongodb-version: ${{ matrix.mongodb-version }}
35+
36+
- name: Install dependencies
37+
run: npm install
38+
- name: Run Tests
39+
run: npm run-script test-ci
40+
- name: Send Coverage
41+
run: npm run-script coverage
42+
43+
publish_dev:
44+
name: Publish dev branch to Docker Hub
45+
needs: test
46+
runs-on: ubuntu-latest
47+
if: github.ref == 'refs/heads/dev'
48+
env:
49+
DOCKER_IMAGE: nightscout/cgm-remote-monitor
50+
steps:
51+
- name: Login to Docker Hub
52+
uses: docker/login-action@v1
53+
with:
54+
username: ${{ secrets.DOCKER_USER }}
55+
password: ${{ secrets.DOCKER_PASS }}
56+
- name: Clean git Checkout
57+
if: success()
58+
uses: actions/checkout@v2
59+
- name: Build, tag and push the dev Docker image
60+
if: success()
61+
run: |
62+
docker build --no-cache=true -t ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} .
63+
docker image push ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }}
64+
docker tag ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} ${{ env.DOCKER_IMAGE }}:latest_dev
65+
docker image push ${{ env.DOCKER_IMAGE }}:latest_dev
1366
67+
publish_master:
68+
name: Publish master branch to Docker Hub
69+
needs: test
70+
runs-on: ubuntu-latest
71+
if: github.ref == 'refs/heads/master'
72+
env:
73+
DOCKER_IMAGE: nightscout/cgm-remote-monitor
1474
steps:
15-
- uses: actions/checkout@v1
16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: ${{ matrix.node-version }}
20-
- name: Install dependencies
21-
run: npm install
22-
- name: Install MongoDB
23-
run: |
24-
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
25-
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
26-
sudo apt-get update
27-
sudo apt-get install -y mongodb-org
28-
sudo apt-get install -y --allow-downgrades mongodb-org=4.4.0 mongodb-org-server=4.4.0 mongodb-org-shell=4.4.0 mongodb-org-mongos=4.4.0 mongodb-org-tools=4.4.0
29-
- name: Start MongoDB
30-
run: sudo systemctl start mongod
31-
- name: Run Tests
32-
run: npm run-script test-ci
33-
- name: Send Coverage
34-
run: npm run-script coverage
75+
- name: Login to Docker Hub
76+
uses: docker/login-action@v1
77+
with:
78+
username: ${{ secrets.DOCKER_USER }}
79+
password: ${{ secrets.DOCKER_PASS }}
80+
- name: Clean git Checkout
81+
if: success()
82+
uses: actions/checkout@v2
83+
- name: get-npm-version
84+
if: success()
85+
id: package-version
86+
uses: martinbeentjes/npm-get-version-action@master
87+
- name: Build, tag and push the master Docker image
88+
if: success()
89+
run: |
90+
docker build --no-cache=true -t ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} .
91+
docker image push ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }}
92+
docker tag ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} ${{ env.DOCKER_IMAGE }}:latest
93+
docker image push ${{ env.DOCKER_IMAGE }}:latest

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.16.0
1+
14.15.3

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
- [List of Contributors](#list-of-contributors)
1616
- [Core developers, contributing developers, coordinators and documentation writers](#core-developers-contributing-developers-coordinators-and-documentation-writers)
1717
- [Plugin contributors](#plugin-contributors)
18-
- [Translators](#translators)
1918
- [List of all contributors](#list-of-all-contributors)
2019

2120
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -36,6 +35,10 @@
3635
[discord-img]: https://img.shields.io/discord/629952586895851530?label=discord%20chat
3736
[discord-url]: https://discord.gg/rTKhrqz
3837

38+
## Translations
39+
40+
Please visit our [project in Crowdin](https://crowdin.com/project/nightscout) to translate Nigthscout. If you want to add a new language, please get in touch with the dev team in [Discord][discord-url].
41+
3942
## Installation for development
4043

4144
Nightscout is a Node.js application. The basic installation of the software for local purposes is:
@@ -188,8 +191,6 @@ Also if you can't code, it's possible to contribute by improving the documentati
188191
| Core developers: | [@jasoncalabrese] [@MilosKozak] [@PieterGit] [@sulkaharo] |
189192
| Former Core developers: (not active): | [@bewest] |
190193
| Contributing developers: | [@jpcunningh] [@scottleibrand] [@komarserjio] [@jweismann] |
191-
| Release coordination 0.10.x: | [@PieterGit] [@sulkaharo] |
192-
| Release coordination 0.11.x: | [@PieterGit] |
193194
| Issue/Pull request coordination: | Please volunteer |
194195
| Cleaning up git fork spam: | Please volunteer |
195196
| Documentation writers: | [@andrew-warrington] [@unsoluble] [@tynbendad] [@danamlewis] [@rarneson] |
@@ -230,41 +231,6 @@ Also if you can't code, it's possible to contribute by improving the documentati
230231
| [`upbat` (Uploader Battery)](README.md#upbat-uploader-battery)| [@jpcunningh] | Please volunteer |
231232
| [`xdrip-js` (xDrip-js)](README.md#xdrip-js-xdrip-js)| [@jpcunningh] | Please volunteer |
232233

233-
### Translators
234-
235-
See `/translations` of your Nightscout, to view the current translation coverage and the missing items.
236-
Languages with less than 90% coverage will be removed in a future Nightscout versions.
237-
238-
| Language | List of translators | Status
239-
| ------------- | -------------------- |-------------------- |
240-
| Български (`bg`) |Please volunteer| OK |
241-
| Čeština (`cs`) |Please volunteer|OK |
242-
| Deutsch (`de`) |[@viderehh] [@herzogmedia] |OK |
243-
| Dansk (`dk`) | [@janrpn] |OK |
244-
| Ελληνικά (`el`)|Please volunteer|Needs attention: 68.5%|
245-
| English (`en`)|Please volunteer|OK|
246-
| Español (`es`) |Please volunteer|OK|
247-
| Suomi (`fi`)|[@sulkaharo] |OK|
248-
| Français (`fr`)|Please volunteer|OK|
249-
| עברית (`he`)| [@jakebloom] |OK|
250-
| Hrvatski (`hr`)|[@OpossumGit]|OK|
251-
| Italiano (`it`)|Please volunteer|OK|
252-
| 日本語 (`ja`)|[@LuminaryXion]|Working on this|
253-
| 한국어 (`ko`)|Please volunteer|Needs attention: 80.6%|
254-
| Norsk (Bokmål) (`nb`)|Please volunteer|OK|
255-
| Nederlands (`nl`)|[@PieterGit]|OK|
256-
| Polski (`pl`)|[@Bartlomiejsz]|OK|
257-
| Português (Brasil) (`pt`)|Please volunteer|OK|
258-
| Română (`ro`)|Please volunteer|OK|
259-
| Русский (`ru`)|[@apanasef]|OK|
260-
| Slovenčina (`sk`)|Please volunteer|OK|
261-
| Svenska (`sv`)|Please volunteer|OK|
262-
| Türkçe (`tr`)|[@diabetlum]|OK|
263-
| 中文(简体) (`zh_cn`) | [@jizhongwen]|OK|
264-
| 中文(繁體) (`zh_tw`) | [@jizhongwen]|Needs attention: 25.0%
265-
| 日本語 (`ja_jp`) | [@LuminaryXion]|
266-
267-
268234
### List of all contributors
269235
| Contribution area | List of contributors |
270236
| ------------------------------------- | -------------------- |

Dockerfile.example renamed to Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM node:10-alpine
1+
FROM node:14.15.3-alpine
22

3-
MAINTAINER Nightscout Contributors
3+
LABEL maintainer="Nightscout Contributors"
44

55
RUN mkdir -p /opt/app
66
ADD . /opt/app

Makefile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ MONGO_SETTINGS=MONGO_CONNECTION=${MONGO_CONNECTION} \
1515
# coverage reporter's ability to instrument the tests correctly.
1616
# Hard coding it to the local with our pinned version is bigger for
1717
# initial installs, but ensures a consistent environment everywhere.
18-
# On Travis, ./node_modules/.bin and other `nvm` and `npm` bundles are
18+
# On GA, ./node_modules/.bin and other `nvm` and `npm` bundles are
1919
# inserted into the default `$PATH` enviroinment, making pointing to
2020
# the unwrapped mocha executable necessary.
2121
MOCHA=./node_modules/mocha/bin/_mocha
@@ -25,7 +25,7 @@ ANALYZED=./coverage/lcov.info
2525
# Following token deprecated
2626
# export CODACY_REPO_TOKEN=e29ae5cf671f4f918912d9864316207c
2727

28-
DOCKER_IMAGE=nightscout/cgm-remote-monitor-travis
28+
DOCKER_IMAGE=nightscout/cgm-remote-monitor
2929

3030
all: test
3131

@@ -48,7 +48,7 @@ test_onebyone:
4848
test:
4949
${MONGO_SETTINGS} ${MOCHA} --timeout 30000 --exit --bail -R tap ${TESTS}
5050

51-
travis:
51+
ci_tests:
5252
python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
5353
# NODE_ENV=test ${MONGO_SETTINGS} \
5454
# ${ISTANBUL} cover ${MOCHA} --report lcovonly -- --timeout 5000 -R tap ${TESTS}
@@ -57,28 +57,25 @@ travis:
5757
docker_release:
5858
# Get the version from the package.json file
5959
$(eval DOCKER_TAG=$(shell cat package.json | jq '.version' | tr -d '"'))
60-
$(eval NODE_VERSION=$(shell cat .nvmrc))
60+
$(eval BRANCH=$(lastword $(subst /, ,$(GITHUB_REF))))
6161
#
62-
# Create a Dockerfile that contains the correct NodeJS version
63-
cat Dockerfile.example | sed -e "s/^FROM node:.*/FROM node:${NODE_VERSION}/" > Dockerfile
6462
#
6563
# Rebuild the image. We do this with no-cache so that we have all security upgrades,
6664
# since that's more important than fewer layers in the Docker image.
6765
docker build --no-cache=true -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
68-
# Push an image to Docker Hub with the version from package.json:
69-
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
7066
#
7167
# Push the master branch to Docker hub as 'latest'
72-
if [ "$(TRAVIS_BRANCH)" = "master" ]; then \
68+
if [ "$(BRANCH)" = "master" ]; then \
7369
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest && \
70+
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
7471
docker push $(DOCKER_IMAGE):latest; \
7572
fi
7673
#
7774
# Push the dev branch to Docker Hub as 'latest_dev'
78-
if [ "$(TRAVIS_BRANCH)" = "dev" ]; then \
75+
if [ "$(BRANCH)" = "dev" ]; then \
7976
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest_dev && \
77+
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
8078
docker push $(DOCKER_IMAGE):latest_dev; \
8179
fi
82-
rm -f Dockerfile
8380

84-
.PHONY: all coverage docker_release report test travis
81+
.PHONY: all coverage docker_release report test ci_tests

app.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ function create (env, ctx) {
154154
// serve the static content
155155
app.use(staticFiles);
156156

157+
app.use('/translations', express.static('translations', {
158+
maxAge
159+
}));
160+
157161
if (ctx.bootErrors && ctx.bootErrors.length > 0) {
158162
const bootErrorView = require('./lib/server/booterror')(env, ctx);
159163
bootErrorView.setLocals(app.locals);
@@ -220,11 +224,6 @@ function create (env, ctx) {
220224
, title: 'Nightscout reporting'
221225
, type: 'report'
222226
}
223-
, "/translations": {
224-
file: "translationsindex.html"
225-
, title: 'Nightscout translations'
226-
, type: 'translations'
227-
}
228227
, "/split": {
229228
file: "frame.html"
230229
, title: '8-user view'

bundle/bundle.reports.source.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import './bundle.source';
22

3-
window.Nightscout.report_plugins = require('../lib/report_plugins/')();
3+
console.info('Nightscout report bundle start');
4+
5+
window.Nightscout.report_plugins_preinit = require('../lib/report_plugins/');
46
window.Nightscout.predictions = require('../lib/report/predictions');
7+
window.Nightscout.reportclient = require('../lib/report/reportclient');
58

69
console.info('Nightscout report bundle ready');
710

811
// Needed for Hot Module Replacement
912
if(typeof(module.hot) !== 'undefined') {
1013
module.hot.accept()
11-
}
14+
}

bundle/bundle.source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ console.info('Nightscout bundle ready');
3333
// Needed for Hot Module Replacement
3434
if(typeof(module.hot) !== 'undefined') {
3535
module.hot.accept()
36-
}
36+
}

crowdin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
files:
2+
- source: /translations/en/*.json
3+
translation: /translations/%locale_with_underscore%.json

0 commit comments

Comments
 (0)