Ansible role for Gitea service https://gitea.io/
Go to file
Jakub Sokołowski 89acb00bfb
config: use formatting that Gitea wants
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-08-01 20:27:11 +02:00
defaults config: use port 2222 for SSH 2024-08-01 19:55:22 +02:00
files init: fix script to use gitea api token 2024-02-01 10:43:35 +01:00
meta use full names of ansible roles used 2024-08-01 20:25:26 +02:00
tasks use full names of ansible roles used 2024-08-01 20:25:26 +02:00
templates config: use formatting that Gitea wants 2024-08-01 20:27:11 +02: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