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:
committed by
GitHub
parent
6c5aa110ce
commit
dc26a93fb6
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user