Installation

Patchforge is distributed as a container image. It runs as a standalone service and connects directly to PostgreSQL.

Docker

docker run -d \
  -p 8080:8080 \
  -e DB_HOST=postgres \
  -e DB_PORT=5432 \
  -e DB_NAME=appdb \
  -e DB_USER=app \
  -e DB_PASSWORD=secret \
  -e ADMIN_TOKEN=changeme \
  -e GIT_REPO_URL=https://github.com/org/repo.git \
  -e GIT_BRANCH=main \
  -e GIT_TOKEN=ghp_xxxxxxxxx \
  -e PATCHES_SUBDIR=db/patches \
  manaslusystems/patchforge:0.1.13-apply-only
    

Database credentials and Git tokens should be provided using secrets in production environments.

Required Environment Variables

DB_HOST
DB_PORT
DB_NAME
DB_USER
DB_PASSWORD
ADMIN_TOKEN
GIT_REPO_URL
GIT_BRANCH
GIT_TOKEN
PATCHES_SUBDIR
    

Patchforge pulls patch files from the configured Git repository on every apply operation.

Kubernetes

Patchforge must run as a single replica.

Concurrent patch application is prevented using PostgreSQL advisory locks, but multiple replicas are not supported.

PostgreSQL Client Compatibility

Patchforge dynamically selects the correct PostgreSQL client binaries based on the server version.

PostgreSQL 13 through 16 are supported.

Security Notes

Rollback functionality exists but is considered beta and may change.