prosody: Make component registration more flexible

This commit is contained in:
Alex Palaistras 2023-01-02 14:15:13 +00:00
parent cb4b61321e
commit 6f8b8763c6
3 changed files with 6 additions and 6 deletions

View File

@ -68,7 +68,7 @@ HUGO_DEPLOY_SECRET=password
# Configuration for GoToSocial.
GOTOSOCIAL_HOST=social.localhost
GOTOSOCIAL_ACCOUNT_DOMAIN=localhost
GOTOSOCIAL_DEFAULT_USERNAME=default
GOTOSOCIAL_DEFAULT_USERNAME=admin
GOTOSOCIAL_SMTP_FROM=noreply@social.localhost
# Configuration for Slidge.

View File

@ -8,16 +8,17 @@ Type=oneshot
RemainAfterExit=true
SyslogIdentifier=%N
Environment=PROSODY_COMPONENT_NAME=%i
Environment=COMPONENT_CONF=%E/coreos-home-server/prosody/service/component.cfg.lua.template
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
ExecStartPre=/bin/sh -c "envsubst < ${COMPONENT_CONF} > /tmp/%N/component.cfg.lua"
ExecStartPre=/bin/podman cp --archive=false /tmp/%N/component.cfg.lua prosody:/etc/prosody/conf.d/10-%i.cfg.lua
ExecStartPre=/bin/sh -c 'podman exec prosody prosodyctl shell host deactivate "$PROSODY_COMPONENT_NAME" || true'
ExecStartPre=/bin/podman exec prosody prosodyctl shell config reload
ExecStart=/bin/podman exec prosody prosodyctl shell host activate "$PROSODY_COMPONENT_NAME"
ExecStartPost=/bin/rm -Rf /tmp/%N
ExecStop=/bin/podman exec prosody prosodyctl shell host deactivate "$PROSODY_COMPONENT_NAME"
ExecStopPost=/bin/podman exec --user=root prosody rm -f /etc/prosody/conf.d/%i.cfg.lua
ExecStopPost=/bin/podman exec --user=root prosody rm -f /etc/prosody/conf.d/10-%i.cfg.lua
ExecStopPost=/bin/podman exec prosody prosodyctl shell config reload
[Install]

View File

@ -1,8 +1,7 @@
[Unit]
Description=Slidge Gateway for XMPP (%i)
Wants=container-build@%p.service container-volume@%p-%i.service prosody.service prosody-component-register@%p-%i.service
After=container-build@%p.service container-volume@%p-%i.service prosody.service
Before=prosody-component-register@%p-%i.service
After=container-build@%p.service container-volume@%p-%i.service prosody.service prosody-component-register@%p-%i.service
[Service]
Type=notify