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

Signed-off-by: Julien Roy <julien@jroy.ca>
This commit is contained in:
Julien Roy
2024-03-24 14:44:30 -04:00
parent 2ae0050fd0
commit 05ce96e01c
6 changed files with 129 additions and 0 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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
}

View File

@@ -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

View File

@@ -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>julien@jroy.ca</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>

View File

@@ -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
}