Fix: remove legacy psycopg2 dependency not required for default SQLite setup#450
Open
shamilsj2025aids wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to simplify the default SQLite-based setup by removing the legacy PostgreSQL driver (psycopg2) and related Docker system packages, while also improving the README intro text.
Changes:
- Removed
psycopg2==2.9.3fromrequirements.txt. - Removed an
apt-get installlayer (includingdnsutils,libpq-dev,python3-dev) from theDockerfile. - Rewrote the README opening description for clarity.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| requirements.txt | Drops the Postgres driver dependency. |
| Dockerfile | Removes OS package installation previously used for runtime tooling and Postgres build deps. |
| README.md | Updates the project’s introductory description. |
Comments suppressed due to low confidence (1)
Dockerfile:12
- This change removes installation of
dnsutils, but the app executesdig/nslookupin the command-injection lab (cmd_lab). The Docker image should explicitly include those binaries (or the lab should be refactored not to depend on them), otherwise that functionality will break in containerized runs.
# set work directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Removes psycopg2 and its associated system dependencies from the project
as they are not required for the default SQLite database configuration.
Investigation
As investigated in issue #382, the default database in pygoat/settings.py
is SQLite (django.db.backends.sqlite3), not PostgreSQL. psycopg2 is a
PostgreSQL driver and serves no purpose in the default setup.
The apt-get line in the Dockerfile that installs libpq-dev, python3-dev,
and dnsutils exists solely to support psycopg2 — and is a direct
contributor to the EOL Debian Buster build failure.
Changes made
Impact
Closes #382