.
All checks were successful
/ build-docker-image (push) Successful in 51s

This commit is contained in:
2025-09-21 18:44:23 +01:00
parent c965abb702
commit 86bc19b15b
3 changed files with 12 additions and 20 deletions

View File

@@ -23,13 +23,13 @@ services:
image: git.limbosolutions.com/kb/borg-backup:latest
restart: no
tty: true
entrypoint: [ "bash", "-c", "loadenv && /init-repo"]
environment:
- BORG_REPO: ssh://user@server/home/user/borg-repo
- BORG_RSH: "-o StrictHostKeyChecking=no -o LogLevel=ERROR"
configs:
- source: id_ed25519 # required for ssh client
target: /home/borg/.ssh/id_ed25519
target: /root/.ssh/id_ed25519
- source: borg_init_repo_sh
target: /init-repo
@@ -51,10 +51,6 @@ configs:
-----END OPENSSH PRIVATE KEY-----
```
``` bash
docker run git.limbosolutions.com/kb/borg-backup:latest
```
### creating a backup
```yaml
@@ -105,7 +101,7 @@ services:
image: git.limbosolutions.com/kb/borg-backup:latest
# execute loadenv before you re scripts
# so some enviromnent variables are set
entrypoint: ["bash", "loadenv & /backup"]
configs:
- source: backup_script
target: /backup
@@ -120,7 +116,7 @@ services:
BORG_RSH: "ssh -o StrictHostKeyChecking=no"
BORG_PASSPHRASE: *****
REPO_SYNC_MAX_SIZE: 10737418240 #10GB
MODE:
volumes:
- /home/user/repos:/mnt/repos

View File

@@ -1,5 +1,5 @@
services:
borg:
borg-dev:
tty: true
stdin_open: true
@@ -9,13 +9,11 @@ services:
environment:
- BORG_REPO="${BORG_REPO}"
- BORG_RSH="${BORG_REPO}"
- BORG_RSH="${BORG_RSH}"
- BORG_PASSPHRASE="${BORG_PASSPHRASE}"
- MODE=SCRIPT # Valid modes are: BORG, SCRIPT, SHELL, default is BORG
#command: "ls -lah"
configs:
# - source: backup_script
# target: /app/backup-scripts/run
- source: id_ed25519
target: /root/.ssh/id_ed25519
mode: 0400
@@ -27,15 +25,10 @@ services:
- ./docker/dev-backup-scripts:/app/backup-scripts
configs:
# backup_script:
# content: |
# #!bin/bash
# echo "hello work!!!! (please override me)"
id_ed25519:
content: |
${ID_ED25519}
file: ~/.ssh/id_ed25519
borg_key:
content: |

View File

@@ -2,6 +2,9 @@
source /app/scripts/loadenv
#fix if its an string instead of an array
IFS=' ' read -r -a rsh_parts <<< "$BORG_RSH"
export BORG_RSH="${rsh_parts[@]}"
case "$MODE" in