Skip to content

Commit 8010e62

Browse files
authored
Merge pull request #586 from MichMich/develop
Release 2.1.0
2 parents 65b8f78 + 09e6a6a commit 8010e62

Some content is hidden

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

74 files changed

+3289
-761
lines changed

.eslintrc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"quotes": ["error", "double"],
55
"max-len": ["error", 250],
66
"curly": "error",
7-
"camelcase": ["error", {"properties": "never"}]
7+
"camelcase": ["error", {"properties": "never"}],
8+
"no-trailing-spaces": ["error"],
9+
"no-irregular-whitespace": ["error"]
810
},
911
"env": {
1012
"browser": true,
1113
"node": true,
1214
"es6": true
1315
}
14-
}
16+
}

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To run StyleLint, use `grunt stylelint`.
2323

2424
### Submitting Issues
2525

26-
Please only submit reproducible issues.
26+
Please only submit reproducible issues.
2727

2828
If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt)
2929
Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> Please send your pull requests the develop branch.
1+
> Please send your pull requests the develop branch.
22
> Don't forget to add the change to CHANGELOG.md.
33
44
* Does the pull request solve a **related** issue?

CHANGELOG.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,65 @@
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.1.0] - 2016-12-31
6+
7+
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
8+
9+
### Added
10+
- Finnish translation.
11+
- Danish translation.
12+
- Turkish translation.
13+
- Option to limit access to certain IP addresses based on the value of `ipWhitelist` in the `config.js`, default is access from localhost only (Issue [#456](https://github.com/MichMich/MagicMirror/issues/456)).
14+
- Added ability to change the point of time when calendar events get relative.
15+
- Add Splash screen on boot.
16+
- Add option to show humidity in currentWeather module.
17+
- Add VSCode IntelliSense support.
18+
- Module API: Add Visibility locking to module system. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules#visibility-locking) for more information.
19+
- Module API: Method to overwrite the module's header. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules#getheader) for more information.
20+
- Module API: Option to define the minimum MagicMirror version to run a module. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules#requiresversion) for more information.
21+
- Calendar module now broadcasts the event list to all other modules using the notification system. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/calendar) for more information.
22+
- Possibility to use the the calendar feed as the source for the weather (currentweather & weatherforecast) location data. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/weatherforecast) for more information.
23+
- Added option to show rain amount in the weatherforecast default module
24+
- Add module `updatenotification` to get an update whenever a new version is availabe. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/updatenotification) for more information.
25+
- Add the abilty to set timezone on the date display in the Clock Module
26+
- Ability to set date format in calendar module
27+
- Possibility to use currentweather for the compliments
28+
- Added option `disabled` for modules.
29+
- Added option `address` to set bind address.
30+
- Added option `onlyTemp` for currentweather module to show show only current temperature and weather icon.
31+
- Added option `remoteFile` to compliments module to load compliment array from filesystem.
32+
- Added option `zoom` to scale the whole mirror display with a given factor.
33+
- Added option `roundTemp` for currentweather and weatherforecast modules to display temperatures rounded to nearest integer.
34+
- Added abilty set the classes option to compliments module for style and text size of compliments.
35+
- Added ability to configure electronOptions
36+
- Calendar module: option to hide private events
37+
- Add root_path for global vars
38+
39+
### Updated
40+
- Modified translations for Frysk.
41+
- Modified core English translations.
42+
- Updated package.json as a result of Snyk security update.
43+
- Improve object instantiation to prevent reference errors.
44+
- Improve logger. `Log.log()` now accepts multiple arguments.
45+
- Remove extensive logging in newsfeed node helper.
46+
- Calendar times are now uniformly capitalized.
47+
- Modules are now secure, and Helmet is now used to prevent abuse of the Mirror's API.
48+
49+
### Fixed
50+
- Solve an issue where module margins would appear when the first module of a section was hidden.
51+
- Solved visual display errors on chrome, if all modules in one of the right sections are hidden.
52+
- Global and Module default config values are no longer modified when setting config values.
53+
- Hide a region if all modules in a region are hidden. Prevention unwanted margins.
54+
- Replaced `electron-prebuilt` package with `electron` in order to fix issues that would happen after 2017.
55+
- Documentation of alert module
56+
557
## [2.0.5] - 2016-09-20
658

759
### Added
860
- Added ability to remove tags from the beginning or end of newsfeed items in 'newsfeed.js'.
961
- Added ability to define "the day after tomorrow" for calendar events (Definition for German and Dutch already included).
1062
- Added CII Badge (we are compliant with the CII Best Practices)
11-
- Add support for doing http basic auth when loading calendars
63+
- Add support for doing http basic auth when loading calendars
1264
- Add the abilty to turn off and on the date display in the Clock Module
1365

1466
### Fixed

Gruntfile.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ module.exports = function(grunt) {
66
options: {
77
configFile: ".eslintrc.json"
88
},
9-
target: ["js/*.js", "modules/default/*.js", "serveronly/*.js", "*.js"]
9+
target: ["js/*.js", "modules/default/*.js", "modules/default/*/*.js",
10+
"serveronly/*.js", "*.js", "!modules/default/alert/notificationFx.js",
11+
"!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js"
12+
]
1013
},
1114
stylelint: {
1215
simple: {
@@ -47,7 +50,6 @@ module.exports = function(grunt) {
4750
"MD018": false,
4851
"MD012": false,
4952
"MD026": false,
50-
"MD036": false,
5153
"MD038": false
5254
}
5355
},
@@ -64,4 +66,4 @@ module.exports = function(grunt) {
6466
grunt.loadNpmTasks("grunt-yamllint");
6567
grunt.loadNpmTasks("grunt-markdownlint");
6668
grunt.registerTask("default", ["eslint", "stylelint", "jsonlint", "markdownlint", "yamllint"]);
67-
};
69+
};

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following wiki links are helpful in the configuration of your MagicMirror²
6060
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:
6161

6262
```bash
63-
git pull
63+
git pull && npm install
6464
```
6565

6666
If you changed nothing more than the config or the modules, this should work without any problems.
@@ -73,15 +73,18 @@ Type `git status` to see your changes, if there are any, you can reset them with
7373

7474
The following properties can be configured:
7575

76-
7776
| **Option** | **Description** |
7877
| --- | --- |
7978
| `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. |
80-
| `kioskmode` | This allows MagicMirror² to run in Kiosk Mode. It protects from other programs popping on top of your screen. The default value is `false`|
79+
| `address` | The ip address the accept connections. The default open bind `::` is IPv6 is available or `0.0.0.0` IPv4 run on. Example config: `192.168.10.100`. |
80+
| `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"]]`).|
81+
| `zoom` | This allows to scale the mirror contents with a given zoom factor. The default value is `1.0`|
8182
| `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`. |
8283
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. |
8384
| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. |
8485
| `modules` | An array of active modules. **The array must contain objects. See the next table below for more information.** |
86+
| `electronOptions` | An optional array of Electron (browser) options. This allows configuration of e.g. the browser screen size and position (defaults `.width = 800` & `.height = 600`). Kiosk mode can be enabled by setting `.kiosk = true`, `.autoHideMenuBar = false`, `.fullscreen = false`. More options can be found [here](https://github.com/electron/electron/blob/master/docs/api/browser-window.md). |
87+
8588

8689
Module configuration:
8790

@@ -91,6 +94,7 @@ Module configuration:
9194
| `position` | The location of the module in which the module will be loaded. Possible values are `top_ bar`, `top_left`, `top_center`, `top_right`, `upper_third`, `middle_center`, `lower_third`, `bottom_left`, `bottom_center`, `bottom_right`, `bottom_bar`, `fullscreen_above`, and `fullscreen_below`. This field is optional but most modules require this field to set. Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file. |
9295
| `classes` | Additional classes which are passed to the module. The field is optional. |
9396
| `header` | To display a header text above the module, add the header property. This field is optional. |
97+
| `disabled` | Set disabled to `true` to skip creating the module. This field is optional. |
9498
| `config` | An object with the module configuration properties. Check the documentation of the module for more information. This field is optional, unless the module requires extra configuration. |
9599

96100
## Modules
@@ -129,3 +133,8 @@ Please keep the following in mind:
129133
- **New Features**: please please discuss in a GitHub issue before you start to alter a big part of the code. Without discussion upfront, the pull request will not be accepted / merged.
130134

131135
Thanks for your help in making MagicMirror² better!
136+
137+
<p align="center">
138+
<br>
139+
<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>
140+
</p>

config/config.js.sample

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
var config = {
88
port: 8080,
9+
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
910

1011
language: 'en',
1112
timeFormat: 24,
@@ -15,6 +16,10 @@ var config = {
1516
{
1617
module: 'alert',
1718
},
19+
{
20+
module: "updatenotification",
21+
position: "top_bar"
22+
},
1823
{
1924
module: 'clock',
2025
position: 'top_left'
@@ -50,9 +55,9 @@ var config = {
5055
position: 'top_right',
5156
header: 'Weather Forecast',
5257
config: {
53-
location: 'New York',
58+
location: 'New York',
5459
locationID: '5128581', //ID from http://www.openweathermap.org
55-
appid: 'YOUR_OPENWEATHER_API_KEY'
60+
appid: 'YOUR_OPENWEATHER_API_KEY'
5661
}
5762
},
5863
{

css/main.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ sup {
113113
*/
114114

115115
.module {
116-
margin-top: 30px;
116+
margin-bottom: 30px;
117117
}
118118

119-
.module:first-child {
120-
margin-top: 0;
119+
.region.bottom .module {
120+
margin-top: 30px;
121+
margin-bottom: 0;
121122
}
122123

123124
/**

index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<link rel="stylesheet" type="text/css" href="css/main.css">
99
<link rel="stylesheet" type="text/css" href="fonts/roboto.css">
1010
<!-- custom.css is loaded by the loader.js to make sure it's loaded after the module css files. -->
11+
12+
<script type="text/javascript">
13+
var version = "#VERSION#";
14+
</script>
1115
</head>
1216
<body>
1317
<div class="region fullscreen below"><div class="container"></div></div>

installers/raspberry.sh

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ echo ' \$$$$$$ |'
1818
echo ' \______/'
1919
echo -e "\e[0m"
2020

21-
# Define the tested version of Node.js.
21+
# Define the tested version of Node.js.
2222
NODE_TESTED="v5.1.0"
2323

2424
#Determine which Pi is running.
@@ -49,19 +49,19 @@ if command_exists node; then
4949
echo -e "\e[0mMinimum Node version: \e[1m$NODE_TESTED\e[0m"
5050
echo -e "\e[0mInstalled Node version: \e[1m$NODE_CURRENT\e[0m"
5151
if version_gt $NODE_TESTED $NODE_CURRENT; then
52-
echo -e "\e[96mNode should be upgraded.\e[0m"
53-
NODE_INSTALL=true
54-
55-
#Check if a node process is currenlty running.
56-
#If so abort installation.
57-
if pgrep "node" > /dev/null; then
58-
echo -e "\e[91mA Node process is currently running. Can't upgrade."
59-
echo "Please quit all Node processes and restart the installer."
60-
exit;
52+
echo -e "\e[96mNode should be upgraded.\e[0m"
53+
NODE_INSTALL=true
54+
55+
#Check if a node process is currenlty running.
56+
#If so abort installation.
57+
if pgrep "node" > /dev/null; then
58+
echo -e "\e[91mA Node process is currently running. Can't upgrade."
59+
echo "Please quit all Node processes and restart the installer."
60+
exit;
6161
fi
6262

63-
else
64-
echo -e "\e[92mNo Node.js upgrade nessecery.\e[0m"
63+
else
64+
echo -e "\e[92mNo Node.js upgrade nessecery.\e[0m"
6565
fi
6666

6767
else
@@ -113,6 +113,34 @@ else
113113
exit;
114114
fi
115115

116+
# Check if plymouth is installed (default with PIXEL desktop environment), then install custom splashscreen.
117+
echo -e "\e[96mCheck plymouth installation ...\e[0m"
118+
if command_exists plymouth; then
119+
THEME_DIR="/usr/share/plymouth/themes"
120+
echo -e "\e[90mSplashscreen: Checking themes directory.\e[0m"
121+
if [ -d $THEME_DIR ]; then
122+
echo -e "\e[90mSplashscreen: Create theme directory if not exists.\e[0m"
123+
if [ ! -d $THEME_DIR/MagicMirror ]; then
124+
sudo mkdir $THEME_DIR/MagicMirror
125+
fi
126+
127+
if sudo cp ~/MagicMirror/splashscreen/splash.png $THEME_DIR/MagicMirror/splash.png && sudo cp ~/MagicMirror/splashscreen/MagicMirror.plymouth $THEME_DIR/MagicMirror/MagicMirror.plymouth && sudo cp ~/MagicMirror/splashscreen/MagicMirror.script $THEME_DIR/MagicMirror/MagicMirror.script; then
128+
echo -e "\e[90mSplashscreen: Theme copied successfully.\e[0m"
129+
if sudo plymouth-set-default-theme -R MagicMirror; then
130+
echo -e "\e[92mSplashscreen: Changed theme to MagicMirror successfully.\e[0m"
131+
else
132+
echo -e "\e[91mSplashscreen: Couldn't change theme to MagicMirror!\e[0m"
133+
fi
134+
else
135+
echo -e "\e[91mSplashscreen: Copying theme failed!\e[0m"
136+
fi
137+
else
138+
echo -e "\e[91mSplashscreen: Themes folder doesn't exist!\e[0m"
139+
fi
140+
else
141+
echo -e "\e[93mplymouth is not installed.\e[0m";
142+
fi
143+
116144
echo " "
117145
echo -e "\e[92mWe're ready! Run \e[1m\e[97mDISPLAY=:0 npm start\e[0m\e[92m from the ~/MagicMirror directory to start your MagicMirror.\e[0m"
118146
echo " "

0 commit comments

Comments
 (0)