nixpkgs/nixos/doc/manual/release-notes
Elias Probst 27da11972d nixos/restic: correct location of cache directory
By default, restic determines the location of the cache based on the XDG
base dir specification, which is `~/.cache/restic` when the environment
variable `$XDG_CACHE_HOME` isn't set.
As restic is executed as root by default, this resulted in the cache being
written to `/root/.cache/restic`, which is not quite right for a system
service and also meant, multiple backup services would use the same cache
directory - potentially causing issues with locking, data corruption,
etc.

The goal was to ensure, restic uses the correct cache location for a
system service - one cache per backup specification, using `/var/cache`
as the base directory for it.

systemd sets the environment variable `$CACHE_DIRECTORY` once
`CacheDirectory=` is defined, but restic doesn't change its behavior
based on the presence of this environment variable.
Instead, the specifier [1] `%C` can be used to point restic explicitly
towards the correct cache location using the `--cache-dir` argument.

Furthermore, the `CacheDirectoryMode=` was set to `0700`, as the default
of `0755` is far too open in this case, as the cache might contain
sensitive data.

[1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers
2021-01-30 18:24:51 -08:00
..
release-notes.xml 21.03 is Okapi 2020-09-07 14:20:35 -07:00
rl-1310.xml nixos docs: format =) 2018-05-01 19:57:09 -04:00
rl-1404.xml treewide: use https for nixos.org and hydra.nixos.org 2020-05-03 22:14:21 -07:00
rl-1412.xml Revert "nixos/doc: re-format" 2019-09-19 19:17:30 +02:00
rl-1509.xml treewide: use https for nixos.org and hydra.nixos.org 2020-05-03 22:14:21 -07:00
rl-1603.xml treewide: use https for nixos.org and hydra.nixos.org 2020-05-03 22:14:21 -07:00
rl-1609.xml Revert "nixos/doc: re-format" 2019-09-19 19:17:30 +02:00
rl-1703.xml Revert "nixos/doc: re-format" 2019-09-19 19:17:30 +02:00
rl-1709.xml Revert "nixos/doc: re-format" 2019-09-19 19:17:30 +02:00
rl-1803.xml Revert "nixos/doc: re-format" 2019-09-19 19:17:30 +02:00
rl-1809.xml Revert "nixos/doc: re-format" 2019-09-19 19:17:30 +02:00
rl-1903.xml docs: add -L to remaining curl install commands 2020-09-11 12:14:07 -07:00
rl-1909.xml doc/rl-1909: fix language 2019-11-15 00:32:09 +01:00
rl-2003.xml Merge pull request #89472 from asymmetric/relnotes-grub 2021-01-18 11:50:52 -08:00
rl-2009.xml nixos/gnome3: Note the reintroduction of epiphany in release notes 2021-01-05 16:27:20 +01:00
rl-2103.xml nixos/restic: correct location of cache directory 2021-01-30 18:24:51 -08:00