{"repo":"h1n054ur/vps-git","free":true,"listed":false,"github":"https://github.com/h1n054ur/vps-git","clone":"git clone https://github.com/h1n054ur/vps-git.git","description":"Self-hosted Forgejo with HA streaming replication, automatic failover, and Ansible deployment behind Cloudflare Tunnel","language":"Python","stars":19,"topics":["ansible","cloudflare-tunnel","devops","docker-compose","failover","forgejo","git-server","high-availability","infrastructure","postgres"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"vps-git Self-hosted Forgejo instance with high availability, streaming replication, automatic failover, and zero-downtime recovery -- deployed and managed entirely through Ansible. Architecture Primary runs the full stack (Postgres, Forgejo, cloudflared, backup sidecar). Standby runs Postgres as a hot standby streaming replica and receives periodic Forgejo data rsyncs. If the primary goes down, the watchdog automatically promotes the standby via Ansible -- Cloudflare routes traffic to the new primary within seconds. Components Directory Contents --- --- stack/ Docker Compose stack with profile-based deployment ( primary / standby ) ansible/ Playbooks: deploy.yml , promote.yml (failover), demote.yml (failback), watchdog.yml watchdog/ Uptime Kuma monitoring + auto-failover agent + cloudflared tunnel + auto-setup cloudflared/ Tunnel configuration templates Prerequisites - Two VPS nodes (Debian 12 / Ubuntu 24.04) with Docker installed - Private network connectivity between nodes (NetBird, WireGuard, Tailscale, etc.) - Cloudflare account with a domain - Ansible on your control machine ( pip install ansible or brew install ansible ) - A machine to run the watchdog (your laptop, a 3rd VPS, etc.) Setup 1. Clone and configure Edit ansible/inventory.yml with your: - VPS IPs and SSH key paths - Postgres and replication passwords (generate strong random ones) - Forgejo admin credentials ( forgejo admin user , forgejo admin password , forgejo admin email ) - NetBird/WireGuard peer IPs - C","default_branch":null,"files":null,"tree":[],"storefront":"/r/h1n054ur","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/h1n054ur/vps-git/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}