From b0d8cddd7b6957e3b565f74bf2b6d7ec5cef7d1c Mon Sep 17 00:00:00 2001 From: ange Date: Mon, 23 Dec 2024 03:40:25 +0000 Subject: [PATCH] bump: 1.21.1 (#3) Reviewed-on: https://git.gmoker.com/gmoker/synapse/pulls/3 --- .env | 6 +++--- compose.yaml | 13 +++++++++---- manifests/bin/deploy.sh | 27 +++++++++++++++------------ manifests/bin/devel.sh | 1 + manifests/bin/prod.sh | 1 + 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.env b/.env index 51a42f2..ee88b05 100644 --- a/.env +++ b/.env @@ -1,8 +1,8 @@ PROD_URL=matrix.gmoker.com SERVER_NAME=gmoker.com -IMAGEAPP=ghcr.io/element-hq/synapse:v1.115.0 +IMAGEAPP=ghcr.io/element-hq/synapse:v1.121.1 -TURN_URL=turn.test.gmoker.com -IMAGECOTURN=docker.io/coturn/coturn:4.6.2-r12 +#TURN_URL=turn.test.gmoker.com +#IMAGECOTURN=docker.io/coturn/coturn:4.6.2-r12 MAX_UPLOAD_SIZE=50M diff --git a/compose.yaml b/compose.yaml index c7e182c..71a3b09 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,12 +1,12 @@ --- services: db: - image: docker.io/postgres:15 + image: docker.io/postgres:17 restart: unless-stopped environment: - - POSTGRES_DB - - POSTGRES_USER - - POSTGRES_PASSWORD + - POSTGRES_DB=db + - POSTGRES_USER=db + - POSTGRES_PASSWORD=db volumes: - db:/var/lib/postgresql/data/ @@ -16,6 +16,11 @@ services: ports: - "8080:8008" - "8448:8448" + environment: + - POSTGRES_HOST=db + - POSTGRES_DB=db + - POSTGRES_USER=db + - POSTGRES_PASSWORD=db volumes: - synapse_config:/config/ - synapse_data:/data/ diff --git a/manifests/bin/deploy.sh b/manifests/bin/deploy.sh index cd0fe42..2e8c599 100755 --- a/manifests/bin/deploy.sh +++ b/manifests/bin/deploy.sh @@ -3,32 +3,35 @@ set -o pipefail function kapply() { for f in "$@"; do - kubectl apply -f \ - <(envsubst "$(env | xargs printf '$%s ')" < "manifests/$f") + kubectl apply -f <(envsubst < "manifests/$f") done -} +}; export -f kapply function kcreatesec() { - kubectl create secret generic --save-config --dry-run=client -oyaml "$@" | kubectl apply -f- -} + kubectl create secret generic --dry-run=client -oyaml "$@" | kubectl replace -f- +}; export -f kcreatesec function kcreatecm() { - kubectl create configmap --dry-run=client -oyaml "$@" | kubectl apply -f- -} + kubectl create configmap --dry-run=client -oyaml "$@" | kubectl replace -f- +}; export -f kcreatecm function kgseckey() { local sec="$1"; shift local key="$1"; shift - kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d -} + if ! kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\" // empty" | base64 -d; then + return 1 + fi +}; export -f kgseckey function kgcmkey() { - local cm="$1"; shift + local cm="$1"; shift local key="$1"; shift - kubectl get configmap "$cm" -o jsonpath="{.data.$key}" -} + if ! kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\" // empty"; then + return 1 + fi +}; export -f kgcmkey function get_synapse_key() { kgcmkey synapse 'homeserver\.yaml' | awk -F\" "/^\s*$1/{print \$2}" || openssl rand -hex 32 diff --git a/manifests/bin/devel.sh b/manifests/bin/devel.sh index 464c4d0..65675aa 100755 --- a/manifests/bin/devel.sh +++ b/manifests/bin/devel.sh @@ -1,4 +1,5 @@ #!/bin/bash -e +set -o pipefail export NB_REPLICAS=1 diff --git a/manifests/bin/prod.sh b/manifests/bin/prod.sh index 018bd3b..f70a7f1 100755 --- a/manifests/bin/prod.sh +++ b/manifests/bin/prod.sh @@ -1,4 +1,5 @@ #!/bin/bash -e +set -o pipefail # TODO: 3 export NB_REPLICAS=1