Add xmpp contact info

This commit is contained in:
Bob Mottram 2018-03-07 10:52:18 +00:00
parent 5846205b48
commit 8a19b05ef4
1 changed files with 20 additions and 0 deletions

View File

@ -60,6 +60,7 @@ xmpp_variables=(ONION_ONLY
XMPP_ECC_CURVE
XMPP_ECC_CURVE
MY_USERNAME
MY_EMAIL_ADDRESS
DEFAULT_DOMAIN_NAME
XMPP_DOMAIN_CODE)
@ -431,6 +432,7 @@ function upgrade_xmpp {
function_check update_prosody_modules
update_prosody_modules
xmpp_onion_addresses /etc/prosody/prosody.cfg.lua
xmpp_contact_info /etc/prosody/prosody.cfg.lua
if grep -q "/etc/ssl/certs/xmpp.dhparam" /etc/prosody/prosody.cfg.lua; then
cp /etc/ssl/certs/xmpp.dhparam /etc/prosody/xmpp.dhparam
@ -658,10 +660,27 @@ function xmpp_email_headers {
done
}
function xmpp_contact_info {
filename="$1"
if grep -q "contact_info =" "$filename"; then
return
fi
{ 'contact_info = {';
"abuse = { \"mailto:${MY_EMAIL_ADDRESS}\", \"xmpp:${USERNAME}@${HOSTNAME}\" };";
"admin = { \"mailto:${MY_EMAIL_ADDRESS}\", \"xmpp:${USERNAME}@${HOSTNAME}\" };";
"feedback = { \"mailto:${MY_EMAIL_ADDRESS}\", \"xmpp:${USERNAME}@${HOSTNAME}\" };";
"security = { \"xmpp:${USERNAME}@${HOSTNAME}\" };";
"support = { \"xmpp:${USERNAME}@${HOSTNAME}\" };";
'};'; } >> "$filename"
}
function xmpp_modules {
filename="$1"
{ echo 'modules_enabled = {';
echo ' "server_contact_info";';
echo ' "pubsub";';
echo ' "pubsub_hub";';
echo ' "dialback"; -- s2s dialback support';
@ -754,6 +773,7 @@ function xmpp_create_config {
xmpp_modules /etc/prosody/prosody.cfg.lua
echo '' >> /etc/prosody/prosody.cfg.lua
xmpp_onion_addresses /etc/prosody/prosody.cfg.lua
xmpp_contact_info /etc/prosody/prosody.cfg.lua
{ echo '';
echo 'allow_registration = false;';
echo '';