From a5eb4c7d9f65e2c7c6dc724d8522ef6236fed4b7 Mon Sep 17 00:00:00 2001 From: LUXEY Adrien Date: Sun, 21 Jun 2020 19:28:12 +0200 Subject: [PATCH] minor additions --- deployer/README.md | 16 ++++++++++++++-- deployer/group_vars/all/vars.yml | 1 + .../build/templates/synapse/homeserver.yaml.j2 | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/deployer/README.md b/deployer/README.md index 89088fe..1c7a059 100644 --- a/deployer/README.md +++ b/deployer/README.md @@ -44,6 +44,12 @@ TODO: Ansible task to install that before the rest * Nginx and docker-compose configurations * Most of the work is by hand, because there is quite a lot of interaction between the host and the container (for forwarding ssh). +* Create Synapse instances + + * Configured to access PostGreSQL on host. + + * *Access through TCP*: You need to allow postgres to listen to your docker network, e.g. `172.27.0.0/16`. See `/etc/postgresql/x.y/main/pg_hba.conf`, and read the comments about changing `listen_addresses` too. + * Access through Unix socket: Make a non-superuser role for root, and configure Synapse to use `/var/run/postgresql` as DB host. ### Does not support @@ -72,16 +78,22 @@ TODO: Ansible task to install that before the rest ## Misc +### Synapse + +Someone advised me to install matrix-media-repo to enable animated thumbnails as people's avatar (https://github.com/turt2live/matrix-media-repo/blob/master/config.sample.yaml#L394), and to setup https://github.com/ma1uta/ma1sd which is a federated identity server. + + + ### Ansible * You can create passwords/keys in templates using the following Jinja2 command: {{ lookup('password', '/dev/null length=20') }} - See https://docs.ansible.com/ansible/latest/plugins/lookup/password.html ans https://docs.ansible.com/ansible/latest/user_guide/playbooks_lookups.html + See https://docs.ansible.com/ansible/latest/plugins/lookup/password.html and https://docs.ansible.com/ansible/latest/user_guide/playbooks_lookups.html -### Useful SQL commands +### Useful MySQL commands ```sql select host, user, password from mysql.user order by user; diff --git a/deployer/group_vars/all/vars.yml b/deployer/group_vars/all/vars.yml index 49ec234..22e7993 100644 --- a/deployer/group_vars/all/vars.yml +++ b/deployer/group_vars/all/vars.yml @@ -145,6 +145,7 @@ sites: subnet_gateway_ip: 172.27.7.1 subnet_site_ip: 172.27.7.2 # PostgreSQL + postgres_host: /var/run/postgresql postgres_database: synapse_test postgres_username: synapse_test postgres_password: "{{ vault_synapse_test_postgres_password }}" diff --git a/deployer/roles/build/templates/synapse/homeserver.yaml.j2 b/deployer/roles/build/templates/synapse/homeserver.yaml.j2 index 4025222..4ce4910 100644 --- a/deployer/roles/build/templates/synapse/homeserver.yaml.j2 +++ b/deployer/roles/build/templates/synapse/homeserver.yaml.j2 @@ -633,7 +633,7 @@ database: user: "{{ site.postgres_username }}" password: "{{ site.postgres_password }}" database: "{{ site.postgres_database }}" - host: "{{ site.subnet_gateway_ip }}" + host: "{{ site.postgres_host }}" cp_min: 5 cp_max: 10