Files
nextcloud/README.md
Márcio Fernandes 4de754d763
Some checks failed
/ continuous-deploy (push) Failing after 14s
modified: README.md
2026-04-09 13:40:52 +01:00

5.0 KiB
Raw Blame History

cloud.limbosolutions.com

Welcome to public repository of https://cloud.limbosolutions.com

Using NextCloud

Integrations

OAuth2/OpenID Provider

cli

su -s /bin/bash www-data -c "php occ upgrade;"

maintenance mode

su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ maintenance:mode --on;"
su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ maintenance:mode --off"

scan files

su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ files:scan --all"

update mime-types

su -s /bin/bash www-data -c "php /var/www/html/occ maintenance:mimetype:update-db"
su -s /bin/bash www-data -c "php /var/www/html/occ maintenance:mimetype:update-js"

preview generator

https://apps.nextcloud.com/apps/previewgenerator

su -s /bin/bash www-data -c "./occ preview:generate-all -vvv"
su -s /bin/bash www-data -c "./occ preview:generate-all --path=marcio.fernandes/files/Photos -vvv"
# cron job
 php /var/www/nextcloud/occ preview:pre-generate 

repair tree

su -s /bin/bash www-data -c "php occ files:repair-tree"

Repair AppData Cache (Fix App Store 500 Error)

When the App Store returns HTTP 500, the cause is usually stale filecache entries pointing to missing files inside appdata_*. This procedure clears the broken cache and forces Nextcloud to rebuild it.

# Enable maintenance mode
su -s /bin/bash www-data -c "php occ maintenance:mode --on;"

# Remove stale filecache entries (run inside MariaDB)
mariadb -u root -p nextcloud -e "DELETE FROM oc_filecache WHERE path LIKE 'appdata_ocuihfjhxkga/appstore%';"

# Remove corrupted appdata folder
rm -rf /var/www/html/data/appdata_*

# Disable maintenance mode
su -s /bin/bash www-data -c "php occ maintenance:mode --off"

# Rebuild appdata and caches
su -s /bin/bash www-data -c "php occ maintenance:repair"

force create indexes


# Rebuild appdata and caches
su -s /bin/bash www-data -c "php occ db:add-missing-indices"

documentserver repair

# Rebuild appdata and caches
su -s /bin/bash www-data -c "php occ onlyoffice:documentserver --clear"
su -s /bin/bash www-data -c "php occ maintenance:repair"
su -s /bin/bash www-data -c "php occ files:scan-app-data"

Mimetype migrations available


# Rebuild appdata and caches
su -s /bin/bash www-data -c "php occ maintenance:repair --include-expensive"

delete file locks

# execute on mariadb
DELETE FROM oc_file_locks WHERE 1;

Setup and Deploy

App

Security context:

This script is intended to be executed only by lowprivilege deployment identities, such as the continuousdeploy ServiceAccount or an application maintainer with equivalent permissions.

./ops-scripts/apply-app.sh

Responsibilities:

  • Database deployment
  • Persistent Volume Claims (storage.limbosolutions.com)
  • Nextcloud Helm chart deployment
  • Backup job deployment

Requirements:

Infra

Security context: This script requires elevated clusterlevel permissions and must be executed only by platform maintainers, not by the continuousdeploy identity.

./ops-scripts/apply-infra.sh

Responsibilities:

  • Ingress controller deployment
  • Persistent storage provisioning (storage.limbosolutions.com)
  • services accounts:
    • Continuous deploy - Deployment RBAC (ServiceAccount + Role + RoleBinding)

Database

Connect to db:

kubectl exec -it nextcloud-mariadb-0 -- mariadb -u nextcloud -h nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local -p

Restore database:

kubectl run mysql-client -i --rm \
  --image=mysql:latest --restart=Never -- \
   mysql -h nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local \
   -u ???? -p???? nextcloud < ./tmp/host-nextcloud-full-backup.sql