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