fix(nextcloud): multiple small fixes (#3580)

* add non-blocking hpb url addition

* fix(nextcloud): multiple small fixes

* set default phone region to US to remove useless error

* fix typo

* Update charts/stable/nextcloud/templates/_hpb.tpl

Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>

* Update charts/stable/nextcloud/templates/_hpb.tpl

Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>

* set CLI url before the rest of the commands are executed

* small verbosity tweaks

Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Kjeld Schouten-Lebbing
2022-08-26 15:01:18 +00:00
committed by GitHub
co-authored by Stavros Kois
parent 6c5aa110ce
commit dc26a93fb6
4 changed files with 24 additions and 44 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ sources:
- https://github.com/nextcloud/docker - https://github.com/nextcloud/docker
- https://github.com/nextcloud/helm - https://github.com/nextcloud/helm
type: application type: application
version: 15.2.46 version: 15.3.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- cloud - cloud
+1 -1
View File
@@ -80,7 +80,7 @@ questions:
schema: schema:
type: string type: string
valid_chars: '^[A-Z]{2}$' valid_chars: '^[A-Z]{2}$'
default: "" default: "US"
- variable: imaginary - variable: imaginary
group: "Container Configuration" group: "Container Configuration"
label: "Preview Generation Configuration" label: "Preview Generation Configuration"
+13 -27
View File
@@ -57,11 +57,11 @@ command:
until [ -f /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push ] until [ -f /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push ]
do do
sleep 10 sleep 10
echo "Notify_push not found... waiting..." echo "Notify_push app not found... waiting..."
done done
echo "Waiting for Nextcloud to start..." echo "Waiting for Nextcloud to start..."
until $(curl --output /dev/null --silent --head --fail -H "Host: test.fakedomain.dns" http://127.0.0.1:8080/status.php); do until $(curl --output /dev/null --silent --head --fail -H "Host: test.fakedomain.dns" http://127.0.0.1:8080/status.php); do
echo "Nextcloud not found... waiting..." echo "Nextcloud not responding... waiting..."
sleep 10 sleep 10
done done
until $(curl --silent --fail -H "Host: test.fakedomain.dns" http://127.0.0.1:8080/status.php | jq --raw-output '.installed' | grep "true"); do until $(curl --silent --fail -H "Host: test.fakedomain.dns" http://127.0.0.1:8080/status.php | jq --raw-output '.installed' | grep "true"); do
@@ -71,6 +71,16 @@ command:
echo "Nextcloud instance with Notify_push found... Launching High Performance Backend..." echo "Nextcloud instance with Notify_push found... Launching High Performance Backend..."
/var/www/html/custom_apps/notify_push/bin/x86_64/notify_push /var/www/html/config/config.php & /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push /var/www/html/config/config.php &
{{- $accessurl := ( printf "http://%v:%v" ( .Values.env.AccessIP | default ( printf "%v-%v" .Release.Name "nextcloud" ) ) .Values.service.main.ports.main.port ) }}
{{- if .Values.ingress.main.enabled }}
{{- with (first .Values.ingress.main.hosts) }}
{{- $accessurl = ( printf "https://%s" .host ) }}
{{- end }}
{{- end }}
echo "Configuring CLI url..."
php /var/www/html/occ config:system:set overwrite.cli.url --value='{{ $accessurl }}/'
{{- if .Values.imaginary.enabled }} {{- if .Values.imaginary.enabled }}
echo "Imaginary High Performance Previews enabled, enabling it on Nextcloud..." echo "Imaginary High Performance Previews enabled, enabling it on Nextcloud..."
php /var/www/html/occ config:system:set preview_imaginary_url --value='http://127.0.0.1:9090' php /var/www/html/occ config:system:set preview_imaginary_url --value='http://127.0.0.1:9090'
@@ -108,37 +118,13 @@ command:
{{ if .Values.imaginary.preview_font }}php /var/www/html/occ config:system:set enabledPreviewProviders {{ $c }} --value='OC\Preview\Font'{{ $c = add1 $c }}{{ end }} {{ if .Values.imaginary.preview_font }}php /var/www/html/occ config:system:set enabledPreviewProviders {{ $c }} --value='OC\Preview\Font'{{ $c = add1 $c }}{{ end }}
{{- end }} {{- end }}
# Set overwrite.cli.uri
{{- $url := ( printf "http://%s:{{ .Values.service.main.ports.main.port }}/" ( .Values.env.AccessIP | default ( printf "%v-%v" .Release.Name "nextcloud" ) ) ) }}
{{- if .Values.ingress.main.enabled }}
{{- with (first .Values.ingress.main.hosts) }}
{{- $url = ( printf "https://%s/" .host ) }}
{{- end }}
{{- end }}
php /var/www/html/occ config:system:set overwrite.cli.url --value='{{ $url }}'
# Set default phone region # Set default phone region
{{- with .Values.nextcloud.default_phone_region | upper }} {{- with .Values.nextcloud.default_phone_region | upper }}
php /var/www/html/occ config:system:set default_phone_region --value='{{ . }}' php /var/www/html/occ config:system:set default_phone_region --value='{{ . }}'
{{- end }} {{- end }}
until $(curl --output /dev/null --silent --head --fail -H "Host: test.fakedomain.dns" http://127.0.0.1:7867/push/test/cookie); do
echo "High Performance Backend not running ... waiting..."
sleep 10
done
{{- $accessurl := ( printf "http://%v:%v" ( .Values.env.AccessIP | default ( printf "%v-%v" .Release.Name "nextcloud" ) ) .Values.service.main.ports.main.port ) }}
{{- if .Values.ingress.main.enabled }}
{{- with (first .Values.ingress.main.hosts) }}
{{- $accessurl = ( printf "https://%s" .host ) }}
{{- end }}
{{- end }}
until $(curl --output /dev/null --silent --head --fail {{ $accessurl }}/push/test/cookie); do
echo "High Performance Backend service not accessable ... waiting..."
sleep 10
done
echo "High Performance Backend found..."
echo "Configuring High Performance Backend for url: {{ $accessurl }}" echo "Configuring High Performance Backend for url: {{ $accessurl }}"
php /var/www/html/occ notify_push:setup {{ $accessurl }}/push php /var/www/html/occ config:app:set notify_push base_endpoint --value='{{ $accessurl }}/push'
fg fg
EOF EOF
env: env:
+9 -15
View File
@@ -103,22 +103,15 @@ initContainers:
- "-c" - "-c"
- | - |
/bin/bash <<'EOF' /bin/bash <<'EOF'
if [[ -f /data/config/config.php ]] && [[ ! -f /html/config/config.php ]]; then echo "Forcing permissions on userdata folder..."
echo "migrating from single to dual PVC's..." if nfs4xdr_getfacl && nfs4xdr_getfacl | grep -qv "Failed to get NFSv4 ACL"; then
echo "moving to placeholder location..." echo "NFSv4 ACLs detected, Trying to override permissions using nfs4_setfacl..."
mv -f /var/www/html/data/* /var/www/html/data/tomigrate/ nfs4_setfacl -R -a A:g:33:RWX "/var/www/html/data"
echo "moving userdata to data-pvc root..." else
mv -f /var/www/html/data/tomigrate/data/* /var/www/html/data/ echo "No NFSv4 ACLs detected, trying to override permissions using chown/chmod..."
echo "removing old data folder..." chown -R :33 "/var/www/html/data"
rm -rf /var/www/html/data/tomigrate/data chmod 770 /var/www/html/data
echo "moving config, apps, templates and other content to html-pvc root..."
mv -f /var/www/html/data/tomigrate/* /var/www/html/
echo "Removing migration temporary folder..."
rm -rf /var/www/html/data/tomigrate
fi fi
echo "Enforcing chmod 770 on data-dir..."
chmod 770 /var/www/html/data
echo "Migrating old data when found..."
EOF EOF
volumeMounts: volumeMounts:
@@ -139,6 +132,7 @@ env:
TRUSTED_PROXIES: "172.16.0.0/16 127.0.0.1" TRUSTED_PROXIES: "172.16.0.0/16 127.0.0.1"
POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}" POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}"
POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}" POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}"
NC_check_data_directory_permissions: "true"
POSTGRES_PASSWORD: POSTGRES_PASSWORD:
secretKeyRef: secretKeyRef:
name: dbcreds name: dbcreds