1
0
Fork 0

disable nextcloud maintenance mode on service restart

This commit is contained in:
ibizaman 2024-09-01 21:36:33 +02:00 committed by Pierre Penninckx
parent d711e59f91
commit 6da0a4b988
2 changed files with 19 additions and 0 deletions

View file

@ -14,6 +14,7 @@
- `shb.authelia.oidcClients.description` -> `shb.authelia.oidcClients.client_name` - `shb.authelia.oidcClients.description` -> `shb.authelia.oidcClients.client_name`
- `shb.authelia.oidcClients.secret` -> `shb.authelia.oidcClients.client_secret` - `shb.authelia.oidcClients.secret` -> `shb.authelia.oidcClients.client_secret`
- `shb.authelia.ldapEndpoint` -> `shb.authelia.ldapHostname` and `shb.authelia.ldapPort` - `shb.authelia.ldapEndpoint` -> `shb.authelia.ldapHostname` and `shb.authelia.ldapPort`
- Make Nextcloud automatically disable maintenance mode upon service restart.
## User Facing Backwards Compatible Changes ## User Facing Backwards Compatible Changes

View file

@ -550,6 +550,16 @@ in
default = null; default = null;
example = "debug_me"; example = "debug_me";
}; };
autoDisableMaintenanceModeOnStart = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Upon starting the service, disable maintenance mode if set.
This is useful if a deploy failed and you try to redeploy.
'';
};
}; };
config = lib.mkMerge [ config = lib.mkMerge [
@ -988,5 +998,13 @@ in
} }
]; ];
}) })
(lib.mkIf cfg.autoDisableMaintenanceModeOnStart {
systemd.services.nextcloud-setup.preStart =
lib.mkBefore ''
if [[ -e /var/lib/nextcloud/config/config.php ]]; then
${occ} maintenance:mode --no-interaction --quiet --off
fi
'';
})
]; ];
} }