mirror of
https://github.com/truecharts/charts.git
synced 2026-08-03 00:11:23 -03:00
fix(nextcloud): Correctly make use of accessIP when no ingress is enabled (#9720)
**Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 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?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [x] 📄 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 - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ 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._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
@@ -29,7 +29,7 @@ sources:
|
||||
- https://github.com/nextcloud/docker
|
||||
- https://github.com/nextcloud/helm
|
||||
type: application
|
||||
version: 20.0.0
|
||||
version: 20.0.1
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- cloud
|
||||
|
||||
@@ -49,7 +49,7 @@ questions:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: run_optimize
|
||||
label: Run Optiomize Scripts
|
||||
label: Run Optimize Scripts
|
||||
description: |
|
||||
Runs the following commands at startup:</br>
|
||||
occ db:add-missing-indices</br>
|
||||
@@ -59,10 +59,6 @@ questions:
|
||||
occ maintenance:mimetype:update-js</br>
|
||||
occ maintenance:mimetype:update-db</br>
|
||||
occ maintenance:update:htaccess</br>
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
{{/* Define the configmap */}}
|
||||
{{- define "nextcloud.configmaps" -}}
|
||||
{{- $fullname := (include "tc.v1.common.lib.chart.names.fullname" $) -}}
|
||||
{{- $urlNoProtocol := regexReplaceAll ".*://(.*)" .Values.chartContext.APPURL "${1}" -}}
|
||||
{{- $protocolOnly := regexReplaceAll "(.*)://.*" .Values.chartContext.APPURL "${1}" -}}
|
||||
{{- $accessUrl := .Values.chartContext.APPURL -}}
|
||||
{{- if or (contains "127.0.0.1" $accessUrl) (contains "localhost" $accessUrl) -}}
|
||||
{{- if .Values.nextcloud.general.accessIP -}}
|
||||
{{- $prot := "http" -}}
|
||||
{{- $host := .Values.nextcloud.general.accessIP -}}
|
||||
{{- $port := .Values.service.main.ports.main.port -}}
|
||||
{{/*
|
||||
Allowing here to override protocol and port
|
||||
should be enough to make it work with any rev proxy
|
||||
*/}}
|
||||
{{- $accessUrl = printf "%v://%v:%v" $prot $host $port -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $accessHostPort := regexReplaceAll ".*://(.*)" $accessUrl "${1}" -}}
|
||||
{{- $accessProtocol := regexReplaceAll "(.*)://.*" $accessUrl "${1}" -}}
|
||||
{{- $redisHost := .Values.redis.creds.plainhost | trimAll "\"" -}}
|
||||
{{- $redisPass := .Values.redis.creds.redisPassword | trimAll "\"" -}}
|
||||
{{- $healthHost := "kube.internal.healthcheck" -}}
|
||||
@@ -72,11 +85,7 @@ nextcloud-config:
|
||||
{{/* Notify Push */}}
|
||||
NX_NOTIFY_PUSH: {{ .Values.nextcloud.notify_push.enabled | quote }}
|
||||
{{- if .Values.nextcloud.notify_push.enabled }}
|
||||
{{- $endpoint := .Values.chartContext.APPURL -}}
|
||||
{{- if or (contains "127.0.0.1" $endpoint) (contains "localhost" $endpoint) -}}
|
||||
{{- $endpoint = printf "http://%v:%v" $fullname .Values.service.main.ports.main.port -}}
|
||||
{{- end }}
|
||||
NX_NOTIFY_PUSH_ENDPOINT: {{ $endpoint }}/push
|
||||
NX_NOTIFY_PUSH_ENDPOINT: {{ $accessUrl }}/push
|
||||
{{- end }}
|
||||
|
||||
{{/* Previews */}}
|
||||
@@ -151,10 +160,10 @@ nextcloud-config:
|
||||
{{- end }}
|
||||
|
||||
{{/* URLs */}}
|
||||
NX_OVERWRITE_HOST: {{ $urlNoProtocol }}
|
||||
NX_OVERWRITE_CLI_URL: {{ .Values.chartContext.APPURL }}
|
||||
NX_OVERWRITE_HOST: {{ $accessHostPort }}
|
||||
NX_OVERWRITE_CLI_URL: {{ $accessUrl }}
|
||||
# Return the protocol part of the URL
|
||||
NX_OVERWRITE_PROTOCOL: {{ $protocolOnly | lower }}
|
||||
NX_OVERWRITE_PROTOCOL: {{ $accessProtocol | lower }}
|
||||
# IP (or range in this case) of the proxy(ies)
|
||||
NX_TRUSTED_PROXIES: |
|
||||
{{ .Values.chartContext.svcCIDR }}
|
||||
@@ -166,8 +175,8 @@ nextcloud-config:
|
||||
{{ $fullname }}
|
||||
{{ printf "%v-*" $fullname }}
|
||||
{{ $healthHost }}
|
||||
{{- if ne $urlNoProtocol "127.0.0.1" }}
|
||||
{{- $urlNoProtocol | nindent 6 }}
|
||||
{{- if not (contains "127.0.0.1" $accessHostPort) }}
|
||||
{{- $accessHostPort | nindent 6 }}
|
||||
{{- end -}}
|
||||
{{- with .Values.nextcloud.general.accessIP }}
|
||||
{{- . | nindent 6 }}
|
||||
|
||||
Reference in New Issue
Block a user