mirror of
https://github.com/runyanjake/olomana.git
synced 2026-03-26 05:53:17 -07:00
Gitea
Self hosted Git
Followed instructions on Gitea page: https://docs.gitea.com/next/installation/install-with-docker
Steps
- Create a new user to own the gitea folder.
sudo groupadd gitea && sudo useradd giteauser && sudo usermod -a -G gitea giteauser && chown -r gitea:giteauser .
- Configure Environment
Create
gitea.envanddatabase.envfrom the examples, replacing with relevant env values.
See Gitea Documentation for examples/types.
- Run via Docker Compose
docker-compose up -d
- Test postgresql
docker exec -it gitea_db bash
psql -h 127.0.0.1 -p 5432 -U olomana_readwrite -d gitea
- Go to xxx.xxx.xx.xxx:3000 and fill out initial config. Everything should match up to default value. Some things that were weird:
- could not use any port that wasnt default postgresql (5432)
- had to make sure to specify database container by the right name. Removed custom name and used just "database". Note that the first admin is set via env vars, by generating the password hash. Alternatively create your users by setting the env var that controls signups.
-
Provision new users You can do that from the "Site Administration" view from the first admin user.
-
Configure SSH
Via Traefik (TCP passthrough on port 2222):
- The
giteaentrypoint on:2222is defined intraefik.toml. - TCP router labels in
docker-compose.ymlforward port 2222 → container port 22. SSH_DOMAINandSSH_PORT=2222ingitea.envtell Gitea what to advertise in clone URLs.
Test with:
ssh -T -p 2222 git@git.whitney.rip
- Handle user authentication like you'd do on Github by generating new ssh keys and adding them to the SSH Keys section. Settings > SSH/GPG Keys > Manage SSH Keys Now should also be able to clone with SSH.
Running
docker compose down && docker compose build && docker compose up -d && docker logs -f gitea
References
https://docs.gitea.com/next/administration/config-cheat-sheet