|
|
|
|
434
|
cd ${INSTALL_DIR}/${prosody_filename}
|
434
|
cd ${INSTALL_DIR}/${prosody_filename}
|
435
|
./configure --ostype=debian
|
435
|
./configure --ostype=debian
|
436
|
make
|
436
|
make
|
437
|
- make install
|
|
|
438
|
- if [ ! -f /usr/local/bin/prosody ]; then
|
|
|
439
|
- echo $'Failed to build prosody nightly'
|
|
|
|
|
437
|
+ make install PREFIX=/usr
|
|
|
438
|
+ if [ -f /usr/local/bin/prosody ]; then
|
|
|
439
|
+ echo $'Failed to build prosody nightly to /usr/bin'
|
440
|
rm ${INSTALL_DIR}/${prosody_filename}.tar.gz
|
440
|
rm ${INSTALL_DIR}/${prosody_filename}.tar.gz
|
441
|
rm -rf ${INSTALL_DIR}/${prosody_filename}
|
441
|
rm -rf ${INSTALL_DIR}/${prosody_filename}
|
442
|
exit 628732
|
442
|
exit 628732
|
443
|
fi
|
443
|
fi
|
444
|
- cp -f /usr/local/bin/prosody* /usr/bin
|
|
|
445
|
- rm /usr/local/bin/prosody*
|
|
|
446
|
rm ${INSTALL_DIR}/${prosody_filename}.tar.gz
|
444
|
rm ${INSTALL_DIR}/${prosody_filename}.tar.gz
|
447
|
rm -rf ${INSTALL_DIR}/${prosody_filename}
|
445
|
rm -rf ${INSTALL_DIR}/${prosody_filename}
|
448
|
- rm -rf /usr/local/lib/prosody
|
|
|
449
|
- rm -rf /usr/local/var/lib/prosody
|
|
|
450
|
- rm -rf /usr/local/etc/prosody
|
|
|
451
|
}
|
446
|
}
|
452
|
|
447
|
|
453
|
function install_xmpp_main {
|
448
|
function install_xmpp_main {
|
|
|
|
|
577
|
fi
|
572
|
fi
|
578
|
ln -sf /etc/prosody/conf.avail/xmpp.cfg.lua /etc/prosody/conf.d/xmpp.cfg.lua
|
573
|
ln -sf /etc/prosody/conf.avail/xmpp.cfg.lua /etc/prosody/conf.d/xmpp.cfg.lua
|
579
|
|
574
|
|
580
|
- if [ -f /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem ]; then
|
|
|
581
|
- sed -i "s|/etc/prosody/certs/localhost.key|/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.key|g" /etc/prosody/prosody.cfg.lua
|
|
|
582
|
- sed -i "s|/etc/prosody/certs/localhost.crt|/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.pem|g" /etc/prosody/prosody.cfg.lua
|
|
|
583
|
- else
|
|
|
584
|
- sed -i 's|/etc/prosody/certs/localhost.key|/etc/prosody/certs/xmpp.key|g' /etc/prosody/prosody.cfg.lua
|
|
|
585
|
- sed -i 's|/etc/prosody/certs/localhost.crt|/etc/prosody/certs/xmpp.crt|g' /etc/prosody/prosody.cfg.lua
|
|
|
586
|
- fi
|
|
|
587
|
- if ! grep -q "xmpp.dhparam" /etc/prosody/prosody.cfg.lua; then
|
|
|
588
|
- if [ -f /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.dhparam ]; then
|
|
|
589
|
- sed -i "/certificate =/a\ dhparam = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.dhparam\";" /etc/prosody/prosody.cfg.lua
|
|
|
590
|
- else
|
|
|
591
|
- sed -i '/certificate =/a\ dhparam = "/etc/prosody/certs/xmpp.dhparam";' /etc/prosody/prosody.cfg.lua
|
|
|
592
|
- fi
|
|
|
593
|
- fi
|
|
|
594
|
- if ! grep -q 'options = {"no_sslv2", "no_sslv3" }' /etc/prosody/prosody.cfg.lua; then
|
|
|
595
|
- sed -i '/certificate =/a\ options = {"no_sslv2", "no_sslv3" };' /etc/prosody/prosody.cfg.lua
|
|
|
596
|
- fi
|
|
|
597
|
- if ! grep -q 'ciphers =' /etc/prosody/prosody.cfg.lua; then
|
|
|
598
|
- sed -i "/certificate =/a\ ciphers = $XMPP_CIPHERS;" /etc/prosody/prosody.cfg.lua
|
|
|
599
|
- fi
|
|
|
600
|
- if ! grep -q 'depth = "1";' /etc/prosody/prosody.cfg.lua; then
|
|
|
601
|
- sed -i '/certificate =/a\ depth = "1";' /etc/prosody/prosody.cfg.lua
|
|
|
602
|
- fi
|
|
|
603
|
- if ! grep -q 'curve =' /etc/prosody/prosody.cfg.lua; then
|
|
|
604
|
- sed -i "/certificate =/a\ curve = $XMPP_ECC_CURVE;" /etc/prosody/prosody.cfg.lua
|
|
|
605
|
- fi
|
|
|
606
|
- sed -i 's/c2s_require_encryption = false/c2s_require_encryption = true/g' /etc/prosody/prosody.cfg.lua
|
|
|
607
|
- if ! grep -q "s2s_require_encryption" /etc/prosody/prosody.cfg.lua; then
|
|
|
608
|
- sed -i '/c2s_require_encryption/a\s2s_require_encryption = true' /etc/prosody/prosody.cfg.lua
|
|
|
609
|
- fi
|
|
|
610
|
- if ! grep -q "allow_unencrypted_plain_auth" /etc/prosody/prosody.cfg.lua; then
|
|
|
611
|
- echo 'allow_unencrypted_plain_auth = false' >> /etc/prosody/conf.avail/xmpp.cfg.lua
|
|
|
612
|
- fi
|
|
|
613
|
- sed -i 's/--"bosh";/"bosh";/g' /etc/prosody/prosody.cfg.lua
|
|
|
614
|
- sed -i 's/authentication = "internal_plain"/authentication = "internal_hashed"/g' /etc/prosody/prosody.cfg.lua
|
|
|
615
|
- sed -i 's/enabled = false -- Remove this line to enable this host//g' /etc/prosody/prosody.cfg.lua
|
|
|
616
|
- if [ -f /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem ]; then
|
|
|
617
|
- # use an existing cert if possible
|
|
|
618
|
- sed -i "s|key = \"/etc/prosody/certs/example.com.key\"|key = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.key\"|g" /etc/prosody/prosody.cfg.lua
|
|
|
619
|
- sed -i "s|certificate = \"/etc/prosody/certs/example.com.crt\"|certificate = \"/etc/prosody/certs/${DEFAULT_DOMAIN_NAME}.pem\"|g" /etc/prosody/prosody.cfg.lua
|
|
|
620
|
- else
|
|
|
621
|
- sed -i 's|key = "/etc/prosody/certs/example.com.key"|key = "/etc/prosody/certs/xmpp.key"|g' /etc/prosody/prosody.cfg.lua
|
|
|
622
|
- sed -i 's|certificate = "/etc/prosody/certs/example.com.crt"|certificate = "/etc/prosody/certs/xmpp.crt"|g' /etc/prosody/prosody.cfg.lua
|
|
|
623
|
- fi
|
|
|
624
|
- sed -i "s/example.com/$DEFAULT_DOMAIN_NAME/g" /etc/prosody/prosody.cfg.lua
|
|
|
625
|
-
|
|
|
626
|
if [ ! -d /var/lib/tor ]; then
|
575
|
if [ ! -d /var/lib/tor ]; then
|
627
|
echo $'No Tor installation found. xmpp onion site cannot be configured.'
|
576
|
echo $'No Tor installation found. xmpp onion site cannot be configured.'
|
628
|
exit 877367
|
577
|
exit 877367
|
|
|
|
|
677
|
|
626
|
|
678
|
systemctl restart prosody
|
627
|
systemctl restart prosody
|
679
|
|
628
|
|
680
|
- sleep 5
|
|
|
681
|
-
|
|
|
682
|
prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME "$XMPP_PASSWORD"
|
629
|
prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME "$XMPP_PASSWORD"
|
683
|
if [ ! "$?" = "0" ]; then
|
630
|
if [ ! "$?" = "0" ]; then
|
684
|
echo ''
|
631
|
echo ''
|
685
|
echo ''
|
632
|
echo ''
|
|
|
633
|
+ systemctl status prosody -l
|
|
|
634
|
+ echo ''
|
|
|
635
|
+ echo ''
|
686
|
which prosody
|
636
|
which prosody
|
687
|
which prosodyctl
|
637
|
which prosodyctl
|
688
|
echo ''
|
638
|
echo ''
|