feat: customize public name and server name
Some checks failed
/ deploy (push) Failing after 0s

Reviewed-on: #1
This commit is contained in:
ange 2024-05-02 15:33:50 +00:00
commit e440d92b2c
7 changed files with 21 additions and 29 deletions

2
.env
View File

@ -1,5 +1,5 @@
PROD_URL=matrix.gmoker.com
PUBLIC_URL=gmoker.com
SERVER_NAME=gmoker.com
IMAGEAPP=ghcr.io/element-hq/synapse:v1.106.0
TURN_URL=turn.test.gmoker.com

View File

@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v1
- name: setup env
run: |
. ./.env
. ./.env || true
if [ "${{ gitea.ref_name }}" == prod ] && [ -n "$PROD_URL" ]; then
BASE_URL="$PROD_URL"
else

View File

@ -1,5 +1,5 @@
server_name: "$BASE_URL"
public_baseurl: "https://$PUBLIC_URL"
server_name: "$SERVER_NAME"
public_baseurl: "https://$BASE_URL"
pid_file: /homeserver.pid
web_client: false
soft_file_limit: 0
@ -8,14 +8,12 @@ log_config: "/config/log.config"
listeners:
- port: 8008
tls: false
bind_addresses: ['::']
type: http
x_forwarded: false
x_forwarded: true
bind_addresses: ['::']
resources:
- names: [client]
- names: [client, federation]
compress: true
- names: [federation]
compress: false
database:
name: "psycopg2"
@ -91,5 +89,3 @@ password_config:
enabled: true
encryption_enabled_by_default_for_room_type: "all"
serve_server_wellknown: true

View File

@ -51,6 +51,7 @@ kcreatecm synapse-config \
--from-file=homeserver.yaml=<(envsubst "$(env | xargs printf '$%s ')" < homeserver.yaml) \
--from-file=log.config=<(envsubst "$(env | xargs printf '$%s ')" < log.config)
kapply common/keys.yaml common/app.yaml
kapply common/keys.yaml common/app.yaml common/delegation.yaml
kubectl rollout restart deployment delegation
kubectl rollout restart statefulset app

View File

@ -4,7 +4,3 @@
export NB_REPLICAS=1
. ./manifests/bin/deploy.sh
kapply prod/delegation.yaml
kubectl rollout restart deployment delegation

View File

@ -10,20 +10,13 @@ spec:
tls:
- secretName: tls-delegation
hosts:
- "$PUBLIC_URL"
- "$SERVER_NAME"
rules:
- host: "$PUBLIC_URL"
- host: "$SERVER_NAME"
http:
paths:
- path: /.well-known/matrix/server
pathType: Exact
backend:
service:
name: app
port:
name: http
- path: /.well-known/matrix/client
pathType: Exact
- path: /.well-known/matrix/
pathType: Prefix
backend:
service:
name: delegation
@ -53,11 +46,17 @@ data:
server {
listen 80;
location /.well-known/matrix/server {
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '{"m.server": "$BASE_URL:443"}';
}
location /.well-known/matrix/client {
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '{"m.homeserver": { "base_url": "https://$BASE_URL" }}';
return 200 '{"m.homeserver": {"base_url": "https://$BASE_URL"}}';
}
}
---

View File

@ -1,3 +1,3 @@
#!/bin/bash -e
kubectl exec -it -n synapse svc/app -- register_new_matrix_user -c /config/homeserver.yaml
kubectl exec -it svc/app -- register_new_matrix_user -c /config/homeserver.yaml