Optionally set a separate xmpp password
This commit is contained in:
parent
96fa1f77f2
commit
58fc0619dd
|
@ -304,6 +304,7 @@ MARIADB_PASSWORD=
|
||||||
|
|
||||||
# Directory where XMPP settings are stored
|
# Directory where XMPP settings are stored
|
||||||
XMPP_DIRECTORY="/var/lib/prosody"
|
XMPP_DIRECTORY="/var/lib/prosody"
|
||||||
|
XMPP_PASSWORD=
|
||||||
|
|
||||||
# file containing a list of remote locations to backup to
|
# file containing a list of remote locations to backup to
|
||||||
# Format: [username@friendsdomain//home/username] [ssh_password]
|
# Format: [username@friendsdomain//home/username] [ssh_password]
|
||||||
|
@ -1038,6 +1039,9 @@ function read_configuration {
|
||||||
if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then
|
if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then
|
||||||
cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg
|
cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg
|
||||||
fi
|
fi
|
||||||
|
if grep -q "XMPP_PASSWORD" $CONFIGURATION_FILE; then
|
||||||
|
XMPP_PASSWORD=$(grep "XMPP_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
|
fi
|
||||||
if grep -q "RSS_READER_REPO" $CONFIGURATION_FILE; then
|
if grep -q "RSS_READER_REPO" $CONFIGURATION_FILE; then
|
||||||
RSS_READER_REPO=$(grep "RSS_READER_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
RSS_READER_REPO=$(grep "RSS_READER_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
@ -7428,11 +7432,13 @@ function install_xmpp {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "Your XMPP password is" /home/$MY_USERNAME/README; then
|
if ! grep -q "Your XMPP password is" /home/$MY_USERNAME/README; then
|
||||||
|
if [ ${#XMPP_PASSWORD} -lt 8 ]; then
|
||||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||||
XMPP_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
XMPP_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||||
else
|
else
|
||||||
XMPP_PASSWORD="$(openssl rand -base64 8)"
|
XMPP_PASSWORD="$(openssl rand -base64 8)"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME $XMPP_PASSWORD
|
prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME $XMPP_PASSWORD
|
||||||
echo '' >> /home/$MY_USERNAME/README
|
echo '' >> /home/$MY_USERNAME/README
|
||||||
echo '' >> /home/$MY_USERNAME/README
|
echo '' >> /home/$MY_USERNAME/README
|
||||||
|
@ -7478,6 +7484,9 @@ function install_xmpp_client {
|
||||||
echo 'priority.away=0' >> $XMPP_CLIENT_ACCOUNTS
|
echo 'priority.away=0' >> $XMPP_CLIENT_ACCOUNTS
|
||||||
echo 'priority.xa=0' >> $XMPP_CLIENT_ACCOUNTS
|
echo 'priority.xa=0' >> $XMPP_CLIENT_ACCOUNTS
|
||||||
echo 'priority.dnd=0' >> $XMPP_CLIENT_ACCOUNTS
|
echo 'priority.dnd=0' >> $XMPP_CLIENT_ACCOUNTS
|
||||||
|
if [ ${#XMPP_PASSWORD} -gt 2 ]; then
|
||||||
|
echo "password=$XMPP_PASSWORD" >> $XMPP_CLIENT_ACCOUNTS
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /var/lib/tor/hidden_service_xmpp/hostname ]; then
|
if [ -f /var/lib/tor/hidden_service_xmpp/hostname ]; then
|
||||||
|
@ -7499,6 +7508,9 @@ function install_xmpp_client {
|
||||||
echo 'priority.away=0' >> $XMPP_CLIENT_ACCOUNTS
|
echo 'priority.away=0' >> $XMPP_CLIENT_ACCOUNTS
|
||||||
echo 'priority.xa=0' >> $XMPP_CLIENT_ACCOUNTS
|
echo 'priority.xa=0' >> $XMPP_CLIENT_ACCOUNTS
|
||||||
echo 'priority.dnd=0' >> $XMPP_CLIENT_ACCOUNTS
|
echo 'priority.dnd=0' >> $XMPP_CLIENT_ACCOUNTS
|
||||||
|
if [ ${#XMPP_PASSWORD} -gt 2 ]; then
|
||||||
|
echo "password=$XMPP_PASSWORD" >> $XMPP_CLIENT_ACCOUNTS
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d /home/$MY_USERNAME/.config/profanity ]; then
|
if [ ! -d /home/$MY_USERNAME/.config/profanity ]; then
|
||||||
|
|
Loading…
Reference in New Issue