From 98e37ca13e4d2c40ea273fb489171ea6854b39c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sara=20Aim=C3=A9e=20Smiseth?= <51710585+SaraSmiseth@users.noreply.github.com> Date: Sun, 31 May 2020 11:24:31 +0200 Subject: [PATCH] add vcard_muc module --- Dockerfile | 3 +++ conf.d/04-vhost.cfg.lua | 5 ++-- docker-prosody-module-copy | 55 ++++++++++++++++++++++++++++++++++++++ readme.md | 2 ++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 docker-prosody-module-copy diff --git a/Dockerfile b/Dockerfile index 6e37b73..084c8ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -77,6 +77,9 @@ RUN docker-prosody-module-install \ smacks `# stream management (XEP-0198)` \ throttle_presence `# presence throttling in CSI` +RUN docker-prosody-module-copy \ + vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)` + USER prosody ENTRYPOINT ["/entrypoint.sh"] diff --git a/conf.d/04-vhost.cfg.lua b/conf.d/04-vhost.cfg.lua index fccda6c..f8b5f5a 100644 --- a/conf.d/04-vhost.cfg.lua +++ b/conf.d/04-vhost.cfg.lua @@ -17,11 +17,12 @@ Component ("proxy." .. domain) "proxy65" -- Component (domain) "http_upload" -- is set-up via modules_enabled -Component ("muc." .. domain) "muc" +Component ("conference." .. domain) "muc" name = "Prosody Chatrooms" restrict_room_creation = false max_history_messages = 20 modules_enabled = { - "muc_mam"; + "muc_mam", + "vcard_muc" } diff --git a/docker-prosody-module-copy b/docker-prosody-module-copy new file mode 100755 index 0000000..fe7c7ab --- /dev/null +++ b/docker-prosody-module-copy @@ -0,0 +1,55 @@ +#!/bin/sh +set -e + +source="/usr/src/prosody-modules" +target="/usr/local/lib/prosody/custom-modules" + +srcExists= +if [ -d ${source} ]; then + srcExists=1 +fi +docker-prosody-module-source pullTo ${source} + +if [ -z "$srcExists" ]; then + touch ${source}/.docker-delete-me +fi + +cd ${source} + +usage() { + echo "usage: $0 ext-name [ext-name ...]" + echo " ie: $0 carbons e2e_policy proxy65" + echo + echo 'Possible values for ext-name:' + find . -mindepth 1 -maxdepth 1 -type d | sort | sed s/\.\\/mod_//g | xargs +} + +exts= +for ext; do + if [ -z "mod_$ext" ]; then + continue + fi + if [ ! -d "mod_$ext" ]; then + echo >&2 "error: $PWD/mod_$ext does not exist" + echo >&2 + usage >&2 + exit 1 + fi + exts="$exts $ext" +done + +if [ -z "$exts" ]; then + usage >&2 + exit 1 +fi + +for ext in $exts; do + echo "Installing mod_${ext}" + + echo " - copying to ${target}" + cp -r "${source}/mod_${ext}" "${target}/" +done + +if [ -e ${source}/.docker-delete-me ]; then + docker-prosody-module-source deleteFrom ${source} +fi diff --git a/readme.md b/readme.md index 76edfcb..d801be9 100644 --- a/readme.md +++ b/readme.md @@ -102,6 +102,8 @@ There is a helper script that eases installing additional prosody modules: ```do It downloads the current [prosody-modules](https://hg.prosody.im/prosody-modules/) repository. The specified modules are copied and its name is added to the ```modules_enabled``` variable within ```conf.d/01-modules.cfg.lua```. +There is also ```docker-prosody-module-copy``` which copies the specified modules but does not add them to the ```modules_enabled``` variable within ```conf.d/01-modules.cfg.lua```. + If you need additional configuration just overwrite the respective _cfg.lua_ file or add new ones. ### Debugging