any.software.gitea: started role
This commit is contained in:
parent
1fed7d327a
commit
09e19680e6
13 changed files with 305 additions and 0 deletions
5
roles/any.software.gitea/files/gitea.Caddyfile
Normal file
5
roles/any.software.gitea/files/gitea.Caddyfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
git.rustybever.be {
|
||||
reverse_proxy localhost:8010 {
|
||||
header_down +X-Robots-Tag "none"
|
||||
}
|
||||
}
|
||||
12
roles/any.software.gitea/files/gitea.data.backup.sh
Normal file
12
roles/any.software.gitea/files/gitea.data.backup.sh
Normal 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"
|
||||
12
roles/any.software.gitea/files/gitea.lfs.backup.sh
Normal file
12
roles/any.software.gitea/files/gitea.lfs.backup.sh
Normal 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"
|
||||
4
roles/any.software.gitea/files/gitea.pod
Normal file
4
roles/any.software.gitea/files/gitea.pod
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# vim: ft=systemd
|
||||
[Pod]
|
||||
PublishPort=8016:22
|
||||
PublishPort=8010:3000
|
||||
7
roles/any.software.gitea/files/gitea.postgres.backup.sh
Normal file
7
roles/any.software.gitea/files/gitea.postgres.backup.sh
Normal 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
|
||||
12
roles/any.software.gitea/files/gitea.repositories.backup.sh
Normal file
12
roles/any.software.gitea/files/gitea.repositories.backup.sh
Normal 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"
|
||||
13
roles/any.software.gitea/files/gitea.service
Normal file
13
roles/any.software.gitea/files/gitea.service
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue