How to force che-server to bind to localhost (127.0.0.1) using CLI?
See original GitHub issueDescription
I’m trying to setup Che as a local IDE on my workstation. According to the docs this scenario is supported:
This makes a single user Che a good choice for developers working locally.
The problem is that che-server
binds to any local address:
tcp6 0 0 :::8080 :::* LISTEN 1217/docker-proxy
So my IDE and all my workspaces are accessible without any access control to anyone in my LAN.
Reproduction Steps
- setup Che according to Getting Started: Local guide
- run
sudo netstat -anp | grep 8080
OS and version:
- ubuntu 16.04
- che 5.22.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
Can't access 127.0.0.1 - Stack Overflow
0.1 is not working on any port from anywhere (for example, browser says Unable to connect). Here are the results of my research:...
Read more >3 Different ways to start a HTTP Web Server from the Terminal
In this relatively quick video I want to showcase 3 very quick and different ways that you can start up a HTTP Web...
Read more >Administration Guide Red Hat CodeReady Workspaces 1.0
In order to connect to Git repositories over SSH, an SSH key pair needs to be generated. ... If applying the che-server-template.yaml configuration, ......
Read more >How to communicate between docker container including ...
localhost for connect is docker's private network, not your computers localhost ... So solution is to either use network_mode: host for all containers, ......
Read more >You need to bind the IP address to `127.0.0.1` or `localhost`
If you need more help then please refer our documentation on how to use these options with the mongod command in the command...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, the problem with
localhost
is that it is problematic to access127.0.0.1
from the inside of the docker container in the default docker configuration. Why?I managed to bind
che-server
to docker bridge interface (docker0
) this way preventing access to it from LAN:${data_dir}/che.env
setCHE_HOST=<ip-of-the-docker0>
${data_dir}/instance/docker-compose-container.yml
'8080:8080'
->'${CHE_HOST}:8080:8080'
--skip:config
to restrain it from rewriting${data_dir}/instance/docker-compose-container.yml
http://<ip-of-the-docker0>:8080
Anyway it bothers me that official docs encourage new users to run Local installation in such an unsafe manner.
https://github.com/eclipse/che/blob/69d51483859d828aa285bcef324244ca236109ad/dockerfiles/base/scripts/base/commands/cmd_stop.sh this is the script that stands behind it.
There must be some check that depends on format of port binding.