feat: matrix

This commit is contained in:
AngeD 2023-09-17 00:27:10 +02:00
parent e5f9fa5a04
commit 72cd04329b
4 changed files with 101 additions and 0 deletions

10
matrix/.env Normal file
View File

@ -0,0 +1,10 @@
BASE_URL=matrix.
EMAIL=
POSTGRES_PASSWORD=
PUID=1000
PGID=1000
SYNAPSE_REPORT_STATS=no
POSTGRES_USER=matrix
POSTGRES_DB=matrix

60
matrix/compose.yaml Normal file
View File

@ -0,0 +1,60 @@
---
services:
install_site:
build: install_site
environment:
- BASE_URL
- EMAIL
volumes:
- ./nginx.conf:/web/matrix.conf
- sites:/sites/
- certs:/etc/letsencrypt/
- certbotroot:/var/www/certbot/
- /var/run/docker.sock:/var/run/docker.sock
db:
image: docker.io/postgres:15
restart: unless-stopped
volumes:
- db:/var/lib/postgresql/data/
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
matrix:
image: docker.io/matrixdotorg/synapse:latest
restart: unless-stopped
volumes:
- config:/config/
- data:/data/
environment:
- SYNAPSE_SERVER_NAME=$BASE_URL
- SYNAPSE_REPORT_STATS
- SYNAPSE_CONFIG_DIR=/config
- SYNAPSE_DATA_DIR=/data
- POSTGRES_HOST=db
- UID=$PUID
- GID=$PGID
env_file:
- .env
networks:
- nginx
- default
depends_on:
- db
volumes:
sites:
external: true
certs:
external: true
certbotroot:
external: true
db:
config:
data:
networks:
nginx:
external: true

1
matrix/install_site Symbolic link
View File

@ -0,0 +1 @@
../nginx/install_site

30
matrix/nginx.conf Normal file
View File

@ -0,0 +1,30 @@
server {
listen 80;
listen [::]:80;
server_name $BASE_URL;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name $BASE_URL;
# # 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;
location ~ ^(/_matrix|/_synapse/client) {
proxy_pass http://matrix:8008;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
client_max_body_size 50M;
proxy_http_version 1.1;
}
}