From e6609349c7dd752438d4d9af4338ec4de12b960a Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Mon, 17 Jun 2024 13:36:24 +0200 Subject: [PATCH] net-im/sliding-sync: new package, add 0.99.18 Signed-off-by: Alarig Le Lay --- .../md5-cache/net-im/sliding-sync-0.99.18 | 15 +++++++ net-im/sliding-sync/Manifest | 2 + net-im/sliding-sync/files/sliding-sync.confd | 42 +++++++++++++++++++ net-im/sliding-sync/files/sliding-sync.initd | 29 +++++++++++++ .../sliding-sync/files/sliding-sync.service | 11 +++++ net-im/sliding-sync/metadata.xml | 13 ++++++ .../sliding-sync/sliding-sync-0.99.18.ebuild | 32 ++++++++++++++ 7 files changed, 144 insertions(+) create mode 100644 metadata/md5-cache/net-im/sliding-sync-0.99.18 create mode 100644 net-im/sliding-sync/Manifest create mode 100644 net-im/sliding-sync/files/sliding-sync.confd create mode 100644 net-im/sliding-sync/files/sliding-sync.initd create mode 100644 net-im/sliding-sync/files/sliding-sync.service create mode 100644 net-im/sliding-sync/metadata.xml create mode 100644 net-im/sliding-sync/sliding-sync-0.99.18.ebuild diff --git a/metadata/md5-cache/net-im/sliding-sync-0.99.18 b/metadata/md5-cache/net-im/sliding-sync-0.99.18 new file mode 100644 index 0000000..bf4ee86 --- /dev/null +++ b/metadata/md5-cache/net-im/sliding-sync-0.99.18 @@ -0,0 +1,15 @@ +BDEPEND=>=dev-lang/go-1.20:= app-arch/unzip virtual/pkgconfig +DEFINED_PHASES=compile install unpack +DEPEND=dev-db/postgresql +DESCRIPTION=Proxy implementation of MSC3575's sync protocol. +EAPI=8 +HOMEPAGE=https://github.com/matrix-org/sliding-sync +INHERIT=go-module systemd +KEYWORDS=~amd64 +LICENSE=Apache-2.0 +RDEPEND=dev-db/postgresql +RESTRICT=strip +SLOT=0 +SRC_URI=https://github.com/matrix-org/sliding-sync/archive/v0.99.18.tar.gz -> sliding-sync-0.99.18.gh.tar.gz https://herbizarre.swordarmor.fr/garbage/sliding-sync-0.99.18-deps.tar.xz +_eclasses_=multiprocessing 30ead54fa2e2b5f9cd4e612ffc34d0fe toolchain-funcs e56c7649b804f051623c8bc1a1c44084 multilib c19072c3cd7ac5cb21de013f7e9832e0 flag-o-matic d309b9713dfc18e754cba88d3ba69653 go-env dbefaac6fd7019213514bccd65949d9a go-module 83fd3ed1657cfc316c93d6a37018290d systemd c8b03e8df84486aa991d4396686e8942 +_md5_=c2802186476af551d3d75a9d3c7d44c0 diff --git a/net-im/sliding-sync/Manifest b/net-im/sliding-sync/Manifest new file mode 100644 index 0000000..8ce4108 --- /dev/null +++ b/net-im/sliding-sync/Manifest @@ -0,0 +1,2 @@ +DIST sliding-sync-0.99.18-deps.tar.xz 57931848 BLAKE2B ba3bc41d13c7cfe77738d3226375ba4949c0d18e94e960e6ee4fdbeab787e9ad88ed7d6a413c8405e9b95cb4a24948673666cc563c548206564901432ee61541 SHA512 eb9b5008d86b119e4303e4631171f7f1096a661503728df2ee589d6170293e980677616801686e928adcb1d713bce40823daaf9e00e5720f67c5814ddbdb2b08 +DIST sliding-sync-0.99.18.gh.tar.gz 821718 BLAKE2B 29aa6fce3b00a0ffa6daf80e4e7ca92f37c205f7471e063547db44cf42c00488151a536225e072e1e914b051b99ca46f7bc157f02918282de29d1a48174cd1c7 SHA512 ba750b96ee13b1aae9d315f0dcfbaefa8b2c07fee0dbe2b9b2716e8d2e6c3030cfbceed775c3dd6ca945f27cb5c6bb9b860335023285ef08eb7dbad6411bf9bc diff --git a/net-im/sliding-sync/files/sliding-sync.confd b/net-im/sliding-sync/files/sliding-sync.confd new file mode 100644 index 0000000..22a7626 --- /dev/null +++ b/net-im/sliding-sync/files/sliding-sync.confd @@ -0,0 +1,42 @@ +# Required. The destination homeserver to talk to (CS API HTTPS URL) e.g 'https://matrix-client.matrix.org' (Supports unix socket: /path/to/socket) +SYNCV3_SERVER="https://matrix-client.matrix.org" + +# Required. The postgres connection string: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING +SYNCV3_DB="user=dbuser dbname=syncv3 sslmode=disable password='DATABASE_PASSWORD_HERE'" + +# Required. A secret to use to encrypt access tokens. Must remain the same for the lifetime of the database. +# You can generate it with, eg. `openssl rand -hex 32` +SYNCV3_SECRET="CHANGEME" + +# Default: 0.0.0.0:8008. The interface and port to listen on. (Supports unix socket: /path/to/socket) +SYNCV3_BINDADDR=0.0.0.0:8008 + +# Default: unset. Path to a certificate file to serve to HTTPS clients. Specifying this enables TLS on the bound address. +# SYNCV3_TLS_CERT= + +# Default: unset. Path to a key file for the certificate. Must be provided along with the certificate file. +# SYNCV3_TLS_KEY= + +# Default: unset. The bind addr for pprof debugging e.g ':6060'. If not set, does not listen. +# SYNCV3_PPROF= + +# Default: unset. The bind addr for Prometheus metrics, which will be accessible at /metrics at this address. +# SYNCV3_PROM= + +# Default: unset. The OTLP HTTP URL to send spans to e.g https://localhost:4318 - if unset does not send OTLP traces. +# SYNCV3_OTLP_URL= + +# Default: unset. The OTLP username for Basic auth. If unset, does not send an Authorization header. +# SYNCV3_OTLP_USERNAME= + +# Default: unset. The OTLP password for Basic auth. If unset, does not send an Authorization header. +# SYNCV3_OTLP_PASSWORD= + +# Default: unset. The Sentry DSN to report events to e.g https://sliding-sync@sentry.example.com/123 - if unset does not send sentry events. +# SYNCV3_SENTRY_DSN= + +# Default: info. The level of verbosity for messages logged. Available values are trace, debug, info, warn, error and fatal +SYNCV3_LOG_LEVEL="info" + +# Default: unset. Max database connections to use when communicating with postgres. Unset or 0 means no limit. +SYNCV3_MAX_DB_CONN="0" \ No newline at end of file diff --git a/net-im/sliding-sync/files/sliding-sync.initd b/net-im/sliding-sync/files/sliding-sync.initd new file mode 100644 index 0000000..7a8fdea --- /dev/null +++ b/net-im/sliding-sync/files/sliding-sync.initd @@ -0,0 +1,29 @@ +#!/sbin/openrc-run + +export SYNCV3_SERVER=${SYNCV3_SERVER:-"https://matrix-client.matrix.org"} +export SYNCV3_DB=${SYNCV3_DB:-"user=dbuser dbname=syncv3 sslmode=disable password='DATABASE_PASSWORD_HERE'"} +export SYNCV3_SECRET=${SYNCV3_SECRET:-"CHANGEME"} +export SYNCV3_BINDADDR=${SYNCV3_BINDADDR:-"0.0.0.0:8008"} +export SYNCV3_TLS_CERT=${SYNCV3_TLS_CERT:-} +export SYNCV3_TLS_KEY=${SYNCV3_TLS_KEY:-} +export SYNCV3_PPROF=${SYNCV3_PPROF:-} +export SYNCV3_PROM=${SYNCV3_PROM:-} +export SYNCV3_OTLP_URL=${SYNCV3_OTLP_URL:-} +export SYNCV3_OTLP_USERNAME=${SYNCV3_OTLP_USERNAME:-} +export SYNCV3_OTLP_PASSWORD=${SYNCV3_OTLP_PASSWORD:-} +export SYNCV3_SENTRY_DSN=${SYNCV3_SENTRY_DSN:-} +export SYNCV3_LOG_LEVEL=${SYNCV3_LOG_LEVEL:-"info"} +export SYNCV3_MAX_DB_CONN=${SYNCV3_MAX_DB_CONN:-"0"} + +name="syncv3" +description="Proxy implementation of MSC3575's sync protocol" +command="/usr/bin/syncv3" +command_background=true +pidfile="/run/${RC_SVCNAME}.pid" + +output_log="/var/log/sliding-sync.log" +error_log="/var/log/sliding-sync.log" + +depend() { + need net +} diff --git a/net-im/sliding-sync/files/sliding-sync.service b/net-im/sliding-sync/files/sliding-sync.service new file mode 100644 index 0000000..ab928e8 --- /dev/null +++ b/net-im/sliding-sync/files/sliding-sync.service @@ -0,0 +1,11 @@ +[Unit] +Description=Proxy implementation of MSC3575's sync protocol +After=network.target + +[Service] +EnvironmentFile=/etc/conf.d/sliding-sync +Restart=always +ExecStart=/usr/bin/syncv3 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/net-im/sliding-sync/metadata.xml b/net-im/sliding-sync/metadata.xml new file mode 100644 index 0000000..bfdd776 --- /dev/null +++ b/net-im/sliding-sync/metadata.xml @@ -0,0 +1,13 @@ + + + + + Julien Roy + julien@jroy.ca + + + https://github.com/matrix-org/sliding-sync/issues + https://github.com/matrix-org/sliding-sync/releases + matrix-org/sliding-sync + + diff --git a/net-im/sliding-sync/sliding-sync-0.99.18.ebuild b/net-im/sliding-sync/sliding-sync-0.99.18.ebuild new file mode 100644 index 0000000..16e1b73 --- /dev/null +++ b/net-im/sliding-sync/sliding-sync-0.99.18.ebuild @@ -0,0 +1,32 @@ +# Copyright 2023-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +DESCRIPTION="Proxy implementation of MSC3575's sync protocol." +HOMEPAGE="https://github.com/matrix-org/sliding-sync" +SRC_URI=" + https://github.com/matrix-org/sliding-sync/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz + https://herbizarre.swordarmor.fr/garbage/${P}-deps.tar.xz +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND="dev-db/postgresql" +DEPEND="${RDEPEND}" + +src_compile() { + ego build "${S}/cmd/syncv3" +} + +src_install() { + dobin syncv3 + + newinitd "${FILESDIR}"/sliding-sync.initd sliding-sync + newconfd "${FILESDIR}"/sliding-sync.confd sliding-sync + systemd_dounit "${FILESDIR}"/sliding-sync.service +}