From 0d60c04e2d8d9748e09f08ccc80c7074f929ed28 Mon Sep 17 00:00:00 2001 From: Felix Wolf Date: Sat, 4 Apr 2026 18:28:11 +0200 Subject: [PATCH] feat: Centralize Nextcloud hostname configuration Introduces a YAML anchor to define the Nextcloud host once, improving consistency. Applies the hostname anchor to ingress, probes, and Nextcloud's host setting. Adds `overwritehost` and `overwrite.cli.url` to Nextcloud's `config.php` for correct URL generation when behind a reverse proxy. --- prototypes/nextcloud/helm/nextcloud.yaml | 12 ++++++++---- .../nextcloud/configmap-nextcloud-config.yaml | 2 ++ .../production/nextcloud/deployment-nextcloud.yaml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/prototypes/nextcloud/helm/nextcloud.yaml b/prototypes/nextcloud/helm/nextcloud.yaml index d233999..3e3872f 100644 --- a/prototypes/nextcloud/helm/nextcloud.yaml +++ b/prototypes/nextcloud/helm/nextcloud.yaml @@ -1,4 +1,6 @@ --- +_hostname: &hostname nextcloud.tr1ceracop.de + replicaCount: 1 image: @@ -8,7 +10,7 @@ nginx: enabled: false nextcloud: - host: nextcloud.tr1ceracop.de + host: *hostname existingSecret: enabled: true @@ -36,6 +38,8 @@ nextcloud: $CONFIG = array( 'trusted_proxies' => ['10.0.0.0/8'], 'overwriteprotocol' => 'https', + 'overwritehost' => 'nextcloud.tr1ceracop.de', + 'overwrite.cli.url' => 'https://nextcloud.tr1ceracop.de', 'default_phone_region' => 'DE', ); @@ -99,7 +103,7 @@ nextcloud: port: 80 httpHeaders: - name: Host - value: nextcloud.tr1ceracop.de + value: *hostname initialDelaySeconds: 30 periodSeconds: 15 timeoutSeconds: 5 @@ -109,7 +113,7 @@ nextcloud: port: 80 httpHeaders: - name: Host - value: nextcloud.tr1ceracop.de + value: *hostname initialDelaySeconds: 30 periodSeconds: 15 timeoutSeconds: 5 @@ -171,7 +175,7 @@ ingress: tls: - secretName: nextcloud-tls hosts: - - nextcloud.tr1ceracop.de + - *hostname resources: requests: diff --git a/rendered/envs/production/nextcloud/configmap-nextcloud-config.yaml b/rendered/envs/production/nextcloud/configmap-nextcloud-config.yaml index 18c1cef..0ebc9d5 100644 --- a/rendered/envs/production/nextcloud/configmap-nextcloud-config.yaml +++ b/rendered/envs/production/nextcloud/configmap-nextcloud-config.yaml @@ -93,6 +93,8 @@ data: $CONFIG = array( 'trusted_proxies' => ['10.0.0.0/8'], 'overwriteprotocol' => 'https', + 'overwritehost' => 'nextcloud.tr1ceracop.de', + 'overwrite.cli.url' => 'https://nextcloud.tr1ceracop.de', 'default_phone_region' => 'DE', ); redis.config.php: |- diff --git a/rendered/envs/production/nextcloud/deployment-nextcloud.yaml b/rendered/envs/production/nextcloud/deployment-nextcloud.yaml index 50f5c50..0b1adb0 100644 --- a/rendered/envs/production/nextcloud/deployment-nextcloud.yaml +++ b/rendered/envs/production/nextcloud/deployment-nextcloud.yaml @@ -28,7 +28,7 @@ spec: metadata: annotations: hooks-hash: 47a89ca9deff73131884ece615e1cabb1f600fec60aa8f20244ae3c5bb58f948 - nextcloud-config-hash: 0d229123637fe9f641f41261891a44b761ff32c52f973314650897e768f3456d + nextcloud-config-hash: ec89ea6d9676ed525984771aab8f4536c9f4f62736b2c9898e883f5d0a7f90f8 php-config-hash: b638f66fd8d65de8364dbad6efc59a6524c7b2e2377b5623cf5e921e4d3d2400 labels: app.kubernetes.io/component: app