docker-samples/forgejo_cloudflare
2024-11-01 21:50:08 -06:00
..
.env Initial version of the Forgejo via. Cloudflare 2024-11-01 21:50:08 -06:00
docker-compose.yml Initial version of the Forgejo via. Cloudflare 2024-11-01 21:50:08 -06:00
README.md Initial version of the Forgejo via. Cloudflare 2024-11-01 21:50:08 -06:00

Forgejo via. Cloudflare Tunnel

This example is a quick start to running an instance of the excellent Forgejo git server under Docker.

  • Publicly exposed via. Cloudflare Tunnel
  • Pre-configured Github Action-style Runners
  • Mail delivery (assuming Mailgun, but adjustable to any SMTP server)
  • Pre-configured (no installation wizard) including admin account

See the full blog post on this here: https://www.straybits.ca/2014/self-hosted-git-server/

Steps:

  1. Create a Tunnel on Cloudflare and grab the Tunnel Token
  2. Copy docker-compose.yml and .env to a new folder
  3. Update variables in .env making sure to generate random secrets for the various secrets marked with ##REQUIRED##
  4. Make sure to update the yourdomain.com to match your name
  5. Add end points to your Tunnel
    1. git.yourdomain.com >> http://server:3000
    2. git-ssh.yourdomain.com >> ssh://server:22
  6. docker compose up -d
  7. Wait...
  8. Wait a bit more
  9. Visit https://git.yourdomain.com in your browser and login with the admin credentials in your .env file.
  10. Verify settings. (i.e. do you want to disable user signups, etc.)

Known Issue

Disappearing Runner Labels

If your runner labels disappear after a restart, you may need to update your runner's config.yml to have the same list of runners as found in your .runner file.