From 51d0b817fe0e56a733cd1b445b81321831b0c4f3 Mon Sep 17 00:00:00 2001 From: Evilham Date: Fri, 18 Jun 2021 20:52:58 +0200 Subject: [PATCH 01/34] [__single_binary_service] Type to manage very simple services. --- explorer/explorer-version | 10 +++ manifest | 158 +++++++++++++++++++++++++++++++++ parameter/boolean | 1 + parameter/default/service-args | 0 parameter/default/state | 1 + parameter/default/user | 1 + parameter/optional | 8 ++ parameter/optional_multiple | 1 + parameter/required | 3 + 9 files changed, 183 insertions(+) create mode 100755 explorer/explorer-version create mode 100755 manifest create mode 100644 parameter/boolean create mode 100644 parameter/default/service-args create mode 100644 parameter/default/state create mode 100644 parameter/default/user create mode 100644 parameter/optional create mode 100644 parameter/optional_multiple create mode 100644 parameter/required diff --git a/explorer/explorer-version b/explorer/explorer-version new file mode 100755 index 0000000..690cc5f --- /dev/null +++ b/explorer/explorer-version @@ -0,0 +1,10 @@ +#!/bin/sh -e + +BIN_PREFIX="/usr/local/bin" +SERVICE_NAME="${__object_id}" + +VERSION_FILE="${BIN_PREFIX}/.${SERVICE_NAME}.cdist.version" + +if [ -f "${VERSION_FILE}" ]; then + cat "${VERSION_FILE}" +fi diff --git a/manifest b/manifest new file mode 100755 index 0000000..d5df410 --- /dev/null +++ b/manifest @@ -0,0 +1,158 @@ +#!/bin/sh -e + +BIN_DIR="/usr/local/bin" + +# Ensure the target bin dir exists +__directory "${BIN_DIR}" \ + --mode 0755 +export require="${require} __directory${BIN_DIR}" + +STATE="$(cat "${__object}/parameter/state")" +USER="$(cat "${__object}/parameter/user")" +GROUP="$(cat "${__object}/parameter/group" 2>/dev/null || true)" +if [ -z "${GROUP}" ]; then + GROUP="${USER}" +fi + +SERVICE_NAME="${__object_id}" + +BINARY="$(cat "${__object}/parameter/binary" 2>/dev/null || true)" +if [ -z "${BINARY}" ]; then + BINARY="${SERVICE_NAME}" +fi +EXTRA_BINARIES="$(cat "${__object}/parameter/extra-binary" 2>/dev/null || true)" +# This only makes sense for file archives +if [ -n "${EXTRA_BINARIES}" ] && [ -f "${__object}/parameter/unpack" ]; then + cat >> /dev/stderr <<-EOF + You cannot specify extra binaries without the --unpack argument. + Make sure that the --url argument points to a file archive. +EOF +fi + +SERVICE_EXEC="$(cat "${__object}/parameter/service-exec" 2>/dev/null || true)" +if [ -z "${SERVICE_EXEC}" ]; then + SERVICE_EXEC="${BIN_DIR}/${BINARY}" +fi +SERVICE_EXEC="${SERVICE_EXEC} $(cat "${__object}/parameter/service-args")" + +SERVICE_DESCRIPTION="$(cat "${__object}/parameter/service-description" \ + 2>/dev/null || true)" +if [ -z "${SERVICE_DESCRIPTION}" ]; then + SERVICE_DESCRIPTION="cdist-managed '${SERVICE_NAME}' service" +fi + +DOWNLOAD_URL="$(cat "${__object}/parameter/url")" +CHECKSUM="$(cat "${__object}/parameter/checksum")" +SHOULD_VERSION="$(cat "${__object}/parameter/version")" + +# Create a user for the service if it is not root +if [ "${USER}" != "root" ]; then + __user "${USER}" \ + --system \ + --state "${STATE}" \ + --home /nonexistent \ + --comment "cdist-managed ${SERVICE_NAME} user" + # Track dependencies + service_require="${service_require} __user/${USER}" +fi + +# TODO: Support non-systemd +__systemd_unit "${SERVICE_NAME}.service" \ + --source "-" \ + --state "${STATE}" \ + --enablement-state "enabled" </dev/null || true)" + # Download packed file + __download "${TMP_PATH}.tar.gz" \ + --url "${DOWNLOAD_URL}" \ + --download remote \ + --sum "${CHECKSUM}" + + # Unpack file and also perform service upgrade + # shellcheck disable=SC2086 + require="__download${TMP_PATH}.tar.gz" \ + __unpack "${TMP_PATH}.tar.gz" \ + ${UNPACK_ARGS} \ + --destination "${TMP_PATH}" \ + --onchange "$(cat < Date: Fri, 18 Jun 2021 22:01:45 +0200 Subject: [PATCH 02/34] [__single_binary_service] Add manpage, config-file and better absent With these changes the type is good for general consumption (modulo the limitations mentioned in the manpage under TODO). --- man.rst | 169 +++++++++++++++++++++++++++++++++++++++++++++ manifest | 39 ++++++++++- parameter/boolean | 1 + parameter/optional | 1 + 4 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 man.rst diff --git a/man.rst b/man.rst new file mode 100644 index 0000000..8f384bf --- /dev/null +++ b/man.rst @@ -0,0 +1,169 @@ +cdist-type__evilham_single_binary_service(7) +============================================ + +NAME +---- +cdist-type__evilham_single_binary_service - Setup a single-binary service + + +DESCRIPTION +----------- +This type is designed to easily deploy and configure a single-binary service +named `${__object_id}`. + +A good example of this are Prometheus exporters. + +This type makes certain assumptions that might not be correct on your system. +If you need more flexibility, please get in touch and provide a use-case +(and hopefully a backwards-compatible patch). + +This type will place the downloaded binary and, if requested, other extra +binaries in `/usr/local/bin`. + +If a `--config-file-source` is provided, it will be placed under: +`/etc/${__object_id}.conf`. + +TODO (patches welcome!): +- It currently only supports `.tar.gz` archives. +- It currently only supports systemd units. +- Does not handle properly BSD-systems (wheel group, /usr/local/etc, systemd) + + +REQUIRED PARAMETERS +------------------- +checksum + This will be passed verbatim to `__download(7)`. + Use something like `sha256:...`. + +url + This will be passed verbatim to `__download(7)`. + +version + This type will use a thumbstone file with a "version" number to track + whether or not a service must be updated. + This thumbstone file is placed under + `/usr/local/bin/.${__object_id}.cdist.version`. + + +BOOLEAN PARAMETERS +------------------ +unpack + If present, the contents of `--url` will be treated as an archive to be + unpacked with `__unpack(7)`. + See also `--unpack-args` and `--extra-binary`. + +do-not-manage-user + Always considered present when `--user` is `root`. + If present, the user in `--user` will not be managed by this type with + `__user`, this means it *must* exist beforehand when installing the service + and it will not be removed by this type. + + +OPTIONAL PARAMETERS +------------------- +config-file-source + If present, this file's contents will be placed under + `/etc/${__object_id}.conf` with permissions `0440` and ownership assigned to + `--user` and `--group`. + If `-` is passed, this type's `stdin` will be used. + +user + The user under which the service will run. Defaults to `root`. + If this user is not `root` and `--do-not-manage-user` is not present, + this user will be created or removed as per the `--state` parameter. + +group + The group under which the service will run. Defaults to `--user`. + +state + Whether the service is to be `present` (default) or `absent`. + When `absent`, this type will clean any binaries listed in `--extra-binary` + and also the config file as described in `--config-file-source`. + +binary + This will be the binary name. Defaults to `${__object_id}`. + If `--unpack` is used, a binary with this name must be unpacked. + Otherwise, the contents of `--url` will be placed under this binary name. + +service-args + Any extra arguments to pass along with `--service-exec`. + +service-exec + The executable to use for this service. + Defaults to `/usr/local/bin/BINARY_NAME` where `BINARY_NAME` is the + resulting value of `--binary`. + +service-description + The service description to be used in, e.g. the systemd unit file. + Defaults to `cdist-managed '${__object_id}' service`. + +unpack-args + Only has an effect if `--unpack` is used. + These arguments will be passed verbatim to `__unpack(7)`. + Very useful as this type assumes the archive does not have the binaries in + subdirectories; that can be worked around with + `--unpack-args '--tar-strip 1'`. + + +OPTIONAL MULTIPLE PARAMETERS +---------------------------- +extra-binary + Only useful with `--unpack`. + If passed, these binaries will also be installed when `--state` is `present` + and removed when `--state` is `absent`. + Handle with care :-). + + +EXAMPLES +-------- + +.. code-block:: sh + + # Install and enable the ipmi_exporter service + # The variables are defined in the manifest previously + __evilham_single_binary_service ipmi_exporter \ + --user "${USER}" \ + --service-args ' --config.file=/etc/ipmi_exporter.conf' \ + --version "${SHOULD_VERSION}" \ + --checksum "${CHECKSUM}" \ + --url "${DOWNLOAD_URL}" \ + --state "present" \ + --unpack \ + --unpack-args "--tar-strip 1" \ + --config-file-source '-' <<-EOF + # Remotely managed, changes will be lost + # [...] config contents goes here + EOF + + # Remove the ipmi_exporter service along with the user and its config + __evilham_single_binary_service ipmi_exporter \ + --user "${USER}" \ + --version "${SHOULD_VERSION}" \ + --checksum "${CHECKSUM}" \ + --url "${DOWNLOAD_URL}" \ + --state "absent" + + # Same, but the service was using my user! Let's not delete that! + __evilham_single_binary_service ipmi_exporter \ + --user "evilham" \ + --do-not-manage-user \ + --version "${SHOULD_VERSION}" \ + --checksum "${CHECKSUM}" \ + --url "${DOWNLOAD_URL}" \ + --state "absent" + + +SEE ALSO +-------- +- `__download(7)` +- `__unpack(7)` + + +AUTHORS +------- +Evilham + + +COPYING +------- +Copyright \(C) 2021 Evilham. diff --git a/manifest b/manifest index d5df410..e279a05 100755 --- a/manifest +++ b/manifest @@ -1,9 +1,12 @@ #!/bin/sh -e BIN_DIR="/usr/local/bin" +ETC_DIR="/etc" # Ensure the target bin dir exists +# Care, we never want to remove it :-D __directory "${BIN_DIR}" \ + --state "exists" \ --mode 0755 export require="${require} __directory${BIN_DIR}" @@ -46,8 +49,13 @@ CHECKSUM="$(cat "${__object}/parameter/checksum")" SHOULD_VERSION="$(cat "${__object}/parameter/version")" # Create a user for the service if it is not root -if [ "${USER}" != "root" ]; then - __user "${USER}" \ +if [ "${USER}" != "root" ] && \ + [ ! -f "${__object}/parameter/do-not-manage-user" ]; then + if [ "${STATE}" = "absent" ]; then + # When removing, ensure user is not being used + user_require="__systemd_unit/${SERVICE_NAME}.service" + fi + require="${require} ${user_require}" __user "${USER}" \ --system \ --state "${STATE}" \ --home /nonexistent \ @@ -56,10 +64,29 @@ if [ "${USER}" != "root" ]; then service_require="${service_require} __user/${USER}" fi +# Place config file if necessary +CONFIG_FILE_DEST="${ETC_DIR}/${SERVICE_NAME}.conf" +CONFIG_FILE_SOURCE="$(cat "${__object}/parameter/config-file-source" 2>/dev/null || true)" +if [ "${CONFIG_FILE_SOURCE}" = "-" ]; then + CONFIG_FILE_SOURCE="${__object}/stdin" +fi +if [ -n "${CONFIG_FILE_SOURCE}" ] && [ "${STATE}" = "present" ]; then + require="${require} __user/${USER}" __file \ + "${CONFIG_FILE_DEST}" \ + --owner "${USER}" \ + --group "${GROUP}" \ + --mode "0440" \ + --source "${CONFIG_FILE_SOURCE}" + service_required="${service_required} __file${CONFIG_FILE_DEST}" +fi + + + # TODO: Support non-systemd __systemd_unit "${SERVICE_NAME}.service" \ --source "-" \ --state "${STATE}" \ + --restart \ --enablement-state "enabled" < Date: Wed, 4 Aug 2021 20:27:08 +0200 Subject: [PATCH 03/34] [__single_binary_service] Adapt bug fixes proposed by pedro there are several typos, some style issues and now there is at most one service restart in all cases. Submitted by: pedro --- gencode-remote | 21 ++++++++++++++++ man.rst | 4 ++- manifest | 68 +++++++++++++++++++++++++++++--------------------- 3 files changed, 64 insertions(+), 29 deletions(-) create mode 100644 gencode-remote diff --git a/gencode-remote b/gencode-remote new file mode 100644 index 0000000..fe769fa --- /dev/null +++ b/gencode-remote @@ -0,0 +1,21 @@ +#!/bin/sh -e + +STATE="$(cat "${__object}/parameter/state")" +if [ "${STATE}" != "present" ]; then + exit +fi + +ETC_DIR="/etc" +SERVICE_NAME="${__object_id}" +CONFIG_FILE_DEST="${ETC_DIR}/${SERVICE_NAME}.conf" + +BIN_DIR="/usr/local/bin" +VERSION_FILE="${BIN_DIR}/.${SERVICE_NAME}.cdist.version" + +# We only restart here if there was a config change +# but there was not a version change +if grep -qE "^__file${CONFIG_FILE_DEST}" "${__messages_in}" && \ + grep -qvE "^__file${VERSION_FILE}" "${__messages_in}"; then + echo "service ${SERVICE_NAME} restart" +fi + diff --git a/man.rst b/man.rst index 8f384bf..804b465 100644 --- a/man.rst +++ b/man.rst @@ -86,7 +86,9 @@ binary Otherwise, the contents of `--url` will be placed under this binary name. service-args - Any extra arguments to pass along with `--service-exec`. + Any extra arguments to pass along with `--service-exec`. Beware that any + service-args having the format `--config=/etc/foo.cfg` should be + represented in the following way `--service-exec='--config=/etc/foo.cfg'` service-exec The executable to use for this service. diff --git a/manifest b/manifest index e279a05..be967eb 100755 --- a/manifest +++ b/manifest @@ -1,5 +1,20 @@ #!/bin/sh -e +OS="$(cat "${__global}/explorer/os")" + +case "${OS}" in + debian) + SUPER_USER_GROUP=root + ;; + *bsd) + SUPER_USER_GROUP=wheel + ;; + *) + echo "Your OS '${OS}' is currently not supported." >&2 + exit 1 + ;; +esac + BIN_DIR="/usr/local/bin" ETC_DIR="/etc" @@ -26,7 +41,7 @@ fi EXTRA_BINARIES="$(cat "${__object}/parameter/extra-binary" 2>/dev/null || true)" # This only makes sense for file archives if [ -n "${EXTRA_BINARIES}" ] && [ -f "${__object}/parameter/unpack" ]; then - cat >> /dev/stderr <<-EOF + cat >&2 <<-EOF You cannot specify extra binaries without the --unpack argument. Make sure that the --url argument points to a file archive. EOF @@ -36,7 +51,8 @@ SERVICE_EXEC="$(cat "${__object}/parameter/service-exec" 2>/dev/null || true)" if [ -z "${SERVICE_EXEC}" ]; then SERVICE_EXEC="${BIN_DIR}/${BINARY}" fi -SERVICE_EXEC="${SERVICE_EXEC} $(cat "${__object}/parameter/service-args")" +SERVICE_ARGS="$(cat "${__object}/parameter/service-args")" +SERVICE_EXEC="${SERVICE_EXEC} ${SERVICE_ARGS}" SERVICE_DESCRIPTION="$(cat "${__object}/parameter/service-description" \ 2>/dev/null || true)" @@ -77,17 +93,19 @@ if [ -n "${CONFIG_FILE_SOURCE}" ] && [ "${STATE}" = "present" ]; then --group "${GROUP}" \ --mode "0440" \ --source "${CONFIG_FILE_SOURCE}" - service_required="${service_required} __file${CONFIG_FILE_DEST}" + service_require="${service_require} __file${CONFIG_FILE_DEST}" fi +INIT="$(cat "${__global}/explorer/init")" # TODO: Support non-systemd -__systemd_unit "${SERVICE_NAME}.service" \ - --source "-" \ - --state "${STATE}" \ - --restart \ - --enablement-state "enabled" <&2 + exit 1 + ;; +esac # Proceed after user and service description have been prepared export require="${require} ${service_require}" -# Perform a service restart if config has changed -if [ "${STATE}" = "present" ]; then - __check_messages "${SERVICE_NAME}_config" \ - --pattern "^__file${CONFIG_FILE_DEST}" \ - --execute "service ${SERVICE_NAME} restart" -fi - VERSION_FILE="${BIN_DIR}/.${SERVICE_NAME}.cdist.version" IS_VERSION="$(cat "${__object}/explorer/explorer-version")" @@ -130,8 +148,7 @@ if [ "${SHOULD_VERSION}" != "${IS_VERSION}" ] && \ service ${SERVICE_NAME} stop || true for bin_file in ${BINARY} ${EXTRA_BINARIES}; do bin_path="${TMP_PATH}/\${bin_file}" - # TODO: on the BSDs, the super user group is wheel - chown root:root "\${bin_path}" + chown root:${SUPER_USER_GROUP} "\${bin_path}" chmod 0555 "\${bin_path}" cp -af "\${bin_path}" "${BIN_DIR}/\${bin_file}" done @@ -154,39 +171,34 @@ EOF require="__download${TMP_PATH}.tar.gz" \ __unpack "${TMP_PATH}.tar.gz" \ ${UNPACK_ARGS} \ - --destination "${TMP_PATH}" \ - --onchange "$(cat < Date: Wed, 4 Aug 2021 21:00:52 +0200 Subject: [PATCH 04/34] [__single_binary_service] Support customisation of systemd units Requested by pedro --- manifest | 14 ++++++++++---- parameter/optional | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/manifest b/manifest index be967eb..fe9ef74 100755 --- a/manifest +++ b/manifest @@ -60,6 +60,8 @@ if [ -z "${SERVICE_DESCRIPTION}" ]; then SERVICE_DESCRIPTION="cdist-managed '${SERVICE_NAME}' service" fi +SERVICE_DEFINITION="$(cat "${__object}/parameter/service-definition" 2>/dev/null || true)" + DOWNLOAD_URL="$(cat "${__object}/parameter/url")" CHECKSUM="$(cat "${__object}/parameter/checksum")" SHOULD_VERSION="$(cat "${__object}/parameter/version")" @@ -102,10 +104,8 @@ INIT="$(cat "${__global}/explorer/init")" # TODO: Support non-systemd case "${INIT}" in systemd) - __systemd_unit "${SERVICE_NAME}.service" \ - --source "-" \ - --state "${STATE}" \ - --enablement-state "enabled" < Date: Wed, 4 Aug 2021 21:02:37 +0200 Subject: [PATCH 05/34] [__single_binary_service] Do not use echo echo echo --- manifest | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manifest b/manifest index fe9ef74..e05b630 100755 --- a/manifest +++ b/manifest @@ -123,10 +123,12 @@ WantedBy=multi-user.target EOF )" fi - echo ${SERVICE_DEFINITION} | __systemd_unit "${SERVICE_NAME}.service" \ + __systemd_unit "${SERVICE_NAME}.service" \ --source "-" \ --state "${STATE}" \ - --enablement-state "enabled" + --enablement-state "enabled" < Date: Sat, 30 Oct 2021 15:36:49 +0200 Subject: [PATCH 06/34] [__single_binary_service] Many improvements + runit support Amongst other things compressed files can be of a type other than .tar.gz (it remains the default) and we now properly support runit services, FreeBSD and Devuan. --- gencode-remote | 21 ---- man.rst | 27 ++++- manifest | 173 +++++++++++++++++++++-------- parameter/default/unpack-extension | 1 + parameter/default/user-home-dir | 1 + parameter/optional | 3 + 6 files changed, 152 insertions(+), 74 deletions(-) delete mode 100644 gencode-remote create mode 100644 parameter/default/unpack-extension create mode 100644 parameter/default/user-home-dir diff --git a/gencode-remote b/gencode-remote deleted file mode 100644 index fe769fa..0000000 --- a/gencode-remote +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -e - -STATE="$(cat "${__object}/parameter/state")" -if [ "${STATE}" != "present" ]; then - exit -fi - -ETC_DIR="/etc" -SERVICE_NAME="${__object_id}" -CONFIG_FILE_DEST="${ETC_DIR}/${SERVICE_NAME}.conf" - -BIN_DIR="/usr/local/bin" -VERSION_FILE="${BIN_DIR}/.${SERVICE_NAME}.cdist.version" - -# We only restart here if there was a config change -# but there was not a version change -if grep -qE "^__file${CONFIG_FILE_DEST}" "${__messages_in}" && \ - grep -qvE "^__file${VERSION_FILE}" "${__messages_in}"; then - echo "service ${SERVICE_NAME} restart" -fi - diff --git a/man.rst b/man.rst index 804b465..cb40330 100644 --- a/man.rst +++ b/man.rst @@ -23,10 +23,8 @@ binaries in `/usr/local/bin`. If a `--config-file-source` is provided, it will be placed under: `/etc/${__object_id}.conf`. -TODO (patches welcome!): -- It currently only supports `.tar.gz` archives. -- It currently only supports systemd units. -- Does not handle properly BSD-systems (wheel group, /usr/local/etc, systemd) +This type supports services managed by `__runit(7)` when `systemd` is not +the init system being used. REQUIRED PARAMETERS @@ -72,6 +70,13 @@ user If this user is not `root` and `--do-not-manage-user` is not present, this user will be created or removed as per the `--state` parameter. +user-home-dir + Does not have an effect if `--do-not-manage-user` is used or `--user` is + `root`. + The home directory of the service user. It will be created. + Defaults to `/nonexistent`, in this case the home directory will not be + created. + group The group under which the service will run. Defaults to `--user`. @@ -95,6 +100,13 @@ service-exec Defaults to `/usr/local/bin/BINARY_NAME` where `BINARY_NAME` is the resulting value of `--binary`. +service-definition + The service definition to be used as an override. + Note that this type decides dinammically between runit and systemd, and + you can currently only define either a systemd unit or a runit script here. + Use this parameter only for testing and get in touch to discuss how your + particular use-case can be supported by the type. + service-description The service description to be used in, e.g. the systemd unit file. Defaults to `cdist-managed '${__object_id}' service`. @@ -106,6 +118,13 @@ unpack-args subdirectories; that can be worked around with `--unpack-args '--tar-strip 1'`. +unpack-extension + Only has an effect if `--unpack` is used. + The file extension of the file to unpack, defaults to `.tar.gz`. + +working-directory + If set, the working directory with which the service will be started. + OPTIONAL MULTIPLE PARAMETERS ---------------------------- diff --git a/manifest b/manifest index e05b630..8288b94 100755 --- a/manifest +++ b/manifest @@ -1,22 +1,43 @@ #!/bin/sh -e +SERVICE_NAME="${__object_id}" OS="$(cat "${__global}/explorer/os")" case "${OS}" in - debian) - SUPER_USER_GROUP=root - ;; - *bsd) - SUPER_USER_GROUP=wheel - ;; - *) - echo "Your OS '${OS}' is currently not supported." >&2 - exit 1 - ;; + debian|devuan) + SUPER_USER_GROUP=root + ETC_DIR="/etc" + ;; + *bsd) + SUPER_USER_GROUP=wheel + ETC_DIR="/usr/local/etc" + ;; + *) + echo "Your OS '${OS}' is currently not supported." >&2 + exit 1 + ;; +esac +INIT="$(cat "${__global}/explorer/init")" + +case "${INIT}" in + systemd) + service_definition_require="__systemd_unit/${SERVICE_NAME}.service" + service_command="service ${SERVICE_NAME} %s" + ;; + runit|sysvinit) + # We will use runit to manage these services + __runit + export require="__runit" + service_definition_require="__runit_service/${SERVICE_NAME}" + service_command="sv %s ${SERVICE_NAME}" + ;; + *) + echo "Init system ${INIT}' is currently not supported." >&2 + exit 1 + ;; esac BIN_DIR="/usr/local/bin" -ETC_DIR="/etc" # Ensure the target bin dir exists # Care, we never want to remove it :-D @@ -29,10 +50,13 @@ STATE="$(cat "${__object}/parameter/state")" USER="$(cat "${__object}/parameter/user")" GROUP="$(cat "${__object}/parameter/group" 2>/dev/null || true)" if [ -z "${GROUP}" ]; then - GROUP="${USER}" + if [ "${USER}" != "root" ]; then + GROUP="${USER}" + else + GROUP="${SUPER_USER_GROUP}" + fi fi -SERVICE_NAME="${__object_id}" BINARY="$(cat "${__object}/parameter/binary" 2>/dev/null || true)" if [ -z "${BINARY}" ]; then @@ -62,22 +86,34 @@ fi SERVICE_DEFINITION="$(cat "${__object}/parameter/service-definition" 2>/dev/null || true)" +WORKING_DIRECTORY_PATH="$(cat "${__object}/parameter/working-directory" 2>/dev/null || true)" +if [ -n "${WORKING_DIRECTORY_PATH}" ]; then + WORKING_DIRECTORY_SYSTEMD="WorkingDirectory=${WORKING_DIRECTORY_PATH}" + WORKING_DIRECTORY_RUNIT="cd '${WORKING_DIRECTORY_PATH}'" +fi + DOWNLOAD_URL="$(cat "${__object}/parameter/url")" CHECKSUM="$(cat "${__object}/parameter/checksum")" SHOULD_VERSION="$(cat "${__object}/parameter/version")" # Create a user for the service if it is not root +USER_HOME_DIR="/root" if [ "${USER}" != "root" ] && \ [ ! -f "${__object}/parameter/do-not-manage-user" ]; then if [ "${STATE}" = "absent" ]; then # When removing, ensure user is not being used - user_require="__systemd_unit/${SERVICE_NAME}.service" + user_require="${service_definition_require}" + fi + USER_HOME_DIR="$(cat "${__object}/parameter/user-home-dir")" + if [ "${USER_HOME_DIR}" != "/nonexistent" ]; then + USER_CREATE_HOME="--create-home" fi require="${require} ${user_require}" __user "${USER}" \ --system \ --state "${STATE}" \ - --home /nonexistent \ - --comment "cdist-managed ${SERVICE_NAME} user" + --home "${USER_HOME_DIR}" \ + --comment "cdist-managed ${SERVICE_NAME} user" \ + ${USER_CREATE_HOME} # Track dependencies service_require="${service_require} __user/${USER}" fi @@ -100,8 +136,8 @@ fi -INIT="$(cat "${__global}/explorer/init")" -# TODO: Support non-systemd +# This should setup the object in $service_definition_require +# See above. case "${INIT}" in systemd) if [ -z "${SERVICE_DEFINITION}" ]; then @@ -117,6 +153,7 @@ User=${USER} Group=${GROUP} ExecStart=${SERVICE_EXEC} Restart=always +${WORKING_DIRECTORY_SYSTEMD} [Install] WantedBy=multi-user.target @@ -129,14 +166,28 @@ EOF --enablement-state "enabled" <&2 - exit 1 - ;; + ;; + runit|sysvinit) + if [ -z "${SERVICE_DEFINITION}" ]; then + SERVICE_DEFINITION="$(cat </dev/null || true)" # Download packed file - __download "${TMP_PATH}.tar.gz" \ + __download "${TMP_PATH}${UNPACK_EXTENSION}" \ --url "${DOWNLOAD_URL}" \ --download remote \ --sum "${CHECKSUM}" # Unpack file and also perform service upgrade # shellcheck disable=SC2086 - require="__download${TMP_PATH}.tar.gz" \ - __unpack "${TMP_PATH}.tar.gz" \ + require="__download${TMP_PATH}${UNPACK_EXTENSION}" \ + __unpack "${TMP_PATH}${UNPACK_EXTENSION}" \ ${UNPACK_ARGS} \ --destination "${TMP_PATH}" - version_bump_require="__unpack${TMP_PATH}.tar.gz" + version_bump_require="__unpack${TMP_PATH}${UNPACK_EXTENSION}" else # Create temp directory __directory "${TMP_PATH}" @@ -196,18 +272,17 @@ EOF # Perform update of cdist-managed version file # And also perform service upgrade + # This is a bug if service_upgrade fails >,< printf "%s" "${SHOULD_VERSION}" | \ require="${version_bump_require}" __file \ "${VERSION_FILE}" \ --onchange "${perform_service_upgrade}" \ --source "-" -fi - -if [ "${STATE}" = "absent" ]; then - # Perform cleanup of generated files - for bin_file in ${BINARY} ${EXTRA_BINARIES}; do - __file "${BIN_DIR}/${bin_file}" --state "absent" - done - __file "${VERSION_FILE}" --state "absent" - __file "${CONFIG_FILE_DEST}" --state "absent" +else + # We only restart here if there was a config change + # but there was not a version change + require="${service_require}" __check_messages \ + "single_binary_service_${__object_id}" \ + --pattern "^__file${CONFIG_FILE_DEST}" \ + --execute "$(sv_cmd restart)" fi diff --git a/parameter/default/unpack-extension b/parameter/default/unpack-extension new file mode 100644 index 0000000..c95e2e9 --- /dev/null +++ b/parameter/default/unpack-extension @@ -0,0 +1 @@ +.tar.gz \ No newline at end of file diff --git a/parameter/default/user-home-dir b/parameter/default/user-home-dir new file mode 100644 index 0000000..4d21ca6 --- /dev/null +++ b/parameter/default/user-home-dir @@ -0,0 +1 @@ +/nonexistent diff --git a/parameter/optional b/parameter/optional index 7c2ca06..7c88cb4 100644 --- a/parameter/optional +++ b/parameter/optional @@ -7,4 +7,7 @@ service-args service-exec service-description service-definition +unpack-extension unpack-args +user-home-dir +working-directory From 9b6788f29a1301773cabd42f1bdd108d6f967716 Mon Sep 17 00:00:00 2001 From: Joachim Desroches Date: Tue, 22 Mar 2022 16:24:00 +0100 Subject: [PATCH 07/34] __php_fpm{,_pool}: initial implementation. --- type/__php_fpm/files/php.ini.sh | 45 +++++++++++ type/__php_fpm/man.rst | 75 ++++++++++++++++++ type/__php_fpm/manifest | 47 +++++++++++ type/__php_fpm/parameter/boolean | 2 + type/__php_fpm/parameter/default/memory-limit | 1 + .../parameter/default/upload-max-filesize | 1 + type/__php_fpm/parameter/optional | 2 + type/__php_fpm/parameter/required | 1 + type/__php_fpm/singleton | 0 type/__php_fpm_pool/files/www.conf.sh | 34 ++++++++ type/__php_fpm_pool/man.rst | 79 +++++++++++++++++++ type/__php_fpm_pool/manifest | 37 +++++++++ type/__php_fpm_pool/parameter/optional | 2 + type/__php_fpm_pool/parameter/required | 5 ++ 14 files changed, 331 insertions(+) create mode 100755 type/__php_fpm/files/php.ini.sh create mode 100644 type/__php_fpm/man.rst create mode 100644 type/__php_fpm/manifest create mode 100644 type/__php_fpm/parameter/boolean create mode 100644 type/__php_fpm/parameter/default/memory-limit create mode 100644 type/__php_fpm/parameter/default/upload-max-filesize create mode 100644 type/__php_fpm/parameter/optional create mode 100644 type/__php_fpm/parameter/required create mode 100644 type/__php_fpm/singleton create mode 100755 type/__php_fpm_pool/files/www.conf.sh create mode 100644 type/__php_fpm_pool/man.rst create mode 100644 type/__php_fpm_pool/manifest create mode 100644 type/__php_fpm_pool/parameter/optional create mode 100644 type/__php_fpm_pool/parameter/required diff --git a/type/__php_fpm/files/php.ini.sh b/type/__php_fpm/files/php.ini.sh new file mode 100755 index 0000000..8fbc4ac --- /dev/null +++ b/type/__php_fpm/files/php.ini.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +cat < + + +COPYING +------- +Copyright \(C) 2022 Joachim Desroches. You can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. diff --git a/type/__php_fpm/manifest b/type/__php_fpm/manifest new file mode 100644 index 0000000..84c4383 --- /dev/null +++ b/type/__php_fpm/manifest @@ -0,0 +1,47 @@ +#!/bin/sh + +os=$(cat "${__global:?}/explorer/os") + +PHPVER=$(cat "${__object:?}/parameter/php-version") +export PHPVER + +case "$os" in +'alpine') + package="php${PHPVER}-fpm" + service="php-fpm${PHPVER}" + opcache_package="php${PHPVER}-opcache" + apcu_package="php${PHPVER}-pecl-apcu" + ;; + +*) + printf "Your operating system is currently not supported by this type\n" >&2 + printf "Please contribute an implementation for it if you can.\n" >&2 + exit 1 + ;; +esac + +__package "$package" +require="__package/$package" __start_on_boot "$service" + +if [ -f "${__object:?}/parameter/enable-opcache" ]; then + __package "$opcache_package" +fi + +if [ -f "${__object:?}/parameter/enable-apcu" ]; then + __package "$apcu_package" +fi + +MEMORY_LIMIT=$(cat "${__object:?}/parameter/memory-limit") +export MEMORY_LIMIT + +UPLOAD_MAX_FILESIZE=$(cat "${__object:?}/parameter/upload-max-filesize") +export UPLOAD_MAX_FILESIZE + +mkdir -p "${__object:?}/files" +"${__type:?}/files/php.ini.sh" >"${__object:?}/files/php.ini" + +require="__package/$package" __file "/etc/php${PHPVER}/php.ini" \ + --mode 644 --source "${__object:?}/files/php.ini" \ + --onchange "service $service restart" + +require="__file/etc/php${PHPVER}/php.ini" __service "$service" --action start diff --git a/type/__php_fpm/parameter/boolean b/type/__php_fpm/parameter/boolean new file mode 100644 index 0000000..9964486 --- /dev/null +++ b/type/__php_fpm/parameter/boolean @@ -0,0 +1,2 @@ +enable-opcache +enable-apcu diff --git a/type/__php_fpm/parameter/default/memory-limit b/type/__php_fpm/parameter/default/memory-limit new file mode 100644 index 0000000..d95fe12 --- /dev/null +++ b/type/__php_fpm/parameter/default/memory-limit @@ -0,0 +1 @@ +512M diff --git a/type/__php_fpm/parameter/default/upload-max-filesize b/type/__php_fpm/parameter/default/upload-max-filesize new file mode 100644 index 0000000..5fbcf1c --- /dev/null +++ b/type/__php_fpm/parameter/default/upload-max-filesize @@ -0,0 +1 @@ +2M diff --git a/type/__php_fpm/parameter/optional b/type/__php_fpm/parameter/optional new file mode 100644 index 0000000..a41a87c --- /dev/null +++ b/type/__php_fpm/parameter/optional @@ -0,0 +1,2 @@ +upload-max-filesize +memory-limit diff --git a/type/__php_fpm/parameter/required b/type/__php_fpm/parameter/required new file mode 100644 index 0000000..173609d --- /dev/null +++ b/type/__php_fpm/parameter/required @@ -0,0 +1 @@ +php-version diff --git a/type/__php_fpm/singleton b/type/__php_fpm/singleton new file mode 100644 index 0000000..e69de29 diff --git a/type/__php_fpm_pool/files/www.conf.sh b/type/__php_fpm_pool/files/www.conf.sh new file mode 100755 index 0000000..aa8fa7c --- /dev/null +++ b/type/__php_fpm_pool/files/www.conf.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +cat < + + +COPYING +------- +Copyright \(C) 2022 Joachim Desroches. You can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. diff --git a/type/__php_fpm_pool/manifest b/type/__php_fpm_pool/manifest new file mode 100644 index 0000000..b090c9d --- /dev/null +++ b/type/__php_fpm_pool/manifest @@ -0,0 +1,37 @@ +#!/bin/sh + +# XXX: this type does not configure or install php-fpm: it expects the +# __recycledcloud_php_fpm type to be used first before pools are configured. + +os=$(cat "${__global:?}/explorer/os") +name=${__object_id:?} + +PHPVER=$(cat "${__object:?}/parameter/php-version") +export PHPVER + +case "$os" in +'alpine') + service="php-fpm${PHPVER}" + : + ;; + +*) + printf "Your operating system is currently not supported by this type\n" >&2 + printf "Please contribute an implementation for it if you can.\n" >&2 + exit 1 + ;; +esac + +POOL_NAME="$name" +POOL_USER=$(cat "${__object:?}/parameter/pool-user") +POOL_GROUP=$(cat "${__object:?}/parameter/pool-group") +POOL_LISTEN_ADDR=$(cat "${__object:?}/parameter/pool-listen-addr") +POOL_LISTEN_OWNER=$(cat "${__object:?}/parameter/pool-listen-owner") +export POOL_USER POOL_GROUP POOL_LISTEN_ADDR POOL_LISTEN_OWNER POOL_NAME + +mkdir -p "${__object:?}/files" +"${__type:?}/files/www.conf.sh" >"${__object:?}/files/www.conf" + +__file "/etc/php${PHPVER:?}/php-fpm.d/${name}.conf" \ + --mode 644 --source "${__object:?}/files/www.conf" \ + --onchange "service $service reload" diff --git a/type/__php_fpm_pool/parameter/optional b/type/__php_fpm_pool/parameter/optional new file mode 100644 index 0000000..7adc0a3 --- /dev/null +++ b/type/__php_fpm_pool/parameter/optional @@ -0,0 +1,2 @@ +memory-limit +open-basedir diff --git a/type/__php_fpm_pool/parameter/required b/type/__php_fpm_pool/parameter/required new file mode 100644 index 0000000..d247290 --- /dev/null +++ b/type/__php_fpm_pool/parameter/required @@ -0,0 +1,5 @@ +php-version +pool-user +pool-group +pool-listen-addr +pool-listen-owner From fa37ede84fd53fa0902cb74ab13dae5989cb5494 Mon Sep 17 00:00:00 2001 From: Evilham Date: Sun, 10 Apr 2022 19:45:08 +0200 Subject: [PATCH 08/34] [__jitsi_meet] Unconfuse jitsi-version and secured domains Closes #14 by committing to keeping the package up to date as promptly as possible; else weird things happen and there are no real good solutions for this. E.g. we have seen in the past that due to security issues, a jitsi dependency needs to be upgraded, but some package that jitsi-meet depends upon also has an upper limit on that package's version. A note was added to the manpage in order make it explicit that maintenance of this type can be sponsored to ensure its proper functioning. Closes #15 by using `__file`. This will also allow us to have more control over jicofo's settings, which might be important when we start doing recordings. Sponsored by: lafede.cat --- type/__jitsi_meet/files/jicofo.conf.sh | 34 +++++++++++++++++ .../default => files}/jitsi-version | 0 type/__jitsi_meet/gencode-remote | 2 +- type/__jitsi_meet/man.rst | 18 +++++---- type/__jitsi_meet/manifest | 38 +++++++++---------- .../parameter/deprecated/jitsi-version | 4 ++ 6 files changed, 67 insertions(+), 29 deletions(-) create mode 100755 type/__jitsi_meet/files/jicofo.conf.sh rename type/__jitsi_meet/{parameter/default => files}/jitsi-version (100%) create mode 100644 type/__jitsi_meet/parameter/deprecated/jitsi-version diff --git a/type/__jitsi_meet/files/jicofo.conf.sh b/type/__jitsi_meet/files/jicofo.conf.sh new file mode 100755 index 0000000..61a782a --- /dev/null +++ b/type/__jitsi_meet/files/jicofo.conf.sh @@ -0,0 +1,34 @@ +#!/bin/sh -eu + +# Start +cat < COPYING ------- -Copyright \(C) 2021 Evilham. +Copyright \(C) 2022 Evilham. diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index 599af18..e9ed5c6 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -13,8 +13,13 @@ esac JITSI_HOST="${__target_host}" -# Currently unused, see below -# JITSI_VERSION="$(cat "${__object}/parameter/jitsi-version")" +if [ -f "${__object}/parameter/jitsi-version" ]; then + # This has been deprecated and will be removed 'soon' + JITSI_VERSION="$(cat "${__object}/parameter/jitsi-version")" +else + # Note this won't be a parameter anymore, we won't let users stay behind + JITSI_VERSION="$(cat "${__type}/files/jitsi-version")" +fi TURN_SERVER="$(cat "${__object}/parameter/turn-server")" TURN_SECRET="$(cat "${__object}/parameter/turn-secret")" @@ -55,11 +60,12 @@ __debconf_set_selections jitsi_meet --line "${DEBCONF_SETTINGS}" export require="${require} __debconf_set_selections/jitsi_meet" # Install and upgrade packages as needed -__package_apt jitsi-meet -# We are not doing version pinning anymore because it breaks when -# the version is not the latest. -# This happens because dependencies cannot be properly resolved. -# --version "${JITSI_VERSION}" +# NOTE: we are doing version pinning again, but it breaks sometimes when +# the version is not the latest. +# This happens because dependencies might not be properly resolved. +# To avoid this, this type must be maintained up to date. +# If we don't use this, keeping Jitsi's up to date is very difficult. +__package_apt jitsi-meet --version "${JITSI_VERSION}" # Proceed only after installation/upgrade has finished export require="__package_apt/jitsi-meet" @@ -151,10 +157,8 @@ EOF if [ -f "${__object}/parameter/secured-domains" ]; then SECURED_DOMAINS_STATE='present' - SECURED_DOMAINS_STATE_JICOFO='present' else SECURED_DOMAINS_STATE='absent' - SECURED_DOMAINS_STATE_JICOFO='absent' fi __file "/etc/prosody/conf.d/${JITSI_HOST}.zauth.cfg.lua" \ @@ -169,18 +173,10 @@ VirtualHost "guest.${JITSI_HOST}" c2s_require_encryption = false EOF -__block jitsi_jicofo_secured_domains \ - --prefix "// begin cdist: jicofo_secured_domains" \ - --suffix "// end cdist: jicofo_secured_domains" \ - --file /etc/jitsi/jicofo/jicofo.conf \ - --state "${SECURED_DOMAINS_STATE_JICOFO}" \ - --text '-' < Date: Sat, 16 Apr 2022 13:22:16 +0200 Subject: [PATCH 09/34] [__jitsi_meet_domain] Simplify logic for secured domains --- type/__jitsi_meet_domain/files/config.js.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/type/__jitsi_meet_domain/files/config.js.sh b/type/__jitsi_meet_domain/files/config.js.sh index 58df3fc..7fec422 100644 --- a/type/__jitsi_meet_domain/files/config.js.sh +++ b/type/__jitsi_meet_domain/files/config.js.sh @@ -13,14 +13,8 @@ var config = { domain: '${JITSI_HOST}', // When using authentication, domain for guest users. -$( if [ -n "${SECURED_DOMAINS}" ]; then cat<. // authdomain: '${JITSI_HOST}', From a12b343660254f5135aba81013d8ad80f161c21d Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 21 Apr 2022 13:13:12 +0200 Subject: [PATCH 10/34] [__jitsi_meet_domain] Add analytics settings parameter with this, admins can take advantage of e.g. matomo to have some usage statistics. The parameter defaults to `disabled: true`, which is the most privacy-friendly! Sponsored by: camilion.eu --- type/__jitsi_meet_domain/files/config.js.sh | 1 + type/__jitsi_meet_domain/man.rst | 5 +++++ type/__jitsi_meet_domain/manifest | 1 + .../__jitsi_meet_domain/parameter/default/analytics-settings | 1 + type/__jitsi_meet_domain/parameter/optional | 1 + 5 files changed, 9 insertions(+) create mode 100644 type/__jitsi_meet_domain/parameter/default/analytics-settings diff --git a/type/__jitsi_meet_domain/files/config.js.sh b/type/__jitsi_meet_domain/files/config.js.sh index 7fec422..506e62d 100644 --- a/type/__jitsi_meet_domain/files/config.js.sh +++ b/type/__jitsi_meet_domain/files/config.js.sh @@ -817,6 +817,7 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) }, analytics: { +${ANALYTICS_SETTINGS} // True if the analytics should be disabled // disabled: false, diff --git a/type/__jitsi_meet_domain/man.rst b/type/__jitsi_meet_domain/man.rst index b035555..dd8c852 100644 --- a/type/__jitsi_meet_domain/man.rst +++ b/type/__jitsi_meet_domain/man.rst @@ -41,6 +41,11 @@ admin-email OPTIONAL PARAMETERS ------------------- +analytics-settings + This goes inside the `analytics` part of `config.js`. + Defaults to: `disabled: true`. + See: https://github.com/jitsi/jitsi-meet/blob/master/config.js + channel-last-n Default value for the "last N" attribute. Defaults to 20. Set to -1 for unlimited. diff --git a/type/__jitsi_meet_domain/manifest b/type/__jitsi_meet_domain/manifest index 87af1b9..abc8a1a 100755 --- a/type/__jitsi_meet_domain/manifest +++ b/type/__jitsi_meet_domain/manifest @@ -18,6 +18,7 @@ NOTICE_MESSAGE="$(cat "${__object}/parameter/notice-message")" START_VIDEO_MUTED="$(cat "${__object}/parameter/start-video-muted")" TURN_SERVER="$(cat "${__object}/parameter/turn-server")" VIDEO_CONSTRAINTS="$(cat "${__object}/parameter/video-constraints")" +ANALYTICS_SETTINGS="$(cat "${__object}/parameter/analytics-settings")" BRANDING_INDEX="$(cat "${__object}/parameter/branding-index")" BRANDING_JSON="$(cat "${__object}/parameter/branding-json")" BRANDING_WATERMARK="$(cat "${__object}/parameter/branding-watermark")" diff --git a/type/__jitsi_meet_domain/parameter/default/analytics-settings b/type/__jitsi_meet_domain/parameter/default/analytics-settings new file mode 100644 index 0000000..561a7d6 --- /dev/null +++ b/type/__jitsi_meet_domain/parameter/default/analytics-settings @@ -0,0 +1 @@ + disabled: true diff --git a/type/__jitsi_meet_domain/parameter/optional b/type/__jitsi_meet_domain/parameter/optional index ce50f0d..1289b85 100644 --- a/type/__jitsi_meet_domain/parameter/optional +++ b/type/__jitsi_meet_domain/parameter/optional @@ -1,3 +1,4 @@ +analytics-settings channel-last-n default-language notice-message From 87cc109bf1753d4a10ca7b9143b6a655cd4d1baa Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 21 Apr 2022 13:20:30 +0200 Subject: [PATCH 11/34] [__jitsi_meet*] Make rooms on different domains not equivalent This is a backwards-compatible change. We switch the approach from "treat all domains as if they were the main domain" to: "each domain has its own prosody settings". This works perfectly fine, even with secured domains. There is a caveat with secured domains, in that they use the main domain to log in; this means that users are shared across all domains (as they were before this commit). This is due to jicofo refusing to start meetings from a domain that is not configured, and it only accepting one domain. Right now, this is acceptable, however we could want to authenticate against e.g. different LDAP / IMAP servers in the future, so this would need addressing at that stage. Probably the best way to solve it is by patching jicofo, so it accepts starting conferences from multiple domains and getting that patch upstream. Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/files/prosody.cfg.lua.sh | 1 + type/__jitsi_meet/gencode-remote | 3 +- type/__jitsi_meet/manifest | 24 ++- .../files/_update_jitsi_configurations.sh | 1 + type/__jitsi_meet_domain/files/config.js.sh | 19 +- type/__jitsi_meet_domain/files/nginx.sh | 4 +- .../files/prosody.cfg.lua.sh | 199 ++++++++++++++++++ .../files/prosody.cfg.lua.sh.orig | 129 ++++++++++++ type/__jitsi_meet_domain/man.rst | 18 +- type/__jitsi_meet_domain/manifest | 35 +++ 10 files changed, 403 insertions(+), 30 deletions(-) create mode 120000 type/__jitsi_meet/files/prosody.cfg.lua.sh create mode 100644 type/__jitsi_meet_domain/files/prosody.cfg.lua.sh create mode 100644 type/__jitsi_meet_domain/files/prosody.cfg.lua.sh.orig diff --git a/type/__jitsi_meet/files/prosody.cfg.lua.sh b/type/__jitsi_meet/files/prosody.cfg.lua.sh new file mode 120000 index 0000000..93678b9 --- /dev/null +++ b/type/__jitsi_meet/files/prosody.cfg.lua.sh @@ -0,0 +1 @@ +../../__jitsi_meet_domain/files/prosody.cfg.lua.sh \ No newline at end of file diff --git a/type/__jitsi_meet/gencode-remote b/type/__jitsi_meet/gencode-remote index 7d181b7..670c7be 100755 --- a/type/__jitsi_meet/gencode-remote +++ b/type/__jitsi_meet/gencode-remote @@ -4,8 +4,7 @@ if grep -qE "^__file/etc/nginx" "${__messages_in}"; then echo "service nginx reload" fi -JITSI_HOST="${__object_id}" -if grep -qE "^(__line/jitsi_jicofo_secured_domains|__file/etc/prosody/conf.d/${JITSI_HOST}.zauth.cfg.lua|__file/etc/jitsi/jicofo/jicofo.conf)" "${__messages_in}"; then +if grep -qE "^(__line/jitsi_jicofo_secured_domains|(__file|__link)/etc/prosody/conf.d/|__file/etc/jitsi/jicofo/jicofo.conf)" "${__messages_in}"; then echo "systemctl restart prosody" echo "systemctl restart jicofo" echo "systemctl restart jitsi-videobridge2" diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index e9ed5c6..02716a0 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -161,18 +161,22 @@ else SECURED_DOMAINS_STATE='absent' fi -__file "/etc/prosody/conf.d/${JITSI_HOST}.zauth.cfg.lua" \ - --owner prosody --group prosody --mode 0440 \ - --state ${SECURED_DOMAINS_STATE} \ - --source - <. - // authdomain: '${JITSI_HOST}', + // NOTE [cdist]: if we use '${DOMAIN}', jicofo won't start the meeting + authdomain: '${JITSI_HOST}', // Focus component domain. Defaults to focus.. - // focus: 'focus.${JITSI_HOST}', + focus: 'focus.${JITSI_HOST}', // XMPP MUC domain. FIXME: use XEP-0030 to discover it. - muc: 'conference.${JITSI_HOST}' + muc: 'conference.${DOMAIN}' }, // BOSH URL. FIXME: use XEP-0156 to discover it. @@ -31,12 +32,12 @@ var config = { bosh: '///http-bind', // Websocket URL - // websocket: 'wss://${JITSI_HOST}/xmpp-websocket', + // websocket: 'wss://${DOMAIN}/xmpp-websocket', // The real JID of focus participant - can be overridden here // Do not change username - FIXME: Make focus username configurable // https://github.com/jitsi/jitsi-meet/issues/7376 - // focusUserJid: 'focus@auth.${JITSI_HOST}', + focusUserJid: 'focus@auth.${JITSI_HOST}', // Testing / experimental features. @@ -270,9 +271,9 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // appKey: '' // Specify your app key here. // // A URL to redirect the user to, after authenticating // // by default uses: - // // 'https://${JITSI_HOST}/static/oauth.html' + // // 'https://${DOMAIN}/static/oauth.html' // redirectURI: - // 'https://${JITSI_HOST}/subfolder/static/oauth.html' + // 'https://${DOMAIN}/subfolder/static/oauth.html' // }, // When integrations like dropbox are enabled only that will be shown, // by enabling fileRecordingsServiceEnabled, we show both the integrations diff --git a/type/__jitsi_meet_domain/files/nginx.sh b/type/__jitsi_meet_domain/files/nginx.sh index 6e874c1..e678dce 100644 --- a/type/__jitsi_meet_domain/files/nginx.sh +++ b/type/__jitsi_meet_domain/files/nginx.sh @@ -100,7 +100,7 @@ server { proxy_set_header X-Forwarded-For \$remote_addr; # Prevision for 'multi-domain' jitsi instances # https://community.jitsi.org/t/same-jitsi-meet-instance-with-multiple-domain-names/17391 - proxy_set_header Host ${JITSI_HOST}; + proxy_set_header Host ${DOMAIN}; } # xmpp websockets @@ -111,7 +111,7 @@ server { proxy_set_header Connection "upgrade"; # Prevision for 'multi-domain' jitsi instances # https://community.jitsi.org/t/same-jitsi-meet-instance-with-multiple-domain-names/17391 - proxy_set_header Host ${JITSI_HOST}; + proxy_set_header Host ${DOMAIN}; tcp_nodelay on; } diff --git a/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh b/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh new file mode 100644 index 0000000..928ce32 --- /dev/null +++ b/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh @@ -0,0 +1,199 @@ +#!/bin/sh -eu + +# Source: +# https://github.com/jitsi/jitsi-meet/blob/master/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example +FOCUS_USER="focus" +JITSI_DOMAIN="${JITSI_DOMAIN:-${JITSI_HOST:?}}" +# PROSODY_MAIN_CONFIG: defined in __jitsi_meet, empty in __jitsi_meet_domain +PROSODY_SECUREDOMAIN_START="--[[" +PROSODY_SECUREDOMAIN_END="--]]" +if [ -n "${PROSODY_MAIN_CONFIG}" ]; then + PROSODY_MAIN_START="" + PROSODY_MAIN_END="" + PROSODY_DOMAIN_START="--[[" + PROSODY_DOMAIN_END="--]]" +else + PROSODY_MAIN_START="--[[" + PROSODY_MAIN_END="--]]" + PROSODY_DOMAIN_START="" + PROSODY_DOMAIN_END="" + if [ -n "${SECURED_DOMAINS}" ]; then + PROSODY_SECUREDOMAIN_START="" + PROSODY_SECUREDOMAIN_END="" + fi +fi +# Websockets haven't been fully tested in this type and don't work reliably +PROSODY_WEBSOCKET="-- " + +# shellcheck disable=SC2034 # This is intended to be included +PROSODY_CONFIG="$(cat < Date: Thu, 21 Apr 2022 14:34:33 +0200 Subject: [PATCH 12/34] [__jitsi_meet] Adapt jicofo and videobridge memory usage This enables us to setup smaller jitsi instances that work reliably. We set 3 threshholds: - < 3G RAM: use 0.75G max memory - < 5G RAM: use 1G max memory - < 8G RAM: use 2G max memory - >= 8G RAM: use 3G max memory (jitsi's default) For more information as to why and how this is done, see: https://gitlab.com/guifi-exo/projectes/-/issues/318 https://github.com/jitsi/jitsi-meet/issues/6589 as investigated back in the day by @pedro Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/explorer/configured-memory | 15 +++++++++ type/__jitsi_meet/gencode-remote | 33 ++++++++++++++++++++ type/__jitsi_meet/man.rst | 2 ++ 3 files changed, 50 insertions(+) create mode 100755 type/__jitsi_meet/explorer/configured-memory diff --git a/type/__jitsi_meet/explorer/configured-memory b/type/__jitsi_meet/explorer/configured-memory new file mode 100755 index 0000000..658f94b --- /dev/null +++ b/type/__jitsi_meet/explorer/configured-memory @@ -0,0 +1,15 @@ +#!/bin/sh -eu + +JICOFO="/usr/share/jicofo/jicofo.sh" +VIDEOBRIDGE="/usr/share/jitsi-videobridge/lib/videobridge.rc" + +if [ -f "${JICOFO:?}" ]; then + jicofo_memory="$(grep JICOFO_MAX_MEMORY= "${JICOFO:?}" | cut -d= -f 2 | cut -d ";" -f 1)" +fi +if [ -f "${VIDEOBRIDGE:?}" ]; then + vb_memory="$(grep VIDEOBRIDGE_MAX_MEMORY= "${VIDEOBRIDGE:?}" | cut -d= -f 2)" +fi +cat < Date: Thu, 21 Apr 2022 14:44:10 +0200 Subject: [PATCH 13/34] [__jitsi_meet] Fix adjustment of jicofo's max memory Leftover from last commit >,< Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/gencode-remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/type/__jitsi_meet/gencode-remote b/type/__jitsi_meet/gencode-remote index d939347..435bbf4 100755 --- a/type/__jitsi_meet/gencode-remote +++ b/type/__jitsi_meet/gencode-remote @@ -24,7 +24,7 @@ if cut -f 2 "${__object}/explorer/configured-memory" | grep -qvE "^${MAX_MEMORY} -e 's!^(#[[:space:]]*)?(VIDEOBRIDGE_MAX_MEMORY)=.*\$!\2=${MAX_MEMORY}!' \ /usr/share/jitsi-videobridge/lib/videobridge.rc sed -i.tmp -E \ - -e 's!^(JICOFO_MAX_MEMORY)[^;]+;!\1=${MAX_MEMORY};!' \ + -e 's!(JICOFO_MAX_MEMORY)[^;]+;!\1=${MAX_MEMORY};!' \ /usr/share/jicofo/jicofo.sh EOF fi From 1658121549dd902714cc0751758e95b0830dc592 Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 21 Apr 2022 15:52:47 +0200 Subject: [PATCH 14/34] [__jitsi_meet*] Update to 2.0.7210 While there, make things a tad easier to maintain. Note that in this version, jitsi switches to using nginx upstreams; it shouldn't be relevant for instances fully managed with these types. Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/files/jitsi-version | 2 +- type/__jitsi_meet/manifest | 21 ++++ .../files/_update_jitsi_configurations.sh | 6 +- type/__jitsi_meet_domain/files/config.js.sh | 99 ++++++++++++++--- .../files/config.js.sh.orig | 100 +++++++++++++++--- type/__jitsi_meet_domain/files/jitsi-version | 1 + type/__jitsi_meet_domain/files/nginx.sh | 21 +++- type/__jitsi_meet_domain/files/nginx.sh.orig | 18 +++- .../files/prosody.cfg.lua.sh | 10 ++ .../files/prosody.cfg.lua.sh.orig | 10 ++ 10 files changed, 246 insertions(+), 42 deletions(-) mode change 100644 => 120000 type/__jitsi_meet/files/jitsi-version create mode 100644 type/__jitsi_meet_domain/files/jitsi-version diff --git a/type/__jitsi_meet/files/jitsi-version b/type/__jitsi_meet/files/jitsi-version deleted file mode 100644 index 4b02224..0000000 --- a/type/__jitsi_meet/files/jitsi-version +++ /dev/null @@ -1 +0,0 @@ -2.0.7001-1 diff --git a/type/__jitsi_meet/files/jitsi-version b/type/__jitsi_meet/files/jitsi-version new file mode 120000 index 0000000..179d1a4 --- /dev/null +++ b/type/__jitsi_meet/files/jitsi-version @@ -0,0 +1 @@ +../../__jitsi_meet_domain/files/jitsi-version \ No newline at end of file diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index 02716a0..6a9d962 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -155,6 +155,27 @@ server { } EOF +# Starting from 2.0.7210, jitsi defines following nginx upstreams +__directory "${NGINX_ETC}/conf.d" --state present +require="__directory${NGINX_ETC}/conf.d" __file "${NGINX_ETC}/conf.d/prosody.conf" \ + --mode 644 \ + --source - << EOF +upstream prosody { + zone upstreams 64K; + server 127.0.0.1:5280; + keepalive 2; +} +EOF +require="__directory${NGINX_ETC}/conf.d" __file "${NGINX_ETC}/conf.d/jvb1.conf" \ + --mode 644 \ + --source - << EOF +upstream jvb1 { + zone upstreams 64K; + server 127.0.0.1:9090; + keepalive 2; +} +EOF + if [ -f "${__object}/parameter/secured-domains" ]; then SECURED_DOMAINS_STATE='present' else diff --git a/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh b/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh index 1b40768..12c405b 100755 --- a/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh +++ b/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh @@ -7,7 +7,7 @@ # We could automate this, but are using it as an indicator for the # latest branch with which we conciliated changes. -BRANCH="jitsi-meet_7001" +BRANCH="jitsi-meet_7210" REPO="https://github.com/jitsi/jitsi-meet" get_url() { @@ -29,3 +29,7 @@ download_file config.js download_file interface_config.js download_file doc/debian/jitsi-meet/jitsi-meet.example nginx.sh.orig download_file doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example prosody.cfg.lua.sh.orig + +# Change the version file, maintainers should check that it matches +# the deb version +printf "2.0.${BRANCH#*_}-1" > jitsi-version diff --git a/type/__jitsi_meet_domain/files/config.js.sh b/type/__jitsi_meet_domain/files/config.js.sh index 357d720..0eca916 100644 --- a/type/__jitsi_meet_domain/files/config.js.sh +++ b/type/__jitsi_meet_domain/files/config.js.sh @@ -85,6 +85,10 @@ var config = { flags: { // Enables source names in the signaling. // sourceNameSignaling: false, + + // Enables sending multiple video streams, i.e., camera and desktop tracks can be shared in the conference + // separately as two different streams instead of one composite stream. + // sendMultipleVideoStreams: false }, // Disables moderator indicators. @@ -481,6 +485,9 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // If Lobby is enabled starts knocking automatically. // autoKnockLobby: false, + // Enable lobby chat. + // enableLobbyChat: true, + // DEPRECATED! Use \`breakoutRooms.hideAddRoomButton\` instead. // Hides add breakout room button // hideAddRoomButton: false, @@ -520,7 +527,7 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // Hides the dominant speaker name badge that hovers above the toolbox // hideDominantSpeakerBadge: false, - // Default language for the user interface. + // Default language for the user interface. Cannot be overwritten. defaultLanguage: '${DEFAULT_LANGUAGE}', // Disables profile and the edit of all fields from the profile settings (display name and email) @@ -607,7 +614,9 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // 'fullscreen', // 'hangup', // 'help', + // 'highlight', // 'invite', + // 'linktosalesforce', // 'livestreaming', // 'microphone', // 'mute-everyone', @@ -639,7 +648,9 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // timeout: 4000, // // Moved from interfaceConfig.TOOLBAR_ALWAYS_VISIBLE // // Whether toolbar should be always visible or should hide after x miliseconds. - // alwaysVisible: false + // alwaysVisible: false, + // // Indicates whether the toolbar should still autohide when chat is open + // autoHideWhileChatIsOpen: false // }, // Toolbar buttons which have their click/tap event exposed through the API on @@ -748,11 +759,22 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // Enables sending participants' emails (if available) to callstats and other analytics // enableEmailInStats: false, - // Enables detecting faces of participants and get their expression and send it to other participants - // enableFacialRecognition: true, + // faceLandmarks: { + // // Enables sharing your face cordinates. Used for centering faces within a video. + // enableFaceCentering: false, - // Enables displaying facial expressions in speaker stats - // enableDisplayFacialExpressions: true, + // // Enables detecting face expressions and sharing data with other participants + // enableFaceExpressionsDetection: false, + + // // Enables displaying face expressions in speaker stats + // enableDisplayFaceExpressions: false, + + // // Minimum required face movement percentage threshold for sending new face centering coordinates data. + // faceCenteringThreshold: 10, + + // // Miliseconds for processing a new image capture in order to detect face coordinates if they exist. + // captureInterval: 100 + // }, // Controls the percentage of automatic feedback shown to participants when callstats is enabled. // The default value is 100%. If set to 0, no automatic feedback will be requested @@ -940,14 +962,18 @@ ${ANALYTICS_SETTINGS} // Options related to end-to-end (participant to participant) ping. // e2eping: { - // // The interval in milliseconds at which pings will be sent. - // // Defaults to 10000, set to <= 0 to disable. - // pingInterval: 10000, + // // Whether ene-to-end pings should be enabled. + // enabled: false, // - // // The interval in milliseconds at which analytics events - // // with the measured RTT will be sent. Defaults to 60000, set - // // to <= 0 to disable. - // analyticsInterval: 60000, + // // The number of responses to wait for. + // numRequests: 5, + // + // // The max conference size in which e2e pings will be sent. + // maxConferenceSize: 200, + // + // // The maximum number of e2e ping messages per second for the whole conference to aim for. + // // This is used to contol the pacing of messages in order to reduce the load on the backend. + // maxMessagesPerSecond: 250 // }, // If set, will attempt to use the provided video input device label when @@ -989,12 +1015,25 @@ ${ANALYTICS_SETTINGS} // Options related to the remote participant menu. // remoteVideoMenu: { + // // Whether the remote video context menu to be rendered or not. + // disabled: true, // // If set to true the 'Kick out' button will be disabled. // disableKick: true, // // If set to true the 'Grant moderator' button will be disabled. - // disableGrantModerator: true + // disableGrantModerator: true, + // // If set to true the 'Send private message' button will be disabled. + // disablePrivateChat: true // }, + // Endpoint that enables support for salesforce integration with in-meeting resource linking + // This is required for: + // listing the most recent records - salesforceUrl/records/recents + // searching records - salesforceUrl/records?text=${text} + // retrieving record details - salesforceUrl/records/${id}?type=${type} + // and linking the meeting - salesforceUrl/sessions/${sessionId}/records/${id} + // + // salesforceUrl: 'https://api.example.com/', + // If set to true all muting operations of remote participants will be disabled. // disableRemoteMute: true, @@ -1101,7 +1140,8 @@ ${ANALYTICS_SETTINGS} // 'e2ee', // 'transcribing', // 'video-quality', - // 'insecure-room' + // 'insecure-room', + // 'highlight-moment' // ] // }, @@ -1241,6 +1281,7 @@ ${ANALYTICS_SETTINGS} // 'notify.invitedThreePlusMembers', // shown when 3+ participants have been invited // 'notify.invitedTwoMembers', // shown when 2 participants have been invited // 'notify.kickParticipant', // shown when a participant is kicked + // 'notify.linkToSalesforce', // shown when joining a meeting with salesforce integration // 'notify.moderationStartedTitle', // shown when AV moderation is activated // 'notify.moderationStoppedTitle', // shown when AV moderation is deactivated // 'notify.moderationInEffectTitle', // shown when user attempts to unmute audio during AV moderation @@ -1256,6 +1297,7 @@ ${ANALYTICS_SETTINGS} // 'notify.raisedHand', // shown when a partcipant used raise hand, // 'notify.startSilentTitle', // shown when user joined with no audio // 'notify.unmute', // shown to moderator when user raises hand during AV moderation + // 'notify.hostAskedUnmute', // shown to participant when host asks them to unmute // 'prejoin.errorDialOut', // 'prejoin.errorDialOutDisconnected', // 'prejoin.errorDialOutFailed', @@ -1278,12 +1320,37 @@ ${ANALYTICS_SETTINGS} // // Disables user resizable filmstrip. Also, allows configuration of the filmstrip // // (width, tiles aspect ratios) through the interfaceConfig options. // disableResizable: false, - // } + // // Disables the stage filmstrip + // // (displaying multiple participants on stage besides the vertical filmstrip) + // disableStageFilmstrip: false + // }, + + // Tile view related config options. + // tileView: { + // // The optimal number of tiles that are going to be shown in tile view. Depending on the screen size it may + // // not be possible to show the exact number of participants specified here. + // numberOfVisibleTiles: 25 + // }, // Specifies whether the chat emoticons are disabled or not // disableChatSmileys: false, + // Settings for the GIPHY integration. + // giphy: { + // // Whether the feature is enabled or not. + // enabled: false, + // // SDK API Key from Giphy. + // sdkKey: '', + // // Display mode can be one of: + // // - tile: show the GIF on the tile of the participant that sent it. + // // - chat: show the GIF as a message in chat + // // - all: all of the above. This is the default option + // displayMode: 'all', + // // How long the GIF should be displayed on the tile (in miliseconds). + // tileTime: 5000 + // }, + // Allow all above example options to include a trailing comma and // prevent fear when commenting out the last value. makeJsonParserHappy: 'even if last key had a trailing comma' diff --git a/type/__jitsi_meet_domain/files/config.js.sh.orig b/type/__jitsi_meet_domain/files/config.js.sh.orig index 0976642..8e4c5bc 100644 --- a/type/__jitsi_meet_domain/files/config.js.sh.orig +++ b/type/__jitsi_meet_domain/files/config.js.sh.orig @@ -1,3 +1,4 @@ + /* eslint-disable no-unused-vars, no-var */ var config = { @@ -78,6 +79,10 @@ var config = { flags: { // Enables source names in the signaling. // sourceNameSignaling: false, + + // Enables sending multiple video streams, i.e., camera and desktop tracks can be shared in the conference + // separately as two different streams instead of one composite stream. + // sendMultipleVideoStreams: false }, // Disables moderator indicators. @@ -473,6 +478,9 @@ var config = { // If Lobby is enabled starts knocking automatically. // autoKnockLobby: false, + // Enable lobby chat. + // enableLobbyChat: true, + // DEPRECATED! Use `breakoutRooms.hideAddRoomButton` instead. // Hides add breakout room button // hideAddRoomButton: false, @@ -512,7 +520,7 @@ var config = { // Hides the dominant speaker name badge that hovers above the toolbox // hideDominantSpeakerBadge: false, - // Default language for the user interface. + // Default language for the user interface. Cannot be overwritten. // defaultLanguage: 'en', // Disables profile and the edit of all fields from the profile settings (display name and email) @@ -599,7 +607,9 @@ var config = { // 'fullscreen', // 'hangup', // 'help', + // 'highlight', // 'invite', + // 'linktosalesforce', // 'livestreaming', // 'microphone', // 'mute-everyone', @@ -631,7 +641,9 @@ var config = { // timeout: 4000, // // Moved from interfaceConfig.TOOLBAR_ALWAYS_VISIBLE // // Whether toolbar should be always visible or should hide after x miliseconds. - // alwaysVisible: false + // alwaysVisible: false, + // // Indicates whether the toolbar should still autohide when chat is open + // autoHideWhileChatIsOpen: false // }, // Toolbar buttons which have their click/tap event exposed through the API on @@ -740,11 +752,22 @@ var config = { // Enables sending participants' emails (if available) to callstats and other analytics // enableEmailInStats: false, - // Enables detecting faces of participants and get their expression and send it to other participants - // enableFacialRecognition: true, + // faceLandmarks: { + // // Enables sharing your face cordinates. Used for centering faces within a video. + // enableFaceCentering: false, - // Enables displaying facial expressions in speaker stats - // enableDisplayFacialExpressions: true, + // // Enables detecting face expressions and sharing data with other participants + // enableFaceExpressionsDetection: false, + + // // Enables displaying face expressions in speaker stats + // enableDisplayFaceExpressions: false, + + // // Minimum required face movement percentage threshold for sending new face centering coordinates data. + // faceCenteringThreshold: 10, + + // // Miliseconds for processing a new image capture in order to detect face coordinates if they exist. + // captureInterval: 100 + // }, // Controls the percentage of automatic feedback shown to participants when callstats is enabled. // The default value is 100%. If set to 0, no automatic feedback will be requested @@ -931,14 +954,18 @@ var config = { // Options related to end-to-end (participant to participant) ping. // e2eping: { - // // The interval in milliseconds at which pings will be sent. - // // Defaults to 10000, set to <= 0 to disable. - // pingInterval: 10000, + // // Whether ene-to-end pings should be enabled. + // enabled: false, // - // // The interval in milliseconds at which analytics events - // // with the measured RTT will be sent. Defaults to 60000, set - // // to <= 0 to disable. - // analyticsInterval: 60000, + // // The number of responses to wait for. + // numRequests: 5, + // + // // The max conference size in which e2e pings will be sent. + // maxConferenceSize: 200, + // + // // The maximum number of e2e ping messages per second for the whole conference to aim for. + // // This is used to contol the pacing of messages in order to reduce the load on the backend. + // maxMessagesPerSecond: 250 // }, // If set, will attempt to use the provided video input device label when @@ -980,12 +1007,25 @@ var config = { // Options related to the remote participant menu. // remoteVideoMenu: { + // // Whether the remote video context menu to be rendered or not. + // disabled: true, // // If set to true the 'Kick out' button will be disabled. // disableKick: true, // // If set to true the 'Grant moderator' button will be disabled. - // disableGrantModerator: true + // disableGrantModerator: true, + // // If set to true the 'Send private message' button will be disabled. + // disablePrivateChat: true // }, + // Endpoint that enables support for salesforce integration with in-meeting resource linking + // This is required for: + // listing the most recent records - salesforceUrl/records/recents + // searching records - salesforceUrl/records?text=${text} + // retrieving record details - salesforceUrl/records/${id}?type=${type} + // and linking the meeting - salesforceUrl/sessions/${sessionId}/records/${id} + // + // salesforceUrl: 'https://api.example.com/', + // If set to true all muting operations of remote participants will be disabled. // disableRemoteMute: true, @@ -1092,7 +1132,8 @@ var config = { // 'e2ee', // 'transcribing', // 'video-quality', - // 'insecure-room' + // 'insecure-room', + // 'highlight-moment' // ] // }, @@ -1232,6 +1273,7 @@ var config = { // 'notify.invitedThreePlusMembers', // shown when 3+ participants have been invited // 'notify.invitedTwoMembers', // shown when 2 participants have been invited // 'notify.kickParticipant', // shown when a participant is kicked + // 'notify.linkToSalesforce', // shown when joining a meeting with salesforce integration // 'notify.moderationStartedTitle', // shown when AV moderation is activated // 'notify.moderationStoppedTitle', // shown when AV moderation is deactivated // 'notify.moderationInEffectTitle', // shown when user attempts to unmute audio during AV moderation @@ -1247,6 +1289,7 @@ var config = { // 'notify.raisedHand', // shown when a partcipant used raise hand, // 'notify.startSilentTitle', // shown when user joined with no audio // 'notify.unmute', // shown to moderator when user raises hand during AV moderation + // 'notify.hostAskedUnmute', // shown to participant when host asks them to unmute // 'prejoin.errorDialOut', // 'prejoin.errorDialOutDisconnected', // 'prejoin.errorDialOutFailed', @@ -1269,12 +1312,37 @@ var config = { // // Disables user resizable filmstrip. Also, allows configuration of the filmstrip // // (width, tiles aspect ratios) through the interfaceConfig options. // disableResizable: false, - // } + // // Disables the stage filmstrip + // // (displaying multiple participants on stage besides the vertical filmstrip) + // disableStageFilmstrip: false + // }, + + // Tile view related config options. + // tileView: { + // // The optimal number of tiles that are going to be shown in tile view. Depending on the screen size it may + // // not be possible to show the exact number of participants specified here. + // numberOfVisibleTiles: 25 + // }, // Specifies whether the chat emoticons are disabled or not // disableChatSmileys: false, + // Settings for the GIPHY integration. + // giphy: { + // // Whether the feature is enabled or not. + // enabled: false, + // // SDK API Key from Giphy. + // sdkKey: '', + // // Display mode can be one of: + // // - tile: show the GIF on the tile of the participant that sent it. + // // - chat: show the GIF as a message in chat + // // - all: all of the above. This is the default option + // displayMode: 'all', + // // How long the GIF should be displayed on the tile (in miliseconds). + // tileTime: 5000 + // }, + // Allow all above example options to include a trailing comma and // prevent fear when commenting out the last value. makeJsonParserHappy: 'even if last key had a trailing comma' diff --git a/type/__jitsi_meet_domain/files/jitsi-version b/type/__jitsi_meet_domain/files/jitsi-version new file mode 100644 index 0000000..f2cc6dd --- /dev/null +++ b/type/__jitsi_meet_domain/files/jitsi-version @@ -0,0 +1 @@ +2.0.7210-1 \ No newline at end of file diff --git a/type/__jitsi_meet_domain/files/nginx.sh b/type/__jitsi_meet_domain/files/nginx.sh index e678dce..ad1b41a 100644 --- a/type/__jitsi_meet_domain/files/nginx.sh +++ b/type/__jitsi_meet_domain/files/nginx.sh @@ -10,6 +10,17 @@ JITSI_NGINX_CONFIG="$(cat < Date: Thu, 21 Apr 2022 17:52:49 +0200 Subject: [PATCH 15/34] [__jitsi_meet] Fix issue with jicofo memory adaptation That was being a bit of a mess. Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/gencode-remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/type/__jitsi_meet/gencode-remote b/type/__jitsi_meet/gencode-remote index 435bbf4..fd782a4 100755 --- a/type/__jitsi_meet/gencode-remote +++ b/type/__jitsi_meet/gencode-remote @@ -24,7 +24,7 @@ if cut -f 2 "${__object}/explorer/configured-memory" | grep -qvE "^${MAX_MEMORY} -e 's!^(#[[:space:]]*)?(VIDEOBRIDGE_MAX_MEMORY)=.*\$!\2=${MAX_MEMORY}!' \ /usr/share/jitsi-videobridge/lib/videobridge.rc sed -i.tmp -E \ - -e 's!(JICOFO_MAX_MEMORY)[^;]+;!\1=${MAX_MEMORY};!' \ + -e 's!(JICOFO_MAX_MEMORY)[^";]+;!\1=${MAX_MEMORY};!' \ /usr/share/jicofo/jicofo.sh EOF fi From 151dc32fb52f695b101369032a0bdad1a9b20916 Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 21 Apr 2022 19:43:32 +0200 Subject: [PATCH 16/34] [__jitsi_meet*] Add support for simultaneous interpretations By using https://gitlab.com/mfmt/jsi which consists of very small and simple static files, we enable interpretations by default. With this commit, any DOMAIN created with __jitsi_meet_domain will serve jsi on https://DOMAIN/i/ and any ROOM can be used with simultaneous interpretation on https://DOMAIN/i/ROOM Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/manifest | 43 +++++++++++++++++++++++++ type/__jitsi_meet_domain/files/nginx.sh | 15 +++++++++ type/__jitsi_meet_domain/man.rst | 9 +++++- 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index 6a9d962..0b728c7 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -262,3 +262,46 @@ EOF fi fi # TODO: disable the exporter if it is deployed and then admin changes their mind + +# +# Setup interpreter assets if requested +# See: https://gitlab.com/mfmt/jsi/ +# +jsi_updated_on="2022-04-21" +__link "/usr/share/jitsi-meet/interpreters.html" \ + --type symbolic \ + --source "/opt/jsi/static/index.html.sample" +__directory /opt/jsi --mode 0755 +export require="__directory/opt/jsi" +__download /opt/jsi/jsi.tar.gz \ + --url 'https://gitlab.com/mfmt/jsi/-/archive/1d2cceaf615ee61c0bba80e5bddc61c5d1018303/jsi-1d2cceaf615ee61c0bba80e5bddc61c5d1018303.tar.gz' \ + --sum "sha256:b020141093daa9937507b098f358d0be994834c3e23866a457fc5140415a0c53" +export require="__download/opt/jsi/jsi.tar.gz" +__unpack /opt/jsi/jsi.tar.gz \ + --preserve-archive \ + --tar-strip 1 \ + --destination /opt/jsi/static \ + --onchange "$(cat <]*(/external_api.js).!src='\1'!" \ + -e "s!

[^<]*

!

Jitsi Meetings with interpreter

!" \ + -e "s!https://meet.mayfirst.org!/!" \ + -e "s!(style.css|jsi.js)([^?])!\1?v=${jsi_updated_on:?}\2!" \ + /opt/jsi/static/index.html.sample +EOF +)" diff --git a/type/__jitsi_meet_domain/files/nginx.sh b/type/__jitsi_meet_domain/files/nginx.sh index ad1b41a..64467d9 100644 --- a/type/__jitsi_meet_domain/files/nginx.sh +++ b/type/__jitsi_meet_domain/files/nginx.sh @@ -102,6 +102,21 @@ server { expires 1y; } } + # Paths for jsi / interpreters + location ~ ^/i/(img/[^./]*.png|jsi.js|style.css)$ + { + add_header 'Access-Control-Allow-Origin' '*'; + alias /opt/jsi/static/\$1; + + # cache all versioned files + if (\$arg_v) { + expires 1y; + } + } + location ~ ^/i/ + { + try_files /${DOMAIN}-interpreters.html /interpreters.html \$uri; + } # BOSH location = /http-bind { diff --git a/type/__jitsi_meet_domain/man.rst b/type/__jitsi_meet_domain/man.rst index 0bef146..97d670b 100644 --- a/type/__jitsi_meet_domain/man.rst +++ b/type/__jitsi_meet_domain/man.rst @@ -11,7 +11,13 @@ DESCRIPTION ----------- This type installs and configures the frontend for Jitsi-Meet. -This supports "multi-domain" installations. +Additionally to regular Jitsi-Meet, users can load `DOMAIN/i/` and +`DOMAIN/i/ROOM` for an interpreter-enabled interface; this is done with a +patched version of Jitsi Simultaneous Interpretation (jsi; see references). +At least a user with `interpreter` in their name must be present. + + +This type supports "multi-domain" installations. New in April 2022: rooms are independent for each domain, that is: https://jitsi1.example.org/room1 and https://jitsi2.example.org/room1 are @@ -156,6 +162,7 @@ SEE ALSO -------- - `__jitsi_meet(7)` - `__jitsi_meet_user(7)` +- Jitsi Meet Simultaneous Interpretation: https://gitlab.com/mfmt/jsi AUTHORS From 67bc8aa02bd9512b98f1850dff3d4ad38f056273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 25 Apr 2022 17:10:50 +0200 Subject: [PATCH 17/34] __uacme_obtain: allow use of stdin with the --renew-hook parameter --- type/__uacme_obtain/man.rst | 3 ++- type/__uacme_obtain/manifest | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/type/__uacme_obtain/man.rst b/type/__uacme_obtain/man.rst index f1db899..16ebe87 100644 --- a/type/__uacme_obtain/man.rst +++ b/type/__uacme_obtain/man.rst @@ -38,7 +38,8 @@ install-key-to Installation path of the certificate's private key. renew-hook - Renew hook executed on certificate renewal (e.g. `service nginx reload`). + Renew hook executed on certificate renewal (e.g. `service nginx reload`, `-` + for the standard input). force-cert-ownership-to Override default ownership for TLS certificate, passed as argument to chown. diff --git a/type/__uacme_obtain/manifest b/type/__uacme_obtain/manifest index b41ddde..a40119b 100644 --- a/type/__uacme_obtain/manifest +++ b/type/__uacme_obtain/manifest @@ -109,7 +109,11 @@ export CERT_TARGET RENEW_HOOK= if [ -f "${__object:?}/parameter/renew-hook" ]; then - RENEW_HOOK="$(cat "${__object:?}/parameter/renew-hook")" + if [ "$(cat "${__object:?}/parameter/renew-hook")" = "-" ]; then + RENEW_HOOK="$(cat ${__object:?}/stdin)" + else + RENEW_HOOK="$(cat "${__object:?}/parameter/renew-hook")" + fi fi export RENEW_HOOK From 977b530dab44061cdae171e7c3c31d78b74191df Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 28 Apr 2022 17:22:19 +0200 Subject: [PATCH 18/34] [__single_binary_service] Update manpage to remove __evilham prefix --- type/__single_binary_service/man.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/type/__single_binary_service/man.rst b/type/__single_binary_service/man.rst index cb40330..65b4fc0 100644 --- a/type/__single_binary_service/man.rst +++ b/type/__single_binary_service/man.rst @@ -1,9 +1,9 @@ -cdist-type__evilham_single_binary_service(7) -============================================ +cdist-type__single_binary_service(7) +==================================== NAME ---- -cdist-type__evilham_single_binary_service - Setup a single-binary service +cdist-type__single_binary_service - Setup a single-binary service DESCRIPTION @@ -142,7 +142,7 @@ EXAMPLES # Install and enable the ipmi_exporter service # The variables are defined in the manifest previously - __evilham_single_binary_service ipmi_exporter \ + __single_binary_service ipmi_exporter \ --user "${USER}" \ --service-args ' --config.file=/etc/ipmi_exporter.conf' \ --version "${SHOULD_VERSION}" \ @@ -157,7 +157,7 @@ EXAMPLES EOF # Remove the ipmi_exporter service along with the user and its config - __evilham_single_binary_service ipmi_exporter \ + __single_binary_service ipmi_exporter \ --user "${USER}" \ --version "${SHOULD_VERSION}" \ --checksum "${CHECKSUM}" \ @@ -165,7 +165,7 @@ EXAMPLES --state "absent" # Same, but the service was using my user! Let's not delete that! - __evilham_single_binary_service ipmi_exporter \ + __single_binary_service ipmi_exporter \ --user "evilham" \ --do-not-manage-user \ --version "${SHOULD_VERSION}" \ @@ -187,4 +187,4 @@ Evilham COPYING ------- -Copyright \(C) 2021 Evilham. +Copyright \(C) 2022 Evilham. From 0cff41488436c7e9f8aa083e5974ba2537fca41e Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 28 Apr 2022 17:28:46 +0200 Subject: [PATCH 19/34] [__jitsi_meet] Simplify exporter logic and update it to 1.2.0 This uses the newly merged __single_binary_service and: - Fixes the bug where once added, the exporter could not be removed - Simplifies keeping it up to date Sponsored by: camilion.eu, eXO.cat --- .../prometheus-jitsi-meet-explorer-version | 7 -- type/__jitsi_meet/manifest | 78 +++++-------------- 2 files changed, 18 insertions(+), 67 deletions(-) delete mode 100755 type/__jitsi_meet/explorer/prometheus-jitsi-meet-explorer-version diff --git a/type/__jitsi_meet/explorer/prometheus-jitsi-meet-explorer-version b/type/__jitsi_meet/explorer/prometheus-jitsi-meet-explorer-version deleted file mode 100755 index b1cec48..0000000 --- a/type/__jitsi_meet/explorer/prometheus-jitsi-meet-explorer-version +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -e - -EXPORTER_VERSION_FILE="/usr/local/bin/.prometheus-jitsi-meet-exporter.cdist.version" - -if [ -f "${EXPORTER_VERSION_FILE}" ]; then - cat "${EXPORTER_VERSION_FILE}" -fi diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index 0b728c7..815d039 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -1,7 +1,6 @@ #!/bin/sh -e os="$(cat "${__global}/explorer/os")" -init="$(cat "${__global}/explorer/init")" case "${os}" in devuan|debian) ;; @@ -27,8 +26,6 @@ if [ -z "${TURN_SERVER}" ]; then TURN_SERVER="${JITSI_HOST}" fi -PROMETHEUS_JITSI_EXPORTER_IS_VERSION="$(cat "${__object}/explorer/prometheus-jitsi-meet-explorer-version")" - # The rest is loosely based on Jitsi's documentation # https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart @@ -203,65 +200,26 @@ export JITSI_HOST "${__type}/files/jicofo.conf.sh" | \ __file /etc/jitsi/jicofo/jicofo.conf --mode 0444 --source '-' + # These two should be changed on new release -PROMETHEUS_JITSI_EXPORTER_SHOULD_VERSION="1.1.5" -PROMETHEUS_JITSI_EXPORTER_CHECKSUM="sha256:3ddf43a48d9a2f62be1bc6db9e7ba75d61994f9423e5c5b28be019f41f06f745" -PROMETHEUS_JITSI_EXPORTER_URL="https://github.com/systemli/prometheus-jitsi-meet-exporter/releases/download/${PROMETHEUS_JITSI_EXPORTER_SHOULD_VERSION}/prometheus-jitsi-meet-exporter-linux-amd64" -PROMETHEUS_JITSI_EXPORTER_VERSION_FILE="/usr/local/bin/.prometheus-jitsi-meet-exporter.cdist.version" -if [ ! -f "${__object}/parameter/disable-prometheus-exporter" ]; then - case "${init}" in - init|sysvinit) - __runit - require="__runit" __runit_service \ - prometheus-jitsi-meet-exporter --log --source - <&1 -EOF - - export require="__runit_service/prometheus-jitsi-meet-exporter" - JITSI_MEET_EXPORTER_SERVICE="sv %s prometheus-jitsi-meet-exporter" - ;; - systemd) - __systemd_unit prometheus-jitsi-meet-exporter.service \ - --source "-" \ - --enablement-state "enabled" < Date: Thu, 28 Apr 2022 17:32:15 +0200 Subject: [PATCH 20/34] [__jitsi_meet] Configure jicofo so metrics are more useful By default the REST API provided by jicofo is less useful than desired. This is a tad under-documented, so finding the right settings was tricky :-). Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/gencode-remote | 2 +- type/__jitsi_meet/manifest | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/type/__jitsi_meet/gencode-remote b/type/__jitsi_meet/gencode-remote index fd782a4..c29d20e 100755 --- a/type/__jitsi_meet/gencode-remote +++ b/type/__jitsi_meet/gencode-remote @@ -33,7 +33,7 @@ if grep -qE "^__file/etc/nginx" "${__messages_in}"; then echo "service nginx reload" fi -if grep -qE "^(__line/jitsi_jicofo_secured_domains|(__file|__link)/etc/prosody/conf.d/|__file/etc/jitsi/jicofo/jicofo.conf)" "${__messages_in}"; then +if grep -qE "^(__line/jitsi_jicofo_secured_domains|(__file|__link)/etc/prosody/conf.d/|__file/etc/jitsi/(jicofo/jicofo.conf|videobridge/jvb.conf))" "${__messages_in}"; then RESTART_SERVICES="YES" fi diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index 815d039..fb22821 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -200,6 +200,29 @@ export JITSI_HOST "${__type}/files/jicofo.conf.sh" | \ __file /etc/jitsi/jicofo/jicofo.conf --mode 0444 --source '-' +# Enable the private colibri REST API end point for better stats +__file "/etc/jitsi/videobridge/jvb.conf" --mode 0444 --source '-' < Date: Thu, 28 Apr 2022 17:34:32 +0200 Subject: [PATCH 21/34] [__jitsi_meet_domain] Make shellcheck happy and fix escaping issue The escaping issue was overlooked because it was in a comment block; it wasn't relevant. No functional changes intended. Sponsored by: camilion.eu, eXO.cat --- .../files/_update_jitsi_configurations.sh | 2 +- type/__jitsi_meet_domain/files/config.js.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh b/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh index 12c405b..0d9f53a 100755 --- a/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh +++ b/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh @@ -32,4 +32,4 @@ download_file doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example prosody. # Change the version file, maintainers should check that it matches # the deb version -printf "2.0.${BRANCH#*_}-1" > jitsi-version +printf "2.0.%s-1" "${BRANCH#*_}" > jitsi-version diff --git a/type/__jitsi_meet_domain/files/config.js.sh b/type/__jitsi_meet_domain/files/config.js.sh index 0eca916..6836dd1 100644 --- a/type/__jitsi_meet_domain/files/config.js.sh +++ b/type/__jitsi_meet_domain/files/config.js.sh @@ -1028,9 +1028,9 @@ ${ANALYTICS_SETTINGS} // Endpoint that enables support for salesforce integration with in-meeting resource linking // This is required for: // listing the most recent records - salesforceUrl/records/recents - // searching records - salesforceUrl/records?text=${text} - // retrieving record details - salesforceUrl/records/${id}?type=${type} - // and linking the meeting - salesforceUrl/sessions/${sessionId}/records/${id} + // searching records - salesforceUrl/records?text=\${text} + // retrieving record details - salesforceUrl/records/\${id}?type=\${type} + // and linking the meeting - salesforceUrl/sessions/\${sessionId}/records/\${id} // // salesforceUrl: 'https://api.example.com/', From 8e1d0b68f1473bd78aea44811c8b977c07af9466 Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 28 Apr 2022 17:40:09 +0200 Subject: [PATCH 22/34] [__jitsi_meet*] Add new parameters for heavier branding This uses nginx' server-side includes, so each domain configured by `__jitsi_meet_domain` can have its own customisation. Note that the file customisation file must exist for each domain, `__jitsi_meet_domain` takes care of that already. Sponsored by: camilion.eu, eXO.cat --- type/__jitsi_meet/manifest | 7 +++++++ type/__jitsi_meet_domain/files/interface_config.js.sh | 2 +- type/__jitsi_meet_domain/man.rst | 11 +++++++++-- type/__jitsi_meet_domain/manifest | 6 ++++++ .../parameter/default/branding-app-name | 1 + .../parameter/default/branding-extra-body | 0 type/__jitsi_meet_domain/parameter/optional | 2 ++ 7 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 type/__jitsi_meet_domain/parameter/default/branding-app-name create mode 100644 type/__jitsi_meet_domain/parameter/default/branding-extra-body diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index fb22821..20e91a7 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -224,6 +224,13 @@ videobridge { } EOFJVB +# Enable simple per-domain body customisation +__file "/usr/share/jitsi-meet/body.html" \ + --mode 0644 \ + --source '-' < +EOF + # These two should be changed on new release EXPORTER_VERSION="1.2.0" EXPORTER_CHECKSUM="sha256:6377ffa7be0c7deb66545616add7245da96f8b7746d6712f41cfa9fe72c935ce" diff --git a/type/__jitsi_meet_domain/files/interface_config.js.sh b/type/__jitsi_meet_domain/files/interface_config.js.sh index 094cc6e..0589ced 100644 --- a/type/__jitsi_meet_domain/files/interface_config.js.sh +++ b/type/__jitsi_meet_domain/files/interface_config.js.sh @@ -20,7 +20,7 @@ JITSI_INTERFACE_CONFIG_JS="$(cat < Date: Thu, 28 Apr 2022 17:43:33 +0200 Subject: [PATCH 23/34] [__jitsi_meet_domain] Add a muc_room_cache_size for jibri @pedro is working on this and this change matched my workflow better :-) --- type/__jitsi_meet_domain/files/prosody.cfg.lua.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh b/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh index ea243c1..5bb93b5 100644 --- a/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh +++ b/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh @@ -153,6 +153,8 @@ Component "internal.auth.${JITSI_DOMAIN:?}" "muc" admins = { "${FOCUS_USER:?}@auth.${JITSI_HOST:?}", "jvb@auth.${JITSI_HOST:?}" } muc_room_locking = false muc_room_default_public_jids = true + -- https://prosody.im/doc/modules/mod_muc + muc_room_cache_size = 1000 ${PROSODY_DOMAIN_END} ${PROSODY_MAIN_START} -- This will be managed by __jitsi_meet From 797f7c864814f69d0a138b3f415acfd4ca539121 Mon Sep 17 00:00:00 2001 From: Evilham Date: Sun, 8 May 2022 21:47:26 +0200 Subject: [PATCH 24/34] [__jitsi_meet] Improve manpage regarding ufw and SSH This documents the fact that this type does not make decisions about anything other than Jitsi-Meet itself and therefore care should be taken with the SSH port. Related to: https://code.ungleich.ch/ungleich-public/cdist-contrib/pulls/23 Reported by: @pedro --- type/__jitsi_meet/man.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/type/__jitsi_meet/man.rst b/type/__jitsi_meet/man.rst index 876c218..03a4a35 100644 --- a/type/__jitsi_meet/man.rst +++ b/type/__jitsi_meet/man.rst @@ -21,10 +21,10 @@ You will also need the `__jitsi_meet_domain` type in order to finish setting up the web frontend (including TLS certificates) and its settings. You may want to use the `files/ufw` example manifest for a `__ufw`-based -firewall compatible with this type. -This file does not include rules for TCP port 9888, which exposes the -prometheus exporter if not disabled. -You should apply your own rules here. +firewall compatible with this type that allows all ports needed by Jitsi-Meet. +Note however that this will not deal with rules for SSH or for TCP port 9888, +which exposes the prometheus exporter if not disabled. +Remember to apply your own rules here, particularly regarding SSH. This type only works on De{bi,vu}an systems. @@ -76,9 +76,11 @@ EXAMPLES .. code-block:: sh - # Setup the firewall + # Setup the firewall for Jitsi-Meet . "${__global}/type/__jitsi_meet/files/ufw" export require="__ufw" + # Setup firewall SSH rules as necessary + __ufw_rule ssh --rule 'allow 22/tcp from 10.0.0.0/24' # Setup Jitsi on this host __jitsi_meet \ --turn-server "turn.exo.cat" \ From 756e5b17c63d641ac35ffad513d3ed15188b87ca Mon Sep 17 00:00:00 2001 From: Evilham Date: Tue, 7 Jun 2022 15:00:00 +0200 Subject: [PATCH 25/34] [__jitsi_meet*] Update to 2.0.7287-1 Sponsored by: camilion.eu, eXO.cat --- .../files/_update_jitsi_configurations.sh | 2 +- type/__jitsi_meet_domain/files/config.js.sh | 38 +++++++++++++++++-- .../files/config.js.sh.orig | 38 +++++++++++++++++-- type/__jitsi_meet_domain/files/jitsi-version | 2 +- .../files/prosody.cfg.lua.sh | 17 +++++++++ .../files/prosody.cfg.lua.sh.orig | 15 ++++++++ 6 files changed, 102 insertions(+), 10 deletions(-) diff --git a/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh b/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh index 0d9f53a..8b14e5c 100755 --- a/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh +++ b/type/__jitsi_meet_domain/files/_update_jitsi_configurations.sh @@ -7,7 +7,7 @@ # We could automate this, but are using it as an indicator for the # latest branch with which we conciliated changes. -BRANCH="jitsi-meet_7210" +BRANCH="jitsi-meet_7287" REPO="https://github.com/jitsi/jitsi-meet" get_url() { diff --git a/type/__jitsi_meet_domain/files/config.js.sh b/type/__jitsi_meet_domain/files/config.js.sh index 6836dd1..e52ed32 100644 --- a/type/__jitsi_meet_domain/files/config.js.sh +++ b/type/__jitsi_meet_domain/files/config.js.sh @@ -4,6 +4,11 @@ JITSI_CONFIG_JS="$(cat <