garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
787 stars 31 forks source link

Expand docs on Windows data and binary directories #361

Open SpiralBrad opened 3 days ago

SpiralBrad commented 3 days ago

Describe the bug

The Installation section of the docs states that "restic will be downloaded and installed in the data directory on first run." - Upon running backrest-tray.exe and attempting to "Open WebUI" - the URL doesn't work. - Checking the logs I see the following:

{"level":"info","ts":1719676879.462121,"msg":"installing restic C:\\Program Files/backrest/restic-0.16.4.exe to 0.16.4..."}
{"level":"fatal","ts":1719676879.4626205,"msg":"error finding or installing restic: install restic: create restic install directory C:\\Program Files/backrest: mkdir C:\\Program Files/backrest: Access is denied."}

(Interesting path slashes you have there... that's fixable...) But yes, this happened because I did not run it as Administrator, nor have C:\Program Files\backrest in place with User write permissions. The kicker: this differs from the Installation docs which state that it will be "downloaded and installed in the data directory on first run"...

What even is "the data directory"? My assumption would be one of two things: the target location for the backup, or the directory where backrest resides. ...Not Windows' Program Files.

To Reproduce

  1. Download backrest on a 'clean' Windows system
  2. Run backrest-windows-tray.exe without UAC elevation
  3. Notice WebUI does not work.

Expected behavior

  1. Download backrest on a 'clean' Windows system
  2. Run backrest-windows-tray.exe without UAC elevation
  3. restic gets downloaded to the current folder/same directory as backrest
  4. WebUI works as expected

Platform Info Windows 11 x64 Backrest 1.2.0

garethgeorge commented 3 days ago

You're right that the docs are misleading on this -- looks like they're out of sync with actual behavior on Windows.

Data directory on windows is in %appdata%/backrest but this is used primarily for logs and the operation database. You're right that restic is installed to program files which is a more sensible location for a binary on Windows. There is a windows installer coming in a future backrest release, I'll have to give some thought to what I can do to avoid requiring administrative privileges on first run. Perhaps the installer can place restic correctly when it runs which would make the requirement for administrative privileges explicit.

I'll go ahead and followup with some doc updates to better outline what backrest does on first run on windows.