Add storage keepalive (upholds) across services, Nextcloud cron, disable Nextcloud PHP JIT

Requires= doesn't restart a service once its required mount comes back after
a USB disconnect/remount, so a dedicated storage-keepalive unit now Upholds=
every storage-dependent service to bring it back automatically. Also adds the
missing Nextcloud cron.php timer (background jobs were never triggered), and
disables opcache.jit in the Nextcloud container — PHP 8.4's JIT was
miscompiling OC\Config\UserConfig::getValueBool(), crashing every
session-bootstrapping request with a bogus strtolower() TypeError.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Aner Zakobar
2026-10-08 09:47:20 +03:00
parent da020a8dfe
commit c3115026e9
18 changed files with 110 additions and 0 deletions
+2
View File
@@ -103,6 +103,8 @@ in
# -------------------------------------------------------------------------
# Storage directory
# -------------------------------------------------------------------------
homey.storage.upholds = [ "podman-aim-server.service" "podman-aim-ui.service" ];
homey.storage.extraDirs = [
{ path = "aim"; mode = "0755"; }
];
+2
View File
@@ -123,6 +123,8 @@ in
# -----------------------------------------------------------------------
# Storage directories (not backed up — no backup.extraPaths entry)
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-attic.service" ];
homey.storage.extraDirs = [
{ path = "attic"; }
{ path = "attic/cache"; mode = "0755"; }
+2
View File
@@ -252,6 +252,8 @@ in
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-authelia.service" ];
homey.storage.extraDirs = [
{ path = "authelia"; }
{ path = "authelia/config"; }
+2
View File
@@ -108,6 +108,8 @@ in
# -------------------------------------------------------------------------
# Storage directories (owned by the service user)
# -------------------------------------------------------------------------
homey.storage.upholds = [ "emulatorjs.service" ];
homey.storage.extraDirs = [
{ path = "emulatorjs"; user = "emulatorjs"; group = "emulatorjs"; }
{ path = "emulatorjs/saves"; user = "emulatorjs"; group = "emulatorjs"; }
+2
View File
@@ -211,6 +211,8 @@ in
# -----------------------------------------------------------------------
# Storage directories (UID 1000 = Gitea's internal user)
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-gitea.service" ];
homey.storage.extraDirs = [
{ path = "gitea"; user = "1000"; group = "1000"; }
{ path = "gitea/data"; user = "1000"; group = "1000"; }
+2
View File
@@ -157,6 +157,8 @@ in
# -------------------------------------------------------------------------
# Storage directories
# -------------------------------------------------------------------------
homey.storage.upholds = [ "podman-home-assistant.service" ];
homey.storage.extraDirs = [
{ path = "home-assistant"; }
{ path = "home-assistant/config"; mode = "0755"; }
+2
View File
@@ -145,6 +145,8 @@ EOF
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-jellyfin.service" ];
homey.storage.extraDirs = [
{ path = "jellyfin"; }
{ path = "jellyfin/config"; }
+2
View File
@@ -113,6 +113,8 @@ in
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-mealie.service" ];
homey.storage.extraDirs = [
{ path = "mealie"; }
{ path = "mealie/data"; mode = "0755"; }
+2
View File
@@ -118,6 +118,8 @@ in
# -------------------------------------------------------------------------
# Storage directories on external HD
# -------------------------------------------------------------------------
homey.storage.upholds = [ "podman-mlflow.service" ];
homey.storage.extraDirs = [
{ path = "mlflow"; }
{ path = "mlflow/data"; mode = "0750"; }
+17
View File
@@ -49,6 +49,19 @@ let
MaxConnectionsPerChild 500
</IfModule>
'';
# PHP 8.4's JIT miscompiles OC\Config\UserConfig::getValueBool() on this
# image, corrupting the type of the value passed to strtolower() and
# throwing "Argument #1 ($string) must be of type string, string given"
# on every request that bootstraps a user session (confirmed by disabling
# JIT live on 2026-10-08: the crash stopped immediately). Not an app or
# data bug — getTypedValue()'s `: string` return type and
# decryptSensitiveValue()'s `string &$value` by-ref param both independently
# guarantee the value is already a real string under strict_types=1 by the
# time strtolower() rejects it.
phpDisableJitConfig = pkgs.writeText "zzz-disable-jit.ini" ''
opcache.jit=0
'';
in
{
options.homey.nextcloud = {
@@ -158,6 +171,8 @@ in
"${nextcloudCustomConfig}:/var/www/html/config/zakobar.config.php:ro"
# Apache MPM limits (caps concurrent PHP processes / disk writers)
"${apacheMpmConfig}:/etc/apache2/mods-available/mpm_prefork.conf:ro"
# Disable JIT — see phpDisableJitConfig comment above for why.
"${phpDisableJitConfig}:/usr/local/etc/php/conf.d/zzz-disable-jit.ini:ro"
];
extraOptions = [
@@ -210,6 +225,8 @@ in
# UID 33 = www-data in the Nextcloud container
# UID 999 = postgres — must own the db dir (creates files directly in it)
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-nextcloud-postgres.service" "podman-nextcloud.service" ];
homey.storage.extraDirs = [
{ path = "nextcloud"; }
{ path = "nextcloud/html"; user = "33"; group = "33"; }
+2
View File
@@ -198,6 +198,8 @@ in
# -----------------------------------------------------------------------
# Storage directories (owned by the ntfy-sh system user)
# -----------------------------------------------------------------------
homey.storage.upholds = [ "ntfy-sh.service" ];
homey.storage.extraDirs = [
{ path = "ntfy"; user = "ntfy-sh"; group = "ntfy-sh"; }
{ path = "ntfy/attachments"; user = "ntfy-sh"; group = "ntfy-sh"; }
+2
View File
@@ -117,6 +117,8 @@ in
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-openldap.service" ];
homey.storage.extraDirs = [
{ path = "openldap"; }
{ path = "openldap/etc-ldap-slapd.d"; }
+2
View File
@@ -152,6 +152,8 @@ in
# -----------------------------------------------------------------------
# Storage directories (UID 1000 = USERMAP_UID in container)
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-paperless-redis.service" "podman-paperless.service" ];
homey.storage.extraDirs = [
{ path = "paperless"; }
{ path = "paperless/data"; user = "1000"; group = "1000"; }
+2
View File
@@ -72,6 +72,8 @@ in
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-stirling-pdf.service" ];
homey.storage.extraDirs = [
{ path = "stirling-pdf"; }
{ path = "stirling-pdf/configs"; mode = "0755"; }
+2
View File
@@ -87,6 +87,8 @@ in
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-transmission.service" ];
homey.storage.extraDirs = [
{ path = "transmission"; user = "1000"; group = "1000"; mode = "0755"; }
{ path = "transmission/config"; user = "1000"; group = "1000"; mode = "0755"; }
+2
View File
@@ -305,6 +305,8 @@ in
# -----------------------------------------------------------------------
# Storage directories
# -----------------------------------------------------------------------
homey.storage.upholds = [ "podman-uptime-kuma.service" ];
homey.storage.extraDirs = [
{ path = "uptime-kuma"; }
];