Merge branch 'develop' into newscripts

This commit is contained in:
Michael Teeuw
2019-10-25 14:25:57 +02:00
committed by GitHub
6 changed files with 127 additions and 9 deletions

View File

@@ -9,11 +9,23 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Updated ### Updated
- updated raspberry.sh installer script to handle new platform issues, split node/npm, pm2, and screen saver changes - updated raspberry.sh installer script to handle new platform issues, split node/npm, pm2, and screen saver changes
- 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. ❤️ **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
- Timestamps in log output
### Updated
### Fixed
## [2.9.0] - 2019-10-01 ## [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). **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).

View File

@@ -24,7 +24,12 @@ var config = {
language: "en", language: "en",
timeFormat: 24, timeFormat: 24,
units: "metric", 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: [ modules: [
{ {
module: "alert", module: "alert",

View File

@@ -11,6 +11,9 @@ var Utils = require(__dirname + "/utils.js");
var defaultModules = require(__dirname + "/../modules/default/defaultmodules.js"); var defaultModules = require(__dirname + "/../modules/default/defaultmodules.js");
var path = require("path"); var path = require("path");
// add timestamps in front of log messages
require('console-stamp')(console, 'HH:MM:ss.l');
// Get version number. // Get version number.
global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version; global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
console.log("Starting MagicMirror: v" + global.version); console.log("Starting MagicMirror: v" + global.version);

47
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "magicmirror", "name": "magicmirror",
"version": "2.9.0", "version": "2.10.0-develop",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -1632,6 +1632,40 @@
"date-now": "^0.1.4" "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": { "content-disposition": {
"version": "0.5.2", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
@@ -5192,6 +5226,11 @@
"trim-newlines": "^1.0.0" "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": { "merge-descriptors": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -5648,9 +5687,9 @@
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
}, },
"nwmatcher": { "nwmatcher": {
"version": "1.4.3", "version": "1.4.4",
"resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.3.tgz", "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz",
"integrity": "sha512-IKdSTiDWCarf2JTS5e9e2+5tPZGdkRJ79XjYV0pzK8Q9BpsFyBq1RGKxzs7Q8UBushGw7m6TzVKz6fcY99iSWw==", "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==",
"dev": true "dev": true
}, },
"oauth-sign": { "oauth-sign": {

View File

@@ -1,10 +1,10 @@
{ {
"name": "magicmirror", "name": "magicmirror",
"version": "2.9.0", "version": "2.10.0-develop",
"description": "The open source modular smart mirror platform.", "description": "The open source modular smart mirror platform.",
"main": "js/electron.js", "main": "js/electron.js",
"scripts": { "scripts": {
"start": "sh run-start.sh", "start": "./run-start.sh",
"install": "cd vendor && npm install", "install": "cd vendor && npm install",
"install-fonts": "cd fonts && npm install", "install-fonts": "cd fonts && npm install",
"postinstall": "sh untrack-css.sh && sh installers/postinstall/postinstall.sh && npm run install-fonts", "postinstall": "sh untrack-css.sh && sh installers/postinstall/postinstall.sh && npm run install-fonts",
@@ -55,8 +55,12 @@
"stylelint-config-standard": "latest", "stylelint-config-standard": "latest",
"time-grunt": "latest" "time-grunt": "latest"
}, },
"optionalDependencies": {
"electron": "^3.0.13"
},
"dependencies": { "dependencies": {
"colors": "^1.1.2", "colors": "^1.1.2",
"console-stamp": "^0.2.9",
"electron": "^3.0.13", "electron": "^3.0.13",
"express": "^4.16.2", "express": "^4.16.2",
"express-ipfilter": "^1.0.1", "express-ipfilter": "^1.0.1",

59
run-start.sh Normal file → Executable file
View File

@@ -1,7 +1,62 @@
#!/bin/bash
# use bash instead of sh
./untrack-css.sh ./untrack-css.sh
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
export DISPLAY=:0 # Set by default display export DISPLAY=:0 # Set by default display
fi 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}"
# check for xwindows running
xorg=$(pgrep Xorg)
#
# if the user requested serveronly OR
# electron support for armv6l has been dropped OR
# system is in text mode
#
if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; then
# if user explicitly configured to run server only (no ui local)
# OR there is no xwindows running, so no support for browser graphics
if [ "$serveronly." == "true." -o "$xorg." == "." ]; 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