diff --git a/README.md b/README.md index 17e5091e0888b2dca4fce8a7de9257e87298ffa0..702c076a29ae4d8992a7d3b600680cfa2dd8fe24 100644 --- a/README.md +++ b/README.md @@ -107,12 +107,19 @@ through the Apps screen in Nextcloud. Apps that are installed this way are automatically updated to their newest version every time Nextcloud is updated. -To install apps, edit the values.yaml file: +To install apps, you can add entries to the following helm values. +- `default` if this app will part of the Stackspin defaults. +- `custom` if you're installing this app only for a specific cluster. +These apps will then be installed when the Nextcloud pod starts. Both `default` and `custom` are treated the same way -- we have both to make it easier to organize your helm values. ```yaml apps: - - name: sociallogin # Installs sociallogin app - enabled: false # Disables sociallogin by default + default: + - name: sociallogin # Installs sociallogin app + enabled: false # Disables sociallogin by default + custom: + - name: polls + enabled: false ``` Note that manually enabled apps will not be disabled upon rerunning the installer, @@ -126,17 +133,18 @@ To install an app from GitHub releases: ```yaml apps: - - name: onlyoffice - # The name of the repository. This is the name for a repository located at - # https://github.com/ONLYOFFICE/onlyoffice-nextcloud: - github_repository: ONLYOFFICE/onlyoffice-nextcloud - # The version to install or upgrade the app to - version: 7.5.4 - # The name of the "asset" to download from this release. This name can be - # found on https://github.com/ONLYOFFICE/onlyoffice-nextcloud/releases - release_filename: onlyoffice.tar.gz - # Enable the app after installing it - enabled: true + default: + - name: onlyoffice + # The name of the repository. This is the name for a repository located at + # https://github.com/ONLYOFFICE/onlyoffice-nextcloud: + github_repository: ONLYOFFICE/onlyoffice-nextcloud + # The version to install or upgrade the app to + version: 7.5.4 + # The name of the "asset" to download from this release. This name can be + # found on https://github.com/ONLYOFFICE/onlyoffice-nextcloud/releases + release_filename: onlyoffice.tar.gz + # Enable the app after installing it + enabled: true ``` diff --git a/templates/nextcloud-onlyoffice-config.yaml b/templates/nextcloud-onlyoffice-config.yaml index b3fddb344927aa7440fe08037a365272db627506..f8c22f73aca5c605d4d26faf037e5aaf5118a10b 100644 --- a/templates/nextcloud-onlyoffice-config.yaml +++ b/templates/nextcloud-onlyoffice-config.yaml @@ -126,7 +126,8 @@ data: echo "app versions found" # Install all apps declared in the `apps` helm values array - {{- range .Values.apps }} + {{- range $apps_type, $apps := .Values.apps }} + {{- range $apps }} {{- if not .name }} echo "Skipping app {{ . }} without name variable set" {{- else if and .github_repository .version .release_filename }} @@ -177,8 +178,9 @@ data: {{- if .enabled }} # Enable {{ .name }} app run_as "php $occ app:enable {{ .name }}" - {{ end }} # end if .enabled - {{ end }} # end range .Values.apps + {{- end }} # end if .enabled + {{- end }} # end range $apps + {{- end }} # end range .Values.apps # Some of the manually installed apps might need to run upgrade scripts, run # them now diff --git a/templates/tests/cypress-test-nc-oo.yaml b/templates/tests/cypress-test-nc-oo.yaml index ac63bf1062e67d9fc949630156a8764ae6272f3d..833697f5b45f68886e27f275ef526408baae6258 100644 --- a/templates/tests/cypress-test-nc-oo.yaml +++ b/templates/tests/cypress-test-nc-oo.yaml @@ -80,7 +80,7 @@ spec: {{- end }} {{- end }} - name: INSTALLED_APPS - value: "{{ range .Values.apps }}{{ .name }},{{ end }}" + value: "{{- range $apps_type, $apps := .Values.apps }}{{- range $apps }}{{ .name }},{{ end }}{{ end }}" volumeMounts: - name: cypress-config mountPath: /e2e diff --git a/values-local.yaml.example b/values-local.yaml.example index 5dcccbc7b91c709092260109cc75f601041ee6e9..c7b6fbebaed2b455234218b48355aea65fad510e 100644 --- a/values-local.yaml.example +++ b/values-local.yaml.example @@ -67,22 +67,25 @@ rabbitmq: # apps controls which apps will be installed and enabled in nextcloud # apps: -# - name: sociallogin -# # apps[0].enabled needs to be set to true if you want to enable login via an external -# # oauth server. In that case you need to configure all the values in `sociallogin` -# enabled: false -# - name: onlyoffice -# enabled: true -# - name: polls -# # Install an app from a github repository. This has the advantage that you -# # can pin the version number, so it does not get auto-updated to breaking -# # versions. -# # Note: you can use the version number in the release_filename variable if -# # needed, as written here: -# github_repository: nextcloud/polls -# version: 3.8.1 -# release_filename: polls-{{ .version }}.tar.gz -# enabled: true +# default: +# - name: sociallogin +# # apps[0].enabled needs to be set to true if you want to enable login via an external +# # oauth server. In that case you need to configure all the values in `sociallogin` +# enabled: false +# - name: onlyoffice +# enabled: true +# custom: +# # Apps you want to add that are not part of Stackspin defaults. +# - name: polls +# # Install an app from a github repository. This has the advantage that you +# # can pin the version number, so it does not get auto-updated to breaking +# # versions. +# # Note: you can use the version number in the release_filename variable if +# # needed, as written here: +# github_repository: nextcloud/polls +# version: 3.8.1 +# release_filename: polls-{{ .version }}.tar.gz +# enabled: true # sociallogin enables login via oAuth/Open-ID Connect # sociallogin: diff --git a/values.yaml b/values.yaml index 7c5073a4b90cb3be0b5d74710c1e7ac4a99ce8e2..108a04e9c5501430650b46d56a4ca1ea7bd25746 100644 --- a/values.yaml +++ b/values.yaml @@ -61,22 +61,23 @@ nextcloud: - "/var/local/setup-apps.sh" apps: - - name: sociallogin - # apps[0].enabled needs to be set to true if you want to enable login via an external - # oauth server. In that case you need to configure all the values in `sociallogin` - enabled: false - # Line order is important here for renovatebot! first github_repository, - # then version - github_repository: zorn-v/nextcloud-social-login - version: v5.4.3 - release_filename: release.tar.gz - - name: onlyoffice - # Line order is important here for renovatebot! first github_repository, - # then version - github_repository: ONLYOFFICE/onlyoffice-nextcloud - version: v7.8.0 - release_filename: onlyoffice.tar.gz - enabled: true + default: + - name: sociallogin + # apps[0].enabled needs to be set to true if you want to enable login via an external + # oauth server. In that case you need to configure all the values in `sociallogin` + enabled: false + # Line order is important here for renovatebot! first github_repository, + # then version + github_repository: zorn-v/nextcloud-social-login + version: v5.4.3 + release_filename: release.tar.gz + - name: onlyoffice + # Line order is important here for renovatebot! first github_repository, + # then version + enabled: true + github_repository: ONLYOFFICE/onlyoffice-nextcloud + version: v7.8.0 + release_filename: onlyoffice.tar.gz setupApps: # How many times the setup-apps job can try and fail before it is marked as