commit:     05ce96e01cf95eaafa0bc788d945ff64551d4df9
Author:     Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Sun Mar 24 18:44:30 2024 +0000
Commit:     Julien Roy <julien <AT> jroy <DOT> ca>
CommitDate: Sun Mar 24 19:23:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=05ce96e0

net-im/sliding-sync: new package, add 0.99.15

Signed-off-by: Julien Roy <julien <AT> jroy.ca>

 net-im/sliding-sync/Manifest                    |  2 ++
 net-im/sliding-sync/files/sliding-sync.confd    | 42 +++++++++++++++++++++++++
 net-im/sliding-sync/files/sliding-sync.initd    | 29 +++++++++++++++++
 net-im/sliding-sync/files/sliding-sync.service  | 11 +++++++
 net-im/sliding-sync/metadata.xml                | 13 ++++++++
 net-im/sliding-sync/sliding-sync-0.99.15.ebuild | 32 +++++++++++++++++++
 6 files changed, 129 insertions(+)

diff --git a/net-im/sliding-sync/Manifest b/net-im/sliding-sync/Manifest
new file mode 100644
index 0000000000..c2595086e7
--- /dev/null
+++ b/net-im/sliding-sync/Manifest
@@ -0,0 +1,2 @@
+DIST sliding-sync-0.99.15-deps.tar.xz 57914328 BLAKE2B 
1a3353e0dc73a972c6b5c252f4a88cfeaee55af43eb875684fe68935d7b1f7c2d3d71cfa2797c78137dd9395e20afa24124c7adfa7af89eeca23bddcf85f4cc3
 SHA512 
abe3f462bbd4d7b90527f4b99ed05c659f300eb198d116ea8725b0704ae97fc64a4afba433aeef5e0048c6a00a3eadb599e65300605eae7426e1b8b1ccf5ca4b
+DIST sliding-sync-0.99.15.gh.tar.gz 812268 BLAKE2B 
dc732e943bc7041ccc1e7f8159a8b6c544a0555cfc32c62dafda9cdca41247cccf0185a0064974d27425a14979afe19da196ecfae4f93ba56a784a820f1211f7
 SHA512 
790b35f05f9acf2bc093a32d7878db4d5362ddd56ad435164a5e386cf06f56bbefc6d0d36b7590be1cd54539a79fd83c9cb78f5179c8a0e8d309c5b4e640cfde

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 0000000000..22a7626672
--- /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://[email protected]/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 0000000000..7a8fdeace2
--- /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 0000000000..ab928e8827
--- /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 0000000000..bfdd7765a8
--- /dev/null
+++ b/net-im/sliding-sync/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <name>Julien Roy</name>
+               <email>[email protected]</email>
+       </maintainer>
+       <upstream>
+               
<bugs-to>https://github.com/matrix-org/sliding-sync/issues</bugs-to>
+               
<changelog>https://github.com/matrix-org/sliding-sync/releases</changelog>
+               <remote-id type="github">matrix-org/sliding-sync</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/net-im/sliding-sync/sliding-sync-0.99.15.ebuild 
b/net-im/sliding-sync/sliding-sync-0.99.15.ebuild
new file mode 100644
index 0000000000..46b7f7a6d7
--- /dev/null
+++ b/net-im/sliding-sync/sliding-sync-0.99.15.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://jroy.ca/dist/${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
+}

Reply via email to