56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
## Database ##
|
|
|
|
# The 'database' setting defines the database that synapse uses to store all of
|
|
# its data.
|
|
#
|
|
# 'name' gives the database engine to use: either 'sqlite3' (for SQLite) or
|
|
# 'psycopg2' (for PostgreSQL).
|
|
#
|
|
# 'args' gives options which are passed through to the database engine,
|
|
# except for options starting 'cp_', which are used to configure the Twisted
|
|
# connection pool. For a reference to valid arguments, see:
|
|
# * for sqlite: https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
|
|
# * for postgres: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
|
|
# * for the connection pool: https://twistedmatrix.com/documents/current/api/twisted.enterprise.adbapi.ConnectionPool.html#__init__
|
|
#
|
|
#
|
|
# Example SQLite configuration:
|
|
#
|
|
#database:
|
|
# name: sqlite3
|
|
# args:
|
|
# database: /path/to/homeserver.db
|
|
#
|
|
#
|
|
# Example Postgres configuration:
|
|
#
|
|
#database:
|
|
# name: psycopg2
|
|
# args:
|
|
# user: synapse
|
|
# password: secretpassword
|
|
# database: synapse
|
|
# host: localhost
|
|
# cp_min: 5
|
|
# cp_max: 10
|
|
#
|
|
# For more information on using Synapse with Postgres, see `docs/postgres.md`.
|
|
#
|
|
{% if not matrix__synapse__pg_enable %}
|
|
database:
|
|
name: sqlite3
|
|
args:
|
|
database: '{{ matrix__synapse__db_file }}'
|
|
{% else %}
|
|
database:
|
|
name: psycopg2
|
|
args:
|
|
host: '{{ matrix__synapse__pg_host }}'
|
|
port: {{ matrix__synapse__pg_port }}
|
|
user: '{{ matrix__synapse__pg_username }}'
|
|
password: '{{ matrix__synapse__pg_password }}'
|
|
database: '{{ matrix__synapse__pg_database }}'
|
|
cp_min: 5
|
|
cp_max: 10
|
|
{% endif %}
|