Self-hostable FastAPI application that mirrors all gists from one authenticated GitHub account into a single self-hosted OpenGist instance.
- Web UI for configuring GitHub/OpenGist credentials
- Manual sync trigger
- Scheduled sync with configurable interval
- Sync history and mirrored gist status table
- OpenGist sync through Git over HTTP (stable path)
- Docker-first deployment
- Docker + Docker Compose (recommended), or Python 3.12+
- A GitHub token with gist access
- Your OpenGist username
- An OpenGist access token
- Clone this repository.
- Build and start the service:
docker compose up --build -d- Open the web UI:
http://localhost:8000
- Configure:
- OpenGist URL (for example
https://opengist.example.com) - OpenGist username
- GitHub token
- OpenGist password or token (legacy
username:tokenalso supported) - Sync interval
- If this app runs in Docker, do not use
localhostfor OpenGist unless OpenGist is in the same container. Usehost.docker.internal:<port>(OpenGist on host) or the OpenGist service name on a shared Docker network.
- OpenGist URL (for example
localhostinside the mirror container points back to the mirror container, not your host machine.- This project’s
docker-compose.ymlincludesextra_hosts: ["host.docker.internal:host-gateway"]so host networking works on Linux Docker as well. - Recommended OpenGist URL values when mirror runs in Docker:
- OpenGist running on host:
http://host.docker.internal:6157 - OpenGist running in another container on same network:
http://<opengist-service-name>:6157
- OpenGist running on host:
- The mirror writes gists using Git push, not the OpenGist REST API.
- This follows OpenGist docs where git-based creation/update is the stable workflow.
OpenGist password/tokensupports:- account password or token together with
OpenGist username, or - legacy
username:tokenformat for backward compatibility.
- account password or token together with
- Create and activate a virtual environment.
- Install dependencies:
pip install -r requirements.txt- Start the app:
uvicorn app.main:app --reload- The app is intentionally single-tenant in v1.
- SQLite data is stored under
./datawhen running with Docker Compose. - Tokens are stored in the local database for UI-driven operation.
- OpenGist URLs without a scheme are normalized to
http://....