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.
This commit is contained in:
Felix Wolf 2026-04-04 18:28:11 +02:00
parent c85ee51590
commit 0d60c04e2d
3 changed files with 11 additions and 5 deletions

View file

@ -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:

View file

@ -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: |-

View file

@ -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