浏览代码

Add message archive management to prosody

Bob Mottram 8 年前
父节点
当前提交
d51af9b3c4
共有 1 个文件被更改,包括 29 次插入1 次删除
  1. 29
    1
      src/freedombone

+ 29
- 1
src/freedombone 查看文件

6934
 	echo 'install_tox_client' >> $COMPLETION_FILE
6934
 	echo 'install_tox_client' >> $COMPLETION_FILE
6935
 }
6935
 }
6936
 
6936
 
6937
+function update_prosody_modules {
6938
+	if [ ! -d $INSTALL_DIR/prosody-modules ]; then
6939
+		return
6940
+	fi
6941
+	if [ ! -d /usr/lib/prosody ]; then
6942
+		return
6943
+	fi
6944
+
6945
+	cd $INSTALL_DIR/prosody-modules
6946
+	hg pull
6947
+	hg update
6948
+
6949
+	# support onion addresses
6950
+	if [ -f $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua ]; then
6951
+		cp $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua /usr/lib/prosody/modules/mod_onions.lua
6952
+	fi
6953
+
6954
+	# message archive management
6955
+	# https://modules.prosody.im/mod_mam.html
6956
+	if [ -d cp $INSTALL_DIR/prosody-modules/mod_mam ]; then
6957
+		cp $INSTALL_DIR/prosody-modules/mod_mam/*.lua /usr/lib/prosody/modules
6958
+	fi
6959
+}
6960
+
6937
 function install_xmpp {
6961
 function install_xmpp {
6938
 	if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6962
 	if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6939
 		return
6963
 		return
6940
 	fi
6964
 	fi
6965
+
6966
+	update_prosody_modules
6967
+
6941
 	if grep -Fxq "install_xmpp" $COMPLETION_FILE; then
6968
 	if grep -Fxq "install_xmpp" $COMPLETION_FILE; then
6942
 		return
6969
 		return
6943
 	fi
6970
 	fi
6958
 	fi
6985
 	fi
6959
 
6986
 
6960
 	# install the onions module
6987
 	# install the onions module
6961
-	cp $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua /usr/lib/prosody/modules/mod_onions.lua
6988
+	update_prosody_modules
6962
 	if [ ! -f /usr/lib/prosody/modules/mod_onions.lua ]; then
6989
 	if [ ! -f /usr/lib/prosody/modules/mod_onions.lua ]; then
6963
 		echo $'mod_onions.lua could not be copied to the prosody modules directory'
6990
 		echo $'mod_onions.lua could not be copied to the prosody modules directory'
6964
 		exit 63952
6991
 		exit 63952
7001
 		echo '  "tls"; -- Enable mod_tls' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7028
 		echo '  "tls"; -- Enable mod_tls' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7002
 		echo '  "saslauth"; -- Enable mod_saslauth' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7029
 		echo '  "saslauth"; -- Enable mod_saslauth' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7003
 		echo '  "onions"; -- Enable chat via onion service' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7030
 		echo '  "onions"; -- Enable chat via onion service' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7031
+		echo '  "mam"; -- Message archive management' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7004
 		echo '}' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7032
 		echo '}' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7005
 		echo '' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7033
 		echo '' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7006
 		echo 'c2s_require_encryption = true' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7034
 		echo 'c2s_require_encryption = true' >> /etc/prosody/conf.avail/xmpp.cfg.lua