any.software.gitea: started role

This commit is contained in:
Jef Roosens 2025-12-23 23:19:46 +01:00
parent 1fed7d327a
commit 09e19680e6
Signed by: Jef Roosens
GPG key ID: 21FD3D77D56BAF49
13 changed files with 305 additions and 0 deletions

View file

@ -0,0 +1,5 @@
git.rustybever.be {
reverse_proxy localhost:8010 {
header_down +X-Robots-Tag "none"
}
}

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
data_dir='/mnt/data1/gitea/data'
snapshot_dir="${data_dir}.snapshot"
# Read-only snapshot for atomic backup
btrfs subvolume snapshot -r "$data_dir" "$snapshot_dir" || exit $?
/usr/local/bin/restic backup "$snapshot_dir"
# Always remove snapshot subvolume, even if restic fails
btrfs subvolume delete "$snapshot_dir"

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
data_dir='/mnt/data1/gitea/lfs'
snapshot_dir="${data_dir}.snapshot"
# Read-only snapshot for atomic backup
btrfs subvolume snapshot -r "$data_dir" "$snapshot_dir" || exit $?
/usr/local/bin/restic backup "$snapshot_dir"
# Always remove snapshot subvolume, even if restic fails
btrfs subvolume delete "$snapshot_dir"

View file

@ -0,0 +1,4 @@
# vim: ft=systemd
[Pod]
PublishPort=8016:22
PublishPort=8010:3000

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
cd /etc/gitea
/usr/bin/docker compose exec -T db pg_dump -U gitea gitea |
/usr/bin/gzip --rsyncable |
/usr/local/bin/restic backup --stdin --stdin-filename gitea-postgres.sql.gz

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
data_dir='/mnt/data1/gitea/repositories'
snapshot_dir="${data_dir}.snapshot"
# Read-only snapshot for atomic backup
btrfs subvolume snapshot -r "$data_dir" "$snapshot_dir" || exit $?
/usr/local/bin/restic backup "$snapshot_dir"
# Always remove snapshot subvolume, even if restic fails
btrfs subvolume delete "$snapshot_dir"

View file

@ -0,0 +1,13 @@
[Unit]
Description=Private, Fast, Reliable DevOps Platform
After=docker.service
Requires=docker.service
[Service]
Type=exec
WorkingDirectory=/etc/gitea
ExecStart=/usr/bin/docker compose up
ExecStop=/usr/bin/docker compose down
[Install]
WantedBy=multi-user.target