-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify HOST for express server to listen on #190
base: master
Are you sure you want to change the base?
Conversation
@@ -224,6 +224,7 @@ if (app.get('env') === 'development') { | |||
|
|||
// App configuration for all environments | |||
app.set('port', process.env.PORT || 3000); | |||
app.set('host', process.env.HOST || '0.0.0.0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about something like this, and remove the line setting this on the app?
var server_params = {
port : process.env.PORT || 3000
}
if(process.env.HOST){
server_params.host = process.env.HOST;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see any pros and cons to this change unless the configuration is needed elsewhere in the application. In addition, the possibility of setting a default value is lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, you can not view the configuration in the log
I have resolved some merge conflicts to master branch. Now it is possible to merge this pull requests. |
@DerOetzi is this still relevant? I see no problem with this PR. |
For me personally this isn't relevant anymore as I don't use openhab-cloud but using a vpn connection behind a haproxy setup. But I think for server admins which want there own cloud instance on a server with multiple IPs this is still a good feature. |
Sorry for the thread necromancy but since it's still open, I have noticed after a batch of test installs that the server seems to come up listening on IPv6 only, and requires something similar to:
in /app.js to listen on IPv4 - where I added the comma and '0.0.0,0' between system.getNodeProcessPort and the callback. I can see the arguments for the ability to set a default in e.g. /config.json and am happy to put up a pr for this if you want it. |
New pull request for feature request #168