Ansible role for Gitea service https://gitea.io/
Go to file
Anton Iakimov 9372a049c2
config: disable repo_archives
We use gitea as a github archive and we also backup repos in restic.
2024-03-04 11:52:11 +01:00
defaults upgrade from 1.20.3 to 1.21.4 2024-01-31 16:40:57 +01:00
files init: fix script to use gitea api token 2024-02-01 10:43:35 +01:00
meta add Ansible metadata 2022-10-20 19:15:15 +02:00
tasks init: fix script to use gitea api token 2024-02-01 10:43:35 +01:00
templates config: disable repo_archives 2024-03-04 11:52:11 +01:00
README.md purge: init script 2023-11-28 10:08:52 +01:00

README.md

Description

This role configures an instance of Gitea using Docker Compose.

Configuration

gitea_app_name: 'Example.org Repos'
gitea_app_web_domain: 'gitea.example.org'
gitea_app_ssh_domain: 'git.example.org'
gitea_app_ssh_port: 22
gitea_app_secret_key: 'super-secret-key'
gitea_app_log_level: 'debug'

# DB
gitea_db_pass: 'super-secret-db-pass'

# Admin
gitea_app_admin_user: 'root'
gitea_app_admin_pass: 'secret-root-pass'
gitea_app_admin_email: 'root@example.org'

Initialisation

Organization can be initialised with:

gitea_organizations:
  - org1
  - org2

Purge

A purge is run daily and remove all containers older than gitea_purge_max_retention days.

It can be configure with:

gitea_container_purge_timer_frequency: 'daily'
gitea_purge_max_retention:   15

Administration

You can manage the services using Docker Compose:

 > docker-compose ps
  Name                 Command               State                           Ports                         
-----------------------------------------------------------------------------------------------------------
gitea-app   /usr/bin/entrypoint /bin/s ...   Up      22/tcp, 0.0.0.0:2222->2222/tcp, 0.0.0.0:3000->3000/tcp
gitea-db    docker-entrypoint.sh postgres    Up      0.0.0.0:5432->5432/tcp  

For example you can easily re-create containers:

 > docker-compose up --force-recreate -d
Recreating gitea-db ... done
Recreating gitea-app ... done

Backups

A Systemd timer creates pg_dump backups of the PostgreSQL database daily:

 > sudo systemctl list-timers -a dump-gitea-db
NEXT                        LEFT    LAST PASSED UNIT                ACTIVATES            
Sat 2021-03-20 00:00:00 UTC 9h left n/a  n/a    dump-gitea-db.timer dump-gitea-db.service