From 83455a90689e2095d2c94b8c56c6bbd3b66a1959 Mon Sep 17 00:00:00 2001
From: kqmaverick <121722567+kqmaverick@users.noreply.github.com>
Date: Tue, 10 Dec 2024 05:28:49 -0700
Subject: [PATCH] docs(nextcloud): update nextcloud guides (#29799)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
**Description**
Update nextcloud gudies with yalm examples.
⚒️ Fixes #
**⚙️ Type of change**
- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code
**🧪 How Has This Been Tested?**
**📃 Notes:**
**✔️ Checklist:**
- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [ ] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):` or `chore(chart-name):`
**➕ App addition**
If this PR is an app addition please make sure you have done the
following.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`
---
_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
---
.../docs/backup-restore-migrate-guide.mdx | 181 ------------------
.../nextcloud/docs/changingpassword.md | 26 ---
.../nextcloud/docs/installation-notes.md | 112 ++++++++---
3 files changed, 82 insertions(+), 237 deletions(-)
delete mode 100644 charts/premium/nextcloud/docs/backup-restore-migrate-guide.mdx
diff --git a/charts/premium/nextcloud/docs/backup-restore-migrate-guide.mdx b/charts/premium/nextcloud/docs/backup-restore-migrate-guide.mdx
deleted file mode 100644
index 16f10176c22..00000000000
--- a/charts/premium/nextcloud/docs/backup-restore-migrate-guide.mdx
+++ /dev/null
@@ -1,181 +0,0 @@
----
-title: Nextcloud Backup, Restore and Migration Guide
----
-
-This guide can will walk through the process of backing up and existing Nextcloud installation and how to restore or migrate that installation. This guide utilize HostPath or NFS for UserData.
-
-## Backup
-
-:::danger[SMB EXTERNAL STORAGE]
-
-If you are using SMB authenticated external storage on your Nextcloud remove it before starting this guide. The migration process will fail if it is not removed.
-
-:::
-
-:::danger[TWO FACTOR AUTHENTICATION]
-
-If you are using two factor authentication on your Nextcloud accounts disable it before starting this guide. While it can be done via the CLI later it is much easier to disable it before hand.
-
-:::
-
-### Backup Database
-
-If you have not already done so install PGAdmin and the [tcdbinfo.sh script](/
-
-import { Steps } from '@astrojs/starlight/components';
-
-
-
-1. Run the tcdbinfo.sh script and take note of the connection info
-
- ```bash title="List Database Info"
- bash tcdbinfo.sh
- ```
-
- 
-
-2. Add Nextcloud to PGAdmin using the connection info from previous step.
- 
- 
-3. Backup Nextcloud database.
- 
-
-
-
-### Backup User Data
-
-If you are using HostPath of NFS for UserData then no further action is required. If you are using PVC for UserData then you will first need to mount your Nextcloud PVC and copy your UserData to a new dataset.
-
-## Restore
-
-### Remove Old AppData
-
-This step is not required but to have a clean installation remove all UserData folder and files that are not user folders.
-
-```bash title="List Files"
-ls -la
-```
-
-
-
-:::caution
-
-Next steps are destructive without a way to undo. Make sure you have proper backups to avoid data loss.
-
-You have been **warned**
-
-```bash title="Remmove Old Nextcloud Users/Folders"
-rm -rf
-```
-
-```bash title="Remove Old Nextcloud Files"
-rm .ocdata .htaccess index.html nextcloud.log
-```
-
-
-
-:::
-
-### Verify User Data Permissions
-
-Nextcloud uses apps for file ownership. Apply permissions as shown below to your User Data dataset.
-
-
-
-### Install Nextcloud
-
-Install with a temporary admin user that you do not currently use for Nextcloud (ie. temp)
-
-:::caution[UNIQUE USER]
-
-If you do not install with a unique user the install will fail because Nexctloud will be unable to create the user folder when one already exists
-
-:::
-
-Setup Nextcloud User Data storage with your previous User Data dataset or the dataset you copied your User Data to.
-
-
-
-### Restore Database
-
-:::caution[Nextcloud Installation]
-
-Wait for Nextcloud to fully deploy before proceeding.
-
-:::
-
-
-
-1. Stop the main pod of Nextcloud.
-
- ```bash title="Stop Main Pod of Nextcloud"
- k3s kubectl scale deploy nextcloud -n ix-nextcloud --replicas=0
- ```
-
-2. Add Nextcloud to PGAdmin as guided in [steps 1 and 2 here](#backup-database).
-3. In PGAdmin right click on the database and select restore as shown below.
- 
-4. Select the database backup you created previously.
- 
-5. Configure Data/Objects as shown below.
- 
-6. Configure Options as shown below and click restore.
- 
-
- :::caution[PGAdmin Error]
-
- PGAdmin may display an error during the restore process. This is known to occur and may be ignored.
-
- :::
-
-7. Start the main pod of Nextcloud.
-
- ```bash title="Start Main Pod of Nextcloud"
- k3s kubectl scale deploy nextcloud -n ix-nextcloud --replicas=1
- ```
-
-
-
-### OCC Commands
-
-:::caution[Nextcloud Deploy]
-
-Wait for Nextcloud to fully deploy before proceeding.
-
-:::
-
-
-
-1. Open a shell for the Nextcloud main pod as shown below. Ensure your are selecting the correct pod it should just say nextcloud for both Pods (followed by random characters only) and Containers as shown below.
- 
-2. Run the following commands in the Nextcloud shell.
-
- ```bash title="Run Upgrade"
- occ upgrade
- ```
-
- ```bash title="Turn On Maintenance Mode"
- occ maintenance:mode --on
- ```
-
- ```bash title="Run Repair"
- occ maintenance:repair
- ```
-
- ```bash title="Turn Off Maintenance Mode"
- occ maintenance:mode --off
- ```
-
- ```bash title="title="Add Missing Database Indices"
- occ db:add-missing-indices
- ```
-
- ```bash title="Scan All User Files"
- occ files:scan --all
- ```
-
-
-
-### Delete Temporary User Data Folder
-
-You may now remove the folder created during install for the temporary user that was configured.
diff --git a/charts/premium/nextcloud/docs/changingpassword.md b/charts/premium/nextcloud/docs/changingpassword.md
index 586a6f771c0..4342c5d9e2b 100644
--- a/charts/premium/nextcloud/docs/changingpassword.md
+++ b/charts/premium/nextcloud/docs/changingpassword.md
@@ -5,8 +5,6 @@ title: Changing Database Password
Sadly enough, Nextcloud Containers do not correctly update database passwords when changed.
To do so, please execute the following steps to do so manually:
-## Other Platforms
-
Due to other platforms do all having the same storage backend, it depends on your storage backend how you do this.
It might be advisable to change the password within nextcloud _before_ changing the password on the cnpg database.
@@ -14,27 +12,3 @@ In summary:
- Access the config PVC
- Edit config.php to ensure "dbpassword" reflects your password
-
-## TrueNAS SCALE
-
-1. Mount Nextcloud with HeavyScript, ex:
- heavyscript pvc --mount nextcloud
-
-2. Change to the mounted path, then to the nextcloud-config folder, ex:
- cd /mnt/mounted_pvc/nextcloud/nextcloud-config
-
-3. grep out dbpassword, ex:
- cat config.php | grep "dbpassword"
-
-4. Copy the value from the grep command, should look something like: dF6h35JFX5v6AzfFpviFAoBbZU9cghKrwHWJf9GY5oRmYJEaiTHkYz93JPUgRf
- Change to your home directory, or exit the terminal, ex:
- cd ~
-
-5. Unmount Nextcloud with HeavyScript, ex:
- heavyscript pvc --unmount nextcloud
-
-6. Open TrueNAS UI > Apps > Nextcloud > Edit, and scroll down to the CNPG section and replace PLACEHOLDERPASSWORD under the password field, with the grep value (from step 3-4), then save
- If a failure happens here regarding cannot upgrade between pg versions then change the Postgres Version under CNPG settings to 15 if its 16 and attempt to save again
-
-7. Start with heavyscript, ex:
- heavyscript app --start nextcloud
diff --git a/charts/premium/nextcloud/docs/installation-notes.md b/charts/premium/nextcloud/docs/installation-notes.md
index 3e50c5be962..5151c7010f8 100644
--- a/charts/premium/nextcloud/docs/installation-notes.md
+++ b/charts/premium/nextcloud/docs/installation-notes.md
@@ -4,22 +4,7 @@ title: Installation Notes
## Requirements
-1. The Cloudnative-PG operator is required from the `system` train. More information can be found on our [getting started guide](/
-
-2. Ingress is required to be configured. The preferred and supported method for ingress is Traefik. More information can be
- found on our [getting started guide](/.
-
-:::caution[SNAPSHOT DIRECTORY VISIBILITY]
-
-Nextcloud installation will fail if the application or user data datasets have Snapshot Directory set to Visible (invisible by default). Return this setting to default prior to installation.
-
-:::
-
-## User Data Permissions
-
-If you plan to use HostPath or NFS to store user data then the permissions for the dataset will need to be set as shown below.
-
-
+Ingress is required to be configured. The preferred and supported method for ingress is Traefik. More information can be found on our [getting started guide](/.
## Nextcloud Configurations
@@ -27,11 +12,20 @@ If you plan to use HostPath or NFS to store user data then the permissions for t
The following configurations must be set during initial setup in order for Nextcloud to deploy.
-1. An initial admin username needs to be set
-
-2. An initial admin password needs to be set.
-
-3. Default phone region needs to be set (if you are unsure about your region, you can find your code for your region in this [wiki](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements))
+```yaml
+// values.yaml
+nextcloud:
+ credentials:
+ # An admin username needs to be set
+ initialAdminUser: admin
+ # An admin password needs to be set.
+ initialAdminPassword: somepassword
+ general:
+ # The default phone region needs to be set (if you are unsure about your region, you can find your code for your region in this [wiki](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements))
+ default_phone_region: US
+ # You must set `accessIP` to the ip address used by _Traefik_
+ accessIP: 192.168.0.10
+```
:::caution[Password Requirements]
@@ -41,15 +35,73 @@ Due to limitations when converting YAML to JSON, the passwords used with Nextclo
### Optional Addons
-1. Notify Push (Allows Nextcloud to notify clients of changes, instead of clients having to poll. A Notify Push container will be deployed automatically). This is highly recommended to keep enabled.
-
-2. ClamAV (Anti-virus for Nextcloud, keep in mind that only scans files that Nextcloud posts to its endpoint. A Clam AV container will be deployed automatically.
-
-3. Collabora (document editor for Nextcloud. A Collabora container will be deployed automatically.
-
-4. Only Office (document editor for Nextcloud, this does **NOT** deploy the Only Office container.
- You will need to have a separate installation.
+```yaml
+// values.yaml
+nextcloud:
+# ClamAV (Anti-virus for Nextcloud, keep in mind that only scans files that Nextcloud posts to its endpoint. A Clam AV container will be deployed automatically.
+ clamav:
+ enabled: true
+ stream_max_length: 26214400
+ file_max_size: -1
+ infected_action: only_log
+# Notify Push (Allows Nextcloud to notify clients of changes, instead of clients having to poll. A Notify Push container will be deployed automatically). This is highly recommended to keep enabled.
+ notify_push:
+ enabled: true
+# Collabora (document editor for Nextcloud. A Collabora container will be deployed automatically.
+ collabora:
+ enabled: true
+ # default|compact|tabbed
+ interface_mode: default
+ username: admin
+ password: changeme
+ dictionaries:
+ - de_DE
+ - en_GB
+ - en_US
+ - el_GR
+ - es_ES
+ - fr_FR
+ - pt_BR
+ - pt_PT
+ - it
+ - nl
+ - ru
+# Only Office (document editor for Nextcloud, this does **NOT** deploy the Only Office container. You will need to have a separate installation.
+ onlyoffice:
+ enabled: false
+ url: ""
+ internal_url: ""
+ verify_ssl: true
+ jwt: ""
+ jwt_header: Authorization
+```
### Storage
-You can change the User Data Storage option to your preference here if you previously setup the proper dataset permissions. All other Storage should remain the default of PVC.
+You can change the User Data Storage option to your preference here. All other Storage should remain the default of PVC.
+
+```yaml
+// values.yaml
+persistence:
+ data:
+ enabled: true
+ type: nfs
+ path: /mnt/data/nextcloud
+ server: 192.168.1.100
+ targetSelector:
+ main:
+ main:
+ mountPath: /var/www/html/data
+ init-perms:
+ mountPath: /var/www/html/data
+ nextcloud-cron:
+ nextcloud-cron:
+ mountPath: /var/www/html/data
+ preview-cron:
+ preview-cron:
+ mountPath: /var/www/html/data
+ nginx:
+ nginx:
+ mountPath: /var/www/html/data
+ readOnly: true
+```