apply Nextcloud expensive migrations on service start (#294)
This commit is contained in:
parent
e5b76e4183
commit
3a44530844
1 changed files with 20 additions and 0 deletions
|
@ -560,6 +560,17 @@ in
|
|||
This is useful if a deploy failed and you try to redeploy.
|
||||
'';
|
||||
};
|
||||
|
||||
alwaysApplyExpensiveMigrations = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Run `occ maintenance:repair --include-expensive` on service start.
|
||||
|
||||
Larger instances should disable this and run the command at a convenient time
|
||||
but Self Host Blocks assumes that it will not be the case for most users.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
|
@ -1007,5 +1018,14 @@ in
|
|||
fi
|
||||
'';
|
||||
})
|
||||
|
||||
(lib.mkIf (cfg.enable && cfg.alwaysApplyExpensiveMigrations) {
|
||||
systemd.services.nextcloud-setup.script =
|
||||
''
|
||||
if [[ -e /var/lib/nextcloud/config/config.php ]]; then
|
||||
${occ} maintenance:repair --include-expensive
|
||||
fi
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue