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

Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
Alarig Le Lay 2024-06-17 13:36:24 +02:00
parent f11a0dea0b
commit e6609349c7
Signed by: alarig
GPG Key ID: 7AFE62C6DF8BCDEC
7 changed files with 144 additions and 0 deletions

View File

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

View File

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

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://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
}