fititnt / uwazi-docker

Dockerized version of Uwazi (“openness" in Swahili). HURIDOCS designed Uwazi to make human rights information more open and accessible to the defenders who need it.
The Unlicense
11 stars 4 forks source link

Document and/or change default behavior on uwazi-docker bind to :3000 for more than just localhost (e.g be public accessibly) #34

Closed fititnt closed 1 year ago

fititnt commented 5 years ago

Refs: #31, #32, #33, and also https://github.com/huridocs/uwazi/issues/2047 and https://github.com/huridocs/uwazi/pull/2051


This issue is for discuss about how to document about the default behavior or even change the default behavior of uwazi-docker do expose for external access if the user does not make any changes on a default docker installation.

Even if the uwazi application change some of it's behavior, we would still need to make changes here on the docker version. Also, since we are using the v1.3 oficial release (and no really essential change must be made to affect uwazi-docker) we would still stick with the v1.3 version from 14 days ago or maybe do a very specific file patch. So it would make easier to use uwazi-docker with some more stable version than just some lastest version on uwazi development branch.

fititnt commented 5 years ago

About @vasyugan comment here https://github.com/fititnt/uwazi-docker/issues/31#issuecomment-433141233

127.0.0.1:3000:3000

the official documentation says that it should work (see https://docs.docker.com/compose/compose-file/#ports, and several places on the internet, but some says like this one https://stackoverflow.com/questions/45109398/how-can-i-make-docker-compose-bind-the-containers-only-on-defined-network-instea/45133531#45133531 that it does not seems to work on docker-compose files, just on docker run). So maybe this issue is more about docker-compose version on the machine or the operational system.

I did not tested yet on my local machine (but soon will do it eventually) but even if it work or not, still a good idea discover why is not running on the Vasyugan machine. This issue can take a few days if necessary, maybe even ask other people to test after do a simple PR to merge the single like with bind to 127.0.0.1, so then can simple follow the instructions on readme and report if worked or not.

fititnt commented 5 years ago

Actual version, with - 3000:3000:

# fititnt at bravo in /alligo/code/fititnt/uwazi-docker on git:master x [7:31:14]
$ docker-compose up -d uwazi     
uwazi-docker_elasticsearch_1 is up-to-date
uwazi-docker_mongo_1 is up-to-date
Recreating uwazi-docker_uwazi_1 ... done

# fititnt at bravo in /alligo/code/fititnt/uwazi-docker on git:master o [7:31:42]
$ sudo netstat -ntulp | grep 3000
tcp6       0      0 :::3000                 :::*                    OUÇA       9320/docker-proxy

After replacing - 3000:3000 with - "127.0.0.1:3000:3000"

# fititnt at bravo in /alligo/code/fititnt/uwazi-docker on git:master x [7:32:30]
$ sudo netstat -ntulp | grep 3000
tcp        0      0 127.0.0.1:3000          0.0.0.0:*               OUÇA       9642/docker-proxy

I just did not do some nmap port scanning from a outside machine to be really sure if was open or not, but I guess that - "127.0.0.1:3000:3000" should still work (the 127.0.0.1:3000 still opens the uwazi interface from my machine, so the bare minimum to make it work for a development (not a production state by default) would still work great by default, even without some additional documentation.

I think that if by default we make it a bit more safer for someone less experienced with docker and (for who whats to use as base for production) we can add more comments, but not on the simpler explanation on how to use it.

For me, if you @vasyugan if the change still work on your computer, you can just do a new PR, with no extra comments need on the docker-compose.yml for now. But we can still leave this issue open some extra time just to be sure.

vasyugan commented 5 years ago

@fititnt Thanks for testing! So for you, does prepending 127.0.0.1: to 3000:3000 have the effect it should have according to the docker-compose documentation or not? Because for me, it just doesn't work. The machine continues to listen on port 3000 on all network interfaces.

fititnt commented 5 years ago

@vasyugan for me it works.

fititnt commented 1 year ago

Closing old issues. If anyone have questions, please comment in the future!