This commit is contained in:
2025-09-21 19:12:35 +01:00
parent 86bc19b15b
commit 9fcd107db8
2 changed files with 20 additions and 26 deletions

View File

@@ -4,7 +4,7 @@
- [container image](#container-image)
- [environment variables](#environment-variables)
- [borg repo init](#borg-repo-init)
- [borg init repo](#borg-init-repo)
- [creating a backup](#creating-a-backup)
- [using a bash script](#using-a-bash-script)
- [dev](#dev)
@@ -15,40 +15,34 @@
<https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables>
### borg repo init
### borg init repo
```bash
services:
borg-backup:
image: git.limbosolutions.com/kb/borg-backup:latest
restart: no
tty: true
environment:
- BORG_REPO: ssh://user@server/home/user/borg-repo
- BORG_RSH: "-o StrictHostKeyChecking=no -o LogLevel=ERROR"
- BORG_REPO=${BORG_REPO}
- BORG_RSH=${BORG_RSH}
- BORG_PASSPHRASE="${BORG_PASSPHRASE}"
- MODE=SCRIPT # Valid modes are: BORG, SCRIPT, SHELL, default is BORG
configs:
- source: id_ed25519 # required for ssh client
target: /root/.ssh/id_ed25519
- source: borg_init_repo_sh
target: /init-repo
- source: id_ed25519
target: /root/.ssh/id_ed25519
mode: 0400
command:
- |
borg init --encryption=keyfile-blake2 $BORG_REPO
cat /root/.config/borg/keys/*
configs:
borg_init_repo_sh:
# Example, execute
# borg init --encryption=keyfile-blake2 $BORG_REPO
# don't forget to copy key file content on borg folder (/root/.borg/keys/*) and BORG_PASSPHRASE used during initialization
content:
while true; do
sleep 5
done
id_ed25519:
content: |
-----BEGIN OPENSSH PRIVATE KEY-----
**************
**************
-----END OPENSSH PRIVATE KEY-----
file: ~/.ssh/id_ed25519
```
### creating a backup
@@ -182,7 +176,7 @@ For development environment and testing this docker compose files.
BUILD=""
# uncomment do force build
#BUILD="--build"
BUILD="--build"
if [ ! -f ./docker-compose.dev.local.yaml ]; then
touch ./docker-compose.dev.local.yaml

View File

@@ -8,8 +8,8 @@ services:
context: .
environment:
- BORG_REPO="${BORG_REPO}"
- BORG_RSH="${BORG_RSH}"
- BORG_REPO=${BORG_REPO}
- BORG_RSH=${BORG_RSH}
- BORG_PASSPHRASE="${BORG_PASSPHRASE}"
- MODE=SCRIPT # Valid modes are: BORG, SCRIPT, SHELL, default is BORG
configs: