aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-08-16 12:48:34 -0300
committerLeo <thinkabit.ukim@gmail.com>2019-08-16 12:48:34 -0300
commit04b42de371f1bf8a0812cd85245a2124e8eafb1d (patch)
tree3cbb9e05476b73409ec5285ca19c3bee6e923304 /testing
parent364d287d3991d2bee3a144565cb1dc3ffd255138 (diff)
downloadaports-04b42de371f1bf8a0812cd85245a2124e8eafb1d.tar.bz2
aports-04b42de371f1bf8a0812cd85245a2124e8eafb1d.tar.xz
testing/synapse: upgrade to 1.3.0
ref matrix-org/synapse#5732
Diffstat (limited to 'testing')
-rw-r--r--testing/synapse/APKBUILD8
-rw-r--r--testing/synapse/revert-systemd.patch288
2 files changed, 293 insertions, 3 deletions
diff --git a/testing/synapse/APKBUILD b/testing/synapse/APKBUILD
index d127d0883a..e9a01d79bf 100644
--- a/testing/synapse/APKBUILD
+++ b/testing/synapse/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=synapse
-pkgver=1.2.1
+pkgver=1.3.0
pkgrel=0
pkgdesc="Matrix reference homeserver"
url="https://github.com/matrix-org/synapse"
@@ -50,6 +50,7 @@ subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/matrix-org/synapse/archive/v$pkgver.tar.gz
synapse.initd
synapse.confd
+ revert-systemd.patch
"
build() {
@@ -74,6 +75,7 @@ package() {
install -Dm644 "$srcdir"/synapse.confd "$pkgdir"/etc/conf.d/synapse
}
-sha512sums="545bea5b0602add81b9344acd508585b78568395e57d189d62cd76618913183e79c6d543a28bc45c908bfc2b39b799418d4daf90e9cd7cf5b681c760feef0657 synapse-1.2.1.tar.gz
+sha512sums="be891a458119f99a7ae05bc15bab42d274b1848e0cc1db7a2ed87b654be321082f5b064ca22b0ab4846f99a64ad1f88bb4843bdf6f2533cabaa196121df9abde synapse-1.3.0.tar.gz
af8b136f4e4f155001f6a6397e77ca21f1aff749895ac99dbe58a45bfb3a15ce021a6f70dc3aea4c789dc81bf8fabf0841af8351ca35d13741db1730a800e156 synapse.initd
-7c022f0e00c8ac363d6d2e003b6389fb06a3934f68390ebac156cb46bc1366585e6b6cda07b15176bc62a00f5bf21bfda153ff5418b07331257a7075102a6f83 synapse.confd"
+7c022f0e00c8ac363d6d2e003b6389fb06a3934f68390ebac156cb46bc1366585e6b6cda07b15176bc62a00f5bf21bfda153ff5418b07331257a7075102a6f83 synapse.confd
+38838bb2a5709de200d15dce09f46831f896e921a4f980410d703fb4a13f1fb0792a013836b839dcb8a66691680b20c466002a7f2b737eca8e446a9bf30a59c0 revert-systemd.patch"
diff --git a/testing/synapse/revert-systemd.patch b/testing/synapse/revert-systemd.patch
new file mode 100644
index 0000000000..5aaefbbc4b
--- /dev/null
+++ b/testing/synapse/revert-systemd.patch
@@ -0,0 +1,288 @@
+This reverts https://github.com/matrix-org/synapse/pull/5732 which added unconditional
+dependency on systemd.
+
+diff --git a/contrib/systemd-with-workers/system/matrix-synapse-worker@.service b/contrib/systemd-with-workers/system/matrix-synapse-worker@.service
+index 3507e2e..9d980d5 100644
+--- a/contrib/systemd-with-workers/system/matrix-synapse-worker@.service
++++ b/contrib/systemd-with-workers/system/matrix-synapse-worker@.service
+@@ -4,8 +4,7 @@ After=matrix-synapse.service
+ BindsTo=matrix-synapse.service
+
+ [Service]
+-Type=notify
+-NotifyAccess=main
++Type=simple
+ User=matrix-synapse
+ WorkingDirectory=/var/lib/matrix-synapse
+ EnvironmentFile=/etc/default/matrix-synapse
+diff --git a/contrib/systemd-with-workers/system/matrix-synapse.service b/contrib/systemd-with-workers/system/matrix-synapse.service
+index 68e8991..3aae190 100644
+--- a/contrib/systemd-with-workers/system/matrix-synapse.service
++++ b/contrib/systemd-with-workers/system/matrix-synapse.service
+@@ -2,8 +2,7 @@
+ Description=Synapse Matrix Homeserver
+
+ [Service]
+-Type=notify
+-NotifyAccess=main
++Type=simple
+ User=matrix-synapse
+ WorkingDirectory=/var/lib/matrix-synapse
+ EnvironmentFile=/etc/default/matrix-synapse
+diff --git a/contrib/systemd/matrix-synapse.service b/contrib/systemd/matrix-synapse.service
+index 38d369e..595b699 100644
+--- a/contrib/systemd/matrix-synapse.service
++++ b/contrib/systemd/matrix-synapse.service
+@@ -14,9 +14,7 @@
+ Description=Synapse Matrix homeserver
+
+ [Service]
+-Type=notify
+-NotifyAccess=main
+-ExecReload=/bin/kill -HUP $MAINPID
++Type=simple
+ Restart=on-abort
+
+ User=synapse
+diff --git a/synapse/app/_base.py b/synapse/app/_base.py
+index c010e70..540dbd9 100644
+--- a/synapse/app/_base.py
++++ b/synapse/app/_base.py
+@@ -15,12 +15,10 @@
+
+ import gc
+ import logging
+-import os
+ import signal
+ import sys
+ import traceback
+
+-import sdnotify
+ from daemonize import Daemonize
+
+ from twisted.internet import defer, error, reactor
+@@ -244,16 +242,9 @@ def start(hs, listeners=None):
+ if hasattr(signal, "SIGHUP"):
+
+ def handle_sighup(*args, **kwargs):
+- # Tell systemd our state, if we're using it. This will silently fail if
+- # we're not using systemd.
+- sd_channel = sdnotify.SystemdNotifier()
+- sd_channel.notify("RELOADING=1")
+-
+ for i in _sighup_callbacks:
+ i(hs)
+
+- sd_channel.notify("READY=1")
+-
+ signal.signal(signal.SIGHUP, handle_sighup)
+
+ register_sighup(refresh_certificate)
+@@ -269,7 +260,6 @@ def start(hs, listeners=None):
+ hs.get_datastore().start_profiling()
+
+ setup_sentry(hs)
+- setup_sdnotify(hs)
+ except Exception:
+ traceback.print_exc(file=sys.stderr)
+ reactor = hs.get_reactor()
+@@ -302,25 +292,6 @@ def setup_sentry(hs):
+ scope.set_tag("worker_name", name)
+
+
+-def setup_sdnotify(hs):
+- """Adds process state hooks to tell systemd what we are up to.
+- """
+-
+- # Tell systemd our state, if we're using it. This will silently fail if
+- # we're not using systemd.
+- sd_channel = sdnotify.SystemdNotifier()
+-
+- hs.get_reactor().addSystemEventTrigger(
+- "after",
+- "startup",
+- lambda: sd_channel.notify("READY=1\nMAINPID=%s" % (os.getpid())),
+- )
+-
+- hs.get_reactor().addSystemEventTrigger(
+- "before", "shutdown", lambda: sd_channel.notify("STOPPING=1")
+- )
+-
+-
+ def install_dns_limiter(reactor, max_dns_requests_in_flight=100):
+ """Replaces the resolver with one that limits the number of in flight DNS
+ requests.
+diff --git a/synapse/app/appservice.py b/synapse/app/appservice.py
+index 54bb114..e01f3e5 100644
+--- a/synapse/app/appservice.py
++++ b/synapse/app/appservice.py
+@@ -168,9 +168,7 @@ def start(config_options):
+ )
+
+ ps.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ps, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ps, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-appservice", config)
+
+diff --git a/synapse/app/client_reader.py b/synapse/app/client_reader.py
+index 721bb5b..29bddc4 100644
+--- a/synapse/app/client_reader.py
++++ b/synapse/app/client_reader.py
+@@ -194,9 +194,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-client-reader", config)
+
+diff --git a/synapse/app/event_creator.py b/synapse/app/event_creator.py
+index 473c889..042cfd0 100644
+--- a/synapse/app/event_creator.py
++++ b/synapse/app/event_creator.py
+@@ -193,9 +193,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-event-creator", config)
+
+diff --git a/synapse/app/federation_reader.py b/synapse/app/federation_reader.py
+index 5255d9e..76a97f8 100644
+--- a/synapse/app/federation_reader.py
++++ b/synapse/app/federation_reader.py
+@@ -175,9 +175,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-federation-reader", config)
+
+diff --git a/synapse/app/federation_sender.py b/synapse/app/federation_sender.py
+index c5a2880..fec49d5 100644
+--- a/synapse/app/federation_sender.py
++++ b/synapse/app/federation_sender.py
+@@ -198,9 +198,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-federation-sender", config)
+
+diff --git a/synapse/app/frontend_proxy.py b/synapse/app/frontend_proxy.py
+index e2822ca..3824964 100644
+--- a/synapse/app/frontend_proxy.py
++++ b/synapse/app/frontend_proxy.py
+@@ -247,9 +247,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-frontend-proxy", config)
+
+diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
+index 7d6b51b..8233905 100644
+--- a/synapse/app/homeserver.py
++++ b/synapse/app/homeserver.py
+@@ -447,7 +447,7 @@ def setup(config_options):
+ reactor.stop()
+ sys.exit(1)
+
+- reactor.addSystemEventTrigger("before", "startup", start)
++ reactor.callWhenRunning(start)
+
+ return hs
+
+diff --git a/synapse/app/media_repository.py b/synapse/app/media_repository.py
+index 3a16857..50c6d78 100644
+--- a/synapse/app/media_repository.py
++++ b/synapse/app/media_repository.py
+@@ -170,9 +170,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-media-repository", config)
+
+diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py
+index 692ffa2..070de7d 100644
+--- a/synapse/app/pusher.py
++++ b/synapse/app/pusher.py
+@@ -216,7 +216,7 @@ def start(config_options):
+ _base.start(ps, config.worker_listeners)
+ ps.get_pusherpool().start()
+
+- reactor.addSystemEventTrigger("before", "startup", start)
++ reactor.callWhenRunning(start)
+
+ _base.start_worker_reactor("synapse-pusher", config)
+
+diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py
+index a1c3b16..315c030 100644
+--- a/synapse/app/synchrotron.py
++++ b/synapse/app/synchrotron.py
+@@ -451,9 +451,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-synchrotron", config)
+
+diff --git a/synapse/app/user_dir.py b/synapse/app/user_dir.py
+index cb29a1a..03ef21b 100644
+--- a/synapse/app/user_dir.py
++++ b/synapse/app/user_dir.py
+@@ -224,9 +224,7 @@ def start(config_options):
+ )
+
+ ss.setup()
+- reactor.addSystemEventTrigger(
+- "before", "startup", _base.start, ss, config.worker_listeners
+- )
++ reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
+
+ _base.start_worker_reactor("synapse-user-dir", config)
+
+diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py
+index 195a7a7..c6465c0 100644
+--- a/synapse/python_dependencies.py
++++ b/synapse/python_dependencies.py
+@@ -72,7 +72,6 @@ REQUIREMENTS = [
+ "netaddr>=0.7.18",
+ "Jinja2>=2.9",
+ "bleach>=1.4.3",
+- "sdnotify>=0.3",
+ ]
+
+ CONDITIONAL_REQUIREMENTS = {
+