restic / rest-server

Rest Server is a high performance HTTP server that implements restic's REST backend API.
BSD 2-Clause "Simplified" License
943 stars 140 forks source link

Wrong default path on Windows #157

Closed Enrico204 closed 3 years ago

Enrico204 commented 3 years ago

Output of rest-server --version

rest-server version rest-server 0.10.0-dev compiled with go1.17 on windows/amd64 (latest on master)

How did you run rest-server exactly?

rest-server.exe --no-auth

What backend/server/service did you use to store the repository?

Local directory

Expected behavior

rest-server start pointing to a temporary directory (like the Linux version)

Actual behavior

rest-server start pointing to /tmp/restic, which is being translated to \tmp\restic by Go, which in turn is invalid (at least, it doesn't exist in a standard Windows installation)

Steps to reproduce the behavior

Just start rest-server --no-auth in a clean Windows installation.

Do you have any idea what may have caused this?

Wrong default path for Windows platform, caused by hardcoded ref to /tmp/restic here: https://github.com/restic/rest-server/blob/d2813ea61b37e7c8bc40c9afec7990cbe2ffd199/cmd/rest-server/main.go#L30

Do you have an idea how to solve the issue?

Use os.TempDir() to retrieve the platform-specific temporary directory.

Did rest-server help you today? Did it make you happy in any way?

Yes! I'm using rest-server on daily basis as backend for my personal backups :-D

wojas commented 3 years ago

We plan to remove the default path in a future release and make it a required argument.

Enrico204 commented 3 years ago

Ah ok, good. Do we already have an issue to track that change?

wojas commented 3 years ago

Not currently, it may be added as part of PR #140.

Enrico204 commented 3 years ago

Fixed in pull request #158 , closing