From 571259f2413a5a26bcce20adabe3be8175e22457 Mon Sep 17 00:00:00 2001 From: Quinton Marchi Date: Sat, 28 Sep 2013 03:55:06 -0400 Subject: [PATCH] Adds hostname support, fixes #343 Works from previous testing but I haven't tried this personal revision of the code. Take it with a grain of salt. --- src/install.js | 12 +++++++++++- src/webserver.js | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/install.js b/src/install.js index 4a4ef9351f..eae52c45c0 100644 --- a/src/install.js +++ b/src/install.js @@ -40,7 +40,17 @@ var async = require('async'), }, { name: 'redis:password', description: 'Password of your Redis database' - }], + }, { + name: 'use_ip', + description: 'Do you want to bind to an IP or hostname?', + 'default': 'n', + pattern: /y[es]*|n[o]?/, + message: 'Please enter \'yes\' or \'no\'', + }, { + name: 'hostname_ip', + decription: 'Hostname or IP to bind to' + 'default': '0.0.0.0' + }], setup: function (callback) { async.series([ function (next) { diff --git a/src/webserver.js b/src/webserver.js index b9116e7906..4fff4aa58a 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -134,7 +134,7 @@ var express = require('express'), templates['logout'] = parsedTemplate; }); - server.listen(nconf.get('PORT') || nconf.get('port')); + server.listen(nconf.get('PORT') || nconf.get('port'), nconf.get('use_ip') ? nconf.get('hostname_set') : '0.0.0.0'); } auth.initialize(app);