Deploys Nextcloud using an FPM-alpine image with a Caddy sidecar for web serving. Integrates with an external CloudNativePG cluster for PostgreSQL and a dedicated Valkey instance for caching. Configures S3-compatible object storage for file data. Includes an initialization Job to create essential admin and Valkey secrets. Sets up Ingress for external access with automated TLS provisioning via cert-manager. Configures local-path persistence for Nextcloud's core data to ensure state is maintained across pod restarts. Centralizes hostname configuration and migrates various Nextcloud settings to environment variables for streamlined management. Adds ArgoCD ignore rules for `batch/Job` resource selectors and template labels, preventing spurious out-of-sync states caused by Kubernetes mutations and improving synchronization stability.
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
apiVersion: v1
|
|
data:
|
|
Caddyfile: |
|
|
:80 {
|
|
root * /var/www/html
|
|
|
|
header {
|
|
Referrer-Policy "no-referrer"
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "SAMEORIGIN"
|
|
X-Permitted-Cross-Domain-Policies "none"
|
|
X-Robots-Tag "noindex, nofollow"
|
|
X-XSS-Protection "1; mode=block"
|
|
-X-Powered-By
|
|
}
|
|
|
|
redir /.well-known/carddav /remote.php/dav/ 301
|
|
redir /.well-known/caldav /remote.php/dav/ 301
|
|
redir /.well-known/* /index.php{uri} 301
|
|
|
|
@blocked path /build/* /tests/* /config/* /lib/* /3rdparty/* /templates/* /data/*
|
|
respond @blocked 404
|
|
|
|
@davclnt {
|
|
path /
|
|
header User-Agent DavClnt*
|
|
}
|
|
redir @davclnt /remote.php/webdav/ 302
|
|
|
|
redir /remote /remote.php{uri} 301
|
|
|
|
php_fastcgi 127.0.0.1:9000 {
|
|
env HTTPS on
|
|
env modHeadersAvailable true
|
|
env front_controller_active true
|
|
resolve_root_symlink
|
|
}
|
|
|
|
@static path *.css *.js *.mjs *.svg *.gif *.ico *.jpg *.png *.webp *.wasm *.tflite *.map *.ogg *.flac
|
|
header @static Cache-Control "max-age=15778463"
|
|
|
|
@fonts path *.otf *.woff *.woff2
|
|
header @fonts Cache-Control "max-age=604800"
|
|
|
|
encode gzip
|
|
|
|
file_server
|
|
|
|
request_body {
|
|
max_size 16GB
|
|
}
|
|
}
|
|
kind: ConfigMap
|
|
metadata:
|
|
annotations:
|
|
a8r.io/repository: ssh://git@git.tr1ceracop.de:222/gitea_admin/k8s-and-chill.git
|
|
name: nextcloud-caddy-config
|
|
namespace: nextcloud
|