From 34f04b1946a2f339e24236d9b58e05f9b4bc9d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 7 Mar 2017 14:12:48 -0300 Subject: [PATCH 1/8] Add note to allow all IP addresses. ipWhitelist configuration directive. --- README.md | 2 +- config/config.js.sample | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9cadb364..e7b7a841 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ The following properties can be configured: | --- | --- | | `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. | | `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`. | -| `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"]]`).| +| `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.| | `zoom` | This allows to scale the mirror contents with a given zoom factor. The default value is `1.0`| | `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`. | | `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. | diff --git a/config/config.js.sample b/config/config.js.sample index eab22972..797f4d75 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -6,7 +6,7 @@ var config = { port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses. language: "en", timeFormat: 24, From 81aca500b39377ac31c93f268fedcc94319c8ec3 Mon Sep 17 00:00:00 2001 From: BeatIdo Date: Fri, 10 Mar 2017 16:56:28 +0100 Subject: [PATCH 2/8] Hide News Feed loading option Configuration option to hide News Feed module if feed is empty instead of showing LOADING status --- modules/default/newsfeed/newsfeed.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 7c31717a..c2f53d85 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -21,6 +21,7 @@ Module.register("newsfeed",{ showSourceTitle: true, showPublishDate: true, showDescription: false, + hideLoading: false, reloadInterval: 5 * 60 * 1000, // every 5 minutes updateInterval: 10 * 1000, animationSpeed: 2.5 * 1000, @@ -179,12 +180,18 @@ Module.register("newsfeed",{ fullArticle.src = this.newsItems[this.activeItem].url; wrapper.appendChild(fullArticle); } - - - + + if (this.config.hideLoading) { + this.show(); + } + } else { - wrapper.innerHTML = this.translate("LOADING"); - wrapper.className = "small dimmed"; + if (this.config.hideLoading) { + this.hide(); + } else { + wrapper.innerHTML = this.translate("LOADING"); + wrapper.className = "small dimmed"; + } } return wrapper; From 0f27d646bb44702117f9b69f3e1e1b7ea705bd42 Mon Sep 17 00:00:00 2001 From: BeatIdo Date: Fri, 10 Mar 2017 17:03:14 +0100 Subject: [PATCH 3/8] removed trailing spaces --- modules/default/newsfeed/newsfeed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index c2f53d85..e62888dc 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -180,11 +180,11 @@ Module.register("newsfeed",{ fullArticle.src = this.newsItems[this.activeItem].url; wrapper.appendChild(fullArticle); } - + if (this.config.hideLoading) { this.show(); } - + } else { if (this.config.hideLoading) { this.hide(); From 989ee0e28149de7c0a4048bfeaefcd821e674b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 10 Mar 2017 16:27:05 -0300 Subject: [PATCH 4/8] Add link for tutorial ipWhitelist HowTo of @mochman --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7b7a841..98ca4154 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ The following properties can be configured: | --- | --- | | `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. | | `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`. | -| `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.| +| `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) | | `zoom` | This allows to scale the mirror contents with a given zoom factor. The default value is `1.0`| | `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`. | | `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. | From 1bdc46969c3d54379ddf6bccc8fc31b5cbb66574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 10 Mar 2017 16:36:17 -0300 Subject: [PATCH 5/8] Add information message when the ipWhitelist is configurate with [] --- js/server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/server.js b/js/server.js index 901e0350..beb8b84c 100644 --- a/js/server.js +++ b/js/server.js @@ -19,6 +19,10 @@ var Server = function(config, callback) { server.listen(config.port, config.address ? config.address : null); + if (config.ipWhitelist instanceof Array && config.ipWhitelist.length == 0) { + console.info("You're using a full whitelist configuration to allow for all IPs") + } + app.use(function(req, res, next) { var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) { if (err === undefined) { From 44509e027c4e383683ef2efe79ec905b7ded99c1 Mon Sep 17 00:00:00 2001 From: BeatIdo Date: Fri, 17 Mar 2017 09:06:29 +0100 Subject: [PATCH 6/8] Add hideLoading option description --- modules/default/newsfeed/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index bfaa1aad..fabe73d3 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -63,6 +63,7 @@ The following properties can be configured: | `showSourceTitle` | Display the title of the source.

**Possible values:** `true` or `false`
**Default value:** `true` | `showPublishDate` | Display the publish date of an headline.

**Possible values:** `true` or `false`
**Default value:** `true` | `showDescription` | Display the description of an item.

**Possible values:** `true` or `false`
**Default value:** `false` +| `hideLoading` | Hide module instead of showing LOADING status.

**Possible values:** `true` or `false`
**Default value:** `false` | `reloadInterval` | How often does the content needs to be fetched? (Milliseconds)

**Possible values:** `1000` - `86400000`
**Default value:** `300000` (5 minutes) | `updateInterval` | How often do you want to display a new headline? (Milliseconds)

**Possible values:**`1000` - `60000`
**Default value:** `10000` (10 seconds) | `animationSpeed` | Speed of the update animation. (Milliseconds)

**Possible values:**`0` - `5000`
**Default value:** `2500` (2.5 seconds) From 1f5ea40bf68b496867514378d16939bc974ace7d Mon Sep 17 00:00:00 2001 From: BeatIdo Date: Fri, 17 Mar 2017 09:08:45 +0100 Subject: [PATCH 7/8] News Feed hideLoading option --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 564564cb..4a0d1212 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Korean Translation. - Added console warning on startup when deprecated config options are used - Added `DAYAFTERTOMORROW`, `UPDATE_NOTIFICATION`, `UPDATE_NOTIFICATION_MODULE`, `UPDATE_INFO` to Norwegian translations (`nn` and `nb`). +- Added hideLoading option for News Feed module ### Fixed - Update .gitignore to not ignore default modules folder. From 4aec39df7a1c1726a37d5f12a65c71db2383c40d Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Fri, 17 Mar 2017 14:32:01 +0100 Subject: [PATCH 8/8] Fix Merge Conflicts. --- CHANGELOG.md | 3 ++- modules/default/clock/README.md | 1 + modules/default/clock/clock.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1001eef6..ffb4e9c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,8 +50,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added console warning on startup when deprecated config options are used - Add option to display temperature unit label to the current weather module - Added ability to disable wrapping of news items -- Added `DAYAFTERTOMORROW`, `UPDATE_NOTIFICATION`, `UPDATE_NOTIFICATION_MODULE`, `UPDATE_INFO` to Norwegian translations (`nn` and `nb`). +- Updated Norwegian translation. - Added hideLoading option for News Feed module +- Added configurable dateFormat to clock module. ### Fixed - Update .gitignore to not ignore default modules folder. diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index 5570ff5a..f518a2b2 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -30,6 +30,7 @@ The following properties can be configured: | `showPeriodUpper` | Show the period (AM/PM) with 12 hour format as uppercase.

**Possible values:** `true` or `false`
**Default value:** `false` | `clockBold` | Remove the colon and bold the minutes to make a more modern look.

**Possible values:** `true` or `false`
**Default value:** `false` | `showDate` | Turn off or on the Date section.

**Possible values:** `true` or `false`
**Default value:** `true` +| `dateFormat` | Configure the date format as you like.

**Possible values:** [Docs](http://momentjs.com/docs/#/displaying/format/)
**Default value:** `"dddd, LL"` | `displayType` | Display a digital clock, analog clock, or both together.

**Possible values:** `digital`, `analog`, or `both`
**Default value:** `digital` | `analogSize` | **Specific to the analog clock.** Defines how large the analog display is.

**Possible values:** A positive number of pixels`
**Default value:** `200px` | `analogFace` | **Specific to the analog clock.** Specifies which clock face to use.

**Possible values:** `simple` for a simple border, `none` for no face or border, or `face-###` (where ### is currently a value between 001 and 012, inclusive)
**Default value:** `simple` diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index e15fbbbd..21e665e7 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -16,6 +16,7 @@ Module.register("clock",{ showPeriodUpper: false, clockBold: false, showDate: true, + dateFormat: "dddd, LL", /* specific to the analog clock */ analogSize: "200px", @@ -87,7 +88,7 @@ Module.register("clock",{ } if(this.config.showDate){ - dateWrapper.innerHTML = now.format("dddd, LL"); + dateWrapper.innerHTML = now.format(this.config.dateFormat); } timeWrapper.innerHTML = timeString; secondsWrapper.innerHTML = now.format("ss");