Ravinou / borgwarehouse

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

Help on installation #124

Closed GabomaGeek closed 6 months ago

GabomaGeek commented 9 months ago

Hello everyone. I followed the recommendations to install borg on windows and everything worked fine. But one day the Windows machine had a problem and after restoring it, borgwarehouse displayed an API error. I thought it was related to the Windows machine disconnection problem so I manually deleted the directory in config/repo.json, but still nothing. Looking around a bit I saw this error SyntaxError: Unexpected string in JSON at position 1869 at JSON.parse (<anonymous>) at handler (/home/borgwarehouse/borgwarehouse/.next/server/pages/api/repo.js:88:29) The error indicates this line repoList = JSON.parse(repoList); in the file. Anyone have an idea how to solve it? Thanks in advance.

Ravinou commented 9 months ago

Hi @GabomaGeek I think you lose some informations because of your windows restoring. I've never used the linux system under windows.

What I can tell you is that the repo.json file contains data about your repositories. If you've lost this file, you'll need to rebuild it :

If you want to start from scratch, the application at least needs a repo.json file containing just an ampty array : []

GabomaGeek commented 9 months ago

I want to start from scratch. How can i uninstall the entire application (or at least start at the point where there is no repository) before install it again ?

Ravinou commented 9 months ago

What is your environment ? Docker or classic installation on Debian like ?

GabomaGeek commented 9 months ago

Classic installation on ubuntu

What is your environment ? Docker or classic installation on Debian like ?

Ravinou commented 9 months ago

@GabomaGeek If you want to reinstall everything, the best option is to start from scratch.

To do this, you can empty the contents of /home/borgwarehouse to create a blank folder (backup only the .env.local file if you want to keep the same). Your old backups are in /var/borgwarehouse (for v1.x.x), but you can also delete them if you don't want them anymore.

Once you've cleaned up your /home/borgwarehouse directory, you can restart an installation by following the documentation for baremetal installations here.

Please keep me informed, otherwise I'll close the issue if everything's ok with you. Have a nice Sunday 😉

GabomaGeek commented 9 months ago

I start a fresh install with version 2. When i want to create a repository, but i got an error undifined and the repository is not created. But when i read the borgwarehouse/.ssh/authorized_keys, i see informations about the repository that was not created.

Ravinou commented 8 months ago

Hi @GabomaGeek , I need more context and a possible error log to help you please.

GabomaGeek commented 8 months ago

@Ravinou this is the result i took form syslog Feb 13 13:36:13 borgwarehouse npm[4007]: at ChildProcess.exithandler (node:child_process:419:12) Feb 13 13:36:13 borgwarehouse npm[4007]: at ChildProcess.emit (node:events:514:28) Feb 13 13:36:13 borgwarehouse npm[4007]: at maybeClose (node:internal/child_process:1091:16) Feb 13 13:36:13 borgwarehouse npm[4007]: at Socket.<anonymous> (node:internal/child_process:449:11) Feb 13 13:36:13 borgwarehouse npm[4007]: at Socket.emit (node:events:514:28) Feb 13 13:36:13 borgwarehouse npm[4007]: at Pipe.<anonymous> (node:net:323:12) { Feb 13 13:36:13 borgwarehouse npm[4007]: code: 3, Feb 13 13:36:13 borgwarehouse npm[4007]: killed: false, Feb 13 13:36:13 borgwarehouse npm[4007]: signal: null, Feb 13 13:36:13 borgwarehouse npm[4007]: cmd: '/home/borgwarehouse/app/helpers/shells/createRepo.sh "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCTj7VBqhAoOSPXafA5m1c7w/H6yCgtBkz96l7QauELE993YOnG4KBGs6p78zMkYxQkENq8wGjaM73Ji7UzVcnFktDQgiONxo0kde9GHLddsxhPKUPfIT1+m9B4T2NQnWq/yjFSCyA+U8gUE48CeRdK1b7G2tgRDBh3w9hMvMxbF5cdJEp3IgB3vF21flcuEI/FkSi+fhPY0eBCI1KIQv63YJJPWa4U5pqESO5h8yIEMlw3MsnXrrJhBUHTdJengnvgySAuLmmSXjWfbKZTT8Jlsu7d1KyIfWSnbpeQ+xGnte5rddKBpj4hJy0PxcZAkzg1c7/amGlGwkAG8Zf05AB296QsLP7Uc8ZQtcoNQ+ytQO6Z7cFR6pqNipjfXemJWsvXM3PgUmw1gR8lPumzqVdoRev2e8hevhp3hfY4DUyQj78FeMBVZ9bJqPliLNMdKsJ3gdAKZjse5ERS2yS1U2K6Pt+AkAjyqa9OOiuD30CKggAfdSQNnXULYT0aqohUcps= cermel@redcapserver" 68', Feb 13 13:36:13 borgwarehouse npm[4007]: stdout: 'SSH pub key already present in authorized_keys', Feb 13 13:36:13 borgwarehouse npm[4007]: stderr: '' Feb 13 13:36:13 borgwarehouse npm[4007]: }

Ravinou commented 8 months ago

Hi, sorry for delay.

Your error says "'SSH pub key already present in authorized_keys'". Clean your authorized_keys please, it had to match with your current repo on borgwarehouse. And you can't use a public key twice.

GabomaGeek commented 7 months ago

Now, i can add repository. But when i try to initialize a repository, the system request the password for the user borgwarehouse but the user does not have one.

Ravinou commented 7 months ago

If the system asks you for a password, the SSH public key has not been found. So there's a configuration problem. You can check whether the key is in the file.

GabomaGeek commented 7 months ago

The key is in the file. I can connect via ssh to the borgwarehouse VM without being asked for password. And the key is also in /home/borgwarehouse/.ssh/authorized_keys

Ravinou commented 7 months ago

It's really difficult for me to help you without more detailed information.

GabomaGeek commented 7 months ago

I don't know what other information to give you. I reinstalled Borgwarehouse, I had version 1.6.0 and after following your instructions to delete all the folders related to version 1.6.0, I followed the instructions in the documentation to install the version 2.0 and the application is installed but when I want to initialize a repository with borg init -e repokey-blake2 ssh://borgwarehouse@x.x.x.x:22/./7f282f2a, I am asked for a password for the borgwarehouse user who does not have one. Voici le contenu du fichier /home/borgwarehouse/.ssh/authorized_keys: command="cd /home/borgwarehouse/repos;borg serve --restrict-to-path /home/borgwarehouse/repos/7f282f2a --storage-quota 50G",restrict ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCij8wO8UriMpMWCWZo8afkXC3kEiOzJiiRjvmnP5GRNlEa15/ojeUsO2SivrpXNdPzR0Vr/3HqKgMzm30X9oaPNGqhjaS4o0tlq9nxMQFKYMbOE7O73rrSFgk+CcpJr2diNzSVtm1X0gpaNkz3+UyTvHBjzf0Y30uRAj2UfeFeCq1teaBpqHLKv4FbCbGZ4ZvFvoVw+pVYLvVM9WqT3Y/Xjf6OPft3JwfMEXHeiEdetp6QfJv3NDkdcFCJdf/OnnMoyHfCDywrPd5QwClXjs8fg5FtwdjgO72XfQVeSPNylHKjlH1YqjGLAnPL9P9bSWOAFzUdiyDvvttgIr4tq+6cVjnbOrzTrKphEpK6hSlzwDbeOJ05/um7qhICjbfl9qkOEI34CX0Etv2rYXRIbUV2V+km/E4UH5WRUmzSXxarjf/y+VmlqjHL9hGt1Ho1lfdHRmDhn7f2BQwe+U0HShbPRKEkV0KYRT/4koCQA3JUnVO2trFvxOO0+snhMd6Zbr0= cermel@redcapserver. As you see, the key is in the file.

GabomaGeek commented 6 months ago

I finally got the application works. I previously install Borgwarehouse on ubuntu and that worked i fine but since an issue, even a reinstallation did not resolve the issue and the password of the user borgwarehouse was always asked on archive initialization. So i decide to do the installation on debian and everything is now working properly.

Ravinou commented 6 months ago

Thank you for keeping me informed and for taking the time to close the issue. Have a nice evening.