Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions apps/filehosting/nextcloud/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,17 @@ spec:
enabled: false
externalDatabase:
enabled: true
type: mysql
type: postgresql
host: nextcloud-postgresql-rw.{{ .customer.name }}-nextcloud-{{ .customer.stage }}.svc.cluster.local:5432
database: nextcloud
existingSecret:
enabled: true
secretName: "nextcloud-mariadb-auth"
usernameKey: mariadb-username
passwordKey: mariadb-password
secretName: "nextcloud-postgresql-auth"
usernameKey: username
passwordKey: password
# https://github.com/bitnami/charts/tree/main/bitnami/mariadb
mariadb:
enabled: true
enabled: false
image:
tag: 11.3.2-debian-12-r5
auth:
Expand Down
22 changes: 22 additions & 0 deletions apps/filehosting/nextcloud/cnp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,27 @@ spec:
protocol: UDP
- port: "53"
protocol: TCP
- toEntities:
- kube-apiserver
toPorts:
- ports:
- port: "443"
protocol: TCP
- toServices:
- k8sService:
namespace: default
serviceName: kubernetes
toPorts:
- ports:
- port: "443"
protocol: TCP
- toCIDRSet:
- cidr: 10.96.0.1/32
toPorts:
- ports:
- port: "443"
protocol: TCP
- toEntities:
- cluster
- toEntities:
- world
6 changes: 3 additions & 3 deletions tools/nextcloud-db-convert-to-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ echo "Target PostgreSQL host: $PG_HOST"

if [[ "$MAINTENANCE_MODE" == "true" ]]; then
echo "Enabling maintenance mode..."
kubectl -n "$NAMESPACE" exec "$NEXTCLOUD_POD" -- su -s /bin/sh www-data -c "php occ maintenance:mode --on"
kubectl -n "$NAMESPACE" exec "$NEXTCLOUD_POD" -- sh -ec "su -s /bin/sh www-data -c 'php occ maintenance:mode --on' || php occ maintenance:mode --on"
fi

set +e
kubectl -n "$NAMESPACE" exec "$NEXTCLOUD_POD" -- sh -ec "su -s /bin/sh www-data -c \"php occ db:convert-type --all-apps --password '${PG_PASSWORD}' pgsql '${PG_USER}' '${PG_HOST}' '${PG_DB_NAME}'\""
kubectl -n "$NAMESPACE" exec "$NEXTCLOUD_POD" -- sh -ec "su -s /bin/sh www-data -c \"php occ -n db:convert-type --all-apps --password '${PG_PASSWORD}' pgsql '${PG_USER}' '${PG_HOST}' '${PG_DB_NAME}'\" || php occ -n db:convert-type --all-apps --password '${PG_PASSWORD}' pgsql '${PG_USER}' '${PG_HOST}' '${PG_DB_NAME}'"
rc=$?
set -e

if [[ "$MAINTENANCE_MODE" == "true" ]]; then
echo "Disabling maintenance mode..."
kubectl -n "$NAMESPACE" exec "$NEXTCLOUD_POD" -- su -s /bin/sh www-data -c "php occ maintenance:mode --off"
kubectl -n "$NAMESPACE" exec "$NEXTCLOUD_POD" -- sh -ec "su -s /bin/sh www-data -c 'php occ maintenance:mode --off' || php occ maintenance:mode --off"
fi

if [[ $rc -ne 0 ]]; then
Expand Down