nixpkgs/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 nixos/doc/*: editorconfig fixes 2020-07-31 15:08:54 +10:00
man-nixos-enter.xml nixos/doc: Improve code listings 2020-09-23 01:25:25 +02:00
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 Merge pull request #75439 from Ma27/submodule-fixes-for-nixos-option 2020-02-01 10:00:59 +01:00
man-nixos-rebuild.xml Revert "Merge branch 'master' into staging-next" 2020-12-31 08:50:36 +01:00
man-nixos-version.xml nixos/doc: Improve code listings 2020-09-23 01:25:25 +02:00
man-pages.xml nixos/doc+manual: update copyright year range end 2019->2020 2020-01-14 07:01:39 -06:00
manual.xml nixos/doc: Mention how to contribute to it 2020-10-22 17:40:48 +03:00
preface.xml nixos/doc/manual: In the preface, add link to #chap-contributing 2021-01-23 18:58:54 -08:00
README nixos/doc: Mention how to contribute to it 2020-10-22 17:40:48 +03:00
shell.nix

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

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