Merge pull request #112013 from Ma27/nextcloud-file-check
nixos/nextcloud: fail early if {admin,db}passFile is not readable
This commit is contained in:
commit
31b1137c1d
@ -483,6 +483,28 @@ in {
|
|||||||
path = [ occ ];
|
path = [ occ ];
|
||||||
script = ''
|
script = ''
|
||||||
chmod og+x ${cfg.home}
|
chmod og+x ${cfg.home}
|
||||||
|
|
||||||
|
${optionalString (c.dbpassFile != null) ''
|
||||||
|
if [ ! -r "${c.dbpassFile}" ]; then
|
||||||
|
echo "dbpassFile ${c.dbpassFile} is not readable by nextcloud:nextcloud! Aborting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$(<${c.dbpassFile})" ]; then
|
||||||
|
echo "dbpassFile ${c.dbpassFile} is empty!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
${optionalString (c.adminpassFile != null) ''
|
||||||
|
if [ ! -r "${c.adminpassFile}" ]; then
|
||||||
|
echo "adminpassFile ${c.adminpassFile} is not readable by nextcloud:nextcloud! Aborting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$(<${c.adminpassFile})" ]; then
|
||||||
|
echo "adminpassFile ${c.adminpassFile} is empty!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
|
||||||
ln -sf ${cfg.package}/apps ${cfg.home}/
|
ln -sf ${cfg.package}/apps ${cfg.home}/
|
||||||
|
|
||||||
# create nextcloud directories.
|
# create nextcloud directories.
|
||||||
|
Loading…
Reference in New Issue
Block a user