Closed bartoszbielawski closed 8 months ago
Hello @bartoszbielawski ,
I will add this option to the next release.
I've released a new version with this change, you just have to restart your docker container with docker restart macless-haystack
. This will update the container automatically and you will have a new key 'binding_address' in the config.ini.
Hi,
I'm an embedded programmer and not a web-guy, so please forgive my lack of knowledge.
Your solution does bind the HTTP server to the address that's specified, but it only binds it within the container, doesn't it?
This means that the following command (not sure how Docker generates it):
/usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6176 -container-ip 172.18.0.3 -container-port 6176
Isn't really what I wanted because:
Shouldn't it be just the docker-proxy that binds to the localhost instead of 0.0.0.0?
Hi, I'm not really a network guy. ;) Yes, that binds only within the container to the interfaces. I didn't consider that, and it only works natively without Docker. Unfortunately, I can't help you much there because my networking knowledge is limited. I think you would need to configure something in Docker to achieve what you want. I don't know what I would need to change in the application/container for that to work.
After reading I think I have found the answer.
When the container is created you specify port mappings using -p HP:CP
format or using -p H:HP:CP
format. The second one accepts IP address on the host side. Otherwise it binds to all interfaces.
I think that:
-p
is not only not needed, it probably should not be there. I'd suggest checking this and improving README file.
When the container is created you specify port mappings using -p HP:CP format or using -p H:HP:CP format. The second one accepts IP address on the host side. Otherwise it binds to all interfaces.
Yes, that makes sense. So, simply specify "localhost:6176", and then the server will not be externally accessible, and everything will work with the reverse proxy.
The anisette (whatever it does) should probably NOT be exposed beyond the container. My guess is that in that case -p is not only not needed, it probably should not be there.
The Anisette server provides (generated) access credentials required by the macless haystack server. So, the Haystack server needs to access it. While this could work differently (using an internal Docker network), it would complicate the configuration.
For the macless-haystack container one can create local-only binding at that moment. Not possible to modify it later!
That's the way Docker operates. You can either modify the configuration or simply delete the container docker rm -f macless-haystack
and recreate it with the other command. All data will be preserved in the process.
I would like to use a reverse proxy I already have on my server to handle HTTPS traffic. That's why I'd prefer to be able to bind only to localhost. A config option would be handy for this.