From 833f37d3617d3dcceed404b8ff7783cf50b2cbeb Mon Sep 17 00:00:00 2001 From: David Flatz Date: Wed, 22 Dec 2021 10:58:51 +0100 Subject: [PATCH] synapse: update to 1.49.2. Don't patch sample config. Make run script configurable so that admin can change path to config file and set locale if necessary. Create /etc/synapse again. Log to daemon.notice. --- srcpkgs/synapse/files/synapse/log/run | 4 +- srcpkgs/synapse/files/synapse/run | 3 +- srcpkgs/synapse/patches/sample_config.patch | 88 ------------------- .../synapse/patches/sample_log_config.patch | 13 --- srcpkgs/synapse/template | 7 +- 5 files changed, 9 insertions(+), 106 deletions(-) mode change 120000 => 100644 srcpkgs/synapse/files/synapse/log/run delete mode 100644 srcpkgs/synapse/patches/sample_config.patch delete mode 100644 srcpkgs/synapse/patches/sample_log_config.patch 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/log/run b/srcpkgs/synapse/files/synapse/log/run new file mode 100644 index 000000000000..6d902ea1e4b4 --- /dev/null +++ b/srcpkgs/synapse/files/synapse/log/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec logger -p daemon.notice -t synapse diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run index 1ab3a5a8d54b..780499c8a511 100644 --- a/srcpkgs/synapse/files/synapse/run +++ b/srcpkgs/synapse/files/synapse/run @@ -1,4 +1,5 @@ #!/bin/sh +[ -r ./conf ] && . ./conf cd /var/lib/synapse exec 2>&1 -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} 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 diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template index 2452f6a26ca4..fd38593fb22b 100644 --- a/srcpkgs/synapse/template +++ b/srcpkgs/synapse/template @@ -1,7 +1,7 @@ # Template file for 'synapse' pkgname=synapse -version=1.49.0 -revision=2 +version=1.49.2 +revision=1 build_style=python3-module hostmakedepends="python3-setuptools" depends="python3-jsonschema python3-frozendict python3-canonicaljson @@ -19,13 +19,14 @@ license="Apache-2.0" homepage="https://github.com/matrix-org/synapse" changelog="https://raw.githubusercontent.com/matrix-org/synapse/develop/CHANGES.md" distfiles="https://github.com/matrix-org/synapse/archive/v${version}.tar.gz" -checksum=3c1b73eb36ec3af00868707b929f9b9d1faae9ccc4022c2c46bdb025ef0ead8e +checksum=f5b0017e9d77db94fac853fbefbcb4538d879cb80f404b02003930c76f5cafab system_accounts="synapse" 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() {