Skip to content

Backend Modes

The proxy supports three backend modes, controlled by the BACKEND_MODE environment variable. The active backend is reported at the /health endpoint under the "backend" key.

Terminal window
curl https://forgejo-proxy.hochguertel.work/health
# {"status": "ok", "backend": "scrape"}

The proxy scrapes the Forgejo web UI using per-request credentials supplied by the API caller via X-Webui-Username and X-Webui-Password headers. HTML pages or internal UI endpoints are accessed on behalf of the caller for each request.

When to use: Standard self-hosted Forgejo installations where the proxy has network access to the Forgejo instance.

Required config:

VariableDescription
FORGEJO_URLBase URL of your Forgejo instance
environment:
BACKEND_MODE: scrape
FORGEJO_URL: https://forgejo.example.com

The proxy reads Forgejo’s SQLite database file directly. This is faster than scraping but requires the proxy container to have filesystem access to the database.

When to use: Self-hosted Forgejo with a shared volume, or when scraping is unreliable due to UI changes.

Required config:

VariableDescription
FORGEJO_DB_PATHAbsolute path to Forgejo’s forgejo.db SQLite file
environment:
BACKEND_MODE: sqlite
FORGEJO_DB_PATH: /data/forgejo/forgejo.db
volumes:
- forgejo_data:/data/forgejo:ro

The proxy uses the Adminer web UI to query a MariaDB database. This is designed for Forgejo instances hosted on PikaPods where direct database access isn’t available but Adminer is exposed.

When to use: PikaPods-hosted Forgejo, or any setup where Forgejo uses MariaDB and Adminer is accessible.

Required config:

VariableDescription
ADMINER_URLURL of the Adminer instance
ADMINER_SERVERDatabase server hostname
ADMINER_USERDatabase username
ADMINER_PASSWORDDatabase password
ADMINER_DBDatabase name
environment:
BACKEND_MODE: adminer
ADMINER_URL: https://adminer.example.com
ADMINER_SERVER: db
ADMINER_USER: forgejo
ADMINER_PASSWORD: secret
ADMINER_DB: forgejo
Terminal window
curl -H 'Authorization: token YOUR_TOKEN' \
'https://forgejo-proxy.hochguertel.work/health'

Response:

{
"status": "ok",
"backend": "scrape",
"forgejo_url": "https://forgejo.example.com"
}