From 1ff51822df2f071f1de7e29094102b0dbecbbf94 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 1 Oct 2019 19:47:40 +0200 Subject: [PATCH 1/8] Prepare 2.10.0-develop --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db20b96b..5881d2ab 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ This project adheres to [Semantic Versioning](http://semver.org/). ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core. +## [2.10.0] - Unreleased (Develop Branch) + +*This release is scheduled to be released on 2020-01-01.* + +### Added + +### Updated + +### Fixed + ## [2.9.0] - 2019-10-01 ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). diff --git a/package-lock.json b/package-lock.json index 5c706deb..7f877443 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.9.0", + "version": "2.10.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4685bbd0..038a2e01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.9.0", + "version": "2.10.0-develop", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From 823eb23773f2362097d102db2d5e5b18b767a7c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 17:12:07 +0000 Subject: [PATCH 2/8] Bump nwmatcher from 1.4.3 to 1.4.4 Bumps [nwmatcher](https://github.com/dperini/nwmatcher) from 1.4.3 to 1.4.4. - [Release notes](https://github.com/dperini/nwmatcher/releases) - [Commits](https://github.com/dperini/nwmatcher/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c706deb..ed6c0292 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5648,9 +5648,9 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nwmatcher": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.3.tgz", - "integrity": "sha512-IKdSTiDWCarf2JTS5e9e2+5tPZGdkRJ79XjYV0pzK8Q9BpsFyBq1RGKxzs7Q8UBushGw7m6TzVKz6fcY99iSWw==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", + "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", "dev": true }, "oauth-sign": { From a6aae70a552f7d0963ec9054f90cf3f76b5a9d21 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Thu, 5 Sep 2019 20:04:55 +0000 Subject: [PATCH 3/8] Add UTC timestamp to console log --- CHANGELOG.md | 1 + js/app.js | 3 +++ package.json | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5881d2ab..ead46df1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). *This release is scheduled to be released on 2020-01-01.* ### Added +- Timestamps in log output ### Updated diff --git a/js/app.js b/js/app.js index 78f0c847..25a004d9 100644 --- a/js/app.js +++ b/js/app.js @@ -11,6 +11,9 @@ var Utils = require(__dirname + "/utils.js"); var defaultModules = require(__dirname + "/../modules/default/defaultmodules.js"); var path = require("path"); +// add timestamps in front of log messages +require('console-stamp')(console, 'HH:MM:ss.l'); + // Get version number. global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version; console.log("Starting MagicMirror: v" + global.version); diff --git a/package.json b/package.json index 038a2e01..8471223f 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ }, "dependencies": { "colors": "^1.1.2", + "console-stamp": "^0.2.9", "electron": "^3.0.13", "express": "^4.16.2", "express-ipfilter": "^1.0.1", From 81a32b56f04d7aaba2955f18c7b4e622f7eb56f8 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Fri, 6 Sep 2019 06:12:15 +0000 Subject: [PATCH 4/8] Fix TravisCI error --- package-lock.json | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/package-lock.json b/package-lock.json index 7f877443..a57c4b80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1632,6 +1632,40 @@ "date-now": "^0.1.4" } }, + "console-stamp": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/console-stamp/-/console-stamp-0.2.9.tgz", + "integrity": "sha512-jtgd1Fx3Im+pWN54mF269ptunkzF5Lpct2LBTbtyNoK2A4XjcxLM+TQW+e+XE/bLwLQNGRqPqlxm9JMixFntRA==", + "requires": { + "chalk": "^1.1.1", + "dateformat": "^1.0.11", + "merge": "^1.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", From f1f394b871195bc4bc50c2c8c8219641c37bb3e5 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Wed, 23 Oct 2019 10:44:30 +0000 Subject: [PATCH 5/8] Add merge to package-lock to fix Travis fail --- package-lock.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package-lock.json b/package-lock.json index a57c4b80..bbd94274 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5226,6 +5226,11 @@ "trim-newlines": "^1.0.0" } }, + "merge": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", + "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==" + }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", From e958f33450cc5129e231c66ec9a9f4e50058f4a9 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Thu, 24 Oct 2019 09:20:33 -0500 Subject: [PATCH 6/8] add support for armv6l using serveronlymode, make serveronly config option, electron install optional --- config/config.js.sample | 7 +++++- package.json | 6 +++-- run-start.sh | 55 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 63 insertions(+), 5 deletions(-) mode change 100644 => 100755 run-start.sh diff --git a/config/config.js.sample b/config/config.js.sample index 790ada34..0e5ff840 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -24,7 +24,12 @@ var config = { language: "en", timeFormat: 24, units: "metric", - + // serverOnly: true/false/"local" , + // local for armv6l processors, default + // starts serveronly and then starts chrome browser + // false, default for all NON-armv6l devices + // true, force serveronly mode, because you want to.. no UI on this device + modules: [ { module: "alert", diff --git a/package.json b/package.json index 4685bbd0..643f48e0 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { - "start": "sh run-start.sh", + "start": "./run-start.sh", "install": "cd vendor && npm install", "install-fonts": "cd fonts && npm install", "postinstall": "sh untrack-css.sh && sh installers/postinstall/postinstall.sh && npm run install-fonts", @@ -55,9 +55,11 @@ "stylelint-config-standard": "latest", "time-grunt": "latest" }, + "optionalDependencies": { + "electron": "^3.0.13" + }, "dependencies": { "colors": "^1.1.2", - "electron": "^3.0.13", "express": "^4.16.2", "express-ipfilter": "^1.0.1", "feedme": "latest", diff --git a/run-start.sh b/run-start.sh old mode 100644 new mode 100755 index bbfcf921..0d83e7bd --- a/run-start.sh +++ b/run-start.sh @@ -1,7 +1,58 @@ - +#!/bin/bash + # use bash instead of sh ./untrack-css.sh if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty export DISPLAY=:0 # Set by default display fi -electron js/electron.js $1 +# get the processor architecture +arch=$(uname -m) +# got the config option, if any +serveronly=$(grep -i serveronly: config/config.js | awk '{print tolower($2)}' | tr -d ,\"\') +# set default if not defined in config +serveronly="${serveronly:=false}" +# +# if the user requested serveronly OR +# electron support for armv6l has been dropped +# +if [ "$serveronly." != "false." -o "$arch" == "armv6l" ]; then + + # if user explicitly configured to run server only (no ui local) + if [ "$serveronly." == "true." ]; then + # start server mode, + node serveronly + else + # start the server in the background + # wait for server to be ready + # need bash for this + exec 3< <(node serveronly) + + # Read the output of server line by line until one line 'point your browser' + while read line; do + case "$line" in + *point\ your\ browser*) + echo $line + break + ;; + *) + echo $line + #sleep .25 + ;; + esac + done <&3 + + # Close the file descriptor + exec 3<&- + + # lets use chrome to display here now + # get the server port address from the ready message + port=$(echo $line | awk -F\: '{print $4}') + # start chromium + echo "Starting chromium browser now, have patience, it takes a minute" + chromium-browser -noerrdialogs -kiosk -start_maximized --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null + exit + fi +else + # we can use electron directly + `electron js/electron.js $1`; +fi \ No newline at end of file From 0677d0a810dc1b78f7eb49749fa7bf68c3b749f9 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Thu, 24 Oct 2019 09:36:15 -0500 Subject: [PATCH 7/8] add changelog info --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db20b96b..4993f584 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## Updated +- improve handling for armv6l devices, where electron support has gone away, add optional serveronly config option + --- ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core. From c8849a17b6e448ffb497cde3cdcd4add9e6a6329 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Fri, 25 Oct 2019 06:22:10 -0500 Subject: [PATCH 8/8] add detection of xwindows running --- run-start.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/run-start.sh b/run-start.sh index 0d83e7bd..a6c07520 100755 --- a/run-start.sh +++ b/run-start.sh @@ -11,14 +11,18 @@ arch=$(uname -m) serveronly=$(grep -i serveronly: config/config.js | awk '{print tolower($2)}' | tr -d ,\"\') # set default if not defined in config serveronly="${serveronly:=false}" +# check for xwindows running +xorg=$(pgrep Xorg) # # if the user requested serveronly OR -# electron support for armv6l has been dropped +# electron support for armv6l has been dropped OR +# system is in text mode # -if [ "$serveronly." != "false." -o "$arch" == "armv6l" ]; then +if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; then # if user explicitly configured to run server only (no ui local) - if [ "$serveronly." == "true." ]; then + # OR there is no xwindows running, so no support for browser graphics + if [ "$serveronly." == "true." -o "$xorg." == "." ]; then # start server mode, node serveronly else