Reviewed-on: #3
This commit is contained in:
parent
298901b14a
commit
b0d8cddd7b
6
.env
6
.env
@ -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.115.0
|
IMAGEAPP=ghcr.io/element-hq/synapse:v1.121.1
|
||||||
|
|
||||||
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
|
||||||
|
13
compose.yaml
13
compose.yaml
@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: docker.io/postgres:15
|
image: docker.io/postgres:17
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_DB
|
- POSTGRES_DB=db
|
||||||
- POSTGRES_USER
|
- POSTGRES_USER=db
|
||||||
- POSTGRES_PASSWORD
|
- POSTGRES_PASSWORD=db
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data/
|
- db:/var/lib/postgresql/data/
|
||||||
|
|
||||||
@ -16,6 +16,11 @@ 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/
|
||||||
|
@ -3,32 +3,35 @@ set -o pipefail
|
|||||||
|
|
||||||
function kapply() {
|
function kapply() {
|
||||||
for f in "$@"; do
|
for f in "$@"; do
|
||||||
kubectl apply -f \
|
kubectl apply -f <(envsubst < "manifests/$f")
|
||||||
<(envsubst "$(env | xargs printf '$%s ')" < "manifests/$f")
|
|
||||||
done
|
done
|
||||||
}
|
}; export -f kapply
|
||||||
|
|
||||||
function kcreatesec() {
|
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() {
|
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() {
|
function kgseckey() {
|
||||||
local sec="$1"; shift
|
local sec="$1"; shift
|
||||||
local key="$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() {
|
function kgcmkey() {
|
||||||
local cm="$1"; shift
|
local cm="$1"; shift
|
||||||
local key="$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() {
|
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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
export NB_REPLICAS=1
|
export NB_REPLICAS=1
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
# TODO: 3
|
# TODO: 3
|
||||||
export NB_REPLICAS=1
|
export NB_REPLICAS=1
|
||||||
|
Loading…
Reference in New Issue
Block a user