added agent

This commit is contained in:
Mathias Beaulieu-Duncan 2024-11-25 19:00:12 -05:00
parent e70f740a28
commit 7680d762b6
Signed by: mathias
GPG Key ID: 17DFF5425B1AB6BA
2 changed files with 34 additions and 0 deletions

21
backup.sh.save Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
BACKUP_DIR="/backup/$(date +%F_%H-%M)/"
DB_BACKUP_FILE="$BACKUP_DIR/gitea.sql"
$container_id = docker ps --filter "name=^gitea$" -q
$user = docker inspect -f '{{json .Config.Env}}' $container_id | jq -r '.[] | select(startswith("USER=")) | split("=")[1]'
PGPASSWORD="$DB_PASSWORD" pg_dump -h database -U $DB_USER -d $DB_DATABASE -F c -b -v -f $DB_BACKUP_FILE
TARGET_PATH="s3://$BACKUP_SPACE_NAME/backups/$(date +%F_%H-%M)"
BACKUP_FILE=$(date +%F_%H-%M)
tar -czf "backup"
s3cmd put --encrypt $BACKUP_DIR* $TARGET_PATH --recursive
rm -rf $BACKUP_DIR
echo "Files have been uploaded to $TARGET_PATH"

View File

@ -24,6 +24,7 @@ services:
- USER_GID=1000
- GITEA__security__SECRET=${GITEA_SECRET}
- GITEA__security__INTERNAL_TOKEN=${GITEA_TOKEN}
- GITEA__security__ENFORCE_TWO_FACTOR_AUTH=true
- GITEA__database__DB_TYPE=${DB_TYPE}
- GITEA__database__HOST=database:5432
- GITEA__database__NAME=${DB_DATABASE}
@ -67,6 +68,18 @@ services:
volumes:
- ./postgres/data:/var/lib/postgresql/data
runner_A0:
image: gitea/act_runner
restart: always
networks:
- gitea
environment:
- GITEA_INSTANCE_URL=https://git.openharbor.io
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_A0_REGISTRATION_TOKEN}
- GITEA_RUNNER_NAME=A0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
gitea:
driver: bridge