diff --git a/charts/stable/nextcloud/Chart.yaml b/charts/stable/nextcloud/Chart.yaml index d7f916f0e1a..1223c301be1 100644 --- a/charts/stable/nextcloud/Chart.yaml +++ b/charts/stable/nextcloud/Chart.yaml @@ -37,7 +37,7 @@ sources: - https://github.com/nextcloud/docker - https://github.com/nextcloud/helm type: application -version: 15.2.46 +version: 15.3.0 annotations: truecharts.org/catagories: | - cloud diff --git a/charts/stable/nextcloud/questions.yaml b/charts/stable/nextcloud/questions.yaml index bd10206e054..03a33e4c588 100644 --- a/charts/stable/nextcloud/questions.yaml +++ b/charts/stable/nextcloud/questions.yaml @@ -80,7 +80,7 @@ questions: schema: type: string valid_chars: '^[A-Z]{2}$' - default: "" + default: "US" - variable: imaginary group: "Container Configuration" label: "Preview Generation Configuration" diff --git a/charts/stable/nextcloud/templates/_hpb.tpl b/charts/stable/nextcloud/templates/_hpb.tpl index e22c0f709dd..5b7b18a15fa 100644 --- a/charts/stable/nextcloud/templates/_hpb.tpl +++ b/charts/stable/nextcloud/templates/_hpb.tpl @@ -57,11 +57,11 @@ command: until [ -f /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push ] do sleep 10 - echo "Notify_push not found... waiting..." + echo "Notify_push app not found... waiting..." done 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 - echo "Nextcloud not found... waiting..." + echo "Nextcloud not responding... waiting..." sleep 10 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 @@ -71,6 +71,16 @@ command: 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 & + {{- $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 }} 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' @@ -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 }} {{- 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 {{- with .Values.nextcloud.default_phone_region | upper }} php /var/www/html/occ config:system:set default_phone_region --value='{{ . }}' {{- 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 }}" - 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 EOF env: diff --git a/charts/stable/nextcloud/values.yaml b/charts/stable/nextcloud/values.yaml index fa056cf4db8..99d1db95070 100644 --- a/charts/stable/nextcloud/values.yaml +++ b/charts/stable/nextcloud/values.yaml @@ -103,22 +103,15 @@ initContainers: - "-c" - | /bin/bash <<'EOF' - if [[ -f /data/config/config.php ]] && [[ ! -f /html/config/config.php ]]; then - echo "migrating from single to dual PVC's..." - echo "moving to placeholder location..." - mv -f /var/www/html/data/* /var/www/html/data/tomigrate/ - echo "moving userdata to data-pvc root..." - mv -f /var/www/html/data/tomigrate/data/* /var/www/html/data/ - echo "removing old data folder..." - rm -rf /var/www/html/data/tomigrate/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 + echo "Forcing permissions on userdata folder..." + if nfs4xdr_getfacl && nfs4xdr_getfacl | grep -qv "Failed to get NFSv4 ACL"; then + echo "NFSv4 ACLs detected, Trying to override permissions using nfs4_setfacl..." + nfs4_setfacl -R -a A:g:33:RWX "/var/www/html/data" + else + echo "No NFSv4 ACLs detected, trying to override permissions using chown/chmod..." + chown -R :33 "/var/www/html/data" + chmod 770 /var/www/html/data fi - echo "Enforcing chmod 770 on data-dir..." - chmod 770 /var/www/html/data - echo "Migrating old data when found..." EOF volumeMounts: @@ -139,6 +132,7 @@ env: TRUSTED_PROXIES: "172.16.0.0/16 127.0.0.1" POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}" POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}" + NC_check_data_directory_permissions: "true" POSTGRES_PASSWORD: secretKeyRef: name: dbcreds