Création d'un pod matrix avec synapse et postgres

This commit is contained in:
Loïc 2021-06-14 10:07:05 +02:00
parent 15cfb5cfe4
commit 955a9c2921

View file

@ -5,26 +5,44 @@ podman volume create matrixdotorg_synapse-data
podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data
podman unshare chown -R 991:991 `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data` podman unshare chown -R 991:991 `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`
# 991 est l'UID/GID par défaut de matrix-synapse # 991 est l'UID/GID par défaut de matrix-synapse
podman run -it --name synapse-generate --mount type=volume,src=matrixdotorg_synapse-data,dst=/data -e SYNAPSE_SERVER_NAME=garbaye.fr -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse generate podman run -it --name synapse-generate --mount type=volume,src=matrixdotorg_synapse-data,dst=/data -e SYNAPSE_SERVER_NAME=garbaye.fr -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse generate
podman rm synapse-generate podman rm synapse-generate
#postgres
podman pull docker://postgres
podman volume create matrixdotorg_synapse-pgsql
``` ```
``` bash ``` bash
# En root : # En root :
vim /home/podman-matrix/.local/share/containers/storage/volumes/matrixdotorg_synapse-data/_data/homeserver.yaml vim /home/podman-matrix/.local/share/containers/storage/volumes/matrixdotorg_synapse-data/_data/homeserver.yaml
53d52
< public_baseurl: https://qlf-matrix.garbaye.fr < public_baseurl: https://qlf-matrix.garbaye.fr
1142d1140
< enable_registration: false < enable_registration: false
< database:
< name: psycopg2
< user: synapse
< password: mysecretpass
< database: synapse
< host: synapse-db
< port: 5432
< cp_min: 5
< cp_max: 10
``` ```
``` bash ``` bash
podman run -d --name synapse --mount type=volume,src=matrixdotorg_synapse-data,dst=/data -p 8086:8008 matrixdotorg/synapse podman pod create --publish 8086:8008 --name matrix
podman stop synapse podman run -d --name synapse-db --pod matrix --mount type=volume,src=matrixdotorg_synapse-pgsql,dst=/var/lib/postgresql/data/synapse -e POSTGRES_PASSWORD=mysecretpass -e POSTGRES_USER=synapse -e POSTGRES_DB=synapse -e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" -e PGDATA=/var/lib/postgresql/data/synapse postgres
podman start synapse podman run -d --name synapse --pod matrix --mount type=volume,src=matrixdotorg_synapse-data,dst=/data matrixdotorg/synapse
podman pod stop matrix
podman pod start matrix
podman exec -ti synapse register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008 podman exec -ti synapse register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008
``` ```
Reste à faire: Reste à faire:
Passer à Postgres Un volume se attaché à synapse-db se crée avec un id unique mais je ne sais pas à quoi il correspond
Password policy ? Password policy ?
Fédération+redis l 2831 Fédération+redis l 2831
Mettre en place l'enregistrement srv : `_matrix._tcp 86400 IN SRV 5 5 443 matrix` ou le /.well-known/matrix/server (cf https://github.com/matrix-org/synapse/blob/master/docs/delegate.md) Mettre en place l'enregistrement srv : `_matrix._tcp 86400 IN SRV 5 5 443 matrix` ou le /.well-known/matrix/server (cf https://github.com/matrix-org/synapse/blob/master/docs/delegate.md)