nixos/nextcloud: improve error message for invalid dbpassFile

`file_exists` also returns `FALSE` if the file is in a directory that
can't be read by the user. This e.g. happens if permissions for
`nixops(1)`-deployment keys aren't configured correctly.

This patch improves the error message for invalid files to avoid
confusion[1].

[1] https://discourse.nixos.org/t/nixops-deploy-secrets-to-nextcloud/10414/4
This commit is contained in:
Maximilian Bosch 2020-12-09 19:54:43 +01:00
parent ace2457eaf
commit 81662d4798
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -391,7 +391,9 @@ in {
$file = "${c.dbpassFile}";
if (!file_exists($file)) {
throw new \RuntimeException(sprintf(
"Cannot start Nextcloud, dbpass file %s set by NixOS doesn't exist!",
"Cannot start Nextcloud, dbpass file %s set by NixOS doesn't seem to "
. "exist! Please make sure that the file exists and has appropriate "
. "permissions for user & group 'nextcloud'!",
$file
));
}