4 Commits

5 changed files with 31 additions and 32 deletions

View File

@@ -83,7 +83,7 @@ OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling
OC_DOCKER_TAG= OC_DOCKER_TAG=
# Domain of openCloud, where you can find the frontend. # Domain of openCloud, where you can find the frontend.
# Defaults to "cloud.opencloud.test" # Defaults to "cloud.opencloud.test"
OC_DOMAIN= OC_DOMAIN=cloud.opencloud.test
# Demo users should not be created on a production instance, # Demo users should not be created on a production instance,
# because their passwords are public. Defaults to "false". # because their passwords are public. Defaults to "false".
# If demo users is set to "true", the following user accounts are created automatically: # If demo users is set to "true", the following user accounts are created automatically:
@@ -310,3 +310,7 @@ KC_DB_PASSWORD=
# This matches the default user inside the container and avoids permission issues when accessing files. # This matches the default user inside the container and avoids permission issues when accessing files.
# Leaving it default stores data in docker internal volumes. # Leaving it default stores data in docker internal volumes.
#RADICALE_DATA_DIR=/your/local/radicale/data #RADICALE_DATA_DIR=/your/local/radicale/data
### borgbackup Settings ###
BORG_PASSPHRASE=vivid-garnet-lantern-oxide-sparrow-47-reef
PGHOST=postgres

15
.gitignore vendored
View File

@@ -17,15 +17,6 @@
/config/traefik/dynamic/* /config/traefik/dynamic/*
!/config/traefik/dynamic/.gitkeep !/config/traefik/dynamic/.gitkeep
.DS_Store .DS_Store
secrets/caddy_email secrets
secrets/opencloud_jwt_secret Persistent Backup
secrets/opencloud_transfer_secret backups/*
secrets/openproject_secret_key_base
secrets/traefik
Persistent Backup/2025-11-24_18-10/gitea_data_2025-11-24_18-10.tar.gz
Persistent Backup/2025-11-24_18-10/giteadb_2025-11-24_18-10.sql.gz
Persistent Backup/2025-11-24_18-10/odoo_2025-11-24_18-10.sql.gz
Persistent Backup/2025-11-24_18-10/odoo_config_2025-11-24_18-10.tar.gz
Persistent Backup/2025-11-24_18-10/odoo_db_data_2025-11-24_18-10.tar.gz
Persistent Backup/2025-11-24_18-10/opencloud_config_2025-11-24_18-10.tar.gz
Persistent Backup/2025-11-24_18-10/opencloud_data_2025-11-24_18-10.tar.gz

View File

@@ -26,6 +26,7 @@ services:
BACKUP_RETENTION_COUNT: ${BKP_RETENTION_COUNT} BACKUP_RETENTION_COUNT: ${BKP_RETENTION_COUNT}
BACKUP_RETENTION_DAYS: ${BKP_RETENTION_DAYS} BACKUP_RETENTION_DAYS: ${BKP_RETENTION_DAYS}
TIMEZONE: ${TIMEZONE} TIMEZONE: ${TIMEZONE}
APK_MIRROR: ${APK_MIRROR}
volumes: volumes:
- ./backups:/backups - ./backups:/backups
- type: volume - type: volume
@@ -50,4 +51,4 @@ services:
read_only: true read_only: true
- ./scripts/backup/manage-backups.sh:/manage-backups.sh - ./scripts/backup/manage-backups.sh:/manage-backups.sh
- ./scripts/backup/backup-manager.cron:/etc/crontabs/root - ./scripts/backup/backup-manager.cron:/etc/crontabs/root
entrypoint: ["/bin/sh", "-c", "# install bsdtar for xattr-aware archives\napk add --no-cache libarchive-tools attr >/dev/null \n# map host /backups ownership to container backup user\nHOST_UID=$$(stat -c '%u' /backups 2>/dev/null || echo 1000) && HOST_GID=$$(stat -c '%g' /backups 2>/dev/null || echo 1000) && addgroup -g \"$$HOST_GID\" backup 2>/dev/null || true && adduser -D -u \"$$HOST_UID\" -G backup backup 2>/dev/null || true && mkdir -p /var/log /backups && chown -R \"$$HOST_UID\":\"$$HOST_GID\" /var/log /backups 2>/dev/null || true && chmod +x /manage-backups.sh && chown root:root /etc/crontabs/root 2>/dev/null || true && crond -f"] entrypoint: ["/bin/sh", "-c", "# install bsdtar for xattr-aware archives\nif [ -n \"$$APK_MIRROR\" ]; then sed -i \"s|https://dl-cdn.alpinelinux.org|$$APK_MIRROR|g\" /etc/apk/repositories; fi && apk add --no-cache libarchive-tools attr >/dev/null \n# map host /backups ownership to container backup user\nHOST_UID=$$(stat -c '%u' /backups 2>/dev/null || echo 1000) && HOST_GID=$$(stat -c '%g' /backups 2>/dev/null || echo 1000) && addgroup -g \"$$HOST_GID\" backup 2>/dev/null || true && adduser -D -u \"$$HOST_UID\" -G backup backup 2>/dev/null || true && mkdir -p /var/log /backups && chown -R \"$$HOST_UID\":\"$$HOST_GID\" /var/log /backups 2>/dev/null || true && chmod +x /manage-backups.sh && chown root:root /etc/crontabs/root 2>/dev/null || true && crond -f"]

View File

@@ -34,8 +34,10 @@ BORG_PASSPHRASE=your-strong-passphrase
2. Initialize the repository (first time only): 2. Initialize the repository (first time only):
```bash ```bash
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose build borgmatic
borgmatic init --encryption repokey-blake2
docker compose run --rm borgmatic \
init --encryption repokey-blake2
``` ```
## Usage ## Usage
@@ -43,36 +45,40 @@ docker compose -f backup/borgmatic.yml run --rm borgmatic \
### Run Manual Backup ### Run Manual Backup
```bash ```bash
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose build borgmatic
borgmatic --stats -v 1
docker compose run --rm borgmatic \
--stats -v 1
``` ```
### Start Scheduled Backups ### Start Scheduled Backups
```bash ```bash
docker compose -f backup/borgmatic.yml up -d docker compose up -d
``` ```
### List Archives ### List Archives
```bash ```bash
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose build borgmatic
borgmatic list
docker compose run --rm borgmatic \
list
``` ```
### Restore ### Restore
```bash ```bash
# List files in an archive # List files in an archive
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose run --rm borgmatic \
borg list ::archive-name borg list ::archive-name
# Extract entire archive # Extract entire archive
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose run --rm borgmatic \
borg extract ::archive-name borg extract ::archive-name
# Extract specific path # Extract specific path
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose run --rm borgmatic \
borg extract ::archive-name source/gitea_data borg extract ::archive-name source/gitea_data
``` ```
@@ -80,7 +86,7 @@ docker compose -f backup/borgmatic.yml run --rm borgmatic \
```bash ```bash
# Extract dump from backup # Extract dump from backup
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose run --rm borgmatic \
borg extract ::archive-name source/pgdumps/giteadb.dump borg extract ::archive-name source/pgdumps/giteadb.dump
# Restore to database # Restore to database
@@ -90,8 +96,10 @@ docker exec -i postgres pg_restore -U admin -d giteadb -c /path/to/giteadb.dump
### Check Repository ### Check Repository
```bash ```bash
docker compose -f backup/borgmatic.yml run --rm borgmatic \ docker compose build borgmatic
borgmatic check
docker compose run --rm borgmatic \
check
``` ```
## Configuration ## Configuration

View File

@@ -34,15 +34,10 @@ services:
volumes: volumes:
opencloud-config: opencloud-config:
external: true
opencloud-data: opencloud-data:
external: true
gitea_data: gitea_data:
external: true
odoo-db-data: odoo-db-data:
external: true
odoo-config: odoo-config:
external: true
borg-repo: borg-repo:
borgmatic-pgdumps: borgmatic-pgdumps:
borgmatic-cache: borgmatic-cache: