gproxy CLI. On a host you manage yourself, the SQLite database is kept in a volume. Render and Heroku do not keep the local disk across restarts, so their templates run the same image with PostgreSQL.
Docker
The same images are published to four registries for amd64, arm64 and riscv64. Use whichever is closest to you:
Stable releases are tagged
vX.Y.Z, the beta channel is staging, and development snapshots are nightly. Append -musl to any tag for the musl build. Images with v3 tags run v3, not v4.
Start a container with a named volume for the data directory and your master key in the environment:
http://127.0.0.1:8787/console/. The log is the only place they appear, so protect it.
The image listens on port 8787, keeps its SQLite database in /app/data, and runs as user 65532:65532. If you bind-mount a host directory instead of using a named volume, that user must be able to write to it.
To move to a new version, stop and remove the container and start a new one from the new tag with the same volume and the same GPROXY_MASTER_KEY. The database is in the volume, so removing the container does not touch it.
Render
render.yaml Blueprint in the repository root. It creates one web service on the free plan and no database: you supply an external PostgreSQL database.
- Use the button above and review the Blueprint.
- Set
GPROXY_DATABASE_URLto your PostgreSQL connection URL and deploy. The database must accept connections from Render; keep any SSL parameters your provider requires in the URL. - Render generates
GPROXY_ADMIN_PASSWORDandGPROXY_MASTER_KEY. Open the service’s Environment settings and save a copy of both. - Open the service URL followed by
/console/and sign in asadmin.
/healthz on port 8787. Free web services sleep when idle, so the first request after a pause is slow while the service wakes up. Pricing and limits of the external database are your provider’s.
Heroku
app.json and heroku.yml in the repository root. It creates one Basic web dyno and a heroku-postgresql:essential-0 add-on. Both are paid; review the plans before you deploy.
- Generate a master key with
openssl rand -hex 32and save it. - Use the button above, choose an app name and region, and enter the key as
GPROXY_MASTER_KEY. You can leave it empty, in which case upstream credentials are stored unencrypted in the database. - Review the dyno and the add-on, then deploy. Heroku generates
GPROXY_ADMIN_PASSWORD. - Read the password under Settings → Reveal Config Vars, then sign in as
adminat/console/.
deploy/container/Dockerfile.heroku, which only refers to the release image and sets a few environment variables. The program listens on the PORT Heroku assigns and reads the add-on’s DATABASE_URL. A dyno’s local files are temporary, and everything that has to be kept (configuration, credentials, usage) is stored in PostgreSQL.
Running the Render and Heroku templates
Both templates run the release imageghcr.io/leenhawk/gproxy:latest, the latest stable release. Nothing is compiled at deployment. The templates set GPROXY_PLATFORM_ENV=1 and GPROXY_PERSISTENCE=postgres.
Database
WithGPROXY_PLATFORM_ENV=1, the program reads GPROXY_DATABASE_URL when GPROXY_DSN is unset, and the platform’s DATABASE_URL when that is unset too; it reads PORT when GPROXY_PORT is unset. Keep the database and GPROXY_MASTER_KEY across updates and back up both.
Updates
Redeploy to pull the latest stable release. To stay on one version, change the image tag fromlatest to vX.Y.Z: for Render in the image URL in render.yaml, for Heroku in the FROM line of deploy/container/Dockerfile.heroku.
Instances
The templates start one application instance. The cache is kept in process memory and is empty after a restart. To run more than one instance you must setGPROXY_REDIS_URL.
Public address
SetGPROXY_PUBLIC_BASE_URL to the service’s public HTTPS origin if you use OAuth or published file links. The templates do not configure file storage, and files on the local disk are lost on restart.
Client addresses
The client IP is taken from the TCP peer, which may be the platform’s router. Forwarded client-IP headers are not trusted by default; to use them, setGPROXY_TRUSTED_PROXIES to the addresses of the platform’s router.