-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow to use NEEO_SERVER_IP, NEEO_SERVER_BASEURL, NEEO_SERVER_PORT as Environment Variable #171
Conversation
I guess I should move part of this into the neeo-sdk-toolkit? |
I also added |
ok, I just figured out, that I probably should use the neeo-sdk-toolkit to run multiple Devices in one Container. But the Problem with the wrong IP Address taken for the baseURL still exists there. Therefore my 2 PRs: |
Can you send us also the Dockerfile you are using so we can reproduce this? Also, how do you run Docker and on which OS? |
Sure, check https://github.com/splattner/neeo-driver-googlecast
or by using the newer @neeo/cli
I run Docker on my Ubuntu 18.04 and on my Synology NAS
The Problem is with my PR's you can use |
name: serverName || 'default', | ||
adapterIpAddress: process.env.NEEO_SERVER_IP, | ||
baseurl: process.env.NEEO_SERVER_BASEURL, |
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.
Can you explain why the baseurl variable is needed here? it doesn't seem used below and the url is generated from the IP address.
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 https://github.com/NEEOInc/neeo-sdk/blob/master/lib/device/index.js#L48 its only generated when conf.baseurl
is not set. With this change, you can set conf.baseurl
with an ENV
Generating the baseURL by IP Address might not always work (e.g. behind NAT), I even would suggest to not build at all a baseURL that needs to be send to the Brain. But thats an other Topic and probably a bit more tricky.
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.
oh OK makes sense, I didn't see it in the PR and I was confused, my bad.
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.
it's not in the PR :) it was already there. np 👍
I see the use case for this, that makes sense. As you mentioned if we go this way it's more important to add this in the neeo-sdk-toolkit/cli since it will replace this neeo-sdk cli (which will eventually be removed). I'm wondering if we need both adapterIpAddress and baseurl, only 1 might be enough and will keep the interface more concise.
The end goal for you is mainly to use the SDK within docker, correct? |
See NEEOInc/neeo-sdk-toolkit#5
I agree, but as the baseURL was already there as a SDKOption, I wanted to leave it as it is (and just add the Possibility to set it via ENV).
Yes, at least for me it is, but also on Devices with multiple Network Interface (e.g. from a Viritualization Network, Virtualbox or similar) |
My suggestion for #170
This allows to set the full
BASEURL
via Environment Variable or just theADAPTERIPADDRESS
and then let the SDK build the baseurl.