Skip to content

Commit 260655e

Browse files
committed
Add automated maintenance, fixes some warning in the admin panel
1 parent 7f0c542 commit 260655e

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
@@ -190,6 +193,10 @@ if occ config:system:get installed >/dev/null 2>&1; then
190193
echo "Setting admin password"
191194
occ user:resetpassword --password-from-env "${ADMIN_USER:-admin}"
192195
fi
196+
197+
# Run maintenance steps, this also fixes warnings in the admin panel
198+
occ db:add-missing-indices
199+
occ maintenance:repair --include-expensive
193200
else
194201
echo "After completing the web-based installer, restart the Nextcloud container to apply default memory caching and transactional file locking configurations."
195202
echo "Alternatively, you can apply your own configurations by editing /config/www/nextcloud/config/config.php following the documentation:"

0 commit comments

Comments
 (0)