Ravinou / borgwarehouse

A fast and modern WebUI for a BorgBackup's central repository server.
https://borgwarehouse.com
GNU Affero General Public License v3.0
362 stars 21 forks source link

Repo location doesn't seem to read from .env.local? #193

Closed kbekus closed 5 months ago

kbekus commented 6 months ago

hi there, I'm trying to get this service running on a new Debian 12 system as a native application. I've followed the instructions and it's largely running, however it seems that repos are being created in /home/borgwarehouse/repos despite me setting the location in the ~/app/.env.local file:

borgwarehouse@makerverse:~/app $ cat .env.local
## Required variables section ##

# Host port mappings
WEB_SERVER_PORT=3000
SSH_SERVER_PORT=2222

# Hostname and URL
FQDN=192.x.x.23
NEXTAUTH_URL=http://192.x.x.23:3000
SSH_SERVER_PORT=22
SSH_SERVER_FINGERPRINT_RSA=SHA256:xxxxx
SSH_SERVER_FINGERPRINT_ED25519=SHA256:xxxxxx
SSH_SERVER_FINGERPRINT_ECDSA=SHA256:xxxxx

# Secrects
NEXTAUTH_SECRET=xxxxxxxxxxxxx=
CRONJOB_KEY=xxxxxxxxxxxxxx=

# UID:GID must match the user and group ID of the host folders and must be > 1000
# If you want to use a different user than 1001:1001, you must rebuild the image yourself.
UID=1001
GID=1001

# Config and data folders (volume mounts)
# The host folders must be owned by the user with UID and GID specified above
CONFIG_PATH=./config
SSH_PATH=./ssh
SSH_HOST=./ssh_host
BORG_REPOSITORY_PATH=/backup/repos
TMP_PATH=./tmp
LOGS_PATH=./logs

I can create a repo using the web interface and from a remote machine I then initialise the repo. It gets created in /home/borgwarehouse/repos, not /backup/repos.

borgwarehouse@makerverse:~/repos $ pwd
/home/borgwarehouse/repos
borgwarehouse@makerverse:~/repos $ ls -lah
total 12K
drwx------ 3 borgwarehouse borgwarehouse 4.0K Mar 22 16:33 .
drwxr-xr-x 8 borgwarehouse borgwarehouse 4.0K Mar 22 12:37 ..
drwx------ 3 borgwarehouse borgwarehouse 4.0K Mar 22 16:33 4d5b8790
pi@makerverse:/backup/repos $ pwd
/backup/repos
pi@makerverse:/backup/repos $ ls -lah
total 8.0K
drwxr-xr-x 2 borgwarehouse borgwarehouse 4.0K Mar 22 10:16 .
drwxr-xr-x 4 root          root          4.0K Mar 22 12:46 ..

And if I check ~/.ssh/authorised_keys it's putting the repo location in /home/borgwarehouse/repos:

borgwarehouse@makerverse:~/.ssh $ cat authorized_keys
command="cd /home/borgwarehouse/repos;borg serve --restrict-to-path /home/borgwarehouse/repos/4d5b8790 --storage-quota 1000G",restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFq7my5KIVo+7GEdW15e78XqNA9f0vfgscgNMZDWJDfy root@backup

can you tell me please what I'm doing wrong? I've recompiled the application a couple of times since editing the .env.local file and it doesn't seem to be changing the location.

Ravinou commented 5 months ago

Hi @kbekus , sorry for the delay in replying.

According to your question, you are installing BorgWarehouse as a native application and not in a Docker environment (what I call a baremetal installation). That's great, but you're using the docker environment variable file.

I refer you to the Debian documentation, which specifies the environment variables to be used. It's listed here in the documentation..

Finally, in the Debian environment, to use another location for storage, simply make a symbolic link from the repos directory to the directory of your choice. You can even mount an SSHFS directory (storage box hetzner or others...) on repos to deport storage to another machine.

Have a nice Sunday!

kbekus commented 5 months ago

thanks for your reply. I did see the different .env file but wondered if I could use additional fields to perform additional functions.

I'll just delete and recreate the borgwarehouse user specifying the alternate location as the home directory.

Thanks again.