ralphwetzel / theonionbox

Dashboard to monitor Tor node operations
MIT License
122 stars 17 forks source link

Dockerfile #65

Closed ruped24 closed 5 years ago

ruped24 commented 5 years ago

Hello: ralphwetzel

I created a Dockerfile and a docker theonionbox.cfg placed in the root directory.

Build image: sudo docker build -t theonionbox .

Running the app: sudo docker run --network host -p 8080:8080 theonionbox


Tested/passed on: raspberrypi3 and centos 7

ralphwetzel commented 5 years ago

Thank you for providing this PR. Some comments:

ruped24 commented 5 years ago

Hello ralphwetzel:

What for do you need the additional theonionbox.cfg? The change to host I recognized equals the default setting, thus the file seems to be obsolete.

  1. With the default settings, it wants to bind to 127.0.0.1.
  2. Dockerized web apps need to listen on 0.0.0.0.
  3. I put it (theonionbox.cfg) there to also build any config needed at build time. It's optional once the changes has been uploaded to pypi.

To push those changes to users, setup.py needs to be adapted as well.

  1. Changes will need to be uploaded to pypi to meet the docker requirements.
  2. Update the file theonionbox.pybox_host = 0.0.0.0.

There shouldn't be a demand to explicitly pip install urllib3==1.22. urllib is just one of several dependencies - which should be installed automatically by pip.

  1. pip installs version 1.5. This was a workaround.
  2. The change below needs to be uploaded to pypi.
  3. Change setup.py to urllib3==1.22. This is an implicit value.
  4. After step 3, there is no need to install urllib3 from the Dockerfile.

I propose to put whatever is necessary into an additional directory e.g. named Docker. Those files shouldn't be placed into the root of the source tree.

Ok. [Done]

Documentation (including those topics mentioned in the wiki) should be put into a dedicated chapter named e.g. Docker support, placed after the 'The Onion Box ...' chapters.

Ok. [Done]

ralphwetzel commented 5 years ago

Hello again! Thank you for those modifications - and the fact that you found an issue in the setup of The Onion Box.

It was a conscious decision to default box_host to 127.0.0.1 - as it's the safer option for people with lower experience setting up a web server system. This decision yet did not manifest into theonionbox.cfg which still stated the former default setting.

Therefore I confirm the need for a configuration file to support the Docker demanded setting of 0.0.0.0.

I can accept your proposal for the adaptation of the documentation. The changes to setup.py still need rework. I'll do that on your behalf and tweak the rest a bit...