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

hm-rpc im Docker-Container #37

Closed
janhuddel opened this issue May 2, 2017 · 4 comments
Closed

hm-rpc im Docker-Container #37

janhuddel opened this issue May 2, 2017 · 4 comments

Comments

@janhuddel
Copy link

Hallo,

wenn ich iobroker im Docker-Container laufen lasse, funktioniert der Callback der CCU nicht. Grund dafür ist, dass ich im Konfigurations-Dialog von hm-rpc lediglich die Netzwerk-Interfaces des Containers aufgelistet bekomme. Hierbei handelt es sich aber um ein Docker-internes Netzwerk, welches von aussen so nicht erreichbar ist.

Um den Container von aussen erreichbar zu machen, kann ich beim Start des Docker-Containers ein Port-Mapping (zum Bsp. für Port 2001) definieren. Der Dienst im Docker-Container ist dann über die IP des Docker-Hosts erreichbar. Ich müsste hier also in der Lage sein, die IP-Adresse für den HM-RPC-Callback frei setzen zu können. Dass allein reicht allerdings noch nicht, da die derzeitige Implementierung diese IP gleichtig verwendet, um den Socket entsprechend zu binden. Das geht natürlich nicht, da der Docker-Container mit der IP des Docker-Hosts nichts anfangen kann.

Es müsste also eigentlich 2 Eingabefelder für die IP geben:

  1. Die Bind-Adresse (Select; wäre im Docker-Szenario dann mit der IP des Containers - Bsp 172.17.0.1 vorbelegt)
  2. Die Callback-Adresse (Textfeld; vorbelegt mit der IP aus 1. - im Docker-Szenario wird diese dann manuell mit der IP des Docker-Hosts überschrieben)

Viele Grüße
Jan

@angelnu
Copy link
Contributor

angelnu commented Jun 10, 2017

I also have a similar issue since: I also run iobroker as docker container but in my case the ccu is also a docker container. In my case the problem is that docker services does not allow me to set a fix IP address (I use docker swarm/stack to deploy all my house automation with fail-over capabilities), only the hostname.

So my proposal is to use 0.0.0.0 for the bind so we listen in all ports and use the menu to select the callback IP. For the callback I would allow to enter hostnames such as "iobroker" and see if the CCU is able to resolve them.

I will work in a PR at least that @GermanBluefox would like a different design.

@GermanBluefox
Copy link
Contributor

GermanBluefox commented Jun 10, 2017 via email

@angelnu
Copy link
Contributor

angelnu commented Jun 10, 2017

@GermanBluefox we would need two different IP addresses: one to start the RPC server and another external one that is sent to the CCU. I also checked that CCU is able to take a URL such as "http://iobroker:3000".

I opened #40 with a proposal that it is working for my setup. Please check the translations.

I am wondering if there is any reason to set up the RPC server address or if it would be good enough to always use 0.0.0.0. The important address is the one we send to the CCU...

@angelnu
Copy link
Contributor

angelnu commented Jun 10, 2017

Thanks @GermanBluefox - I re-installed from your git repo and it is working find with Docker!

Please notice that you might want to fix the translations for the "Callback Adapter Address" and "Listen to all IPs".

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

No branches or pull requests

3 participants