Merge pull request #541 from roramirez/bind-address

Add option to set bind address
This commit is contained in:
Michael Teeuw 2016-11-26 13:23:27 +01:00 committed by GitHub
commit 60ac4a3e86
4 changed files with 6 additions and 2 deletions

View File

@ -26,6 +26,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Ability to set date format in calendar module
- Possibility to use currentweather for the compliments
- Added option `disabled` for modules.
- Added option `address` to set bind address.
- Added option `onlyTemp` for currentweather module to show show only current temperature and weather icon.
### Updated
- Modified translations for Frysk.

View File

@ -76,6 +76,7 @@ The following properties can be configured:
| **Option** | **Description** |
| --- | --- |
| `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"]]`).|
| `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`|
| `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`. |

View File

@ -17,7 +17,7 @@ var helmet = require("helmet");
var Server = function(config, callback) {
console.log("Starting server op port " + config.port + " ... ");
server.listen(config.port);
server.listen(config.port, config.address ? config.address : null);
app.use(function(req, res, next) {
var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) {

View File

@ -1,5 +1,6 @@
var app = require("../js/app.js");
app.start(function(config) {
console.log("");
console.log("Ready to go! Please point your browser to: http://localhost:" + config.port);
var bindAddress = config.address ? config.address : "localhost";
console.log("Ready to go! Please point your browser to: http://" + bindAddress + ":" + config.port);
});