2 KiB
2 KiB
Forgejo (was: Gitea)
This deploys the Forgejo git hosting software on Fly.io.
Installation
- Clone this repository
fly launch
, follow the prompts- Select
n
when it asks if you want to deploy - Create a volume in a region of your choice:
fly volumes create data --size 50 --region ord
- Generate, and store securely, you secrets:
fly secrets set \ "GITEA__security__SECRET_KEY=$(openssl rand -hex 16)" \ "GITEA__security__INTERNAL_TOKEN=$(openssl rand -hex 16)"
- For S3 storage you'll need to add two more secrets:
fly secrets set \ "GITEA__storage__MINIO_ACCESS_KEY_ID=[redacted]" \ "GITEA__storage__MINIO_SECRET_ACCESS_KEY=[redacted]"
- Deploy,
fly deploy --remote-only
- Setup DNS with your registrar, you must have either CNAME or A/AAAA records set. See: https://fly.io/docs/app-guides/custom-domains-with-fly/
- Create certificate for Fly's automatic TLS termination.
fly certs create git.example.com
- Opens an SSH session to the running container.
fly ssh console
- In the SSH session in the container, run:
su git
and thengitea admin user create \ --username MYNAME \ --email MYEMAIL@example.com \ --admin \ --random-password \ --must-change-password
Proxy the GUI to localhost
- Forward container port 3000 to localhost:3000
fly proxy 3000:3000
Get Connected using WireGuard (VPN)
- Create a WireGuard peer with
fly wireguard create
- Setup WireGuard with generated config
fly ips private
to get the IP of your Daemon- Set the
DOCKER_HOST
env variable using that IP:export DOCKER_HOST=tcp://[fdaa:0:5d2:a7b:81:0:26d4:2]:2375
Final Step
- Delete the Docker Engine from your local system.
- You probably want to scale your remote Daemon:
fly scale vm shared-cpu-2x