Use consistent gnusocial name

This commit is contained in:
Bob Mottram 2016-10-01 20:15:48 +01:00
parent 68ed1a81df
commit 1bd6858b28
5 changed files with 60 additions and 58 deletions

View File

@ -282,14 +282,14 @@ if grep -q "install_sip" $COMPLETION_FILE; then
fi
if grep -q "install_gnusocial" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | awk -F ':' '{print $2}')
if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
php scripts/registeruser.php -n $MY_USERNAME -w "$NEW_USER_PASSWORD" -e "$MY_USERNAME@$HOSTNAME"
${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$MICROBLOG_DOMAIN_NAME" -g gnusocial --public no
echo $'Created GNU Social user'
echo $'Created gnusocial user'
else
echo $"Unable to find GNU Social installation at /var/www/$MICROBLOG_DOMAIN_NAME/htdocs"
echo $"Unable to find gnusocial installation at /var/www/$MICROBLOG_DOMAIN_NAME/htdocs"
userdel -r $MY_USERNAME
exit 11
fi

View File

@ -8,7 +8,7 @@
#
# Freedom in the Cloud
#
# GNU Social application
# gnusocial application
#
# License
# =======
@ -222,13 +222,13 @@ function reconfigure_gnusocial {
}
function upgrade_gnusocial {
if grep -q "GNU Social domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}')
if grep -q "gnusocial domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}')
fi
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "GNU Social commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "gnusocial commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO
function_check gnusocial_running_script
gnusocial_running_script
@ -237,8 +237,8 @@ function upgrade_gnusocial {
function backup_local_gnusocial {
MICROBLOG_DOMAIN_NAME='microblog'
if grep -q "GNU Social domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}')
if grep -q "gnusocial domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}')
fi
source_directory=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
@ -263,12 +263,12 @@ function backup_local_gnusocial {
}
function restore_local_gnusocial {
if ! grep -q "GNU Social domain" $COMPLETION_FILE; then
if ! grep -q "gnusocial domain" $COMPLETION_FILE; then
return
fi
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}')
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}')
if [ $MICROBLOG_DOMAIN_NAME ]; then
echo $"Restoring GNU Social"
echo $"Restoring gnusocial"
temp_restore_dir=/root/tempgnusocial
gnusocial_dir=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
# stop the daemons
@ -286,13 +286,13 @@ function restore_local_gnusocial {
# start the daemons
cd $gnusocial_dir
scripts/startdaemons.sh
echo $"Restore of GNU Social complete"
echo $"Restore of gnusocial complete"
fi
}
function backup_remote_gnusocial {
if grep -q "GNU Social domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}')
if grep -q "gnusocial domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}')
temp_backup_dir=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
if [ -d $temp_backup_dir ]; then
function_check suspend_site
@ -309,15 +309,15 @@ function backup_remote_gnusocial {
function_check restart_site
restart_site
else
echo $"GNU Social domain specified but not found in ${temp_backup_dir}"
echo $"gnusocial domain specified but not found in ${temp_backup_dir}"
fi
fi
}
function restore_remote_gnusocial {
if grep -q "GNU Social domain" $COMPLETION_FILE; then
echo $"Restoring GNU Social"
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}')
if grep -q "gnusocial domain" $COMPLETION_FILE; then
echo $"Restoring gnusocial"
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}')
# stop the daemons
cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
@ -335,7 +335,7 @@ function restore_remote_gnusocial {
# start the daemons
cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
scripts/startdaemons.sh
echo $"Restore of GNU Social complete"
echo $"Restore of gnusocial complete"
fi
}
@ -362,7 +362,7 @@ function remove_gnusocial {
function_check remove_onion_service
remove_onion_service microblog ${MICROBLOG_ONION_PORT}
sed -i '/install_gnusocial/d' $COMPLETION_FILE
sed -i '/GNU Social /d' $COMPLETION_FILE
sed -i '/gnusocial /d' $COMPLETION_FILE
if grep -q "gnusocial" /etc/crontab; then
sed -i "/gnusocial/d" /etc/crontab
fi
@ -408,10 +408,10 @@ function install_gnusocial_main {
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
git checkout $MICROBLOG_COMMIT -b $MICROBLOG_COMMIT
if ! grep -q "GNU Social commit" $COMPLETION_FILE; then
echo "GNU Social commit:$MICROBLOG_COMMIT" >> $COMPLETION_FILE
if ! grep -q "gnusocial commit" $COMPLETION_FILE; then
echo "gnusocial commit:$MICROBLOG_COMMIT" >> $COMPLETION_FILE
else
sed -i "s/GNU Social commit.*/GNU Social commit:$MICROBLOG_COMMIT/g" $COMPLETION_FILE
sed -i "s/gnusocial commit.*/gnusocial commit:$MICROBLOG_COMMIT/g" $COMPLETION_FILE
fi
chmod a+w /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
@ -547,7 +547,7 @@ function install_gnusocial_main {
# NOTE: For the typical case always enable SSL and only
# disable it if in onion only mode. This is due to complexities
# with the way URLs are generated by GNU Social
# with the way URLs are generated by gnusocial
gnusocial_ssl='always'
if [[ $ONION_ONLY != 'no' ]]; then
gnusocial_ssl='never'
@ -563,7 +563,7 @@ function install_gnusocial_main {
# Create the configuration
gnusocial_installer=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/scripts/install_cli.php
if [ ! -f $gnusocial_installer ]; then
echo $'No GNU Social commandline installer found'
echo $'No gnusocial commandline installer found'
exit 53026
fi
${gnusocial_installer} --server "${MICROBLOG_SERVER}" \
@ -638,10 +638,10 @@ function install_gnusocial_main {
fi
fi
if ! grep -q "GNU Social domain" $COMPLETION_FILE; then
echo "GNU Social domain:$MICROBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
if ! grep -q "gnusocial domain" $COMPLETION_FILE; then
echo "gnusocial domain:$MICROBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
else
sed -i "s|GNU Social domain.*|GNU Social domain:$MICROBLOG_DOMAIN_NAME|g" $COMPLETION_FILE
sed -i "s|gnusocial domain.*|gnusocial domain:$MICROBLOG_DOMAIN_NAME|g" $COMPLETION_FILE
fi
install_completed gnusocial_main
@ -657,7 +657,7 @@ function install_gnusocial_plugin_sharings {
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "GNU Social sharings plugin commit" "$SHARINGS_COMMIT" $SHARINGS_REPO
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "gnusocial sharings plugin commit" "$SHARINGS_COMMIT" $SHARINGS_REPO
if [[ $(app_is_installed gnusocial_plugin_sharings) == "1" ]]; then
return
@ -693,28 +693,28 @@ function install_gnusocial_plugin_sharings {
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en/LC_MESSAGES
msgfmt -o Sharings.mo Sharings.po
if [ ! -f Sharings.po ]; then
echo $'English translations for GNU Social sharings plugin were not created'
echo $'English translations for gnusocial sharings plugin were not created'
exit 84352
fi
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_GB/LC_MESSAGES
msgfmt -o Sharings.mo Sharings.po
if [ ! -f Sharings.po ]; then
echo $'English (GB) translations for GNU Social sharings plugin were not created'
echo $'English (GB) translations for gnusocial sharings plugin were not created'
exit 84352
fi
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
msgfmt -o Sharings.mo Sharings.po
if [ ! -f Sharings.po ]; then
echo $'English (US) translations for GNU Social sharings plugin were not created'
echo $'English (US) translations for gnusocial sharings plugin were not created'
exit 84352
fi
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
if ! grep -q "GNU Social sharings plugin commit" $COMPLETION_FILE; then
echo "GNU Social sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE
if ! grep -q "gnusocial sharings plugin commit" $COMPLETION_FILE; then
echo "gnusocial sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social sharings plugin commit.*|GNU Social sharings plugin commit:$SHARINGS_COMMIT|g" $COMPLETION_FILE
sed -i "s|gnusocial sharings plugin commit.*|gnusocial sharings plugin commit:$SHARINGS_COMMIT|g" $COMPLETION_FILE
fi
install_completed gnusocial_plugin_sharings
}
@ -727,7 +727,7 @@ function install_gnusocial_plugin_sharings_theme {
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "GNU Social sharings theme plugin commit" "$SHARINGS_THEME_COMMIT" $SHARINGS_THEME_REPO
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "gnusocial sharings theme plugin commit" "$SHARINGS_THEME_COMMIT" $SHARINGS_THEME_REPO
if [[ $(app_is_installed gnusocial_plugin_sharings_theme) == "1" ]]; then
return
@ -757,10 +757,10 @@ function install_gnusocial_plugin_sharings_theme {
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
if ! grep -q "GNU Social sharings plugin theme commit" $COMPLETION_FILE; then
echo "GNU Social sharings plugin theme commit:$SHARINGS_THEME_COMMIT" >> $COMPLETION_FILE
if ! grep -q "gnusocial sharings plugin theme commit" $COMPLETION_FILE; then
echo "gnusocial sharings plugin theme commit:$SHARINGS_THEME_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social sharings plugin theme commit.*|GNU Social sharings plugin theme commit:$SHARINGS_THEME_COMMIT|g" $COMPLETION_FILE
sed -i "s|gnusocial sharings plugin theme commit.*|gnusocial sharings plugin theme commit:$SHARINGS_THEME_COMMIT|g" $COMPLETION_FILE
fi
install_completed gnusocial_plugin_sharings_theme
}
@ -774,7 +774,7 @@ function expire_gnusocial_posts {
echo '<?php' > $gnusocial_expire_script
echo '' >> $gnusocial_expire_script
echo '// GNU Social post expiry script, based on StatExpire by Tony Baldwin' >> $gnusocial_expire_script
echo '// gnusocial post expiry script, based on StatExpire by Tony Baldwin' >> $gnusocial_expire_script
echo '// https://github.com/tonybaldwin/statexpire' >> $gnusocial_expire_script
echo '' >> $gnusocial_expire_script
echo '$oldate=date(("Y-m-d"), strtotime("-3 months"));' >> $gnusocial_expire_script
@ -804,7 +804,7 @@ function expire_gnusocial_posts {
echo '$rowaff3=mysql_affected_rows();' >> $gnusocial_expire_script
echo 'mysql_close();' >> $gnusocial_expire_script
echo '' >> $gnusocial_expire_script
echo 'echo "Expire GNU Social posts: $rowaff1 notices, $rowaff2 conversations, and $rowaff3 replies deleted from database.\n";' >> $gnusocial_expire_script
echo 'echo "Expire gnusocial posts: $rowaff1 notices, $rowaff2 conversations, and $rowaff3 replies deleted from database.\n";' >> $gnusocial_expire_script
chmod +x $gnusocial_expire_script
# Add a cron job
@ -821,7 +821,7 @@ function expire_gnusocial_posts {
function install_gnusocial_theme {
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter "GNU Social theme commit" "$MICROBLOG_THEME_COMMIT" $MICROBLOG_THEME_REPO
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter "gnusocial theme commit" "$MICROBLOG_THEME_COMMIT" $MICROBLOG_THEME_REPO
# customise with project logo
if [ -f /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png ]; then
@ -910,10 +910,10 @@ function install_gnusocial_theme {
fi
fi
if ! grep -q "GNU Social theme commit" $COMPLETION_FILE; then
echo "GNU Social theme commit:$MICROBLOG_THEME_COMMIT" >> $COMPLETION_FILE
if ! grep -q "gnusocial theme commit" $COMPLETION_FILE; then
echo "gnusocial theme commit:$MICROBLOG_THEME_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social theme commit.*|GNU Social theme commit:$MICROBLOG_THEME_COMMIT|g" $COMPLETION_FILE
sed -i "s|gnusocial theme commit.*|gnusocial theme commit:$MICROBLOG_THEME_COMMIT|g" $COMPLETION_FILE
fi
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
@ -926,7 +926,7 @@ function install_gnusocial_markdown {
# update to the next commit
function_check set_repo_commit
set_repo_commit $MICROBLOG_PATH/local/plugins/Markdown "GNU Social Markdown commit" "$MICROBLOG_MARKDOWN_COMMIT" $MICROBLOG_MARKDOWN_REPO
set_repo_commit $MICROBLOG_PATH/local/plugins/Markdown "gnusocial Markdown commit" "$MICROBLOG_MARKDOWN_COMMIT" $MICROBLOG_MARKDOWN_REPO
if [[ $(app_is_installed gnusocial_markdown) == "1" ]]; then
return
@ -953,10 +953,10 @@ function install_gnusocial_markdown {
echo "addPlugin('Markdown');" >> $microblog_config_file
fi
if ! grep -q "GNU Social Markdown commit" $COMPLETION_FILE; then
echo "GNU Social Markdown commit:$MICROBLOG_MARKDOWN_COMMIT" >> $COMPLETION_FILE
if ! grep -q "gnusocial Markdown commit" $COMPLETION_FILE; then
echo "gnusocial Markdown commit:$MICROBLOG_MARKDOWN_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social Markdown commit.*|GNU Social Markdown commit:$MICROBLOG_MARKDOWN_COMMIT|g" $COMPLETION_FILE
sed -i "s|gnusocial Markdown commit.*|gnusocial Markdown commit:$MICROBLOG_MARKDOWN_COMMIT|g" $COMPLETION_FILE
fi
chown -R www-data:www-data $MICROBLOG_PATH
@ -972,7 +972,7 @@ function install_gnusocial_plugin_nsfw {
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "GNU Social NSFW plugin commit" "$GNUSOCIAL_NSFW_COMMIT" $GNUSOCIAL_NSFW_REPO
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "gnusocial NSFW plugin commit" "$GNUSOCIAL_NSFW_COMMIT" $GNUSOCIAL_NSFW_REPO
if grep -Fxq "install_gnusocial_plugin_nsfw" $COMPLETION_FILE; then
return
@ -1002,10 +1002,10 @@ function install_gnusocial_plugin_nsfw {
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
if ! grep -q "GNU Social NSFW plugin commit" $COMPLETION_FILE; then
echo "GNU Social NSFW plugin commit:$GNUSOCIAL_NSFW_COMMIT" >> $COMPLETION_FILE
if ! grep -q "gnusocial NSFW plugin commit" $COMPLETION_FILE; then
echo "gnusocial NSFW plugin commit:$GNUSOCIAL_NSFW_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social NSFW plugin commit.*|GNU Social NSFW plugin commit:$GNUSOCIAL_NSFW_COMMIT|g" $COMPLETION_FILE
sed -i "s|gnusocial NSFW plugin commit.*|gnusocial NSFW plugin commit:$GNUSOCIAL_NSFW_COMMIT|g" $COMPLETION_FILE
fi
install_completed gnusocial_plugin_nsfw
}

View File

@ -550,7 +550,7 @@ function install_rss_gnusocial {
function_check git_clone
git_clone $RSS_READER_GNUSOCIAL_REPO ttrss-gnusocial
if [ ! -d $INSTALL_DIR/ttrss-gnusocial ]; then
echo $'Could not clone repo for RSS reader GNU Social plugin'
echo $'Could not clone repo for RSS reader gnusocial plugin'
exit 52838
fi
cp -r $INSTALL_DIR/ttrss-gnusocial $RSS_READER_GNUSOCIAL_PATH

View File

@ -95,12 +95,12 @@ if grep -q "install_sip" $COMPLETION_FILE; then
${PROJECT_NAME}-rmsipuser $MY_USERNAME
fi
if grep -q "GNU Social domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
if grep -q "gnusocial domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | awk -F ':' '{print $2}')
if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
php scripts/deleteprofile.php -n $MY_USERNAME -y
echo $'Removed GNU Social user'
echo $'Removed gnusocial user'
fi
fi

View File

@ -66,6 +66,8 @@ function upgrade_installation_from_previous_versions {
sed -i 's|install_tox_node|install_tox|g' $COMPLETION_FILE
sed -i 's|intrusion_detection|install_tripwire|g' $COMPLETION_FILE
sed -i 's|GNU Social|gnusocial|g' $COMPLETION_FILE
if [ -f /usr/local/bin/zeronetavahi ]; then
rm /usr/local/bin/zeronetavahi
fi