Update prosody modules

This commit is contained in:
Bob Mottram 2018-01-04 16:55:15 +00:00
parent a01b116b93
commit d514414ff9
3 changed files with 11 additions and 42 deletions

Binary file not shown.

View File

@ -47,8 +47,8 @@ prosody_filename=prosody-${prosody_latest_version}-1nightly${prosody_nightly}
prosody_nightly_url="https://prosody.im/nightly/${prosody_latest_version}/latest/${prosody_filename}.tar.gz"
# From https://hg.prosody.im/prosody-modules
prosody_modules_filename='prosody-modules-20170514.tar.gz'
prosody_modules_hash='ef404c203317cc0de6da7aaec4f21765a57f630adfbf082cf2dd92b881c15f86'
prosody_modules_filename='prosody-modules-20180104.tar.gz'
prosody_modules_hash='7c81b4ed8a90130b4db5902dc1f299ad1c4dab57a0970552b71cb2042a490bc1'
xmpp_variables=(ONION_ONLY
INSTALLED_WITHIN_DOCKER
@ -326,46 +326,6 @@ function update_prosody_modules {
return
fi
# This module is a workaround for OMEMO within group chat
# See https://github.com/iNPUTmice/omemo_all_access
if [ -f ~/freedombone/image_build/mod_omemo_all_access.lua ]; then
if [ ! -d /var/lib/prosody/prosody-modules ]; then
mkdir -p /var/lib/prosody/prosody-modules
fi
copy_omemo_all_access=1
if [ -f /usr/lib/prosody/modules/mod_omemo_all_access.lua ]; then
curr_hash=$(sha256sum /usr/lib/prosody/modules/mod_omemo_all_access.lua)
new_hash=$(sha256sum ~/freedombone/image_build/mod_omemo_all_access.lua)
if [[ "$curr_hash" == "$new_hash" ]]; then
copy_omemo_all_access=
fi
fi
if [ $copy_omemo_all_access ]; then
systemctl stop prosody
cp ~/freedombone/image_build/mod_omemo_all_access.lua /var/lib/prosody/prosody-modules/mod_omemo_all_access.lua
cp ~/freedombone/image_build/mod_omemo_all_access.lua /usr/lib/prosody/modules/mod_omemo_all_access.lua
chmod +x /var/lib/prosody/prosody-modules/mod_omemo_all_access.lua
chmod +x /usr/lib/prosody/modules/mod_omemo_all_access.lua
if ! grep -q "omemo_all_access" /etc/prosody/prosody.cfg.lua; then
sed -i '/"pep";/a "omemo_all_access"; -- Fix for PEP with OMEMO' /etc/prosody/prosody.cfg.lua
sed -i 's|"omemo_all_access";| "omemo_all_access";|g' /etc/prosody/prosody.cfg.lua
fi
if ! grep -q "omemo_all_access" /etc/prosody/conf.avail/xmpp.cfg.lua; then
sed -i '/"pep";/a "omemo_all_access"; -- Fix for PEP with OMEMO' /etc/prosody/conf.avail/xmpp.cfg.lua
sed -i 's|"omemo_all_access";| "omemo_all_access";|g' /etc/prosody/conf.avail/xmpp.cfg.lua
fi
chown -R prosody:prosody /var/lib/prosody/prosody-modules
chown -R prosody:prosody /usr/lib/prosody/modules
systemctl start prosody
fi
fi
if [ ! -f $INSTALL_DIR/$prosody_modules_filename ]; then
# Obtain the modules
if [ -f ~/freedombone/image_build/$prosody_modules_filename ]; then
@ -413,6 +373,15 @@ function update_prosody_modules {
sed -i '/"pep"/a "vcard";' /etc/prosody/prosody.cfg.lua
systemctl start prosody
fi
if ! grep -q "omemo_all_access" /etc/prosody/prosody.cfg.lua; then
sed -i '/"pep";/a "omemo_all_access"; -- Fix for PEP with OMEMO' /etc/prosody/prosody.cfg.lua
sed -i 's|"omemo_all_access";| "omemo_all_access";|g' /etc/prosody/prosody.cfg.lua
fi
if ! grep -q "omemo_all_access" /etc/prosody/conf.avail/xmpp.cfg.lua; then
sed -i '/"pep";/a "omemo_all_access"; -- Fix for PEP with OMEMO' /etc/prosody/conf.avail/xmpp.cfg.lua
sed -i 's|"omemo_all_access";| "omemo_all_access";|g' /etc/prosody/conf.avail/xmpp.cfg.lua
fi
}
function prosody_daemon_restart_script {