Compare commits

..

8 Commits
devel ... prod

Author SHA1 Message Date
cdd66c8757 bump: v1.115.0 (#1)
Some checks failed
/ deploy (push) Failing after 6s
Reviewed-on: #1
2024-09-27 00:41:05 +00:00
05474d5046 feat: MAX_UPLOAD_SIZE 2024-09-27 00:41:05 +00:00
4b0445befe fix: SERVER_NAME only for prod 2024-09-27 00:41:05 +00:00
0f3784217c fix: !staging.sh + if in prod.sh 2024-09-27 00:41:05 +00:00
ea51dace79 feat: separate staging/prod binaries 2024-09-27 00:41:05 +00:00
fd73485fa5 fix: delegation prod-only 2024-09-27 00:41:05 +00:00
6801eff85d fix: config path 2024-09-27 00:41:05 +00:00
8e94b3d942 feat: rename cm synapse-config -> synapse 2024-09-27 00:41:05 +00:00
5 changed files with 26 additions and 36 deletions

6
.env
View File

@ -1,8 +1,8 @@
PROD_URL=matrix.gmoker.com PROD_URL=matrix.gmoker.com
SERVER_NAME=gmoker.com SERVER_NAME=gmoker.com
IMAGEAPP=ghcr.io/element-hq/synapse:v1.121.1 IMAGEAPP=ghcr.io/element-hq/synapse:v1.115.0
#TURN_URL=turn.test.gmoker.com TURN_URL=turn.test.gmoker.com
#IMAGECOTURN=docker.io/coturn/coturn:4.6.2-r12 IMAGECOTURN=docker.io/coturn/coturn:4.6.2-r12
MAX_UPLOAD_SIZE=50M MAX_UPLOAD_SIZE=50M

View File

@ -1,12 +1,12 @@
--- ---
services: services:
db: db:
image: docker.io/postgres:17 image: docker.io/postgres:15
restart: unless-stopped restart: unless-stopped
environment: environment:
- POSTGRES_DB=db - POSTGRES_DB
- POSTGRES_USER=db - POSTGRES_USER
- POSTGRES_PASSWORD=db - POSTGRES_PASSWORD
volumes: volumes:
- db:/var/lib/postgresql/data/ - db:/var/lib/postgresql/data/
@ -16,11 +16,6 @@ services:
ports: ports:
- "8080:8008" - "8080:8008"
- "8448:8448" - "8448:8448"
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=db
- POSTGRES_USER=db
- POSTGRES_PASSWORD=db
volumes: volumes:
- synapse_config:/config/ - synapse_config:/config/
- synapse_data:/data/ - synapse_data:/data/

View File

@ -1,40 +1,37 @@
#!/bin/bash #!/bin/bash -e
set -xeo pipefail set -o pipefail
function kapply() { function kapply() {
for f in "$@"; do for f in "$@"; do
kubectl apply -f <(envsubst < "manifests/$f") kubectl apply -f \
<(envsubst "$(env | xargs printf '$%s ')" < "manifests/$f")
done done
}; export -f kapply }
function kcreatesec() { function kcreatesec() {
kubectl create secret generic --dry-run=client -oyaml "$@" | kubectl replace -f- kubectl create secret generic --save-config --dry-run=client -oyaml "$@" | kubectl apply -f-
}; export -f kcreatesec }
function kcreatecm() { function kcreatecm() {
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl replace -f- kubectl create configmap --dry-run=client -oyaml "$@" | kubectl apply -f-
}; export -f kcreatecm }
function kgseckey() { function kgseckey() {
local sec="$1"; shift local sec="$1"; shift
local key="$1"; shift local key="$1"; shift
if ! kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\" // empty" | base64 -d; then kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d
return 1 }
fi
}; export -f kgseckey
function kgcmkey() { function kgcmkey() {
local cm="$1"; shift local cm="$1"; shift
local key="$1"; shift local key="$1"; shift
if ! kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\" // empty"; then kubectl get configmap "$cm" -o jsonpath="{.data.$key}"
return 1 }
fi
}; export -f kgcmkey
function get_synapse_key() { function get_synapse_key() {
kgcmkey synapse homeserver.yaml | awk -F\" "/^\s*$1/{print \$2}" || openssl rand -hex 32 kgcmkey synapse 'homeserver\.yaml' | awk -F\" "/^\s*$1/{print \$2}" || openssl rand -hex 32
} }
@ -51,8 +48,8 @@ export TURN_SHARED_SECRET; TURN_SHARED_SECRET="$(get_synapse_key turn_shared_s
export REGISTRATION_SECRET; REGISTRATION_SECRET="$(get_synapse_key registration_shared_secret)" export REGISTRATION_SECRET; REGISTRATION_SECRET="$(get_synapse_key registration_shared_secret)"
kcreatecm synapse \ kcreatecm synapse \
--from-file=homeserver.yaml=<(envsubst < config/homeserver.yaml) \ --from-file=homeserver.yaml=<(envsubst "$(env | xargs printf '$%s ')" < config/homeserver.yaml) \
--from-file=log.config=<(envsubst < config/log.config) --from-file=log.config=<(envsubst "$(env | xargs printf '$%s ')" < config/log.config)
kapply common/keys.yaml common/app.yaml kapply common/keys.yaml common/app.yaml

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash -e
set -eo pipefail
export NB_REPLICAS=1 export NB_REPLICAS=1

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash -e
set -eo pipefail
# TODO: 3 # TODO: 3
export NB_REPLICAS=1 export NB_REPLICAS=1