Verified Commit 245bda28 authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

matrix: Move IRC bridge state to PostgreSQL

parent b8456f78
local all postgres peer
host all postgres 127.0.0.1/32 md5
host all postgres ::1/128 md5
local sameuser all md5
host sameuser all 127.0.0.1/32 md5
host sameuser all ::1/128 md5
local irc synapse md5
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
file: path={{ item }} state=directory owner=synapse group=synapse mode=0700 file: path={{ item }} state=directory owner=synapse group=synapse mode=0700
with_items: with_items:
- /var/lib/synapse - /var/lib/synapse
- /var/lib/synapse/irc-nedb
- /var/lib/synapse/media_store - /var/lib/synapse/media_store
- name: make virtualenv - name: make virtualenv
...@@ -62,6 +61,11 @@ ...@@ -62,6 +61,11 @@
notify: notify:
- restart matrix-appservice-irc - restart matrix-appservice-irc
- name: install pg_hba.conf
copy: src=pg_hba.conf dest=/var/lib/postgres/data/pg_hba.conf owner=postgres group=postgres mode=0600
notify:
- restart postgres
- name: add synapse postgres db - name: add synapse postgres db
postgresql_db: db=synapse postgresql_db: db=synapse
become: yes become: yes
...@@ -69,7 +73,13 @@ ...@@ -69,7 +73,13 @@
become_method: su become_method: su
- name: add synapse postgres user - name: add synapse postgres user
postgresql_user: db=synapse name=synapse password={{ vault_postgres_users.synapse }} encrypted=true postgresql_user: db=synapse user=synapse password={{ vault_postgres_users.synapse }}
become: yes
become_user: postgres
become_method: su
- name: add irc postgres db
postgresql_db: db=irc
become: yes become: yes
become_user: postgres become_user: postgres
become_method: su become_method: su
......
...@@ -497,8 +497,8 @@ sentry: ...@@ -497,8 +497,8 @@ sentry:
# Use an external database to store bridge state. # Use an external database to store bridge state.
database: database:
# database engine (must be 'postgres' or 'nedb'). Default: nedb # database engine (must be 'postgres' or 'nedb'). Default: nedb
engine: "nedb" engine: "postgres"
# Either a PostgreSQL connection string, or a path to the NeDB storage directory. # Either a PostgreSQL connection string, or a path to the NeDB storage directory.
# For postgres, it must start with postgres:// # For postgres, it must start with postgres://
# For NeDB, it must start with nedb://. The path is relative to the project directory. # For NeDB, it must start with nedb://. The path is relative to the project directory.
connectionString: "nedb:///var/lib/synapse/irc-nedb" connectionString: "socket://synapse:{{ vault_postgres_users.synapse }}@/run/postgresql?db=irc"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment