Skip to content

Commit 0f428e0

Browse files
committed
Add automated maintenance, fixes some warning in the admin panel
1 parent c44e9c6 commit 0f428e0

File tree

1 file changed

+7
-0
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-nextcloud-config

1 file changed

+7
-0
lines changed

root/etc/s6-overlay/s6-rc.d/init-nextcloud-config/run

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ if occ config:system:get installed >/dev/null 2>&1; then
181181
if ! occ config:system:get datadirectory >/dev/null 2>&1; then
182182
occ config:system:set datadirectory --value='/data'
183183
fi
184+
if ! occ config:system:get maintenance_window_start >/dev/null 2>&1; then
185+
occ config:system:set maintenance_window_start --value=4 --type=integer
186+
fi
184187
if ! occ config:system:get upgrade.disable-web >/dev/null 2>&1; then
185188
occ config:system:set upgrade.disable-web --value=true --type=boolean
186189
fi
@@ -191,6 +194,10 @@ if occ config:system:get installed >/dev/null 2>&1; then
191194
export OC_PASS=${ADMIN_PASS}
192195
occ user:resetpassword --password-from-env "${ADMIN_USER:-admin}"
193196
fi
197+
198+
# Run maintenance steps, this also fixes warnings in the admin panel
199+
occ db:add-missing-indices
200+
occ maintenance:repair --include-expensive
194201
else
195202
echo "After completing the web-based installer, restart the Nextcloud container to apply default memory caching and transactional file locking configurations."
196203
echo "Alternatively, you can apply your own configurations by editing /config/www/nextcloud/config/config.php following the documentation:"

0 commit comments

Comments
 (0)