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

Use os.TempDir() for temporary directory in default path #158

Closed Enrico204 closed 3 years ago

Enrico204 commented 3 years ago

What is the purpose of this change? What does it change?

This pull request removes the hardcoded reference to /tmp/restic replacing with platform-specific path, retrieved using os.TempDir() stdlib function.

Was the change discussed in an issue or in the forum before?

Issue #157

Checklist

wojas commented 3 years ago

As mentioned in #157, we plan to remove the default path in a future release and make it a required argument.

wojas commented 3 years ago

@wojas: Do you have objections to cleanup the default path calculation for now until we're ready to change how the rest-server is configured?

No, go ahead. It's just that having a default that eats your backups is not great anyway.

Enrico204 commented 3 years ago

I changed the code according to the review (except for the comment on the command line help section) :-)

Enrico204 commented 3 years ago

I've rebased this pull request to the current master to resolve a conflict :-)