Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] synapse: update to 1.49.0.
@ 2021-12-14 14:49 TinfoilSubmarine
  2021-12-17  8:38 ` [PR REVIEW] " ericonr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: TinfoilSubmarine @ 2021-12-14 14:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

There is a new pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages synapse
https://github.com/void-linux/void-packages/pull/34531

synapse: update to 1.49.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()

A patch file from https://github.com/void-linux/void-packages/pull/34531.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-synapse-34531.patch --]
[-- Type: text/x-diff, Size: 6266 bytes --]

From 9614397294126d3d7d5a73613ed1a30c2b6d5840 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 9 Dec 2021 10:49:55 -0500
Subject: [PATCH 1/2] python3-phonenumbers: update to 8.12.39.

---
 srcpkgs/python3-phonenumbers/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/python3-phonenumbers/template b/srcpkgs/python3-phonenumbers/template
index 29e82870d9a4..332733bb9810 100644
--- a/srcpkgs/python3-phonenumbers/template
+++ b/srcpkgs/python3-phonenumbers/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-phonenumbers'
 pkgname=python3-phonenumbers
-version=8.12.38
+version=8.12.39
 revision=1
 wrksrc="phonenumbers-${version}"
 build_style=python3-module
@@ -12,4 +12,4 @@ license="Apache-2.0"
 homepage="https://github.com/daviddrysdale/python-phonenumbers"
 changelog="https://raw.githubusercontent.com/daviddrysdale/python-phonenumbers/dev/python/HISTORY.md"
 distfiles="${PYPI_SITE}/p/phonenumbers/phonenumbers-${version}.tar.gz"
-checksum=3cda1d1cea9a6801babf825e6c0f6a9776ea6d8a68b81b256178f8e5aa813344
+checksum=0f7745e1f108654db347d885e814cbb5f225b8c5f5ce336024b193c79291ddaa

From 7ca63ab04a63236e397f15eb0b19667a3a29ddc5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 2 Dec 2021 12:13:58 -0500
Subject: [PATCH 2/2] synapse: update to 1.49.0.

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()
---
 srcpkgs/synapse/INSTALL              | 27 ------------------------
 srcpkgs/synapse/files/synapse/finish |  2 --
 srcpkgs/synapse/files/synapse/run    |  5 ++---
 srcpkgs/synapse/template             | 31 +++++++++++++++++++++++-----
 4 files changed, 28 insertions(+), 37 deletions(-)
 delete mode 100644 srcpkgs/synapse/INSTALL
 delete mode 100644 srcpkgs/synapse/files/synapse/finish

diff --git a/srcpkgs/synapse/INSTALL b/srcpkgs/synapse/INSTALL
deleted file mode 100644
index fd925ee45e39..000000000000
--- a/srcpkgs/synapse/INSTALL
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Tell user to generate configuration when they first install it
-# Taken from Arch Linux
-#
-case "${ACTION}" in
-post)
-	if [ ! -e /etc/synapse/homeserver.yaml ]; then
-		cat <<-EOF
-		==> A synapse configuration file needs to be generated before you can
-		    start synapse, and you should make sure that it's readable by the
-		    synapse user.
-
-		    cd /var/lib/synapse
-		    sudo -u synapse python3 -m synapse.app.homeserver \\
-		      --server-name my.domain.name \\
-		      --config-path /etc/synapse/homeserver.yaml \\
-		      --generate-config \\
-		      --report-stats=yes
-
-		    N.B.: The default synapse config enables the webclient feature.
-		          You need to either disable it, install the syweb python package
-		          from matrix-angular-sdk, or set 'web_client_location' to a path
-		          to make synapse not try to serve it using syweb.
-		EOF
-	fi
-	;;
-esac
diff --git a/srcpkgs/synapse/files/synapse/finish b/srcpkgs/synapse/files/synapse/finish
deleted file mode 100644
index a5324d1084d6..000000000000
--- a/srcpkgs/synapse/files/synapse/finish
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec synctl stop /etc/synapse/homeserver.yaml
diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run
index b44a41867680..1ab3a5a8d54b 100644
--- a/srcpkgs/synapse/files/synapse/run
+++ b/srcpkgs/synapse/files/synapse/run
@@ -1,5 +1,4 @@
 #!/bin/sh
 cd /var/lib/synapse
-exec chpst -u synapse:synapse python3 \
-						 -m synapse.app.homeserver \
-						 --config-path=/etc/synapse/homeserver.yaml
+exec 2>&1
+exec chpst -u synapse:synapse synapse_homeserver -c /etc/synapse/homeserver.yaml
diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template
index bd5f529503e5..97a27e4f5488 100644
--- a/srcpkgs/synapse/template
+++ b/srcpkgs/synapse/template
@@ -1,6 +1,6 @@
 # Template file for 'synapse'
 pkgname=synapse
-version=1.48.0
+version=1.49.0
 revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
@@ -12,26 +12,47 @@ depends="python3-jsonschema python3-frozendict python3-canonicaljson
  python3-setuptools python3-bleach python3-Jinja2 python3-psycopg2 python3-lxml
  python3-saml2 python3-treq python3-macaroons python3-sortedcontainers
  python3-typing_extensions python3-ijson"
-checkdepends="$depends python3-parameterized"
+checkdepends="$depends python3-parameterized python3-mock"
 short_desc="Matrix reference homeserver"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 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=182facc856f8d0c0d2d0dd4105fae4f851297167c0ee95c202a3aad9ed86c486
+checksum=3c1b73eb36ec3af00868707b929f9b9d1faae9ccc4022c2c46bdb025ef0ead8e
+conf_files="/etc/synapse/homeserver.yaml /etc/synapse/log.yaml"
 
 system_accounts="synapse"
 synapse_homedir="/var/lib/synapse"
 
 make_dirs="
 	/var/lib/synapse 0700 synapse synapse
-	/etc/synapse 0755 synapse synapse"
+	/var/log/synapse 0755 synapse synapse"
+
+post_configure() {
+	# tweak a few lines in the default configs similar to the `generate_config`
+	# and `generate_log_config` scripts, but commenting out
+	# server_name: "SERVERNAME"
+	# instead of setting it to ensure the user does not start synapse without
+	# setting it
+	vsed -e 's,DATADIR,/var/lib/synapse,' \
+	 -e 's,CONFDIR,/etc/synapse,' \
+	 -e 's,pid_file:,#pid_file:,' \
+	 -e 's,server_name: "SERVERNAME",#server_name: "SERVERNAME",' \
+	 -e 's,SERVERNAME.log.config,log.yaml,' \
+	 -i docs/sample_config.yaml
+	vsed -e 's,/var/log/matrix-synapse,/var/log/synapse,' \
+	 -i docs/sample_log_config.yaml
+}
 
 do_check() {
-	PYTHONPATH="." trial3 tests
+	PYTHONPATH="." trial3 ${makejobs} tests
 }
 
 post_install() {
 	vsv synapse
+
+	vmkdir etc/synapse
+	vcopy docs/sample_config.yaml etc/synapse/homeserver.yaml
+	vcopy docs/sample_log_config.yaml etc/synapse/log.yaml
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR REVIEW] synapse: update to 1.49.0.
  2021-12-14 14:49 [PR PATCH] synapse: update to 1.49.0 TinfoilSubmarine
@ 2021-12-17  8:38 ` ericonr
  2021-12-17 12:39 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ericonr @ 2021-12-17  8:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/34531#discussion_r771199421

Comment:
Would it be too hard to make this a patch instead of vseds? Makes things more explicit, I think.

(See `gitea`).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] synapse: update to 1.49.0.
  2021-12-14 14:49 [PR PATCH] synapse: update to 1.49.0 TinfoilSubmarine
  2021-12-17  8:38 ` [PR REVIEW] " ericonr
@ 2021-12-17 12:39 ` TinfoilSubmarine
  2021-12-17 12:39 ` [PR REVIEW] " TinfoilSubmarine
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: TinfoilSubmarine @ 2021-12-17 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages synapse
https://github.com/void-linux/void-packages/pull/34531

synapse: update to 1.49.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()

A patch file from https://github.com/void-linux/void-packages/pull/34531.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-synapse-34531.patch --]
[-- Type: text/x-diff, Size: 10095 bytes --]

From 9614397294126d3d7d5a73613ed1a30c2b6d5840 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 9 Dec 2021 10:49:55 -0500
Subject: [PATCH 1/2] python3-phonenumbers: update to 8.12.39.

---
 srcpkgs/python3-phonenumbers/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/python3-phonenumbers/template b/srcpkgs/python3-phonenumbers/template
index 29e82870d9a4..332733bb9810 100644
--- a/srcpkgs/python3-phonenumbers/template
+++ b/srcpkgs/python3-phonenumbers/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-phonenumbers'
 pkgname=python3-phonenumbers
-version=8.12.38
+version=8.12.39
 revision=1
 wrksrc="phonenumbers-${version}"
 build_style=python3-module
@@ -12,4 +12,4 @@ license="Apache-2.0"
 homepage="https://github.com/daviddrysdale/python-phonenumbers"
 changelog="https://raw.githubusercontent.com/daviddrysdale/python-phonenumbers/dev/python/HISTORY.md"
 distfiles="${PYPI_SITE}/p/phonenumbers/phonenumbers-${version}.tar.gz"
-checksum=3cda1d1cea9a6801babf825e6c0f6a9776ea6d8a68b81b256178f8e5aa813344
+checksum=0f7745e1f108654db347d885e814cbb5f225b8c5f5ce336024b193c79291ddaa

From 4d90f1aa4b4c763d4d55c44431d0b4942160bb4d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 2 Dec 2021 12:13:58 -0500
Subject: [PATCH 2/2] synapse: update to 1.49.0.

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()
---
 srcpkgs/synapse/INSTALL                       | 27 ------
 srcpkgs/synapse/files/synapse/finish          |  2 -
 srcpkgs/synapse/files/synapse/run             |  5 +-
 srcpkgs/synapse/patches/sample_config.patch   | 88 +++++++++++++++++++
 .../synapse/patches/sample_log_config.patch   | 13 +++
 srcpkgs/synapse/template                      | 15 ++--
 6 files changed, 113 insertions(+), 37 deletions(-)
 delete mode 100644 srcpkgs/synapse/INSTALL
 delete mode 100644 srcpkgs/synapse/files/synapse/finish
 create mode 100644 srcpkgs/synapse/patches/sample_config.patch
 create mode 100644 srcpkgs/synapse/patches/sample_log_config.patch

diff --git a/srcpkgs/synapse/INSTALL b/srcpkgs/synapse/INSTALL
deleted file mode 100644
index fd925ee45e39..000000000000
--- a/srcpkgs/synapse/INSTALL
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Tell user to generate configuration when they first install it
-# Taken from Arch Linux
-#
-case "${ACTION}" in
-post)
-	if [ ! -e /etc/synapse/homeserver.yaml ]; then
-		cat <<-EOF
-		==> A synapse configuration file needs to be generated before you can
-		    start synapse, and you should make sure that it's readable by the
-		    synapse user.
-
-		    cd /var/lib/synapse
-		    sudo -u synapse python3 -m synapse.app.homeserver \\
-		      --server-name my.domain.name \\
-		      --config-path /etc/synapse/homeserver.yaml \\
-		      --generate-config \\
-		      --report-stats=yes
-
-		    N.B.: The default synapse config enables the webclient feature.
-		          You need to either disable it, install the syweb python package
-		          from matrix-angular-sdk, or set 'web_client_location' to a path
-		          to make synapse not try to serve it using syweb.
-		EOF
-	fi
-	;;
-esac
diff --git a/srcpkgs/synapse/files/synapse/finish b/srcpkgs/synapse/files/synapse/finish
deleted file mode 100644
index a5324d1084d6..000000000000
--- a/srcpkgs/synapse/files/synapse/finish
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec synctl stop /etc/synapse/homeserver.yaml
diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run
index b44a41867680..1ab3a5a8d54b 100644
--- a/srcpkgs/synapse/files/synapse/run
+++ b/srcpkgs/synapse/files/synapse/run
@@ -1,5 +1,4 @@
 #!/bin/sh
 cd /var/lib/synapse
-exec chpst -u synapse:synapse python3 \
-						 -m synapse.app.homeserver \
-						 --config-path=/etc/synapse/homeserver.yaml
+exec 2>&1
+exec chpst -u synapse:synapse synapse_homeserver -c /etc/synapse/homeserver.yaml
diff --git a/srcpkgs/synapse/patches/sample_config.patch b/srcpkgs/synapse/patches/sample_config.patch
new file mode 100644
index 000000000000..15954e0cd782
--- /dev/null
+++ b/srcpkgs/synapse/patches/sample_config.patch
@@ -0,0 +1,88 @@
+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
new file mode 100644
index 000000000000..e4196a446456
--- /dev/null
+++ b/srcpkgs/synapse/patches/sample_log_config.patch
@@ -0,0 +1,13 @@
+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 bd5f529503e5..b096a6441cdd 100644
--- a/srcpkgs/synapse/template
+++ b/srcpkgs/synapse/template
@@ -1,6 +1,6 @@
 # Template file for 'synapse'
 pkgname=synapse
-version=1.48.0
+version=1.49.0
 revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
@@ -12,26 +12,31 @@ depends="python3-jsonschema python3-frozendict python3-canonicaljson
  python3-setuptools python3-bleach python3-Jinja2 python3-psycopg2 python3-lxml
  python3-saml2 python3-treq python3-macaroons python3-sortedcontainers
  python3-typing_extensions python3-ijson"
-checkdepends="$depends python3-parameterized"
+checkdepends="$depends python3-parameterized python3-mock"
 short_desc="Matrix reference homeserver"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 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=182facc856f8d0c0d2d0dd4105fae4f851297167c0ee95c202a3aad9ed86c486
+checksum=3c1b73eb36ec3af00868707b929f9b9d1faae9ccc4022c2c46bdb025ef0ead8e
+conf_files="/etc/synapse/homeserver.yaml /etc/synapse/log.yaml"
 
 system_accounts="synapse"
 synapse_homedir="/var/lib/synapse"
 
 make_dirs="
 	/var/lib/synapse 0700 synapse synapse
-	/etc/synapse 0755 synapse synapse"
+	/var/log/synapse 0755 synapse synapse"
 
 do_check() {
-	PYTHONPATH="." trial3 tests
+	PYTHONPATH="." trial3 ${makejobs} tests
 }
 
 post_install() {
 	vsv synapse
+
+	vmkdir etc/synapse
+	vcopy docs/sample_config.yaml etc/synapse/homeserver.yaml
+	vcopy docs/sample_log_config.yaml etc/synapse/log.yaml
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR REVIEW] synapse: update to 1.49.0.
  2021-12-14 14:49 [PR PATCH] synapse: update to 1.49.0 TinfoilSubmarine
  2021-12-17  8:38 ` [PR REVIEW] " ericonr
  2021-12-17 12:39 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2021-12-17 12:39 ` TinfoilSubmarine
  2021-12-17 15:39 ` [PR PATCH] [Updated] " TinfoilSubmarine
  2021-12-19 19:55 ` [PR PATCH] [Merged]: " ericonr
  4 siblings, 0 replies; 6+ messages in thread
From: TinfoilSubmarine @ 2021-12-17 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/34531#discussion_r771364040

Comment:
Changed to patch, thanks for the advice!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] synapse: update to 1.49.0.
  2021-12-14 14:49 [PR PATCH] synapse: update to 1.49.0 TinfoilSubmarine
                   ` (2 preceding siblings ...)
  2021-12-17 12:39 ` [PR REVIEW] " TinfoilSubmarine
@ 2021-12-17 15:39 ` TinfoilSubmarine
  2021-12-19 19:55 ` [PR PATCH] [Merged]: " ericonr
  4 siblings, 0 replies; 6+ messages in thread
From: TinfoilSubmarine @ 2021-12-17 15:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages synapse
https://github.com/void-linux/void-packages/pull/34531

synapse: update to 1.49.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()

A patch file from https://github.com/void-linux/void-packages/pull/34531.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-synapse-34531.patch --]
[-- Type: text/x-diff, Size: 10087 bytes --]

From 9614397294126d3d7d5a73613ed1a30c2b6d5840 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 9 Dec 2021 10:49:55 -0500
Subject: [PATCH 1/2] python3-phonenumbers: update to 8.12.39.

---
 srcpkgs/python3-phonenumbers/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/python3-phonenumbers/template b/srcpkgs/python3-phonenumbers/template
index 29e82870d9a4..332733bb9810 100644
--- a/srcpkgs/python3-phonenumbers/template
+++ b/srcpkgs/python3-phonenumbers/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-phonenumbers'
 pkgname=python3-phonenumbers
-version=8.12.38
+version=8.12.39
 revision=1
 wrksrc="phonenumbers-${version}"
 build_style=python3-module
@@ -12,4 +12,4 @@ license="Apache-2.0"
 homepage="https://github.com/daviddrysdale/python-phonenumbers"
 changelog="https://raw.githubusercontent.com/daviddrysdale/python-phonenumbers/dev/python/HISTORY.md"
 distfiles="${PYPI_SITE}/p/phonenumbers/phonenumbers-${version}.tar.gz"
-checksum=3cda1d1cea9a6801babf825e6c0f6a9776ea6d8a68b81b256178f8e5aa813344
+checksum=0f7745e1f108654db347d885e814cbb5f225b8c5f5ce336024b193c79291ddaa

From cf0e05f0797b4abd0570c40db496fadea6dd91dc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Thu, 2 Dec 2021 12:13:58 -0500
Subject: [PATCH 2/2] synapse: update to 1.49.0.

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()
---
 srcpkgs/synapse/INSTALL                       | 27 ------
 srcpkgs/synapse/files/synapse/finish          |  2 -
 srcpkgs/synapse/files/synapse/run             |  5 +-
 srcpkgs/synapse/patches/sample_config.patch   | 88 +++++++++++++++++++
 .../synapse/patches/sample_log_config.patch   | 13 +++
 srcpkgs/synapse/template                      | 14 +--
 6 files changed, 112 insertions(+), 37 deletions(-)
 delete mode 100644 srcpkgs/synapse/INSTALL
 delete mode 100644 srcpkgs/synapse/files/synapse/finish
 create mode 100644 srcpkgs/synapse/patches/sample_config.patch
 create mode 100644 srcpkgs/synapse/patches/sample_log_config.patch

diff --git a/srcpkgs/synapse/INSTALL b/srcpkgs/synapse/INSTALL
deleted file mode 100644
index fd925ee45e39..000000000000
--- a/srcpkgs/synapse/INSTALL
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Tell user to generate configuration when they first install it
-# Taken from Arch Linux
-#
-case "${ACTION}" in
-post)
-	if [ ! -e /etc/synapse/homeserver.yaml ]; then
-		cat <<-EOF
-		==> A synapse configuration file needs to be generated before you can
-		    start synapse, and you should make sure that it's readable by the
-		    synapse user.
-
-		    cd /var/lib/synapse
-		    sudo -u synapse python3 -m synapse.app.homeserver \\
-		      --server-name my.domain.name \\
-		      --config-path /etc/synapse/homeserver.yaml \\
-		      --generate-config \\
-		      --report-stats=yes
-
-		    N.B.: The default synapse config enables the webclient feature.
-		          You need to either disable it, install the syweb python package
-		          from matrix-angular-sdk, or set 'web_client_location' to a path
-		          to make synapse not try to serve it using syweb.
-		EOF
-	fi
-	;;
-esac
diff --git a/srcpkgs/synapse/files/synapse/finish b/srcpkgs/synapse/files/synapse/finish
deleted file mode 100644
index a5324d1084d6..000000000000
--- a/srcpkgs/synapse/files/synapse/finish
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec synctl stop /etc/synapse/homeserver.yaml
diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run
index b44a41867680..1ab3a5a8d54b 100644
--- a/srcpkgs/synapse/files/synapse/run
+++ b/srcpkgs/synapse/files/synapse/run
@@ -1,5 +1,4 @@
 #!/bin/sh
 cd /var/lib/synapse
-exec chpst -u synapse:synapse python3 \
-						 -m synapse.app.homeserver \
-						 --config-path=/etc/synapse/homeserver.yaml
+exec 2>&1
+exec chpst -u synapse:synapse synapse_homeserver -c /etc/synapse/homeserver.yaml
diff --git a/srcpkgs/synapse/patches/sample_config.patch b/srcpkgs/synapse/patches/sample_config.patch
new file mode 100644
index 000000000000..15954e0cd782
--- /dev/null
+++ b/srcpkgs/synapse/patches/sample_config.patch
@@ -0,0 +1,88 @@
+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
new file mode 100644
index 000000000000..e4196a446456
--- /dev/null
+++ b/srcpkgs/synapse/patches/sample_log_config.patch
@@ -0,0 +1,13 @@
+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 bd5f529503e5..076294326efb 100644
--- a/srcpkgs/synapse/template
+++ b/srcpkgs/synapse/template
@@ -1,6 +1,6 @@
 # Template file for 'synapse'
 pkgname=synapse
-version=1.48.0
+version=1.49.0
 revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
@@ -12,26 +12,30 @@ depends="python3-jsonschema python3-frozendict python3-canonicaljson
  python3-setuptools python3-bleach python3-Jinja2 python3-psycopg2 python3-lxml
  python3-saml2 python3-treq python3-macaroons python3-sortedcontainers
  python3-typing_extensions python3-ijson"
-checkdepends="$depends python3-parameterized"
+checkdepends="$depends python3-parameterized python3-mock"
 short_desc="Matrix reference homeserver"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 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=182facc856f8d0c0d2d0dd4105fae4f851297167c0ee95c202a3aad9ed86c486
+checksum=3c1b73eb36ec3af00868707b929f9b9d1faae9ccc4022c2c46bdb025ef0ead8e
+conf_files="/etc/synapse/homeserver.yaml /etc/synapse/log.yaml"
 
 system_accounts="synapse"
 synapse_homedir="/var/lib/synapse"
 
 make_dirs="
 	/var/lib/synapse 0700 synapse synapse
-	/etc/synapse 0755 synapse synapse"
+	/var/log/synapse 0755 synapse synapse"
 
 do_check() {
-	PYTHONPATH="." trial3 tests
+	PYTHONPATH="." trial3 ${makejobs} tests
 }
 
 post_install() {
 	vsv synapse
+
+	vinstall docs/sample_config.yaml 644 etc/synapse homeserver.yaml
+	vinstall docs/sample_log_config.yaml 644 etc/synapse log.yaml
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Merged]: synapse: update to 1.49.0.
  2021-12-14 14:49 [PR PATCH] synapse: update to 1.49.0 TinfoilSubmarine
                   ` (3 preceding siblings ...)
  2021-12-17 15:39 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2021-12-19 19:55 ` ericonr
  4 siblings, 0 replies; 6+ messages in thread
From: ericonr @ 2021-12-19 19:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1377 bytes --]

There's a merged pull request on the void-packages repository

synapse: update to 1.49.0.
https://github.com/void-linux/void-packages/pull/34531

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Remove outdated INSTALL and include default configs in package instead

Remove unneeded `finish` script from `synapse` service

Use `synapse_homeserver` entrypoint instead of calling python directly

Redirect stderr to stdout so that errors with config can be seen by user

Support ${makejobs} in do_check()

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-19 19:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 14:49 [PR PATCH] synapse: update to 1.49.0 TinfoilSubmarine
2021-12-17  8:38 ` [PR REVIEW] " ericonr
2021-12-17 12:39 ` [PR PATCH] [Updated] " TinfoilSubmarine
2021-12-17 12:39 ` [PR REVIEW] " TinfoilSubmarine
2021-12-17 15:39 ` [PR PATCH] [Updated] " TinfoilSubmarine
2021-12-19 19:55 ` [PR PATCH] [Merged]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).