1
0
Fork 0

apply Nextcloud expensive migrations on service start (#294)

This commit is contained in:
Pierre Penninckx 2024-09-02 20:22:53 -07:00 committed by GitHub
parent e5b76e4183
commit 3a44530844
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -560,6 +560,17 @@ in
This is useful if a deploy failed and you try to redeploy. 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 [ config = lib.mkMerge [
@ -1007,5 +1018,14 @@ in
fi 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
'';
})
]; ];
} }