2 KiB
2 KiB
Forgejo on halla-aho.net
Lightweight Git hosting + CI with Forgejo (Gitea fork) behind Apache on halla-aho.net.
What’s included
- Docker Compose for Forgejo + SSH and an Actions runner (
forgejo/docker-compose.yml). - Apache vhost snippet (added to
default-ssl.conf) to reverse-proxygit.halla-aho.netto the Forgejo container on port 3000.
Prereqs
- Docker installed on halla-aho.net.
- SSLMate certs for
git.halla-aho.netplaced on the host (paths referenced indefault-ssl.conf). - A DNS record for
git.halla-aho.netpointing to the server.
Deploy Forgejo
- Create host dirs for data:
sudo mkdir -p /srv/forgejo/data /srv/forgejo/runner sudo chown -R $USER:$USER /srv/forgejo - Start the Forgejo service:
docker compose -f forgejo/docker-compose.yml up -d forgejo - Configure Apache (already added to
default-ssl.conf):- VirtualHost
git.halla-aho.net:9443proxies tohttp://127.0.0.1:3000/. - TLS files:
/etc/apache2/ssl/git.halla-aho.net.{crt,key,chain.crt}(update if different). - Enable the site and reload Apache.
- VirtualHost
- Finish setup in the UI at
https://git.halla-aho.net/:- Create the admin user.
- Configure SMTP in the admin UI (Mail settings).
- Set
ROOT_URL/SSH_DOMAINif you change ports/domains.
Register the Actions runner
- In Forgejo, create a runner registration token (Site Admin → Runners).
- Register the runner (writes
/srv/forgejo/runner/config.yaml):docker compose -f forgejo/docker-compose.yml run --rm runner \ forgejo-runner register \ --instance https://git.halla-aho.net \ --token <REGISTRATION_TOKEN> \ --name halla-runner \ --labels docker \ --config /data/config.yaml - Start the runner:
docker compose -f forgejo/docker-compose.yml up -d runner
CI workflow for this repo
- Add workflows under
.forgejo/workflows/. - Example included:
ci.ymlruns npm install + lint + type-check + format check on push/PR using thedockerrunner label.