DedSecInside / TorBot

Dark Web OSINT Tool
Other
2.85k stars 525 forks source link

Docker: "ValueError" recieved on run. #240

Closed anoduck closed 2 years ago

anoduck commented 2 years ago

Describe the bug On the second day of attempting to achieve a successful installation, I was successful. Modifications were made to the Dockerfile in order to appropriate copy the contents of the repository to the dockerized container, and the addition of required dependencies libblas-dev liblapack-dev gfortran were added to the list of packages installed by apt. This allowed numpy to compile.

But when I went to run the dockerized app, I received the following error pertaining Line 7 of torbot.py, and I unsure how to resolve this error.

Traceback (most recent call last):
  File "torBot.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "requests/__init__.py", line 133, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "requests/utils.py", line 42, in <module>
  File "certifi/core.py", line 37, in where
  File "contextlib.py", line 135, in __enter__
  File "importlib/_common.py", line 89, in _tempfile
  File "importlib/abc.py", line 371, in read_bytes
  File "importlib/_adapters.py", line 54, in open
ValueError

To Reproduce

The modifications made to the Dockerfile are included below, and mainly involve the addition of those dependencies mentioned above. The Dockerfile will need to be relocated to the repository root in order to be correctly copied to the container. Furthermore, I created a docker-compose.yml file to ensure both torbot and tor network were started at the same time, and tor would always be accessible to torbot. I did not include this simple file here. I recieved the error after installation, and upon the first execution of the script with docker-compose run --rm torbot ./torBot -u http://SomeOnionAddressV3.onion. This should have been successfully executed.

FROM python:3
LABEL maintainer="dedsec_inside"

# Install PyQt5
RUN apt-get update \
    && apt-get install -y --no-install-recommends python3-pyqt5 \
    libblas-dev \
    liblapack-dev \ 
    gfortran \ 
    python3-numpy \
    python3-threadpoolctl \
    python3-pastel \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY . .

RUN pip install --no-cache-dir poetry
RUN poetry config virtualenvs.create false && poetry config --list && sleep 5
RUN python -m poetry install --no-dev

RUN chmod +x install.sh
RUN bash install.sh

ENTRYPOINT ["./torBot", "--ip", "tor"]
anoduck commented 2 years ago

If built within both kali Linux and Alpine Linux, error received on installation of ete3, "install_layout" fails.

If you disable creation of virtual env in poetry with Alpine, poetry removes system python libraries and installation immediately fails.

Also fails to install on kali Linux with pipenv, with install_layout error.

Hesitant to attempt to install in kali with virtual environment creation disabled, because I would prefer not to risk damaging system python libraries.

Two Operating systems and two dependency managers, zero success.

Project release appears to be deprecated, and no longer installable.

KingAkeem commented 2 years ago

I don't personally use Docker when running the project, I'd suggest doing that as well to reduce complexity for yourself unless you're able to resolve the issue.

anoduck commented 2 years ago

Not sure why running outside of docker will make any difference. It is practically the same, are running all the commands in a shell script.

Regardless, I have moved on, and will close out the issue.