Different way of referencing prosody modules
This commit is contained in:
parent
32a481b057
commit
e123a8a2f4
|
@ -127,68 +127,75 @@ function reconfigure_xmpp {
|
|||
}
|
||||
|
||||
function update_prosody_modules {
|
||||
if [ ! -d $INSTALL_DIR/prosody-modules ]; then
|
||||
if [ ! -d /var/lib/prosody/prosody-modules ]; then
|
||||
return
|
||||
fi
|
||||
if [ ! -d /usr/lib/prosody ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd $INSTALL_DIR/prosody-modules
|
||||
cd /var/lib/prosody/prosody-modules
|
||||
hg pull
|
||||
hg update
|
||||
|
||||
# support onion addresses
|
||||
if [ -f $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua /usr/lib/prosody/modules/mod_onions.lua
|
||||
fi
|
||||
#if [ -f $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua /usr/lib/prosody/modules/mod_onions.lua
|
||||
#fi
|
||||
|
||||
# XEP-0313 message archive management
|
||||
# https://modules.prosody.im/mod_mam.html
|
||||
# Allows you to download your previous messages onto a new client
|
||||
# This only applies if you are not using forward secret crypto
|
||||
# such as OTR or OMEMO (eg. OpenPGP)
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_mam ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_mam/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_mam ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_mam/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
# XEP-0352 Client State Indication
|
||||
# Notifies the server if the app is in the background or not
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_csi ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_csi/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_csi ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_csi/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
# XEP-0280 Message Carbons
|
||||
# Ensures all messages get delivered to all clients (if you have a mobile and desktop client)
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_carbons ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_carbons/*.lua /usr/lib/prosody/modules
|
||||
cp $INSTALL_DIR/prosody-modules/mod_carbons_adhoc/*.lua /usr/lib/prosody/modules
|
||||
cp $INSTALL_DIR/prosody-modules/mod_carbons_copies/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_carbons ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_carbons/*.lua /usr/lib/prosody/modules
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_carbons_adhoc/*.lua /usr/lib/prosody/modules
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_carbons_copies/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
# XEP-0198 Stream management
|
||||
# Helps mobile apps recover when a device switches networks.
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_smacks ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_smacks/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_smacks_offline ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_smacks_offline/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_smacks ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_smacks/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_smacks_offline ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_smacks_offline/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
# XEP-0191: blocking
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_blocking ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_blocking/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_blocking ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_blocking/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
# XEP-0016 Privacy lists
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_privacy_lists ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_privacy_lists/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_privacy_lists ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_privacy_lists/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
# If offline then send messages to email
|
||||
if [ -d $INSTALL_DIR/prosody-modules/mod_offline_email ]; then
|
||||
cp $INSTALL_DIR/prosody-modules/mod_offline_email/*.lua /usr/lib/prosody/modules
|
||||
fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_offline_email ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_offline_email/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_pep_vcard_avatar ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_pep_vcard_avatar/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
|
||||
#if [ -d $INSTALL_DIR/prosody-modules/mod_blocking ]; then
|
||||
# cp $INSTALL_DIR/prosody-modules/mod_blocking/*.lua /usr/lib/prosody/modules
|
||||
#fi
|
||||
}
|
||||
|
||||
function upgrade_xmpp {
|
||||
|
@ -291,9 +298,6 @@ function remove_xmpp {
|
|||
remove_onion_service xmpp 5222 5223 5269
|
||||
|
||||
apt-get -yq remove --purge prosody prosody-modules
|
||||
if [ -d $INSTALL_DIR/prosody-modules ]; then
|
||||
rm -rf $INSTALL_DIR/prosody-modules
|
||||
fi
|
||||
if [ -d /etc/prosody ]; then
|
||||
rm -rf /etc/prosody
|
||||
fi
|
||||
|
@ -340,20 +344,27 @@ function xmpp_modules {
|
|||
echo ' "mam"; -- Message archive management' >> $filename
|
||||
echo ' "csi"; -- Client state indication' >> $filename
|
||||
echo ' "carbons"; -- Message carbons' >> $filename
|
||||
echo ' "carbons_adhoc"; -- Message carbons' >> $filename
|
||||
echo ' "carbons_copies"; -- Message carbons' >> $filename
|
||||
echo ' "smacks"; -- Stream management' >> $filename
|
||||
echo ' "smacks_offline"; -- Stream management' >> $filename
|
||||
echo ' "pep"; -- Personal Eventing Protocol (to support OMEMO)' >> $filename
|
||||
echo ' "pep_vcard_avatar"; -- Personal Eventing Protocol (to support OMEMO)' >> $filename
|
||||
echo ' "privacy"; -- Privacy lists' >> $filename
|
||||
echo ' "privacy_lists"; -- Privacy lists' >> $filename
|
||||
echo ' "blocking"; -- Blocking command' >> $filename
|
||||
echo ' "roster"; -- Roster versioning' >> $filename
|
||||
echo ' "offline_email"; -- If offline send to email' >> $filename
|
||||
echo ' "offline"; -- Store offline messages' >> $filename
|
||||
echo ' "http";' >> $filename
|
||||
echo ' "http_upload";' >> $filename
|
||||
echo ' "websocket";' >> $filename
|
||||
echo '};' >> $filename
|
||||
}
|
||||
|
||||
function xmpp_create_config {
|
||||
echo "admins = { \"$MY_USERNAME@$DEFAULT_DOMAIN_NAME\" }" > /etc/prosody/prosody.cfg.lua
|
||||
echo 'plugin_paths = { "/var/lib/prosody/prosody-modules" }' >> /etc/prosody/prosody.cfg.lua
|
||||
echo '' >> /etc/prosody/prosody.cfg.lua
|
||||
xmpp_modules /etc/prosody/prosody.cfg.lua
|
||||
echo '' >> /etc/prosody/prosody.cfg.lua
|
||||
|
@ -363,6 +374,13 @@ function xmpp_create_config {
|
|||
echo '' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'pidfile = "/var/run/prosody/prosody.pid";' >> /etc/prosody/prosody.cfg.lua
|
||||
echo '' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'https_ports = { 5281 }' >> /etc/prosody/prosody.cfg.lua
|
||||
echo ' https_interfaces = { "*" }' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'https_ssl = {' >> /etc/prosody/prosody.cfg.lua
|
||||
echo " certificate = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.pem\";" >> /etc/prosody/prosody.cfg.lua
|
||||
echo " key = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.key\";" >> /etc/prosody/prosody.cfg.lua
|
||||
echo "}" >> /etc/prosody/prosody.cfg.lua
|
||||
echo '' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'ssl = {' >> /etc/prosody/prosody.cfg.lua
|
||||
echo " key = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.key\";" >> /etc/prosody/prosody.cfg.lua
|
||||
echo " certificate = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.pem\";" >> /etc/prosody/prosody.cfg.lua
|
||||
|
@ -398,6 +416,8 @@ function xmpp_create_config {
|
|||
echo ' }' >> /etc/prosody/prosody.cfg.lua
|
||||
echo '' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'Include "conf.d/*.cfg.lua"' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'http_upload_path = "/var/lib/prosody/http_uploads"' >> /etc/prosody/prosody.cfg.lua
|
||||
echo 'http_upload_file_size_limit = 50000000' >> /etc/prosody/prosody.cfg.lua
|
||||
}
|
||||
|
||||
function install_xmpp_main {
|
||||
|
@ -415,8 +435,10 @@ function install_xmpp_main {
|
|||
fi
|
||||
fi
|
||||
|
||||
apt-get -yq install lua-sec lua-bitop
|
||||
apt-get -yq install prosody prosody-modules mercurial
|
||||
apt-get -yq install lua-sec lua-bitop lua5.1 liblua5.1-dev
|
||||
apt-get -yq install libidn11-dev libssl-dev lua-dbi-sqlite3
|
||||
apt-get -yq mercurial
|
||||
apt-get -yq install prosody prosody-modules
|
||||
|
||||
if [ ! -d /etc/prosody ]; then
|
||||
echo $"ERROR: prosody does not appear to have installed. $CHECK_MESSAGE"
|
||||
|
@ -425,30 +447,28 @@ function install_xmpp_main {
|
|||
|
||||
groupadd prosody
|
||||
|
||||
if [ ! -d /var/lib/prosody ]; then
|
||||
mkdir /var/lib/prosody
|
||||
if [ ! -d /var/lib/prosody/http_uploads ]; then
|
||||
mkdir -p /var/lib/prosody/http_uploads
|
||||
fi
|
||||
if [ ! -d /etc/prosody/conf.d ]; then
|
||||
mkdir /etc/prosody/conf.d
|
||||
fi
|
||||
chmod -R 700 /etc/prosody/conf.d
|
||||
chown -R prosody /var/lib/prosody
|
||||
chown -R prosody /etc/prosody/conf.d
|
||||
|
||||
# obtain the prosody modules
|
||||
cd $INSTALL_DIR
|
||||
hg clone https://hg.prosody.im/prosody-modules/ prosody-modules
|
||||
if [ ! -d $INSTALL_DIR/prosody-modules/mod_onions ]; then
|
||||
if [ ! -d /var/lib/prosody/prosody-modules ]; then
|
||||
hg clone https://hg.prosody.im/prosody-modules/ /var/lib/prosody/prosody-modules
|
||||
fi
|
||||
if [ ! -d /var/lib/prosody/prosody-modules/mod_onions ]; then
|
||||
echo $'mod_onions prosody module could not be found'
|
||||
exit 73254
|
||||
fi
|
||||
|
||||
chmod -R 700 /etc/prosody/conf.d
|
||||
chown -R prosody /var/lib/prosody
|
||||
chown -R prosody /etc/prosody/conf.d
|
||||
|
||||
# install the onions module
|
||||
update_prosody_modules
|
||||
if [ ! -f /usr/lib/prosody/modules/mod_onions.lua ]; then
|
||||
echo $'mod_onions.lua could not be copied to the prosody modules directory'
|
||||
exit 63952
|
||||
fi
|
||||
|
||||
# create a certificate
|
||||
if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "0" ]]; then
|
||||
|
|
Loading…
Reference in New Issue