add matrix

This commit is contained in:
Waylon Walker 2023-07-30 21:40:15 -05:00
parent 248930703c
commit 28420e86dd
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
3 changed files with 540 additions and 141 deletions

52
matrix/docker-compose.yml Normal file
View file

@ -0,0 +1,52 @@
# docker run --name synapse \
# -v ./synapse-data:/data \
# -p 8008:8008 \
# matrixdotorg/synapse:latest
#
version: "3"
services:
synapse:
image: docker.io/matrixdotorg/synapse:latest
container_name: synapse
restart: unless-stopped
networks:
- proxy
security_opt:
- no-new-privileges:true
volumes:
- ${PWD}/matrix/synapse-data:/data
depends_on:
- db
ports:
- 8448:8448/tcp
labels:
- "traefik.enable=true"
- "traefik.http.routers.synapse.entrypoints=http"
- "traefik.http.routers.synapse.rule=Host(`matrix.${URL}`)"
- "traefik.http.middlewares.synapse-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.synapse.middlewares=synapse-https-redirect"
- "traefik.http.routers.synapse-secure.entrypoints=https"
- "traefik.http.routers.synapse-secure.rule=Host(`matrix.${URL}`)"
- "traefik.http.routers.synapse-secure.tls=true"
- "traefik.http.routers.synapse-secure.service=synapse"
- "traefik.http.services.synapse.loadbalancer.server.port=8008"
- "traefik.docker.network=proxy"
db:
image: docker.io/postgres:12-alpine
container_name: synapse-db
# Change that password, of course!
environment:
- POSTGRES_USER=${SYNAPSE_POSTGRES_USER:-synapse}
- POSTGRES_PASSWORD=${SYNAPSE_POSTGRES_PASSWORD:-synapse}
# ensure the database gets created correctly
# https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes:
# You may store the database tables in a local folder..
- ${PWD}/matrix/schemas:/var/lib/postgresql/data
# .. or store them on some high performance storage for better results
# - /path/to/ssd/storage:/var/lib/postgresql/data
networks:
proxy:
external: true

View file

@ -0,0 +1,39 @@
# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
server_name: "matrix.local.waylonwalker.com"
pid_file: /data/homeserver.pid
listeners:
- port: 8008
tls: false
type: http
x_forwarded: true
resources:
- names: [client, federation]
compress: false
database:
name: sqlite3
args:
database: /data/homeserver.db
log_config: "/data/my.matrix.host.log.config"
media_store_path: /data/media_store
registration_shared_secret: "B*RE63qiUX:5d1v@~N,jR;+&4r&cO#@i5NKsv@CT.lOu:,ddxs"
enable_registration: true
enable_registration_without_verification: true
report_stats: true
macaroon_secret_key: "Y8,4qCMmb=9OvY*0h+6.2MP-q4u#Kg9W:Hh7iE4:F2;&Pndw=7"
form_secret: "uZvi=OI+;Mf9wI:rXA-1Vt=QX:OD5NKot6.DnybItdsw2*g=+d"
signing_key_path: "/data/my.matrix.host.signing.key"
trusted_key_servers:
- server_name: "matrix.org"
# vim:ft=yaml