nixos/nextcloud: preserve OC_PASS env variable in the occ wrapper
The OC_PASS environment variable can be used to create a user with `occ user:add --password-from-env`. It is currently not possible to use the `nextcloud-occ` to "non-interactively" create a user since this variable is ignored by sudo.
This commit is contained in:
parent
1059cdab38
commit
cb682317b0
@ -34,7 +34,7 @@ let
|
|||||||
cd ${cfg.package}
|
cd ${cfg.package}
|
||||||
sudo=exec
|
sudo=exec
|
||||||
if [[ "$USER" != nextcloud ]]; then
|
if [[ "$USER" != nextcloud ]]; then
|
||||||
sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR'
|
sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS'
|
||||||
fi
|
fi
|
||||||
export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
|
export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
|
||||||
$sudo \
|
$sudo \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user