182 lines
5.1 KiB
Markdown
182 lines
5.1 KiB
Markdown
# cloud.limbosolutions.com
|
|
|
|
Welcome to public repository of [https://cloud.limbosolutions.com](https://cloud.limbosolutions.com)
|
|
|
|
Using [NextCloud](https://nextcloud.com/)
|
|
|
|
- [Integrations](#integrations)
|
|
- [OAuth2/OpenID Provider](#oauth2openid-provider)
|
|
- [whiteboard](#whiteboard)
|
|
- [cli](#cli)
|
|
- [maintenance mode](#maintenance-mode)
|
|
- [scan files](#scan-files)
|
|
- [update mime-types](#update-mime-types)
|
|
- [preview generator](#preview-generator)
|
|
- [repair tree](#repair-tree)
|
|
- [Repair AppData Cache (Fix App Store 500 Error)](#repair-appdata-cache-fix-app-store-500-error)
|
|
- [force create indexes](#force-create-indexes)
|
|
- [documentserver repair](#documentserver-repair)
|
|
- [Mimetype migrations available](#mimetype-migrations-available)
|
|
- [delete file locks](#delete-file-locks)
|
|
- [Setup and Deploy](#setup-and-deploy)
|
|
- [internal logs](#internal-logs)
|
|
- [Database](#database)
|
|
|
|
## Integrations
|
|
|
|
### OAuth2/OpenID Provider
|
|
|
|
- <https://integrations.goauthentik.io/chat-communication-collaboration/nextcloud/#nextcloud-configuration/>
|
|
- <https://github.com/nextcloud/user_oidc>
|
|
- <https://apps.nextcloud.com/apps/user_oidc>
|
|
|
|
### whiteboard
|
|
|
|
``` bash
|
|
php occ config:app:set whiteboard collabBackendUrl --value="https://cloud.limbosolutions.com/whiteboard"
|
|
php occ config:app:set whiteboard jwt_secret_key --value="?????"
|
|
```
|
|
|
|
## cli
|
|
|
|
When on browser error:
|
|
|
|
Please use the command line updater because updating via browser is disabled in your config.php.
|
|
|
|
Execute:
|
|
|
|
``` bash
|
|
php occ upgrade;
|
|
```
|
|
|
|
### maintenance mode
|
|
|
|
``` bash
|
|
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
|
|
|
|
``` bash
|
|
su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ files:scan --all"
|
|
```
|
|
|
|
### update mime-types
|
|
|
|
``` bash
|
|
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>
|
|
|
|
``` bash
|
|
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"
|
|
```
|
|
|
|
``` bash
|
|
# cron job
|
|
php /var/www/nextcloud/occ preview:pre-generate
|
|
```
|
|
|
|
### repair tree
|
|
|
|
``` bash
|
|
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.
|
|
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
|
|
# Rebuild appdata and caches
|
|
su -s /bin/bash www-data -c "php occ db:add-missing-indices"
|
|
```
|
|
|
|
### documentserver repair
|
|
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
|
|
# Rebuild appdata and caches
|
|
su -s /bin/bash www-data -c "php occ maintenance:repair --include-expensive"
|
|
```
|
|
|
|
### delete file locks
|
|
|
|
``` bash
|
|
# execute on mariadb
|
|
DELETE FROM oc_file_locks WHERE 1;
|
|
```
|
|
|
|
## Setup and Deploy
|
|
|
|
- All kustomizations can be executed using vscode task `Kustomize - Build & Deploy - Selected File`.
|
|
- Helm charts can be deployed using vscode task `Apply App`.
|
|
|
|
**Required encrypted filed on repo:**
|
|
|
|
``` bash
|
|
sops -e ./deploy/whiteboard/whiteboard-secrets.dec.yaml > ./deploy/whiteboard/whiteboard-secrets.yaml
|
|
sops -e ./deploy/onlyoffice/onlyoffice-secrets.dec.yaml > ./deploy/onlyoffice/onlyoffice-secrets.yaml
|
|
sops -e ./deploy/backups/backup-secrets.dec.yaml > ./deploy/backups/backup-secrets.yaml
|
|
```
|
|
|
|
## internal logs
|
|
|
|
``` bash
|
|
POD_NAME=$(kubectl get pod -l 'app.kubernetes.io/name'=nextcloud -n cloud-limbosolutions-com -o jsonpath='{.items[0].metadata.name}')
|
|
kubectl exec -it ${POD_NAME} -- cat /var/www/html/data/nextcloud.log
|
|
```
|
|
|
|
## Database
|
|
|
|
**Connect to db:**
|
|
|
|
``` bash
|
|
kubectl exec -it nextcloud-mariadb-0 -- mariadb -u nextcloud -h nextcloud-mariadb.cloud-limbosolutions-com.svc.cluster.local -p
|
|
```
|
|
|
|
**Restore database:**
|
|
|
|
``` bash
|
|
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
|
|
```
|