Conversation
Added the ability to choose by name the interface the server will listen on.
config.js
Outdated
| var config = {}; | ||
|
|
||
| config.webPort = process.env.WEB_PORT || 8000; | ||
| config.webPort = process.env.WEB_PORT || 8002; |
There was a problem hiding this comment.
No need to change the default port to 8002. Users can change their port in the env file via "WEB_PORT=".
And config.js is anyways the wrong place to set user config, because it will be compiled into the runtime (for runtime versions). User configuration should be done in the env file.
There was a problem hiding this comment.
I had a server running on this port on my dev machine already. I thought I had changed that back before doing the pull request. Sorry. I fixed it now.
cprezzi
left a comment
There was a problem hiding this comment.
Please do not directly use config.js for user settings (as it is not available in compiled runtime)!
Instead config.js should only define the default and read the user setting from the env file.
| config.serverVersion = '4.0.136'; | ||
| config.apiVersion = '4.0.7'; | ||
| //config.interface = 'Wi-Fi' //Windows Name | ||
| //config.interface = 'wlan0' //linux name |
There was a problem hiding this comment.
This should be done like all the other user configurable presets:
config.interface = process.env.WEB_INTERFACE || null;
Then the user can set the interface in his .env file with:
WEB_INTERFACE = "wlan0"
Added the ability to choose by name the interface the server will listen on.
On my windows machine, it looks to try to listen on an interface without a valid ip (169. etc). This will allow for a config.interface name to be set in config.js and used to discover the correct IP address.