hegusung/WebHashcat

Any docker plans?

djbios opened this issue · 14 comments

I think it would be comfortable to run nodes and web server in docker. Any plans on it?

Unfortunatly I am not very familiar with docker, but it is a good opportunity to learn.

I will work on this probably next week

Dockerfile and docker-compose.yml files for HashcatNode are ready

Webhashcat also hash docker support now, let me know if you had any isues running it

@hegusung Thank you for quick response!
A couple comments on dockerfile:

  1. It's better to install requirements before code copying, because you don't need to rebuild all image and install all dependencies on any code change.
  2. Dockerfiles are too big now. In Docker file every line is separate image layer, so I think lines number should be reduced, because it could be some perfomance issues.
  3. Flask in node now starting in dev mode. Maybe consider starting flask app with uwsgi.
  4. All secrets, passwords and other settings can be extracted from docker-compose.yml in .env file, it's convinient way to handle them on production.
  5. As far as i remember, celery-beat could be replaced with -b flag on celery worker.
  6. For some reasons, web service in webhashcat orchestra doesnt starting on my local PC, but it could be because of Windows host.

I can help with corrections of dockerfiles and compose files, if you wish.

Thanks for all these comments, I reopen this issue so I can take care of them

About 5, is there some advantages of using celery -b instead of celery-beat ?

As you guessed, WebHashcat has been developped for linux. So far only HashcatNode is comptatible with Windows. I will take a look into it, it should work without too much effort.

If you have time, I will gladly accept your help on the Dockerfiles and compose files !

I just corrected a small mistake in the dockerfile,

Now it seems to be running on windows using docker

Thanks, i will check it today.

About 5 - it's just reduce containers count. Every container uses some system resources itself.

So, I found problem on windows. It's line endings, known windows issue, when we run git clone on windows, it replaces Unix line ends LF with Windows CRLF, and dockerized linux can't deal with it.
There are two options to fix it:

  1. Everybody who using docker on windows should use git clone git@github.com:hegusung/WebHashcat.git --config core.autocrlf=input command. In that case I think this should be in README
  2. Use dos2unix tool in dockerfile while building. I Used this method in couple of my projects.

Now I am starting to improve dockerfiles. One more question. Why we are installing hashcat in webhascat image manually and don't use image dizcza/docker-hashcat:latest like in WebHashCatNode? If for choosing hashcat version by env variable, why only in web but not in node?

hashcatnode requires the GPU, therefore dizcza/docker-hashcat:latest enables this (using nvidia-docker instead of docker)
https://github.com/NVIDIA/nvidia-docker

webhashcat does not require the GPU, it only uses hashcat binary to extract the useful info and perform some basic commands)
So in the case of WebHashcat, docker binary is sufficiant (this config allows the user not to install nvidia-docker if you are not using HashcatNode and WebHashcat on the same host)

Okay, make sense. I've almost done with dockerfiles fixes, now i am trying to check all working. What default password node have? I can see only hash in env variable.
UPDATE I've cracked it)

BTW I have exception JSONDecodeError at /Nodes/ on incorrect node password. Maybe it should be processed more accurate.

@hegusung Okay, I am ready to provide some fixes on pull request. Please, give me permissions to push my branch.

Please fork the project on your account and make the commit on your version of the project. Then please make a pull request.

Thank you for your help !