emuell / restic-browser

A GUI to browse and restore restic backup repositories.
MIT License
664 stars 19 forks source link

Password file not being trimmed and newlines not shown in password field but takes effect, but restic trims password files #107

Closed arberg closed 4 months ago

arberg commented 4 months ago

env

I was unable to access my repositories via restic-browser until I discovered that pesky newline at the end of my password file.

I have tested that restic trims both newlines and spaces before and after password, so I assume restic runs a trim command. I tested this by adding spaces and newlines befoer and after in my password file, and check that .\restic.exe snapshots -p pwfile.txt still works (and that $env:RESTIC_PASSWORD is undefined in the env.

restic certainly doesn't remove all spaces, as I have another password with spaces. I didn't check the restic source-code though.

When I copied my password manually into the filed in restic-browser it also didn't work, because I copied entire file content including last newline. When I delete the last visible char in restic-browser and enters it again it gets the newline deleted and the password works.

I havn't been using restic-browser for a long time because it just didn't work, so I suspect others might also just conclude wrongly that restic-browser is broken if they run into this.

emuell commented 4 months ago

Thanks for the detailed description. This will be fixed here: https://github.com/emuell/restic-browser/pull/108