Skip to content

Conversation

@ScyDev
Copy link

@ScyDev ScyDev commented Nov 4, 2020

Bind admin UI to 0.0.0.0 to allow Docker containers to properly forward to that port.

What does it do?

Binding port 8000 to 0.0.0.0 instead of localhost.

Why is it needed?

In order for Docker containers to be able to forward to that port. Docker can't forward to ports that are bound to localhost.

Related issue(s)/PR(s)

None.

@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #8573 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8573   +/-   ##
=======================================
  Coverage   33.25%   33.25%           
=======================================
  Files        1221     1221           
  Lines       13636    13636           
  Branches     1359     1359           
=======================================
  Hits         4535     4535           
  Misses       8217     8217           
  Partials      884      884           
Flag Coverage Δ
front 24.70% <ø> (ø)
unit 54.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6455734...37842a6. Read the comment docs.

bind admin UI to 0.0.0.0 to allow Docker containers to properly forward to that port.

Signed-off-by: Lukas Sägesser <lukas.saegesser@scydev.ch>
@ScyDev ScyDev force-pushed the ScyDev-bind-admin-to-0.0.0.0 branch from bb525b4 to 37842a6 Compare November 4, 2020 15:57
Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strapi/maintainers Is this needed since the user can configure it via the ./config/server.js ?

@ScyDev
Copy link
Author

ScyDev commented Nov 5, 2020

@derrickmehaffy I would ask if there is a good reason why it should only bind to localhost in dev mode?

@derrickmehaffy
Copy link
Member

@derrickmehaffy I would ask if there is a good reason why it should only bind to localhost in dev mode?

I would say security and typical standard practice, the assumption generally being if you are working on something in a development mode it runs locally in a sheltered environment.

I do understand why you need it to bind to the docker interface, but that's why we have the config option. (Which can also be set by environment variables)

@ScyDev
Copy link
Author

ScyDev commented Nov 6, 2020

@derrickmehaffy Ok, I can live with the config option. But leaves me wondering, why would that be a security concern for the local, sheltered dev environment, but then for production it binds to 0.0.0.0 by default?

@derrickmehaffy
Copy link
Member

@derrickmehaffy Ok, I can live with the config option. But leaves me wondering, why would that be a security concern for the local, sheltered dev environment, but then for production it binds to 0.0.0.0 by default?

You have far more control over the environment your deploying in (and we had issues with users not reading the docs when deploying to Heroku and other PaaS services).

Where as it's certainly not uncommon for you to be in a coffee shop on public WiFi to just be broadcasting an insecure application all over it.

Docker itself has had issues with blowing holes in Linux/Mac firewalls if you don't explicitly set it to only bind on 127.0.0.1 on the host.

But the same applies here as it does in your case, there are configuration options and all can be set by environment variables.

@derrickmehaffy
Copy link
Member

I'm going to mark the PR as closed as I think the topic has been discussed enough to where we don't need this change.

@ScyDev
Copy link
Author

ScyDev commented Nov 6, 2020

Agreed, thanks for the discussion.

@derrickmehaffy
Copy link
Member

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/missing-open-the-administration-button-when-running-locally/9455/8

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

Successfully merging this pull request may close these issues.

2 participants