Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrecognized --logDir and/or --log_dir #255

Open
mendo1024 opened this issue Dec 5, 2024 · 1 comment
Open

unrecognized --logDir and/or --log_dir #255

mendo1024 opened this issue Dec 5, 2024 · 1 comment

Comments

@mendo1024
Copy link

mendo1024 commented Dec 5, 2024

When running pantestgpt while trying to specify the logdir, pentestgpt is confused how the argument should looks like

Pretty funny behavior. It complains about the argument logDir and suggests the log_dir. When using log_dir is asks to use logDir back.

root@1b760b9c3232:/app# pentestgpt --logDir /app/test_history/logs
Your CHATGPT_COOKIE is not set. Please set it in the environment variable.
Your GOOGLE_API_KEY is not set. Please set it in the environment variable.
Your GOOGLE_API_KEY is not set. Please set it in the environment variable.
usage: pentestgpt [-h] [--log_dir LOG_DIR] [--reasoning_model {gpt-4,gpt-4-turbo}]
                  [--parsing_model {gpt-4-turbo,gpt-3.5-turbo-16k}] [--logging] [--useAPI]
pentestgpt: error: unrecognized arguments: --logDir /app/test_history/logs
root@1b760b9c3232:/app# pentestgpt --log_dir /app/test_history/logs
Your CHATGPT_COOKIE is not set. Please set it in the environment variable.
Your GOOGLE_API_KEY is not set. Please set it in the environment variable.
Your GOOGLE_API_KEY is not set. Please set it in the environment variable.
usage: pentestgpt [-h] [--logDir LOGDIR] [--baseUrl BASEURL]
pentestgpt: error: unrecognized arguments: --log_dir /app/test_history/logs
root@1b760b9c3232:/app# 

I am running that in the docker:

# Use an official Python 3.10 base image
FROM python:3.10-slim

# Install system dependencies for Python builds and Git
RUN apt-get update && apt-get install -y \
    git \
    screen \
    && rm -rf /var/lib/apt/lists/*

# Create app directory
RUN mkdir /app

# Clone the PentestGPT repository
RUN git config --global http.version HTTP/1.1 && git clone --progress --verbose https://github.com/GreyDGL/PentestGPT.git /app 

# Set the working directory to the cloned repository
WORKDIR /app

# Install PentestGPT in editable mode
RUN pip3 install --no-cache-dir -e .

# Create a startup script for screen

RUN echo '#!/bin/bash' > /start.sh && \
    echo 'screen -dmS pentestgpt bash -c "pentestgpt; exec bash"' >> /start.sh && \
    chmod +x /start.sh

# Set the entry point to start screen with PentestGPT
CMD ["/bin/bash", "-c", "/start.sh && exec /bin/bash"]

Then, running like this:

docker run -it --name pentestgpt -v /home/user/pentestgpt/test_history:/app/test_history -e OPENAI_API_KEY='key' pentestgpt

Which works well if I do not try to specify the logdir.

Running it in the screen for testing and keeping the container running.

Is this a bug or doing something wrong?

@GreyDGL
Copy link
Owner

GreyDGL commented Dec 5, 2024

This is a bug. Logdir is not well maintained. Let me open a PR to resolve it.

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

No branches or pull requests

2 participants