coreos-home-server/config/service/prosody/systemd/prosody-component-register@.service
Alex Palaistras d83017d689 Make Prosody components configurable
This allows for registering external components for Prosody as needed,
and enables us to create templated Spectrum services for each supported
protocol.

Configuration has been updated for Biboumi to allow for automated
registration against Prosody as well.
2021-10-26 13:30:40 +01:00

22 lines
780 B
Desktop File

[Unit]
Description=Prosody XMPP Component for %I
Wants=prosody.service
After=prosody.service
[Service]
Type=oneshot
RemainAfterExit=true
SyslogIdentifier=%N
Environment=PROSODY_COMPONENT_NAME=%i
EnvironmentFile=-%E/coreos-home-server/%i/%i.env
ExecStartPre=/bin/install --mode 0700 --directory /tmp/%N
ExecStartPre=/bin/sh -c "envsubst < %E/coreos-home-server/prosody/service/component.cfg.lua.template > /tmp/%N/component.cfg.lua"
ExecStartPre=/bin/podman cp --archive=false /tmp/%N/component.cfg.lua prosody:/etc/prosody/conf.d/%i.cfg.lua
ExecStart=/bin/systemctl reload prosody
ExecStartPost=/bin/rm -Rf /tmp/%N
ExecStop=/bin/podman exec --user=root prosody rm -f /etc/prosody/conf.d/%i.cfg.lua
ExecStopPost=/bin/systemctl reload prosody
[Install]
WantedBy=multi-user.target