feat(matrix): bootstrap script

This commit is contained in:
AngeD 2023-12-01 15:20:05 +01:00
parent 7dc4159820
commit 5d946e8a34
7 changed files with 25 additions and 10 deletions

View File

@ -7,6 +7,7 @@ services:
ports:
- "80:80"
- "443:443"
- "8448:8448" # matrix federation
volumes:
- sites:/etc/nginx/conf.d/
- certs:/etc/letsencrypt/

View File

@ -5,6 +5,9 @@ POSTGRES_PASSWORD=
PUID=1000
PGID=1000
#SYNAPSE_ENABLE_REGISTRATION=yes
#SYNAPSE_ALLOW_GUEST=yes
SYNAPSE_REPORT_STATS=no
POSTGRES_USER=matrix
POSTGRES_DB=matrix

View File

@ -24,7 +24,7 @@ services:
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
matrix:
image: docker.io/matrixdotorg/synapse:latest
image: docker.io/matrixdotorg/synapse:v1.97.0
restart: unless-stopped
volumes:
- config:/config/
@ -33,11 +33,8 @@ services:
- SYNAPSE_SERVER_NAME=$BASE_URL
- SYNAPSE_CONFIG_DIR=/config
- SYNAPSE_DATA_DIR=/data
- POSTGRES_HOST=db
- UID=$PUID
- GID=$PGID
env_file:
- .env
networks:
- nginx
- default

15
matrix/init_config.sh Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env -S - bash -e
set -a
. .env
SYNAPSE_SERVER_NAME="$BASE_URL"
SYNAPSE_NO_TLS=1
POSTGRES_HOST=db
set +a
ENV=()
while read -r LINE; do
ENV+=(-e "$LINE")
done < <(env)
docker-compose run "${ENV[@]}" matrix migrate_config

View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/bash -e
sudo docker-compose exec matrix register_new_matrix_user -c /config/homeserver.yaml
docker-compose exec -it matrix register_new_matrix_user -c /config/homeserver.yaml

View File

@ -11,9 +11,9 @@ server {
listen [::]:443 ssl;
server_name $BASE_URL;
# # For the federation port
# listen 8448 ssl default_server;
# listen [::]:8448 ssl default_server;
# For the federation port
listen 8448 ssl default_server;
listen [::]:8448 ssl default_server;
ssl_certificate /etc/letsencrypt/live/$BASE_URL/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$BASE_URL/privkey.pem;

View File

@ -14,7 +14,6 @@ server {
ssl_certificate /etc/letsencrypt/live/$BASE_URL/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$BASE_URL/privkey.pem;
location / {
proxy_pass http://nextcloud;