From d5eb0cccdd0a829147b505d15be798f279733830 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Fri, 31 Dec 2021 09:45:03 +0100 Subject: [PATCH 1/5] synapse: remove logging process. By default synapse only logs to stderr when there is a problem with configuration. For this we don't need a process running that won't do anything for 99% of the time. Logging to runsvdir should be enough. --- srcpkgs/synapse/files/synapse/log/run | 1 - srcpkgs/synapse/files/synapse/run | 1 - 2 files changed, 2 deletions(-) delete mode 120000 srcpkgs/synapse/files/synapse/log/run diff --git a/srcpkgs/synapse/files/synapse/log/run b/srcpkgs/synapse/files/synapse/log/run deleted file mode 120000 index 3a5b4a586051..000000000000 --- a/srcpkgs/synapse/files/synapse/log/run +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/vlogger \ No newline at end of file diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run index 1ab3a5a8d54b..b0ed0c0b28b3 100644 --- a/srcpkgs/synapse/files/synapse/run +++ b/srcpkgs/synapse/files/synapse/run @@ -1,4 +1,3 @@ #!/bin/sh cd /var/lib/synapse -exec 2>&1 exec chpst -u synapse:synapse synapse_homeserver -c /etc/synapse/homeserver.yaml From 56aa3e6067e44dcdc41ac3d51b6156b4bc0264c3 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Fri, 31 Dec 2021 09:48:57 +0100 Subject: [PATCH 2/5] synapse: make service configurable. That way one can set desired locale and path to config file. --- srcpkgs/synapse/files/synapse/run | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run index b0ed0c0b28b3..0778d6317328 100644 --- a/srcpkgs/synapse/files/synapse/run +++ b/srcpkgs/synapse/files/synapse/run @@ -1,3 +1,4 @@ #!/bin/sh +[ -r ./conf ] && . ./conf cd /var/lib/synapse -exec chpst -u synapse:synapse synapse_homeserver -c /etc/synapse/homeserver.yaml +exec chpst -u synapse:synapse synapse_homeserver -c ${CONFIG_FILE:-/etc/synapse/homeserver.yaml} From 24eb8b4da9d496b42f9abd2d7091d4f51d1fb323 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Fri, 31 Dec 2021 09:50:33 +0100 Subject: [PATCH 3/5] synapse: remove patches to sample config. --- srcpkgs/synapse/patches/sample_config.patch | 88 ------------------- .../synapse/patches/sample_log_config.patch | 13 --- 2 files changed, 101 deletions(-) delete mode 100644 srcpkgs/synapse/patches/sample_config.patch delete mode 100644 srcpkgs/synapse/patches/sample_log_config.patch diff --git a/srcpkgs/synapse/patches/sample_config.patch b/srcpkgs/synapse/patches/sample_config.patch deleted file mode 100644 index 15954e0cd782..000000000000 --- a/srcpkgs/synapse/patches/sample_config.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff --git a/docs/sample_config.yaml b/docs/sample_config.yaml -index 6696ed5d1..f17661fff 100644 ---- a/docs/sample_config.yaml -+++ b/docs/sample_config.yaml -@@ -68,11 +68,11 @@ modules: - # lowercase and may contain an explicit port. - # Examples: matrix.org, localhost:8080 - # --server_name: "SERVERNAME" -+#server_name: "SERVERNAME" - - # When running as a daemon, the file to store the pid in - # --pid_file: DATADIR/homeserver.pid -+#pid_file: /var/lib/synapse/homeserver.pid - - # The absolute URL to the web client which /_matrix/client will redirect - # to if 'webclient' is configured under the 'listeners' configuration. -@@ -370,8 +370,8 @@ manhole_settings: - # If these are left unset, then hardcoded and non-secret keys are used, - # which could allow traffic to be intercepted if sent over a public network. - # -- #ssh_priv_key_path: CONFDIR/id_rsa -- #ssh_pub_key_path: CONFDIR/id_rsa.pub -+ #ssh_priv_key_path: /etc/synapse/id_rsa -+ #ssh_pub_key_path: /etc/synapse/id_rsa.pub - - # Forward extremities can build up in a room due to networking delays between - # homeservers. Once this happens in a large room, calculation of the state of -@@ -614,11 +614,11 @@ retention: - # any intermediate certificates (for instance, if using certbot, use - # `fullchain.pem` as your certificate, not `cert.pem`). - # --#tls_certificate_path: "CONFDIR/SERVERNAME.tls.crt" -+#tls_certificate_path: "/etc/synapse/SERVERNAME.tls.crt" - - # PEM-encoded private key for TLS - # --#tls_private_key_path: "CONFDIR/SERVERNAME.tls.key" -+#tls_private_key_path: "/etc/synapse/SERVERNAME.tls.key" - - # Whether to verify TLS server certificates for outbound federation requests. - # -@@ -808,7 +808,7 @@ caches: - database: - name: sqlite3 - args: -- database: DATADIR/homeserver.db -+ database: /var/lib/synapse/homeserver.db - - - ## Logging ## -@@ -816,7 +816,7 @@ database: - # A yaml python logging config file as described by - # https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema - # --log_config: "CONFDIR/SERVERNAME.log.config" -+log_config: "/etc/synapse/log.yaml" - - - ## Ratelimiting ## -@@ -942,7 +942,7 @@ log_config: "CONFDIR/SERVERNAME.log.config" - - # Directory where uploaded images and attachments are stored. - # --media_store_path: "DATADIR/media_store" -+media_store_path: "/var/lib/synapse/media_store" - - # Media storage providers allow media to be stored in different - # locations. -@@ -1531,7 +1531,7 @@ room_prejoin_state: - - # Path to the signing key to sign messages with - # --signing_key_path: "CONFDIR/SERVERNAME.signing.key" -+signing_key_path: "/etc/synapse/SERVERNAME.signing.key" - - # The keys that the server used to sign messages with but won't use - # to sign new messages. -@@ -1710,7 +1710,7 @@ saml2_config: - # Instead of putting the config inline as above, you can specify a - # separate pysaml2 configuration file: - # -- #config_path: "CONFDIR/sp_conf.py" -+ #config_path: "/etc/synapse/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/srcpkgs/synapse/patches/sample_log_config.patch b/srcpkgs/synapse/patches/sample_log_config.patch deleted file mode 100644 index e4196a446456..000000000000 --- a/srcpkgs/synapse/patches/sample_log_config.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/docs/sample_log_config.yaml b/docs/sample_log_config.yaml -index 2485ad25e..71465726b 100644 ---- a/docs/sample_log_config.yaml -+++ b/docs/sample_log_config.yaml -@@ -19,7 +19,7 @@ handlers: - file: - class: logging.handlers.TimedRotatingFileHandler - formatter: precise -- filename: /var/log/matrix-synapse/homeserver.log -+ filename: /var/log/synapse/homeserver.log - when: midnight - backupCount: 3 # Does not include the current log file. - encoding: utf8 From 0f4aed2ea527fc073bda8dc1363193cefe1e57b1 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Fri, 31 Dec 2021 09:51:01 +0100 Subject: [PATCH 4/5] synapse: create directory for config. --- srcpkgs/synapse/template | 1 + 1 file changed, 1 insertion(+) diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template index abdb2e314e62..fd38593fb22b 100644 --- a/srcpkgs/synapse/template +++ b/srcpkgs/synapse/template @@ -26,6 +26,7 @@ synapse_homedir="/var/lib/synapse" make_dirs=" /var/lib/synapse 0700 synapse synapse + /etc/synapse 755 synapse synapse /var/log/synapse 0755 synapse synapse" do_check() { From bcc71989b11be0a9c00dba986478dd589d8046ac Mon Sep 17 00:00:00 2001 From: David Flatz Date: Wed, 5 Jan 2022 09:08:48 +0100 Subject: [PATCH 5/5] synapse: revbump for miscellaneous changes. --- srcpkgs/synapse/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template index fd38593fb22b..e0e3da99e2ab 100644 --- a/srcpkgs/synapse/template +++ b/srcpkgs/synapse/template @@ -1,7 +1,7 @@ # Template file for 'synapse' pkgname=synapse version=1.49.2 -revision=1 +revision=2 build_style=python3-module hostmakedepends="python3-setuptools" depends="python3-jsonschema python3-frozendict python3-canonicaljson