diff --git a/bundles/nextcloud/files/rescan b/bundles/nextcloud/files/rescan new file mode 100644 index 0000000..2b440d5 --- /dev/null +++ b/bundles/nextcloud/files/rescan @@ -0,0 +1,4 @@ +#!/bin/bash + +php /opt/nextcloud/occ files:scan-app-data +php /opt/nextcloud/occ preview:generate-all diff --git a/bundles/nextcloud/items.py b/bundles/nextcloud/items.py index 662c1b6..8aa5fb9 100644 --- a/bundles/nextcloud/items.py +++ b/bundles/nextcloud/items.py @@ -80,6 +80,15 @@ files = { 'directory:/etc/nextcloud', ], }, + '/opt/nextcloud/rescan': { + 'owner': 'www-data', + 'group': 'www-data', + 'mode': '550', + 'needs': [ + 'directory:/opt/nextcloud', + 'action:extract_nextcloud', + ], + }, } # SETUP diff --git a/bundles/nextcloud/metadata.py b/bundles/nextcloud/metadata.py index b677d0a..ef18055 100644 --- a/bundles/nextcloud/metadata.py +++ b/bundles/nextcloud/metadata.py @@ -68,8 +68,14 @@ defaults = { }, 'systemd-timers': { 'nextcloud-cron': { - 'command': '/usr/bin/sudo -u www-data /usr/bin/php -f /opt/nextcloud/cron.php', + 'command': '/usr/bin/php -f /opt/nextcloud/cron.php', 'when': '*:0/5', + 'user': 'www-data', + }, + 'nextcloud-rescan': { + 'command': '/opt/nextcloud/rescan', + 'when': 'Sun 00:00:00', + 'user': 'www-data', }, }, 'zfs': { diff --git a/bundles/systemd-timers/metadata.py b/bundles/systemd-timers/metadata.py index 4f2868e..7944107 100644 --- a/bundles/systemd-timers/metadata.py +++ b/bundles/systemd-timers/metadata.py @@ -28,6 +28,7 @@ def systemd(metadata): 'Description': f'{name} timer service', }, 'Service': { + 'User': config.get('user', 'root'), 'ExecStart': config['command'], }, }, diff --git a/bundles/tasmota-charge/metadata.py b/bundles/tasmota-charge/metadata.py index 9663440..66433d0 100644 --- a/bundles/tasmota-charge/metadata.py +++ b/bundles/tasmota-charge/metadata.py @@ -6,8 +6,9 @@ defaults = { }, 'systemd-timers': { 'tasmota-charge': { - 'command': f'/usr/bin/sudo -u tasmota-charge /opt/tasmota-charge', + 'command': f'/opt/tasmota-charge', 'when': 'minutely', + 'user': 'tasmota-charge', }, }, }