nextcloud / all-in-one

📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.
https://hub.docker.com/r/nextcloud/all-in-one
GNU Affero General Public License v3.0
5.36k stars 617 forks source link

AIO hardcodes local repository path in Borg which prevents remote repositories to be used despite being a standard Borg feature #4985

Closed devnoname120 closed 3 months ago

devnoname120 commented 3 months ago

Steps to reproduce

  1. Get a cloud storage that comes with Borg installed server-side. For example rsync.net.
  2. Set the env variable BORG_REPO to e.g. ssh://zh1234@zh1234.rsync.net/data1/home/zh1234/borg_backups as specified in Borg's documentation.
  3. Try to perform a backup from Nextcloud AIO.

Expected behavior

Nextcloud should perform the backups and restores using the remote Borg repository without issues because they are natively and seamlessly supported by Borg and don't require additional changes to use them compared to local repositories.

Actual behavior

Nextcloud AIO harcodes $BORG_BACKUP_DIRECTORY (/mnt/borgbackup/borg) in all the Borg commands, which causes Borg to use this local repository and to ignore the remote repository. Nextcloud AIO doesn't provide a way to override the value of BORG_BACKUP_DIRECTORY so we are stuck:

https://github.com/nextcloud/all-in-one/blob/ef1e7c28f6fe002a079de8e92e76f2866e3b2b4f/Containers/borgbackup/start.sh#L4-L5

https://github.com/nextcloud/all-in-one/blob/ef1e7c28f6fe002a079de8e92e76f2866e3b2b4f/Containers/borgbackup/start.sh#L39

Note that remote repositories are natively and seamlessly supported by Borg, and don't require changes compared to local repositories.

Host OS

Ubuntu Server 24.04 LTS aarch64

Nextcloud AIO version

v9.1.0

Current channel

latest

Other valuable info

While the remote Borg repository could as a hack be mounted with sshfs or SMB in a Docker volume mounted to the /mnt/borgbackup/borg it's unreliable, slow, and awkward compared to using the standard Borg feature.

devnoname120 commented 3 months ago

I just saw a PR was recently submitted: https://github.com/nextcloud/all-in-one/pull/4804