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

[Bug]: Webserver settings not properly saved/derived if chosen web instance bound to single interface #145

Closed
raintonr opened this issue Dec 24, 2022 · 4 comments · Fixed by #153
Assignees
Labels

Comments

@raintonr
Copy link
Contributor

Contact Details

robin@rainton.com

What happened?

This Chromecast adapter has 1 or 2 drop configuration down values regarding web instances:

  1. Web instance : Mandatory. This is the actual instance number (eg. web.0, web.1, etc).
  2. Web server IP : Optional. This is only shown if the chosen web instance is bound to all interfaces.

I recently re-configured our IoB web instances to only listen on a single interface (good security practice).

What this means is that the Web server IP configuration option disappears and a null value is stored for adapter.config.webServer setting.

As a result, trying to play local files (by setting the appropriate state) causes the error messages, 'Sorry, cannot play file', 'Please configure webserver settings first!' to be logged.

Adapter Version

3.1.0

JS-Controller Version

4.0.23

Node JS Version

v16.17.1

NPM Version

8.15.0

Operating System

Debian

Relevant log output

2022-12-24 19:29:41.066  - error: chromecast.0 (8597) Nest_Mini- Sorry, cannot play file "/some/file/here.mp3"
2022-12-24 19:29:41.067  - error: chromecast.0 (8597) Nest_Mini- Please configure webserver settings first!


### Anything else?

_No response_
@raintonr raintonr added the bug label Dec 24, 2022
@raintonr
Copy link
Contributor Author

As an FYI, a workaround is:

  1. Configure the required web instance to listen on all interfaces.
  2. Configure the Chromecast adapter to use the required web instance. As the web instance is not using a single interface, the Web server IP option will be shown and the required address can be chosen.
  3. Return to the web instance configuration and change to only listen on the required interface.

While this works, it shows a rather nasty problem that occurs when one adapter is reliant on another. There should be a more defined API/interface in place for configuration of such dependencies.

@raintonr
Copy link
Contributor Author

@GermanBluefox ... I will fix this after #103 is merged.

@divY42
Copy link

divY42 commented Jan 12, 2023

you just closed my ticket and marked it as a duplicate, but your workaround for me is not working because:

2. Configure the Chromecast adapter to use the required web instance. As the web instance is not using a single interface, the Web server IP option will be shown and the required address can be chosen.

My issue is I actually cannot change my adress

@raintonr raintonr self-assigned this Jan 12, 2023
raintonr added a commit that referenced this issue Jan 12, 2023
@raintonr raintonr linked a pull request Jan 12, 2023 that will close this issue
raintonr added a commit that referenced this issue Jan 12, 2023
…erver-settings-not-properly-savedderived-if-chosen-web-instance-bound-to-single-interface

#145 Add good.
@raintonr
Copy link
Contributor Author

For the record, this mechanism is rather clumsy because if one re-configures their web adapter interface settings it may mean that any Chromecast adapter using that will stop working until it too is re-configured.

A slightly nicer way might be to remove the IP address option from the Chromecast adapter and have it work out the address to use by looking at web adapater and Chromecast device subnets (or some other logic?).

mcm1957 added a commit that referenced this issue Jan 22, 2024
- (mcm1957) changed: Testing gas been updsated to use node 16/18/20
- (mcm1957) changed: dependencies have been updated
* (raintonr) YouTube videos are allowed now ([#75](#75))
* (raintonr) AppId has been added to status ([#151](#151))
* (raintonr) Saving has been corrected if web instance listens on only one address ([#145](#145))
mcm1957 added a commit that referenced this issue Jan 22, 2024
- (mcm1957) changed: Testing has been updated to use node.js 16/18/20
- (mcm1957) changed: Dependencies have been updated
* (raintonr) YouTube videos are allowed now ([#75](#75))
* (raintonr) AppId has been added to status ([#151](#151))
* (raintonr) Storing of webserver settings has been corrected if web instance listens on only one address ([#145](#145))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants