src.nth.io/

summaryrefslogtreecommitdiff
path: root/matrix-synapse/templates
diff options
context:
space:
mode:
Diffstat (limited to 'matrix-synapse/templates')
-rw-r--r--matrix-synapse/templates/homeserver.yaml.j226
-rw-r--r--matrix-synapse/templates/log.yaml.j256
-rw-r--r--matrix-synapse/templates/setup_db.psql.j22
3 files changed, 76 insertions, 8 deletions
diff --git a/matrix-synapse/templates/homeserver.yaml.j2 b/matrix-synapse/templates/homeserver.yaml.j2
index fd984cc..5a8ecc6 100644
--- a/matrix-synapse/templates/homeserver.yaml.j2
+++ b/matrix-synapse/templates/homeserver.yaml.j2
@@ -13,7 +13,7 @@
# e.g. matrix.org, localhost:8080, etc.
# This is also the last part of your UserID.
#
-server_name: "{{nginx_server_name}}"
+server_name: "{{matrix_synapse_server_name}}"
# When running as a daemon, the file to store the pid in
#
@@ -437,11 +437,11 @@ retention:
# instance, if using certbot, use `fullchain.pem` as your certificate,
# not `cert.pem`).
#
-#tls_certificate_path: "/home/lhoersten/nth.io.tls.crt"
+#tls_certificate_path: "path/to/homeserver.tls.crt"
# PEM-encoded private key for TLS
#
-#tls_private_key_path: "/home/lhoersten/nth.io.tls.key"
+#tls_private_key_path: "path/to/homeserver.tls.key"
# Whether to verify TLS server certificates for outbound federation requests.
#
@@ -558,7 +558,7 @@ acme:
#
# If unspecified, we will use CONFDIR/client.key.
#
- account_key_file: /home/lhoersten/acme_account.key
+ account_key_file: path/to/homeserver/acme_account.key
# List of allowed TLS fingerprints for this server to publish along
# with the signing keys for this server. Other matrix servers that
@@ -627,10 +627,20 @@ acme:
#
# For more information on using Synapse with Postgres, see `docs/postgres.md`.
#
+# database:
+# name: sqlite3
+# args:
+# database: "{{matrix_synapse_sqlite_db}}"
+
database:
- name: sqlite3
- args:
- database: "{{matrix_synapse_db}}"
+ name: psycopg2
+ args:
+ user: "{{matrix_synapse_pgsql_user}}"
+ password: "{{matrix_synapse_pgsql_pass}}"
+ database: "{{matrix_synapse_pgsql_db}}"
+ host: "{{matrix_synapse_pgsql_host}}"
+ cp_min: 5
+ cp_max: 10
# Number of events to cache in memory.
#
@@ -1377,7 +1387,7 @@ saml2_config:
# Instead of putting the config inline as above, you can specify a
# separate pysaml2 configuration file:
#
- #config_path: "/home/lhoersten/sp_conf.py"
+ #config_path: "path/to/homeserver/sp_conf.py"
# The lifetime of a SAML session. This defines how long a user has to
# complete the authentication process, if allow_unsolicited is unset.
diff --git a/matrix-synapse/templates/log.yaml.j2 b/matrix-synapse/templates/log.yaml.j2
new file mode 100644
index 0000000..51aba22
--- /dev/null
+++ b/matrix-synapse/templates/log.yaml.j2
@@ -0,0 +1,56 @@
+
+version: 1
+
+formatters:
+ precise:
+ format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
+ journal_fmt:
+ format: '%(name)s: [%(request)s] %(message)s'
+
+filters:
+ context:
+ (): synapse.util.logcontext.LoggingContextFilter
+ request: ""
+
+handlers:
+ file:
+ class: logging.handlers.WatchedFileHandler
+ formatter: precise
+ filename: /var/log/matrix-synapse/homeserver.log
+ filters: [context]
+ level: ERROR
+ encoding: utf8
+ console:
+ class: logging.StreamHandler
+ formatter: precise
+ level: ERROR
+ journal:
+ class: systemd.journal.JournalHandler
+ formatter: journal_fmt
+ filters: [context]
+ SYSLOG_IDENTIFIER: synapse
+
+loggers:
+ twisted:
+ level: ERROR
+
+ synapse:
+ level: ERROR
+
+ # the following levels are more verbose than most users want
+ # set them to INFO if you need more logging
+ synapse.metrics:
+ level: ERROR
+
+ synapse.http.federation.well_known_resolver:
+ level: ERROR
+
+ synapse.storage.TIME:
+ level: ERROR
+
+ synapse.http.matrixfederationclient:
+ level: ERROR
+
+root:
+ level: ERROR
+ handlers: [journal]
diff --git a/matrix-synapse/templates/setup_db.psql.j2 b/matrix-synapse/templates/setup_db.psql.j2
new file mode 100644
index 0000000..dee0478
--- /dev/null
+++ b/matrix-synapse/templates/setup_db.psql.j2
@@ -0,0 +1,2 @@
+CREATE USER {{matrix_synapse_pgsql_user}} WITH ENCRYPTED PASSWORD '{{matrix_synapse_pgsql_pass}}';
+CREATE DATABASE {{matrix_synapse_pgsql_db}} ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 WITH OWNER {{matrix_synapse_pgsql_user}};