Add conduit matrix server

This commit is contained in:
Manuel Friedli 2024-03-30 02:12:24 +01:00
parent 42edb15b1e
commit f639262d49
Signed by: manuel
GPG key ID: 41D08ABA75634DA1
14 changed files with 226 additions and 16 deletions

View file

@ -0,0 +1 @@
EBUILD conduit-1.ebuild 302 BLAKE2B c24e4cea3d12c832b634205291640dc08aefe2911c0be4795213d387b090c8b5a9e6f6629c99d8e5861877df114afeb23516edd51f6bdfcabe8bb64b9b61cb87 SHA512 9ab75ec40237c25ec9d3c0fe99c0164a222700130bf000c94f10114a1b0a65df364191a0e04b8be32fb285d6da40fc6cd106a4fead043514a43bacc336846a69

View file

@ -0,0 +1,12 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-group
DESCRIPTION="Group used for the Conduit Matrix server"
KEYWORDS="~amd64"
# If you want this to persist across multiple machines, pick a real number!
ACCT_GROUP_ID="-1"

View file

@ -0,0 +1 @@
EBUILD conduit-1.ebuild 263 BLAKE2B cab58ce88aa21ee8d28d5a9b57f12a3ae5553b1366813abda76388339faafe31c44b46440425fd7649159d6efbc72509c5fa146ddbc41416e2f65af901f53159 SHA512 42cde81ba05731e125cd154588733307a5e2b6ade0fe943627b7ee714eeb114987e0335f50a4b415bd64ec625fccfa251cfc10ef5846cd09d73a893fdab78615

View file

@ -0,0 +1,14 @@
# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-user
DESCRIPTION="User for the Conduit Matrix server"
KEYWORDS="~amd64"
ACCT_USER_ID=-1
ACCT_USER_GROUPS=( ${PN} )
acct-user_add_deps

View file

@ -0,0 +1,8 @@
DEFINED_PHASES=install preinst pretend
DESCRIPTION=Group used for the Conduit Matrix server
EAPI=8
INHERIT=acct-group
KEYWORDS=~amd64
SLOT=0
_eclasses_=user-info 9951b1a0e4f026d16c33a001fd2d5cdf acct-group 1ba28b31fccef7f4ff1cebfad243a633
_md5_=68b065a6d8a27eda55fb980d5551792e

View file

@ -0,0 +1,9 @@
DEFINED_PHASES=install postinst preinst prerm pretend
DESCRIPTION=User for the Conduit Matrix server
EAPI=8
INHERIT=acct-user
KEYWORDS=~amd64
RDEPEND=acct-group/conduit
SLOT=0
_eclasses_=user-info 9951b1a0e4f026d16c33a001fd2d5cdf acct-user 485d9a6aa1311a8ca9da380d8a8c6c76
_md5_=eaa708e0f47056ed0b21c9d387a900dd

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,5 @@
AUX conduit-example.toml 2519 BLAKE2B 040b56d877bcc497097412059e0ac2c7a8d501e4b9efa11ba5e29529617fe2c6f663ee91030c0632c1375df0ef02ede8c79977780a2a88ab280f0b8ef2622cb4 SHA512 bdb71aefb932f8c24a1dce1e6840795b2c614177b39688e36083290b156682de33e7415145f54bd2b22d8aac2866f6e96843ce429cdf0796089d008baad27026
AUX conduit.service 249 BLAKE2B 7c2b1478c357c99ddfc339aa12cfa814bc7557639b68aaf0ba297b68204167bbcfd3cf3c3b5b3e587232e9635716214f7b701ecfcf53edabfaa4eedde910447b SHA512 30841d91e9c90783d6c95b17f7532592ac0a5a8e7141895b56f43e97a2bd0db2e6d025e014b0e98a34f1ca5a199f1def018ad00dbf2ab670ddb654c1e4903739
DIST addr2line-0.21.0.crate 40807 BLAKE2B 9796b9a1177a299797902b7f64247d81d63d3f7e0dcc1256990628e84c5f92e3094ee8d753d9b72187b9aaa73b7ca67c0217899f2226ebd1076f8d25b458475b SHA512 afde7660dda30dee240e79df1fb5b92d4572520bf17a134ef3765e2a077af9e13713952d52e27fae420109b40f6e24dbce1056687dbcbead858ffc21cc7dc69b DIST addr2line-0.21.0.crate 40807 BLAKE2B 9796b9a1177a299797902b7f64247d81d63d3f7e0dcc1256990628e84c5f92e3094ee8d753d9b72187b9aaa73b7ca67c0217899f2226ebd1076f8d25b458475b SHA512 afde7660dda30dee240e79df1fb5b92d4572520bf17a134ef3765e2a077af9e13713952d52e27fae420109b40f6e24dbce1056687dbcbead858ffc21cc7dc69b
DIST adler-1.0.2.crate 12778 BLAKE2B a1dc17786adae945ac09d3525e609ed944e6465690787bbb831a1b9d53793cba1989793d0a5606d5d23ee20d36457923d451b1b3530c9ec7072a487aa3e55bbd SHA512 7ab190d31890fc05b0b55d8e2c6527a505e06793d5496be0b3831e0513412f9ba97f8148f6f68ed0770fa9cd980a5092d885e058becf1d5506b7c74b82674aa1 DIST adler-1.0.2.crate 12778 BLAKE2B a1dc17786adae945ac09d3525e609ed944e6465690787bbb831a1b9d53793cba1989793d0a5606d5d23ee20d36457923d451b1b3530c9ec7072a487aa3e55bbd SHA512 7ab190d31890fc05b0b55d8e2c6527a505e06793d5496be0b3831e0513412f9ba97f8148f6f68ed0770fa9cd980a5092d885e058becf1d5506b7c74b82674aa1
DIST ahash-0.8.11.crate 43607 BLAKE2B 7dff8e41798ba25df8c4827ff414a182bb25da4825f0119a74916fe775db5445b87be8fc87f7c7f98d3b5053e1d47546f98873de1a942d36e5f308a3fb7dd620 SHA512 47d211b2422de0b381dfe32229faa346406eb7a22dff867dc04c22389609a8671ce3218e662000c49891a06c259d82e0ff4413740f007729d80e097a6c3f0d9d DIST ahash-0.8.11.crate 43607 BLAKE2B 7dff8e41798ba25df8c4827ff414a182bb25da4825f0119a74916fe775db5445b87be8fc87f7c7f98d3b5053e1d47546f98873de1a942d36e5f308a3fb7dd620 SHA512 47d211b2422de0b381dfe32229faa346406eb7a22dff867dc04c22389609a8671ce3218e662000c49891a06c259d82e0ff4413740f007729d80e097a6c3f0d9d
@ -589,5 +591,6 @@ DIST zeroize_derive-1.4.2.crate 11141 BLAKE2B a40add656369a3a40d5b5f3397a77a1e9f
DIST zigzag-0.1.0.crate 2085 BLAKE2B b5e9c11c0e904ab62f532ec24a4c773ad47e7248bd867420274c7da40ae566b909989b0e321b558e9a7e8c310b7be2cbaf1cf18acb8aed61a265cae051c96d08 SHA512 a716fbd7423c1d8fc33c13239b3329016cae5400ff6eda71a082a2c581071efde06689e19b7e839b3eb75c15c1a43d25e3d23f75726f6cc523f895a2d281759f DIST zigzag-0.1.0.crate 2085 BLAKE2B b5e9c11c0e904ab62f532ec24a4c773ad47e7248bd867420274c7da40ae566b909989b0e321b558e9a7e8c310b7be2cbaf1cf18acb8aed61a265cae051c96d08 SHA512 a716fbd7423c1d8fc33c13239b3329016cae5400ff6eda71a082a2c581071efde06689e19b7e839b3eb75c15c1a43d25e3d23f75726f6cc523f895a2d281759f
DIST zstd-sys-2.0.8+zstd.1.5.5.crate 736270 BLAKE2B 9ee3bae57279efca7305f6ac9456c71eb5714b595cf75b0faac7232c91f9df127c75c02f68021291ea01d6ab42a51a550d84cec246cd47bb8f502bbd32ceee09 SHA512 acfbf6c464678438bcab289c8be2e67a2bdfb910143d77363bf1ad5227dffc4b60e224388b7e59186fd4d1e017b63fef49734e99e383cbda19b82b4ed382fcd8 DIST zstd-sys-2.0.8+zstd.1.5.5.crate 736270 BLAKE2B 9ee3bae57279efca7305f6ac9456c71eb5714b595cf75b0faac7232c91f9df127c75c02f68021291ea01d6ab42a51a550d84cec246cd47bb8f502bbd32ceee09 SHA512 acfbf6c464678438bcab289c8be2e67a2bdfb910143d77363bf1ad5227dffc4b60e224388b7e59186fd4d1e017b63fef49734e99e383cbda19b82b4ed382fcd8
DIST zstd-sys-2.0.9+zstd.1.5.5.crate 728791 BLAKE2B f08f8730d9cc1efc5520f223e9bfb0854b3a67a2907e47c38e0572d8eca688c1bae61560e11e664834dbff1bed3d40608b23d08f102ce6cd7f1af72b48446e4c SHA512 604c01eae4975745aca1dc1d351db98fec34f7036143e59dfeb4d36e6ee18ac9f3871a288557c8ebdc9e816967a008da43154dc9a0eb3cac85071ccb05bf58aa DIST zstd-sys-2.0.9+zstd.1.5.5.crate 728791 BLAKE2B f08f8730d9cc1efc5520f223e9bfb0854b3a67a2907e47c38e0572d8eca688c1bae61560e11e664834dbff1bed3d40608b23d08f102ce6cd7f1af72b48446e4c SHA512 604c01eae4975745aca1dc1d351db98fec34f7036143e59dfeb4d36e6ee18ac9f3871a288557c8ebdc9e816967a008da43154dc9a0eb3cac85071ccb05bf58aa
EBUILD conduit-0.6.0.ebuild 8057 BLAKE2B 8f9996f2b7378623af92646b2bc2118586c7c16a14d38df2b2fa6e6eb56ce572ec72bb987e64b8ad80266d036f8b2b37f844d384c07bebd46568dcce57165884 SHA512 6ffaf093b86a3614312e244de16b658a5776d93a147cc863f80ba527fdc2dc27241fa0e9f4133a89d10ed34d3794e8e454cd78caaa73b2ed7d8b6a7405cb93d6 EBUILD conduit-0.6.0.ebuild 8962 BLAKE2B 065ca19102a60cc4c1a829db7aae820b80c441ef4d6684e092ad6b53a360b955ef760fc03aadf423f618b5b63b46e74f140d52aee3af1e9384582db3a25e59a9 SHA512 04ea5a8220a74628f40258d615c6e9e1eafd6a445fd91144c0aec25b759cecf9d4b511d0ca9c151cdef0f099d674ccdaf3045eac98d425a90ed49bb45dd0fd1e
EBUILD conduit-0.7.0_alpha.ebuild 7877 BLAKE2B d72f19818a1939dd03d5ecd2c2c47c83d358759e99d4f4241da9cc3210d346375b9684791eab7fcbc523fc1b0eab8ab585c60d55e93c88c701e7c41b7b0a5e87 SHA512 90e671d759142bd9502541a2c39f06b84d86b8024388edb3f80f4f06381cf7e6dc10833b134a6ebe7a9c14ac6fc1b4268e4c674fee5b9e0936e8d3f8b35d1e8f EBUILD conduit-0.7.0_alpha.ebuild 8759 BLAKE2B fa92d8a8c0a2d25757c6b6654772b1fb838d0ff2f786012931b5a11a0aa0cc3f4ef7ab20fc38b3e0a910d5594cfc7296b605f398f6aaddce7fd6b340d5b197a5 SHA512 c7f4cb7c56b8faa16f18883389be70dc8204635ba718b7a187238ec529bea2d4be65f6a4f99bd1a288abfe032dfd0dec16d31417e7b460ad385abc31e12e204a
MISC metadata.xml 377 BLAKE2B e0fa8fc1856b5fd078d9d9ee871a0311a164139511be5191dc85ea7c54f43bf6d30c00cdfdb3e16017b06eadfc169d3883540e9ab0cfc74517b95827d5d125f0 SHA512 ba3ae2043bf548698acc93f98bed0552dd0032aec75e865f0c5b972714b50f144c42681fd283ae93a1fab06d9bf7a1f75d4457f4b7daa5b5aefb20ac2b342100

View file

@ -362,17 +362,17 @@ CRATES="
" "
declare -A GIT_CRATES=( declare -A GIT_CRATES=(
[ruma]="https://github.com/ruma/ruma;3bd58e3c899457c2d55c45268dcb8a65ae682d54" [ruma]="https://github.com/ruma/ruma;3bd58e3c899457c2d55c45268dcb8a65ae682d54;ruma-%commit%/crates/ruma"
[reqwest]="https://github.com/timokoesters/reqwest;57b7cf4feb921573dfafad7d34b9ac6e44ead0bd" [reqwest]="https://github.com/timokoesters/reqwest;57b7cf4feb921573dfafad7d34b9ac6e44ead0bd"
[heed]="https://github.com/timokoesters/heed;f6f825da7fb2c758867e05ad973ef800a6fe1d5d" [heed]="https://github.com/timokoesters/heed;f6f825da7fb2c758867e05ad973ef800a6fe1d5d;heed-%commit%/heed"
) )
inherit cargo inherit cargo systemd
DESCRIPTION="A Matrix homeserver written in Rust" DESCRIPTION="A Matrix homeserver written in Rust"
# Double check the homepage as the cargo_metadata crate # Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used # does not provide this value so instead repository is used
HOMEPAGE="https://gitlab.com/famedly/conduit" HOMEPAGE="https://gitlab.com/famedly/conduit https://famedly.gitlab.io/conduit/"
SRC_URI="${CARGO_CRATE_URIS} SRC_URI="${CARGO_CRATE_URIS}
https://gitlab.com/famedly/conduit/-/archive/v${PV}/conduit-v${PV}.tar.bz2 -> ${P}.tar.bz2" https://gitlab.com/famedly/conduit/-/archive/v${PV}/conduit-v${PV}.tar.bz2 -> ${P}.tar.bz2"
@ -382,12 +382,36 @@ LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Boost-1.0 CC0
SLOT="0" SLOT="0"
KEYWORDS="~amd64" KEYWORDS="~amd64"
DEPEND="" RDEPEND="${DEPEND}
RDEPEND="${DEPEND}" acct-user/conduit"
BDEPEND=""
S="${WORKDIR}/conduit-v${PV}" S="${WORKDIR}/conduit-v${PV}"
# rust does not use *FLAGS from make.conf, silence portage warning # rust does not use *FLAGS from make.conf, silence portage warning
# update with proper path to binaries this crate installs, omit leading / # update with proper path to binaries this crate installs, omit leading /
QA_FLAGS_IGNORED="usr/bin/${PN}" QA_FLAGS_IGNORED="usr/bin/${PN}"
src_install() {
systemd_dounit "${FILESDIR}/${PN}.service"
insinto /etc/matrix-conduit
newins "${FILESDIR}/conduit-example.toml" conduit.toml
fowners conduit:conduit /etc/matrix-conduit
fperms 0750 /etc/matrix-conduit
keepdir /var/lib/matrix-conduit
fowners conduit:conduit /var/lib/matrix-conduit
fperms 0700 /var/lib/matrix-conduit
}
pkg_postinst() {
elog "Check the configuration file at /etc/matrix-conduit/conduit.toml"
elog "and adapt it to your needs. Consult the documentation at"
elog "https://famedly.gitlab.io/conduit/deploying/generic.html"
elog "for information and configuration options. Also, do not forget"
elog "to set up a reverse proxy (Apache, Nginx or the like)."
elog "Additionally, you may want to install net-im/coturn for"
elog "TURN/STUN support."
elog
elog "Have fun!"
}

View file

@ -354,15 +354,15 @@ CRATES="
" "
declare -A GIT_CRATES=( declare -A GIT_CRATES=(
[ruma]="https://github.com/ruma/ruma;1a1c61ee1e8f0936e956a3b69c931ce12ee28475" [ruma]="https://github.com/ruma/ruma;1a1c61ee1e8f0936e956a3b69c931ce12ee28475;ruma-%commit%/crates/ruma"
) )
inherit cargo inherit cargo systemd
DESCRIPTION="A Matrix homeserver written in Rust" DESCRIPTION="A Matrix homeserver written in Rust"
# Double check the homepage as the cargo_metadata crate # Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used # does not provide this value so instead repository is used
HOMEPAGE="https://gitlab.com/famedly/conduit" HOMEPAGE="https://gitlab.com/famedly/conduit https://famedly.gitlab.io/conduit/"
SRC_URI="${CARGO_CRATE_URIS} SRC_URI="${CARGO_CRATE_URIS}
https://gitlab.com/famedly/conduit/-/archive/9176474513481a035c63c85b7dc6c0025b950dcf/conduit-9176474513481a035c63c85b7dc6c0025b950dcf.tar.bz2 -> ${P}.tar.bz2" https://gitlab.com/famedly/conduit/-/archive/9176474513481a035c63c85b7dc6c0025b950dcf/conduit-9176474513481a035c63c85b7dc6c0025b950dcf.tar.bz2 -> ${P}.tar.bz2"
@ -370,14 +370,38 @@ https://gitlab.com/famedly/conduit/-/archive/9176474513481a035c63c85b7dc6c0025b9
# use cargo-license for a more accurate license picture # use cargo-license for a more accurate license picture
LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-1 BSD-2 Boost-1.0 CC0-1.0 ISC MIT MIT-0 MPL-2.0 Unicode-DFS-2016 Unlicense ZLIB" LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-1 BSD-2 Boost-1.0 CC0-1.0 ISC MIT MIT-0 MPL-2.0 Unicode-DFS-2016 Unlicense ZLIB"
SLOT="0" SLOT="0"
KEYWORDS="~amd64" KEYWORDS="-*"
DEPEND="" RDEPEND="${DEPEND}
RDEPEND="${DEPEND}" acct-user/conduit"
BDEPEND=""
S="${WORKDIR}/${PN}-9176474513481a035c63c85b7dc6c0025b950dcf" S="${WORKDIR}/${PN}-9176474513481a035c63c85b7dc6c0025b950dcf"
# rust does not use *FLAGS from make.conf, silence portage warning # rust does not use *FLAGS from make.conf, silence portage warning
# update with proper path to binaries this crate installs, omit leading / # update with proper path to binaries this crate installs, omit leading /
QA_FLAGS_IGNORED="usr/bin/${PN}" QA_FLAGS_IGNORED="usr/bin/${PN}"
src_install() {
systemd_dounit "${FILESDIR}/${PN}.service"
insinto /etc/matrix-conduit
newins "${FILESDIR}/conduit-example.toml" conduit.toml
fowners conduit:conduit /etc/matrix-conduit
fperms 0750 /etc/matrix-conduit
keepdir /var/lib/matrix-conduit
fowners conduit:conduit /var/lib/matrix-conduit
fperms 0700 /var/lib/matrix-conduit
}
pkg_postinst() {
elog "Check the configuration file at /etc/matrix-conduit/conduit.toml"
elog "and adapt it to your needs. Consult the documentation at"
elog "https://famedly.gitlab.io/conduit/deploying/generic.html"
elog "for information and configuration options. Also, do not forget"
elog "to set up a reverse proxy (Apache, Nginx or the like)."
elog "Additionally, you may want to install net-im/coturn for"
elog "TURN/STUN support."
elog
elog "Have fun!"
}

View file

@ -0,0 +1,61 @@
# =============================================================================
# This is the official example config for Conduit.
# If you use it for your server, you will need to adjust it to your own needs.
# At the very least, change the server_name field!
# =============================================================================
[global]
# The server_name is the pretty name of this server. It is used as a suffix for user
# and room ids. Examples: matrix.org, conduit.rs
# The Conduit server needs all /_matrix/ requests to be reachable at
# https://your.server.name/ on port 443 (client-server) and 8448 (federation).
# If that's not possible for you, you can create /.well-known files to redirect
# requests. See
# https://matrix.org/docs/spec/client_server/latest#get-well-known-matrix-client
# and
# https://matrix.org/docs/spec/server_server/r0.1.4#get-well-known-matrix-server
# for more information
# YOU NEED TO EDIT THIS
#server_name = "your.server.name"
# This is the only directory where Conduit will save its data
database_path = "/var/lib/matrix-conduit/"
database_backend = "rocksdb"
# The port Conduit will be running on. You need to set up a reverse proxy in
# your web server (e.g. apache or nginx), so all requests to /_matrix on port
# 443 and 8448 will be forwarded to the Conduit instance running on this port
# Docker users: Don't change this, you'll need to map an external port to this.
port = 6167
# Max size for uploads
max_request_size = 20_000_000 # in bytes
# Enables registration. If set to false, no users can register on this server.
allow_registration = true
allow_federation = true
allow_check_for_updates = true
# Enable the display name lightning bolt on registration.
enable_lightning_bolt = true
# Servers listed here will be used to gather public keys of other servers.
# Generally, copying this exactly should be enough. (Currently, Conduit doesn't
# support batched key requests, so this list should only contain Synapse
# servers.)
trusted_servers = ["matrix.org"]
#max_concurrent_requests = 100 # How many requests Conduit sends to other servers at the same time
# Controls the log verbosity. See also [here][0].
#
# [0]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
#log = "..."
address = "127.0.0.1" # This makes sure Conduit can only be reached using the reverse proxy
#address = "0.0.0.0" # If Conduit is running in a container, make sure the reverse proxy (ie. Traefik) can reach it.

View file

@ -0,0 +1,13 @@
[Unit]
Description=Conduit Matrix Server
After=network.target
[Service]
Environment="CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml"
User=conduit
Group=conduit
Restart=always
ExecStart=/usr/bin/matrix-conduit
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>manuel@fritteli.ch</email>
<name>Manuel Friedli</name>
</maintainer>
<upstream>
<remote-id type="github">ruma/ruma</remote-id>
<remote-id type="gitlab">famedly/conduit</remote-id>
</upstream>
</pkgmetadata>