Homelab/nomad_jobs/services/gitea
2024-02-06 13:01:22 -08:00
..
gitea.nomad.hcl Add Gitea Service 2024-02-06 13:01:22 -08:00
readme.md Add Gitea Service 2024-02-06 13:01:22 -08:00

Gitea

Gitea is a self-hosted git service. It is a great alternative to GitHub or GitLab. It is lightweight and easy to use. It is also easy to deploy and manage while still providing for functionality like SSO and LDAP integration.

Gitea should be configured to not utilize SSH as the job spec does not support it so that SSH is not exposed outside of the home network. If you want to use SSH, you will need to modify the job spec to expose the port and configure the service to use it. You can still run git operations over HTTPS.

Nomad Job for Gitea

You will need to modify the job spec items listed under TODO but there are no Gitea specific adjustments needed. If you run it, it will register with consul and be available to Traefik for routing. If the domain name is configured correctly, you should be able to reach the Gitea setup page to make the needed configuration changes.

Service Dependencies

TODO

If you want to deploy this, you will need to verify you have a valid host volume and update the domain name in the job spec.

Line Default Adjustment
17 source = "gitea-data" Change gitea-data to a valid host volume name
46 "traefik.http.routers.caddy.rule=Host('git.example.com')" Change git.example.com to your domain name
66 volume = "gitea-data" Change gitea-data to the host volume defined on line 15 if applicable

Configuring Gitea

There is no need to embed secrets in the nomad job spec. When you first visit the domain name you configured, you will be prompted to configure Gitea. Postgres should be mounted to the container on the standard 5432 port so you can select postgres as the database type and use 127.0.0.1:5432 as the address and input the username, password, and database name you created for Gitea to use.

If you need help making those credentials, take a look at the postgres readme.