Microblog configuration

This commit is contained in:
Bob Mottram 2016-02-04 09:46:06 +00:00
parent 2c26e3b141
commit 7a52f575ac
1 changed files with 35 additions and 2 deletions

View File

@ -199,6 +199,7 @@ MICROBLOG_ADMIN_PASSWORD=
GNUSOCIAL_COMMIT='94392ab00ceefec6105ac7d6e6846fb644bbd0f1' GNUSOCIAL_COMMIT='94392ab00ceefec6105ac7d6e6846fb644bbd0f1'
MICROBLOG_THEME_REPO="https://git.gnu.io/h2p/Qvitter.git" MICROBLOG_THEME_REPO="https://git.gnu.io/h2p/Qvitter.git"
MICROBLOG_THEME_COMMIT='8abbdeb3c0a6a34754411452ae832d2f19cef7ab' MICROBLOG_THEME_COMMIT='8abbdeb3c0a6a34754411452ae832d2f19cef7ab'
MICROBLOG_WELCOME_MESSAGE=$"<h1>Welcome to ${MICROBLOG_DOMAIN_NAME} a federated microblog</h1><p>Another Freedombone site</p>"
# Domain name for hubzilla installation # Domain name for hubzilla installation
HUBZILLA_DOMAIN_NAME= HUBZILLA_DOMAIN_NAME=
@ -1022,6 +1023,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 "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE; then
MICROBLOG_WELCOME_MESSAGE=$(grep "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "PROJECT_WEBSITE" $CONFIGURATION_FILE; then if grep -q "PROJECT_WEBSITE" $CONFIGURATION_FILE; then
PROJECT_WEBSITE=$(grep "PROJECT_WEBSITE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') PROJECT_WEBSITE=$(grep "PROJECT_WEBSITE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
@ -8541,6 +8545,17 @@ function install_gnu_social {
exit 72357 exit 72357
fi fi
if ! grep -q "Recommended GNU social settings" $microblog_config_file; then
microblog_config_file=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php
echo "" >> $microblog_config_file
echo "// Recommended GNU social settings" >> $microblog_config_file
echo "$config['thumbnail']['maxsize'] = 3000;" >> $microblog_config_file
echo "$config['profile']['delete'] = true;" >> $microblog_config_file
echo "$config['profile']['changenick'] = true;" >> $microblog_config_file
echo "$config['public']['localonly'] = false;" >> $microblog_config_file
echo "addPlugin('StoreRemoteMedia');" >> $microblog_config_file
fi
MICROBLOG_ONION_HOSTNAME=$(add_onion_service microblog 80 ${MICROBLOG_ONION_PORT}) MICROBLOG_ONION_HOSTNAME=$(add_onion_service microblog 80 ${MICROBLOG_ONION_PORT})
systemctl restart php5-fpm systemctl restart php5-fpm
@ -8604,8 +8619,26 @@ function install_gnu_social_theme {
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter
git checkout $MICROBLOG_THEME_COMMIT -b $MICROBLOG_THEME_COMMIT git checkout $MICROBLOG_THEME_COMMIT -b $MICROBLOG_THEME_COMMIT
if ! grep -q "addPlugin('Qvitter')" /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php; then microblog_config_file=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php
echo "addPlugin('Qvitter');" >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php if ! grep -q "addPlugin('Qvitter')" $microblog_config_file; then
echo "" >> $microblog_config_file
echo "// Qvitter settings" >> $microblog_config_file
echo "addPlugin('Qvitter');" >> $microblog_config_file
echo "$config['site']['qvitter']['enabledbydefault'] = true;" >> $microblog_config_file
echo "$config['site']['qvitter']['defaultbackgroundcolor'] = '#f4f4f4';" >> $microblog_config_file
echo "$config['site']['qvitter']['defaultlinkcolor'] = '#0084B4';" >> $microblog_config_file
echo "$config['site']['qvitter']['timebetweenpolling'] = 5000;" >> $microblog_config_file
echo "$config['site']['qvitter']['urlshortenerapiurl'] = 'http://qttr.at/shortener.php';" >> $microblog_config_file
echo "$config['site']['qvitter']['urlshortenersignature'] = 'b6afeec983';" >> $microblog_config_file
echo "$config['site']['qvitter']['sitebackground'] = 'img/vagnsmossen.jpg';" >> $microblog_config_file
echo "$config['site']['qvitter']['favicon'] = 'img/favicon.ico?v=4';" >> $microblog_config_file
echo "$config['site']['qvitter']['sprite'] = Plugin::staticPath('Qvitter', '').'img/sprite.png?v=40';" >> $microblog_config_file
echo "$config['site']['qvitter']['enablewelcometext'] = true;" >> $microblog_config_file
echo "$config['site']['qvitter']['customwelcometext']['en'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
echo "$config['site']['qvitter']['customwelcometext']['de'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
echo "$config['site']['qvitter']['customwelcometext']['fr'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
echo "$config['site']['qvitter']['customwelcometext']['es'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
echo "$config['site']['qvitter']['blocked_ips'] = array();" >> $microblog_config_file
fi fi
if ! grep -q "GNU Social theme commit" $COMPLETION_FILE; then if ! grep -q "GNU Social theme commit" $COMPLETION_FILE; then