net-im/dendrite: Drop polylith mode including possible breakage
Upstream dropped the polylith mode in 0.12.0 as announced in earlier releases. This leads to some renaming of files, see e.g. upstream issue 2975[1]. As I've got no OpenRC system or container right now I can't test the modified OpenRC init scripts. In case you have one feedback either way is appreciated - confirmations that it's working, bug reports if it failes or even just suggestions for improvement. As the ebuild didn't build (failed in the install phase) before this fixup there is no revbump necessary. This commit also adds an service file which is based upon upstream's example for their monolith setup (but with paths in /usr instead of opt)[2]. [1] https://github.com/matrix-org/dendrite/issues/2975 [2] https://github.com/matrix-org/dendrite/blob/main/docs/systemd/monolith-example.service Signed-off-by: Nils Freydank <nils.freydank@posteo.de>
This commit is contained in:
parent
c47bfac70f
commit
163ef0a26e
@ -1,9 +1,13 @@
|
|||||||
# Copyright 2022-2023 Gentoo Authors
|
# Copyright 2022-2023 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# 1. fix LICENSE field
|
||||||
|
# 2. fix init scripts
|
||||||
|
|
||||||
EAPI="8"
|
EAPI="8"
|
||||||
EGO_PN="github.com/matrix-org/dendrite/"
|
EGO_PN="github.com/matrix-org/dendrite/"
|
||||||
inherit go-module
|
inherit go-module systemd
|
||||||
COMMIT_ID=""
|
COMMIT_ID=""
|
||||||
|
|
||||||
DESCRIPTION="Matrix homeserver written in go"
|
DESCRIPTION="Matrix homeserver written in go"
|
||||||
@ -20,7 +24,6 @@ fi
|
|||||||
SRC_URI+=" https://files.holgersson.xyz/gentoo/distfiles/${P}-deps.tar.xz"
|
SRC_URI+=" https://files.holgersson.xyz/gentoo/distfiles/${P}-deps.tar.xz"
|
||||||
|
|
||||||
KEYWORDS="~amd64"
|
KEYWORDS="~amd64"
|
||||||
# FIXME
|
|
||||||
LICENSE="Apache-2.0"
|
LICENSE="Apache-2.0"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE=""
|
IUSE=""
|
||||||
@ -54,25 +57,32 @@ src_test() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
# Install the binaries from bin and prefix everything with "dendrite".
|
# Install files from bin, prefix with 'dendrite' if necessary.
|
||||||
newbin bin/create-account dendrite-create-account
|
newbin bin/create-account dendrite-create-account
|
||||||
|
|
||||||
dobin bin/dendrite-demo-pinecone
|
dobin bin/dendrite-demo-pinecone
|
||||||
dobin bin/dendrite-demo-yggdrasil
|
dobin bin/dendrite-demo-yggdrasil
|
||||||
dobin bin/dendrite-monolith-server
|
dobin bin/dendrite
|
||||||
dobin bin/dendrite-polylith-multi
|
|
||||||
dobin bin/dendrite-upgrade-tests
|
dobin bin/dendrite-upgrade-tests
|
||||||
|
|
||||||
|
# prefix
|
||||||
newbin bin/furl dendrite-furl
|
newbin bin/furl dendrite-furl
|
||||||
newbin bin/generate-config dendrite-generate-config
|
newbin bin/generate-config dendrite-generate-config
|
||||||
newbin bin/generate-keys dendrite-generate-keys
|
newbin bin/generate-keys dendrite-generate-keys
|
||||||
newbin bin/resolve-state dendrite-resolve-state
|
newbin bin/resolve-state dendrite-resolve-state
|
||||||
|
|
||||||
|
# Provide a sample configuration.
|
||||||
dodir "/etc/dendrite"
|
dodir "/etc/dendrite"
|
||||||
insinto /etc/dendrite
|
insinto /etc/dendrite
|
||||||
doins "${S}/dendrite-sample.monolith.yaml"
|
doins "${S}/dendrite-sample.yaml"
|
||||||
doins "${S}/dendrite-sample.polylith.yaml"
|
|
||||||
|
# Install init scripts for OpenRC
|
||||||
newinitd "${FILESDIR}"/dendrite.initd dendrite
|
newinitd "${FILESDIR}"/dendrite.initd dendrite
|
||||||
newconfd "${FILESDIR}"/dendrite.confd dendrite
|
newconfd "${FILESDIR}"/dendrite.confd dendrite
|
||||||
|
|
||||||
|
# Install a systemd unit.
|
||||||
|
systemd_newunit "${FILESDIR}"/dendrite.service dendrite.service
|
||||||
|
|
||||||
keepdir "/var/log/dendrite"
|
keepdir "/var/log/dendrite"
|
||||||
fowners dendrite:dendrite "/var/log/dendrite"
|
fowners dendrite:dendrite "/var/log/dendrite"
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,6 @@ rc_ulimit="-n 4096"
|
|||||||
# this should be set to "loopback" which provides the loopback interface.
|
# this should be set to "loopback" which provides the loopback interface.
|
||||||
rc_need="loopback"
|
rc_need="loopback"
|
||||||
|
|
||||||
# Dendrite mode. Either "monolith" or "polylith".
|
|
||||||
DENDRITE_MODE="monolith"
|
|
||||||
|
|
||||||
# If your configuration of dendrite uses locally running PostgreSQL
|
# If your configuration of dendrite uses locally running PostgreSQL
|
||||||
# you may want to uncomment the next line
|
# you may want to uncomment the next line
|
||||||
# rc_need="${rc_need} postgresql"
|
# rc_need="${rc_need} postgresql"
|
||||||
@ -23,5 +20,5 @@ DENDRITE_MODE="monolith"
|
|||||||
# rc_need="${rc_need} nginx"
|
# rc_need="${rc_need} nginx"
|
||||||
|
|
||||||
# Additional command-line options. These can be used to set the bind address and port of the monolith server,
|
# Additional command-line options. These can be used to set the bind address and port of the monolith server,
|
||||||
# among other things. See `dendrite-monolith-server -help` or `dendrite-polylith-multi -help` for a full list.
|
# among other things. See `dendrite -help` for a full list.
|
||||||
# DENDRITE_OPTS="-http-bind-address localhost:8008"
|
# DENDRITE_OPTS="-http-bind-address localhost:8008"
|
||||||
|
@ -13,19 +13,8 @@ else
|
|||||||
: ${DENDRITE_RC_CONFIG:=${RC_PREFIX%/}/etc/conf.d/dendrite}
|
: ${DENDRITE_RC_CONFIG:=${RC_PREFIX%/}/etc/conf.d/dendrite}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${DENDRITE_BINARY}" ] ; then
|
command="${RC_PREFIX%/}/usr/bin/dendrite"
|
||||||
: # Do nothing, DENDRITE_BINARY is set externally.
|
|
||||||
elif [ -z "${DENDRITE_MODE}" -o "${DENDRITE_MODE}" == "monolith" ] ; then
|
|
||||||
DENDRITE_BINARY=${RC_PREFIX%/}/usr/bin/dendrite-monolith-server
|
|
||||||
elif [ "${DENDRITE_MODE}" == "polylith" ] ; then
|
|
||||||
DENDRITE_BINARY:=${RC_PREFIX%/}/usr/bin/dendrite-polylith-multi
|
|
||||||
else
|
|
||||||
echo "Unknown dendrite mode: \"${DENDRITE_MODE}\"." >&2
|
|
||||||
echo "Check the DENDRITE_MODE variable in ${DENDRITE_RC_CONFIG}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
command="${DENDRITE_BINARY}"
|
|
||||||
pidfile="${DENDRITE_PIDFILE}"
|
pidfile="${DENDRITE_PIDFILE}"
|
||||||
command_background=true
|
command_background=true
|
||||||
command_user="dendrite:dendrite"
|
command_user="dendrite:dendrite"
|
||||||
|
19
net-im/dendrite/files/dendrite.service
Normal file
19
net-im/dendrite/files/dendrite.service
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dendrite Matrix Homeserver
|
||||||
|
After=syslog.target
|
||||||
|
After=network.target
|
||||||
|
After=postgresql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=GODEBUG=madvdontneed=1
|
||||||
|
RestartSec=2s
|
||||||
|
Type=simple
|
||||||
|
User=dendrite
|
||||||
|
Group=dendrite
|
||||||
|
ExecStart=/usr/bin/dendrite --config=/etc/dendrite/config.yaml
|
||||||
|
WorkingDirectory=/var/lib/dendrite/
|
||||||
|
Restart=always
|
||||||
|
LimitNOFILE=65536
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user