Skip to content

Fix: remove legacy psycopg2 dependency not required for default SQLite setup#450

Open
shamilsj2025aids wants to merge 3 commits into
adeyosemanputra:masterfrom
shamilsj2025aids:fix/remove-psycopg2-legacy-dependency
Open

Fix: remove legacy psycopg2 dependency not required for default SQLite setup#450
shamilsj2025aids wants to merge 3 commits into
adeyosemanputra:masterfrom
shamilsj2025aids:fix/remove-psycopg2-legacy-dependency

Conversation

@shamilsj2025aids

Copy link
Copy Markdown

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

  • Removed psycopg2==2.9.3 from requirements.txt
  • Removed the apt-get install line and its comment from Dockerfile

Impact

  • Fixes Docker build failure caused by EOL Debian Buster repositories
  • Reduces image size and build complexity
  • Removes an unused legacy Heroku deployment dependency

Closes #382

Copilot AI review requested due to automatic review settings March 24, 2026 05:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.3 from requirements.txt.
  • Removed an apt-get install layer (including dnsutils, libpq-dev, python3-dev) from the Dockerfile.
  • 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 executes dig/nslookup in 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.

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

Successfully merging this pull request may close these issues.

Investigate whether psycopg2 is required for current deployment setup.

3 participants