mirror of
https://github.com/Heretek-AI/free-git.git
synced 2026-10-12 02:03:44 +00:00
main
free-git — Gitea + Runner + Mirror + Cloudflare Tunnel
Self-hosted Git at https://free-git.org, deployed as one Compose project, backed up here, run in Arcane.
| Service | Image | Exposed as |
|---|---|---|
server (Gitea) |
docker.gitea.com/gitea:1 + postgres:16-alpine |
https://free-git.org via Tunnel |
runner (Gitea Actions) |
gitea/runner:latest-dind |
internal, registers to Gitea |
mirror (gitea-mirror) |
ghcr.io/raylabshq/gitea-mirror:latest |
https://mirror.free-git.org via Tunnel |
tunnel |
cloudflare/cloudflared:latest |
token from Zero Trust dashboard |
1. Cloudflare Tunnel (one-time)
- Domain
free-git.orgnameservers → Cloudflare. - Zero Trust → Networks → Tunnels → Create tunnel
free-git(connectorcloudflared) → copy token. - Public Hostnames:
free-git.org→http://server:3000mirror.free-git.org→http://mirror:4321
- TLS: Full (Strict if origin has cert — not needed, cloudflared terminates at edge).
2. Local run
cp .env.example .env # then fill in real secrets
docker compose config # validate
docker compose up -d db server
# open https://free-git.org, create admin
# Gitea Admin → Actions → Runners → copy token → put in .env as RUNNER_TOKEN
docker compose up -d runner mirror tunnel
docker compose ps
Mirror setup: open https://mirror.free-git.org, first signup = admin, add GitHub source token + Gitea dest http://server:3000 (internal DNS) + Gitea token. Start with a manual mirror, then enable SCHEDULE_ENABLED if desired.
3. Notes / limits
- Compose publishes
3001/4321on127.0.0.1only. Public traffic comes through the Tunnel container on the samefree-gitnetwork. - Git SSH (
2222:22) is LAN-only. Cloudflare Tunnel forwards HTTP(S); SSH needs separatecloudflared access sshsetup. Use HTTPS clone URLs remotely. - Runner uses DIND (
privileged: true). If the host forbids privileged, usegitea/runner:latest+- /var/run/docker.sock:/var/run/docker.sock(less isolated). ROOT_URL=https://free-git.org/must be set before first boot; changing it later requires editingapp.iniinsidegitea-data, not just env.
4. Data backup (not in git)
Git stores config only. Volumes (pgdata, gitea-data, runner-data, mirror-data) hold data. Example nightly backup:
docker compose exec db pg_dump -U gitea gitea > backup-$(date +%F).sql
docker compose exec server sh -c 'gitea dump -c /data/gitea/conf/app.ini -t /tmp && ls /tmp/*backup*.zip'
5. Import into Arcane (http://192.168.31.147:3552/)
- Arcane → Customization → Git Repositories → Add
https://github.com/Heretek-AI/free-git, branchmain. - Projects → Create ▼ → From Git Repo → Pull: name
free-git, pathcompose.yaml, ONSync Files+Redeploy After Sync. - Project → Environment Configuration: paste
POSTGRES_PASSWORD,RUNNER_TOKEN,CLOUDFLARE_TUNNEL_TOKEN,BETTER_AUTH_SECRET,ENCRYPTION_SECRET. - Deploy. Edit config in GitHub → Sync from Git in Arcane (Pull projects are read-only in Arcane).