Skip to content
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

Added IP address bind to HTTP frontend listener #5014

Merged
merged 3 commits into from Nov 23, 2020

Conversation

Roman1us
Copy link
Contributor

Allow attach frontend to specific IP address or interface

@@ -27,6 +27,7 @@ class Frontend extends Extension {
this.server.on('upgrade', this.onUpgrade);
this.developmentServer = settings.get().frontend.development_server;
this.development = !!this.developmentServer;
this.ipAddress = settings.get().frontend.ip || '0.0.0.0';
Copy link
Owner

Choose a reason for hiding this comment

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

Please change ip to host, the rest looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. What about documentation? Do i need fork document repo and make changes?

@Roman1us
Copy link
Contributor Author

Some questions. What about default settings in settings.js file. Should i add frontend section to it? And what default settings you expect?

@nurikk
Copy link
Collaborator

nurikk commented Nov 21, 2020

Some questions. What about default settings in settings.js file. Should i add frontend section to it? And what default settings you expect?

Add defaults here:

const defaults = {

IIRC default host is 0.0.0.0 and port is 8080

@Roman1us
Copy link
Contributor Author

@nurikk I'm already trying this. But... Default behavior for current version: frontend not enabled. If in current pull request i will add this settings, at first all tests fails, because in tests frontend server not release port. Also attach interface to 0.0.0.0 with default behavior is not secure, so i did this pull request.

if (settings.get().frontend) {

If i add defaults, this condition will be always true

@Koenkk
Copy link
Owner

Koenkk commented Nov 21, 2020

@nurikk I'm already trying this. But... Default behavior for current version: frontend not enabled. If in current pull request i will add this settings, at first all tests fails, because in tests frontend server not release port. Also attach interface to 0.0.0.0 with default behavior is not secure, so i did this pull request.

if (settings.get().frontend) {

If i add defaults, this condition will be always true

I see, then please add the defaults back into frontend.js.

Koenkk added a commit to Koenkk/zigbee2mqtt.io that referenced this pull request Nov 23, 2020
@Koenkk
Copy link
Owner

Koenkk commented Nov 23, 2020

Thanks, also updated the docs.

@Koenkk Koenkk merged commit 481cdef into Koenkk:dev Nov 23, 2020
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.

None yet

3 participants