Fixing xmpp

This commit is contained in:
Bob Mottram 2014-09-25 18:17:07 +01:00
parent 2302c6878e
commit f9af361245
1 changed files with 15 additions and 9 deletions

View File

@ -1703,7 +1703,9 @@ function install_xmpp {
return
fi
apt-get -y --force-yes install prosody
if [ ! -f "/etc/ssl/private/xmpp.key" ]; then
makecert xmpp
fi
chown prosody:prosody /etc/ssl/private/xmpp.key
chown prosody:prosody /etc/ssl/certs/xmpp.*
cp -a /etc/prosody/conf.avail/example.com.cfg.lua /etc/prosody/conf.avail/xmpp.cfg.lua
@ -1738,9 +1740,12 @@ function install_xmpp {
sed -i '/c2s_require_encryption/a\s2s_require_encryption = true' /etc/prosody/prosody.cfg.lua
fi
sed -i 's/--"bosh";/"bosh";/g' /etc/prosody/prosody.cfg.lua
sed -i 's/authentication = "internal_plain"/authentication = "internal_hashed"' /etc/prosody/prosody.cfg.lua
sed -i 's/authentication = "internal_plain"/authentication = "internal_hashed"/g' /etc/prosody/prosody.cfg.lua
service prosody restart
touch /home/$MY_USERNAME/README
if ! grep -Fxq "Your XMPP password is" /home/$MY_USERNAME/README; then
XMPP_PASSWORD=$(openssl rand -base64 8)
prosodyctl register $MY_USERNAME $DOMAIN_NAME $XMPP_PASSWORD
echo "Your XMPP password is: $XMPP_PASSWORD" >> /home/$MY_USERNAME/README
@ -1748,6 +1753,7 @@ function install_xmpp {
echo '' >> /home/$MY_USERNAME/README
echo " prosodyctl new_password $MY_USERNAME@$DOMAIN_NAME" >> /home/$MY_USERNAME/README
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
fi
echo 'install_xmpp' >> $COMPLETION_FILE
}