nixpkgs-suyu/nixos/doc/manual
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
..
administration Merge pull request #98661 from doronbehar/doc/nixos/systemd-nixos-specific 2020-11-06 11:52:58 +01:00
configuration qemu-guest: remove security.rngd setting 2021-01-27 18:27:34 +01:00
development Revert "Module-builtin assertions, disabling assertions and submodule assertions" 2020-12-18 16:44:37 +01:00
installation nixos/manual: fix typo in virtualbox installation guide 2020-12-21 11:01:54 +05:30
release-notes nixos/restic: correct location of cache directory 2021-01-30 18:24:51 -08:00
.gitignore
contributing-to-this-manual.xml nixos/doc/manual: In the preface, add link to #chap-contributing 2021-01-23 18:58:54 -08:00
default.nix nixos/manual: make reproducible (#102234) 2020-10-31 21:18:16 +01:00
Makefile
man-configuration.xml
man-nixos-build-vms.xml
man-nixos-enter.xml
man-nixos-generate-config.xml
man-nixos-install.xml nixos-install: pass through keep-going flag 2020-10-31 17:13:45 +01:00
man-nixos-option.xml
man-nixos-rebuild.xml Revert "Merge branch 'master' into staging-next" 2020-12-31 08:50:36 +01:00
man-nixos-version.xml
man-pages.xml
manual.xml
preface.xml nixos/doc/manual: In the preface, add link to #chap-contributing 2021-01-23 18:58:54 -08:00
README
shell.nix

Moved to: ./contributing-to-this-manual.xml. Link:

https://nixos.org/manual/nixos/unstable/#chap-contributing