Skip to content

Conversation

ril3y
Copy link

@ril3y ril3y commented Jan 20, 2020

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.

Added the ability to choose by name the interface the server will listen on.
Copy link
Member

@cprezzi cprezzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, but why did you change the default port to 8002?

Config.js is the place for the default values that get compiled into the exe. User settings should go into the env file.

config.js Outdated
var config = {};

config.webPort = process.env.WEB_PORT || 8000;
config.webPort = process.env.WEB_PORT || 8002;
Copy link
Member

@cprezzi cprezzi Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@cprezzi cprezzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants