Browse Source

[__jitsi_meet] Add --abort-conference-count parameter

Only has an effect if the prometheus exporter is enabled and if it is not
empty (default).
If at least this many conferences are active on the server, the type will
bail out before making any changes.
This is useful if you want to avoid service disruptions due to e.g. an SLA.

Sponsored by:	camilion.eu
master
evilham 6 days ago
parent
commit
11ecb37dd9
Signed by: evilham
GPG Key ID: AE3EE30D970886BF
  1. 6
      type/__jitsi_meet/explorer/jitsi-status
  2. 8
      type/__jitsi_meet/man.rst
  3. 14
      type/__jitsi_meet/manifest
  4. 0
      type/__jitsi_meet/parameter/default/abort-conference-count
  5. 1
      type/__jitsi_meet/parameter/optional

6
type/__jitsi_meet/explorer/jitsi-status

@ -0,0 +1,6 @@
#!/bin/sh -eu
if [ ! -f "${__object}/parameter/disable-prometheus-exporter" ]; then
# TODO: detect curl / depend on it?
curl -s localhost:9888/metrics
fi

8
type/__jitsi_meet/man.rst

@ -47,6 +47,14 @@ NOTE: This type currently does not deal with setting up coturn.
OPTIONAL PARAMETERS
-------------------
abort-conference-count
Only has an effect if the prometheus exporter is enabled and if it is not
empty (default).
If at least this many conferences are active on the server, the type will
bail out before making any changes.
This is useful if you want to avoid service disruptions due to e.g. an SLA.
turn-secret
The shared secret for the TURN server.

14
type/__jitsi_meet/manifest

@ -10,6 +10,20 @@ case "${os}" in
;;
esac
current_conferences="$(cat "${__object}/explorer/jitsi-status" | grep -E "^jitsi_conferences[[:space:]]" | cut -d ' ' -f 2)"
ABORT_CONFERENCE_COUNT="$(cat "${__object}/parameter/abort-conference-count")"
if [ -n "${current_conferences}" ] && [ -n "${ABORT_CONFERENCE_COUNT}" ] && \
[ "${ABORT_CONFERENCE_COUNT}" -le "${current_conferences}" ]; then
cat <<-EOF
Early bail out was requested when at least ${ABORT_CONFERENCE_COUNT} conferences are taking place.
There are currently ${current_conferences} active conferences.
Try again at a later time or remove or increase --abort-conference-count
EOF
exit 1
fi
JITSI_HOST="${__target_host}"
if [ -f "${__object}/parameter/jitsi-version" ]; then

0
type/__jitsi_meet/parameter/default/abort-conference-count

1
type/__jitsi_meet/parameter/optional

@ -1,3 +1,4 @@
abort-conference-count
jitsi-version
turn-secret
turn-server

Loading…
Cancel
Save