3 Commits

5 changed files with 30 additions and 11 deletions

View File

@@ -14,6 +14,9 @@ jobs:
name: Build image
runs-on: ubuntu-22.04
container: catthehacker/ubuntu:act-latest
env:
REGISTRY: git.realmanual.ru
IMAGE_NAME: ${{ gitea.repository }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -21,7 +24,7 @@ jobs:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: git.realmanual.ru
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.PUSH_TOKEN }}
@@ -32,5 +35,5 @@ jobs:
context: .
push: true
tags: |
${{ gitea.registry_name }}/${{ gitea.repository }}:${{ gitea.ref_name }}
${{ gitea.registry_name }}/${{ gitea.repository }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.ref_name }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

View File

@@ -3,7 +3,7 @@
```yaml
services:
sqlite_backup:
image: hub.realmanual.ru/pub/sqlite-backup/backup:latest
image: git.realmanual.ru/pub/sqlite-backup-s3
container_name: sqlite_backup
restart: always
volumes:

View File

@@ -1,6 +1,6 @@
services:
sqlite_backup:
image: hub.realmanual.ru/pub/sqlite-backup/backup:latest
image: git.realmanual.ru/pub/sqlite-backup/backup:latest
container_name: sqlite_backup
restart: always
volumes:

View File

@@ -1,6 +1,8 @@
#!/bin/sh
echo "${CRONTAB} /scripts/backup.sh" > /etc/crontabs/root
# Create crontab in a writable location
mkdir -p /tmp/crontabs
echo "${CRONTAB} /scripts/backup.sh" > /tmp/crontabs/root
/scripts/backup.sh
exec crond -f
exec crond -f -c /tmp/crontabs

View File

@@ -1,18 +1,32 @@
#!/bin/bash
rclone config create myminio s3 provider Minio access_key_id $MINIO_ACCOUNT_ID secret_access_key $MINIO_APPLICATION_KEY endpoint $MINIO_ENDPOINT region $MINIO_LOCATION acl private
# Create rclone config on-the-fly in a writable location
RCLONE_CONFIG_DIR="/tmp/rclone"
mkdir -p "$RCLONE_CONFIG_DIR"
export RCLONE_CONFIG="$RCLONE_CONFIG_DIR/rclone.conf"
cat > "$RCLONE_CONFIG" << EOF
[myminio]
type = s3
provider = Minio
access_key_id = $MINIO_ACCOUNT_ID
secret_access_key = $MINIO_APPLICATION_KEY
endpoint = $MINIO_ENDPOINT
region = $MINIO_LOCATION
acl = private
EOF
case $1 in
copy)
echo "copy from $2 to $3"
rclone copy --progress $2 $3
rclone copy --progress $2 myminio:$3
;;
list)
echo "list $2"
rclone ls $2
rclone ls myminio:$2
;;
delete)
echo "delete $2"
rclone delete $2
rclone delete myminio:$2
;;
esac