Skip to content

Commit fb0cc61

Browse files
authored
Merge pull request #1241 from MichMich/develop
Release 2.3.0
2 parents 20823bf + be29b5d commit fb0cc61

Some content is hidden

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

65 files changed

+6693
-847
lines changed

.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@
1212
"browser": true,
1313
"node": true,
1414
"es6": true
15-
}
15+
},
16+
"parserOptions": {
17+
"sourceType": "module",
18+
"ecmaFeatures": {
19+
"globalReturn": true
20+
}
21+
}
1622
}

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
language: node_js
22
node_js:
3-
- "8"
43
- "7"
5-
- "6"
6-
- "5.1"
74
before_script:
5+
- yarn danger ci
86
- npm install grunt-cli -g
97
- "export DISPLAY=:99.0"
108
- "sh -e /etc/init.d/xvfb start"

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,48 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [2.3.0] - 2018-04-01
6+
7+
### Added
8+
9+
- Add new settings in compliments module: setting time intervals for morning and afternoon
10+
- Add system notification `MODULE_DOM_CREATED` for notifying each module when their Dom has been fully loaded.
11+
- Add types for module.
12+
- Implement Danger.js to notify contributors when CHANGELOG.md is missing in PR.
13+
- Allow to scroll in full page article view of default newsfeed module with gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures)
14+
- Changed 'compliments.js' - update DOM if remote compliments are loaded instead of waiting one updateInterval to show custom compliments
15+
- Automated unit tests utils, deprecated, translator, cloneObject(lockstrings)
16+
- Automated integration tests translations
17+
- Add advanced filtering to the excludedEvents configuration of the default calendar module
18+
- New currentweather module config option: `showFeelsLike`: Shows how it actually feels like. (wind chill or heat index)
19+
- New currentweather module config option: `useKMPHwind`: adds an option to see wind speed in Kmph instead of just m/s or Beaufort.
20+
- Add dc:date to parsing in newsfeed module, which allows parsing of more rss feeds.
21+
22+
### Changed
23+
- Add link to GitHub repository which contains the respective Dockerfile.
24+
- Optimized automated unit tests cloneObject, cmpVersions
25+
- Update notifications use now translation templates instead of normal strings.
26+
- Yarn can be used now as an installation tool
27+
- Changed Electron dependency to v1.7.13.
28+
29+
### Fixed
30+
- News article in fullscreen (iframe) is now shown in front of modules.
31+
- Forecast respects maxNumberOfDays regardless of endpoint.
32+
- Fix exception on translation of objects.
33+
534
## [2.2.2] - 2018-01-02
635

736
### Added
837

938
- Add missing `package-lock.json`.
1039

40+
### Changed
41+
42+
- Changed Electron dependency to v1.7.10.
43+
1144
## [2.2.1] - 2018-01-01
1245

1346
### Fixed
14-
1547
- Fixed linting errors.
1648

1749
## [2.2.0] - 2018-01-01

README.md

Lines changed: 96 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,114 +16,123 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec
1616

1717
## Table Of Contents
1818

19-
- [Usage](#usage)
19+
- [Installation](#installation)
20+
- [Raspberry Pi](#raspberrypi)
21+
- [General](#general)
22+
- [Server Only](#server-only)
23+
- [Client Only](#client-only)
24+
- [Docker](#docker)
2025
- [Configuration](#configuration)
2126
- [Modules](#modules)
27+
- [Updating](#updating)
2228
- [Known Issues](#known-issues)
2329
- [Community](#community)
2430
- [Contributing Guidelines](#contributing-guidelines)
31+
- [Manifesto](#manifesto)
2532

26-
## Usage
33+
## Installation
2734

28-
### Raspberry Pi Support
29-
Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2 & 3. The Raspberry Pi 1 is currently **not** supported. If you want to run this on a Raspberry Pi 1, use the [server only](#server-only) feature and setup a fullscreen browser yourself.
35+
### Raspberry Pi
3036

31-
### Automatic Installer (Raspberry Pi Only!)
37+
#### Automatic Installation (Raspberry Pi only!)
38+
39+
*Electron*, the app wrapper around MagicMirror², only supports the Raspberry Pi 2/3. The Raspberry Pi 0/1 is currently **not** supported. If you want to run this on a Raspberry Pi 1, use the [server only](#server-only) feature and setup a fullscreen browser yourself. (Yes, people have managed to run MM² also on a Pi0, so if you insist, search in the forums.)
40+
41+
Note that you will need to install the lastest full version of Raspbian, **don't use the Lite version**.
3242

3343
Execute the following command on your Raspberry Pi to install MagicMirror²:
34-
````
44+
45+
```bash
3546
bash -c "$(curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh)"
36-
````
47+
```
3748

38-
### Manual Installation
49+
#### Manual Installation
3950

40-
1. Download and install the latest Node.js version.
51+
1. Download and install the latest *Node.js* version.
4152
2. Clone the repository and check out the master branch: `git clone https://github.com/MichMich/MagicMirror`
42-
3. Enter the repository: `cd ~/MagicMirror`
43-
4. Install and run the app: `npm install && npm start`
53+
3. Enter the repository: `cd MagicMirror/`
54+
4. Install and run the app with: `npm install && npm start` \
55+
For **Server Only** use: `npm install && node serveronly` .
4456

45-
**Important:** `npm start` does **not** work via SSH, use `DISPLAY=:0 nohup npm start &` instead. This starts the mirror on the remote display.
4657

47-
**Note:** if you want to debug on Raspberry Pi you can use `npm start dev` which will start the MagicMirror app with Dev Tools enabled.
58+
**:warning: Important!**
4859

49-
### Server Only
50-
In some cases, you want to start the application without an actual app window. In this case, you can start MagicMirror² in server only mode by manually running `node serveronly` or using Docker. This will start the server, after which you can open the application in your browser of choice. Detailed description below.
60+
- **The installation step for `npm install` will take a very long time**, often with little or no terminal response! \
61+
For the RPi3 this is **~10** minutes and for the Rpi2 **~25** minutes. \
62+
Do not interrupt or you risk getting a :broken_heart: by Raspberry Jam.
5163

52-
### Client Only
53-
When you have a server running remotely and want to connect a standalone client to this instance, you can manually run `node clientonly --address 192.168.1.5 --port 8080`. (Specify the ip address and port number of the server)
5464

55-
**Important:** Make sure that you whitelist the interface/ip in the server config where you want the client to connect to, otherwise it will not be allowed to connect to the server
65+
Also note that:
5666

57-
#### Docker
67+
- `npm start` does **not** work via SSH. But you can use `DISPLAY=:0 nohup npm start &` instead. \
68+
This starts the mirror on the remote display.
69+
- If you want to debug on Raspberry Pi you can use `npm start dev` which will start MM with *Dev Tools* enabled.
70+
- To access toolbar menu when in mirror mode, hit `ALT` key.
71+
- To toggle the (web) `Developer Tools` from mirror mode, use `CTRL-SHIFT-I` or `ALT` and select `View`.
5872

59-
MagicMirror² in server only mode can be deployed using [Docker](https://docker.com). After a successful [Docker installation](https://docs.docker.com/engine/installation/) you just need to execute the following command in the shell:
6073

61-
```bash
62-
docker run -d \
63-
--publish 80:8080 \
64-
--restart always \
65-
--volume ~/magic_mirror/config:/opt/magic_mirror/config \
66-
--volume ~/magic_mirror/modules:/opt/magic_mirror/modules \
67-
--name magic_mirror \
68-
bastilimbach/docker-magicmirror
69-
```
74+
### Server Only
7075

71-
| **Volumes** | **Description** |
72-
| --- | --- |
73-
| `/opt/magic_mirror/config` | Mount this volume to insert your own config into the docker container. |
74-
| `/opt/magic_mirror/modules` | Mount this volume to add your own custom modules into the docker container. |
76+
In some cases, you want to start the application without an actual app window. In this case, you can start MagicMirror² in server only mode by manually running `node serveronly` or using Docker. This will start the server, after which you can open the application in your browser of choice. Detailed description below.
7577

76-
You may need to add your Docker Host IP to your `ipWhitelist` option. If you have some issues setting up this configuration, check [this forum post](https://forum.magicmirror.builders/topic/1326/ipwhitelist-howto).
78+
**Important:** Make sure that you whitelist the interface/ip (`ipWhitelist`) in the server config where you want the client to connect to, otherwise it will not be allowed to connect to the server. You also need to set the local host `address` field to `0.0.0.0` in order for the RPi to listen on all interfaces and not only `localhost` (default).
7779

7880
```javascript
7981
var config = {
80-
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:172.17.0.1"]
82+
address: "0.0.0.0", // default is "localhost"
83+
port: 8080, // default
84+
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:172.17.0.1"], // default -- need to add your IP here
85+
...
8186
};
8287
```
8388

84-
If you want to run the server on a raspberry pi, use the `raspberry` tag. (bastilimbach/docker-magicmirror:raspberry)
85-
86-
#### Manual
8789

88-
1. Download and install the latest Node.js version.
89-
2. Clone the repository and check out the master branch: `git clone https://github.com/MichMich/MagicMirror`
90-
3. Enter the repository: `cd ~/MagicMirror`
91-
4. Install and run the app: `npm install && node serveronly`
90+
### Client Only
9291

93-
### Raspberry Configuration & Auto Start.
92+
This is when you already have a server running remotely and want your RPi to connect as a standalone client to this instance, to show the MM from the server. Then from your RPi, you run it with: `node clientonly --address 192.168.1.5 --port 8080`. (Specify the ip address and port number of the server)
9493

95-
The following wiki links are helpful in the configuration of your MagicMirror² operating system:
96-
- [Configuring the Raspberry Pi](https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi)
97-
- [Auto Starting MagicMirror](https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror)
9894

99-
### Updating your MagicMirror²
95+
### Docker
10096

101-
If you want to update your MagicMirror² to the latest version, use your terminal to go to your Magic Mirror folder and type the following command:
97+
MagicMirror² in server only mode can be deployed using [Docker](https://docker.com). After a successful [Docker installation](https://docs.docker.com/engine/installation/) you just need to execute the following command in the shell:
10298

10399
```bash
104-
git pull && npm install
100+
docker run -d \
101+
--publish 80:8080 \
102+
--restart always \
103+
--volume ~/magic_mirror/config:/opt/magic_mirror/config \
104+
--volume ~/magic_mirror/modules:/opt/magic_mirror/modules \
105+
--name magic_mirror \
106+
bastilimbach/docker-magicmirror
105107
```
108+
To get more information about the available Dockerfile versions and configurations head over to the respective [GitHub repository](https://github.com/bastilimbach/docker-MagicMirror).
106109

107-
If you changed nothing more than the config or the modules, this should work without any problems.
108-
Type `git status` to see your changes, if there are any, you can reset them with `git reset --hard`. After that, git pull should be possible.
109110

110111
## Configuration
111112

112-
1. Duplicate `config/config.js.sample` to `config/config.js`. **Note:** If you used the installer script. This step is already done for you.
113-
2. Modify your required settings.
113+
### Raspberry Specific
114+
115+
The following wiki links are helpful for the initial configuration of your MagicMirror² operating system:
116+
- [Configuring the Raspberry Pi](https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi)
117+
- [Auto Starting MagicMirror](https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror)
118+
119+
120+
### General
121+
122+
1. Copy `config/config.js.sample` to `config/config.js`. \
123+
**Note:** If you used the installer script. This step is already done for you.
124+
125+
2. Modify your required settings. \
126+
Note: You'll can check your configuration running `npm run config:check`.
114127

115-
Note: You'll can check your configuration running the follow command:
116-
```bash
117-
npm run config:check
118-
```
119128

120129
The following properties can be configured:
121130

122131
| **Option** | **Description** |
123132
| --- | --- |
124133
| `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. |
125-
| `address` | The ip address the accept connections. The default open bind `localhost`. Example config: `192.168.10.100`. |
126-
| `ipWhitelist` | The list of IPs from which you are allowed to access the MagicMirror². The default value is `["127.0.0.1", "::ffff:127.0.0.1", "::1"]`. It is possible to specify IPs with subnet masks (`["127.0.0.1", "127.0.0.1/24"]`) or define ip ranges (`["127.0.0.1", ["192.168.0.1", "192.168.0.100"]]`). Set `[]` to allow all IP addresses. For more information about how configure this directive see the [follow post ipWhitelist HowTo](https://forum.magicmirror.builders/topic/1326/ipwhitelist-howto) |
134+
| `address` | The *interface* ip address on which to accept connections. The default is `localhost`, which would prevent exposing the built-in webserver to machines on the local network. To expose it to other machines, use: `0.0.0.0`. |
135+
| `ipWhitelist` | The list of IPs from which you are allowed to access the MagicMirror². The default value is `["127.0.0.1", "::ffff:127.0.0.1", "::1"]`, which is from `localhost` only. Add your IP when needed. You can also specify IP ranges with subnet masks (`["127.0.0.1", "127.0.0.1/24"]`) or directly with (`["127.0.0.1", ["192.168.0.1", "192.168.0.100"]]`). Set `[]` to allow all IP addresses. For more information see: [follow post ipWhitelist HowTo](https://forum.magicmirror.builders/topic/1326/ipwhitelist-howto) |
127136
| `zoom` | This allows to scale the mirror contents with a given zoom factor. The default value is `1.0`|
128137
| `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. |
129138
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. |
@@ -156,12 +165,20 @@ The following modules are installed by default.
156165
- [**Hello World**](modules/default/helloworld)
157166
- [**Alert**](modules/default/alert)
158167

159-
For more available modules, check out out the wiki page: [MagicMirror² Modules](https://github.com/MichMich/MagicMirror/wiki/MagicMirror²-Modules). If you want to build your own modules, check out the [MagicMirror² Module Development Documentation](modules) and don't forget to add it to the wiki and the [forum](https://forum.magicmirror.builders/category/7/showcase)!
168+
For more available modules, check out out the wiki page [MagicMirror² 3rd Party Modules](https://github.com/MichMich/MagicMirror/wiki/3rd-party-modules). If you want to build your own modules, check out the [MagicMirror² Module Development Documentation](modules) and don't forget to add it to the wiki and the [forum](https://forum.magicmirror.builders/category/7/showcase)!
160169

161-
## Known issues
162170

163-
- Electron seems to have some issues on certain Raspberry Pi 2's. See [#145](https://github.com/MichMich/MagicMirror/issues/145).
164-
- MagicMirror² (Electron) sometimes quits without an error after an extended period of use. See [#150](https://github.com/MichMich/MagicMirror/issues/150).
171+
## Updating
172+
173+
If you want to update your MagicMirror² to the latest version, use your terminal to go to your Magic Mirror folder and type the following command:
174+
175+
```bash
176+
git pull && npm install
177+
```
178+
179+
If you changed nothing more than the config or the modules, this should work without any problems.
180+
Type `git status` to see your changes, if there are any, you can reset them with `git reset --hard`. After that, git pull should be possible.
181+
165182

166183
## Community
167184

@@ -180,6 +197,22 @@ Please keep the following in mind:
180197

181198
Thanks for your help in making MagicMirror² better!
182199

200+
## Manifesto
201+
202+
A real Manifesto is still to be written. Till then, Michael's response on [one of the repository issues](https://github.com/MichMich/MagicMirror/issues/1174) gives a great summary:
203+
204+
> "... I started this project as an ultimate starter project for Raspberry Pi enthusiasts. As a matter of fact, for most of the contributors, the MagicMirror project is the first open source project they ever contributed to. This is one of the reasons why the MagicMirror project is featured in several RasPi magazines.
205+
>
206+
>The project has a lot of opportunities for improvement. We could use a powerful framework like Vue to ramp up the development speed. We could use SASS for better/easier css implementations. We could make it an NPM installable package. And as you say, we could bundle it up. The big downside of of of these changes is that it over complicates things: a user no longer will be able to open just one file and make a small modification and see how it works out.
207+
>
208+
>Of course, a bundled version can be complimentary to the regular un-bundled version. And I'm sure a lot of (new) users will opt for the bundled version. But this means those users won't be motivated to take a peek under the hood. They will just remain 'users'. They won't become contributors, and worse: they won't be motivated to take their first steps in software development.
209+
>
210+
>And to be honest: motivating curious users to step out of their comfort zone and take those first steps is what drives me in this project. Therefor my ultimate goal is this project is to keep it as accessible as possible."
211+
>
212+
> ~ Michael Teeuw
213+
214+
215+
183216
<p align="center">
184217
<br>
185218
<a href="https://forum.magicmirror.builders/topic/728/magicmirror-is-voted-number-1-in-the-magpi-top-50"><img src="https://magicmirror.builders/img/magpi-best-watermark-custom.png" width="150" alt="MagPi Top 50"></a>

dangerfile.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { danger, fail, warn } from "danger"
2+
3+
// Check if the CHANGELOG.md file has been edited
4+
// Fail the build and post a comment reminding submitters to do so if it wasn't changed
5+
if (!danger.git.modified_files.includes("CHANGELOG.md")) {
6+
warn("Please include an updated `CHANGELOG.md` file.<br>This way we can keep track of all the contributions.")
7+
}
8+
9+
// Check if the PR request is send to the master branch.
10+
// This should only be done by MichMich.
11+
if (danger.github.pr.base.ref === "master" && danger.github.pr.user.login !== "MichMich") {
12+
// Check if the PR body or title includes the text: #accepted.
13+
// If not, the PR will fail.
14+
if ((danger.github.pr.body + danger.github.pr.title).includes("#accepted")) {
15+
fail("Please send all your pull requests to the `develop` branch.<br>Pull requests on the `master` branch will not be accepted.")
16+
}
17+
}

installers/raspberry.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sudo apt-get update || echo -e "\e[91mUpdate failed, carrying on installation ..
4242

4343
# Installing helper tools
4444
echo -e "\e[96mInstalling helper tools ...\e[90m"
45-
sudo apt-get install curl wget git build-essential unzip || exit
45+
sudo apt-get --assume-yes install curl wget git build-essential unzip || exit
4646

4747
# Check if we need to install or upgrade Node.js.
4848
echo -e "\e[96mCheck current Node installation ...\e[0m"
@@ -82,7 +82,7 @@ if $NODE_INSTALL; then
8282
# The NODE_STABLE_BRANCH variable will need to be manually adjusted when a new branch is released. (e.g. 7.x)
8383
# Only tested (stable) versions are recommended as newer versions could break MagicMirror.
8484

85-
NODE_STABLE_BRANCH="6.x"
85+
NODE_STABLE_BRANCH="9.x"
8686
curl -sL https://deb.nodesource.com/setup_$NODE_STABLE_BRANCH | sudo -E bash -
8787
sudo apt-get install -y nodejs
8888
echo -e "\e[92mNode.js installation Done!\e[0m"
@@ -101,7 +101,7 @@ if [ -d "$HOME/MagicMirror" ] ; then
101101
fi
102102

103103
echo -e "\e[96mCloning MagicMirror ...\e[90m"
104-
if git clone https://github.com/MichMich/MagicMirror.git; then
104+
if git clone --depth=1 https://github.com/MichMich/MagicMirror.git; then
105105
echo -e "\e[92mCloning MagicMirror Done!\e[0m"
106106
else
107107
echo -e "\e[91mUnable to clone MagicMirror."
@@ -149,7 +149,7 @@ else
149149
fi
150150

151151
# Use pm2 control like a service MagicMirror
152-
read -p "Do you want use pm2 for auto starting of your MagicMirror (y/n)?" choice
152+
read -p "Do you want use pm2 for auto starting of your MagicMirror (y/N)?" choice
153153
if [[ $choice =~ ^[Yy]$ ]]; then
154154
sudo npm install -g pm2
155155
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi"

js/class.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,4 @@ function cloneObject(obj) {
9292
/*************** DO NOT EDIT THE LINE BELOW ***************/
9393
if (typeof module !== "undefined") {
9494
module.exports = Class;
95-
module.exports._test = {
96-
cloneObject: cloneObject
97-
}
9895
}

0 commit comments

Comments
 (0)