question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to force che-server to bind to localhost (127.0.0.1) using CLI?

See original GitHub issue

Description

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

OS and version:

  • ubuntu 16.04
  • che 5.22.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
vsenkocommented, Dec 27, 2017

OK, the problem with localhost is that it is problematic to access 127.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:

  1. in ${data_dir}/che.env set CHE_HOST=<ip-of-the-docker0>
  2. in ${data_dir}/instance/docker-compose-container.yml '8080:8080' -> '${CHE_HOST}:8080:8080'
  3. start Che only with --skip:config to restrain it from rewriting ${data_dir}/instance/docker-compose-container.yml
  4. Che URL is 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.

0reactions
ghostcommented, Dec 27, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found