Merge pull request #951 from QNimbus/fix-issue-950

Fix for issue #950
This commit is contained in:
Michael Teeuw 2017-07-20 10:12:45 +02:00 committed by GitHub
commit fbd47a7f3b
7 changed files with 35 additions and 32 deletions

View File

@ -11,10 +11,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add symbol and color properties of event when `CALENDAR_EVENTS` notification is broadcasted from `default/calendar` module. - Add symbol and color properties of event when `CALENDAR_EVENTS` notification is broadcasted from `default/calendar` module.
### Updated ### Updated
- Changed 'default.js' - listen on all attached interfaces by default
### Fixed ### Fixed
- Fixed issue with incorrect allignment of analog clock when displayed in the center column of the MM - Fixed issue with incorrect allignment of analog clock when displayed in the center column of the MM
- Fixed ipWhitelist behaviour to make empty whitelist ([]) allow any and all hosts access to the MM
## [2.1.2] - 2017-07-01 ## [2.1.2] - 2017-07-01

View File

@ -8,7 +8,7 @@
*/ */
var port = 8080; var port = 8080;
var address = "localhost"; var address = ""; // Default to listening on all interfaces
if (typeof(mmPort) !== "undefined") { if (typeof(mmPort) !== "undefined") {
port = mmPort; port = mmPort;
} }

View File

@ -46,8 +46,9 @@ function createWindow() {
mainWindow = new BrowserWindow(electronOptions); mainWindow = new BrowserWindow(electronOptions);
// and load the index.html of the app. // and load the index.html of the app.
//mainWindow.loadURL('file://' + __dirname + '../../index.html'); // If config.address is not defined or is an empty string (listening on all interfaces), connect to localhost
mainWindow.loadURL(`http://${config.address}:${config.port}`); var address = config.address === void 0 | config.address === "" ? config.address = "localhost" : config.address;
mainWindow.loadURL(`http://${address}:${config.port}`);
// Open the DevTools if run with "npm start dev" // Open the DevTools if run with "npm start dev"
if (process.argv.includes("dev")) { if (process.argv.includes("dev")) {

View File

@ -30,7 +30,7 @@ var Server = function(config, callback) {
} }
app.use(function(req, res, next) { app.use(function(req, res, next) {
var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) { var result = ipfilter(config.ipWhitelist, {mode: config.ipWhitelist.length === 0 ? "deny" : "allow", log: false})(req, res, function(err) {
if (err === undefined) { if (err === undefined) {
return next(); return next();
} }