diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index 5e370bf1..71314f85 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -30,20 +30,20 @@ VARIANTS='full full-vim media' -MICROBLOG_DOMAIN_NAME= -MICROBLOG_CODE= -MICROBLOG_ONION_PORT=8087 -MICROBLOG_REPO="https://git.gnu.io/gnu/gnu-social.git" -MICROBLOG_COMMIT='c67b89e56bf0f90730a9e22beca7e1bd41fc26c3' -MICROBLOG_ADMIN_PASSWORD= -MICROBLOG_THEME_REPO="https://git.gnu.io/h2p/Qvitter.git" -MICROBLOG_THEME_COMMIT='34510bcf37c727f91afad789fb0a531a45171ccf' -MICROBLOG_WELCOME_MESSAGE=$'
Another Freedombone site
' -MICROBLOG_BACKGROUND_IMAGE_URL= -MICROBLOG_MARKDOWN_REPO="https://git.gnu.io/chimo/markdown.git" -MICROBLOG_MARKDOWN_COMMIT='03c53942f94b3376f0946e6e1fe566cc21ccf232' +GNUSOCIAL_DOMAIN_NAME= +GNUSOCIAL_CODE= +GNUSOCIAL_ONION_PORT=8087 +GNUSOCIAL_REPO="https://git.gnu.io/gnu/gnu-social.git" +GNUSOCIAL_COMMIT='c67b89e56bf0f90730a9e22beca7e1bd41fc26c3' +GNUSOCIAL_ADMIN_PASSWORD= +GNUSOCIAL_THEME_REPO="https://git.gnu.io/h2p/Qvitter.git" +GNUSOCIAL_THEME_COMMIT='34510bcf37c727f91afad789fb0a531a45171ccf' +GNUSOCIAL_WELCOME_MESSAGE=$'Another Freedombone site
' +GNUSOCIAL_BACKGROUND_IMAGE_URL= +GNUSOCIAL_MARKDOWN_REPO="https://git.gnu.io/chimo/markdown.git" +GNUSOCIAL_MARKDOWN_COMMIT='03c53942f94b3376f0946e6e1fe566cc21ccf232' -# Sharings plugin for the microblog +# Sharings plugin for gnusocial SHARINGS_REPO="http://git.lasindias.club/bashrc/Sharings" SHARINGS_COMMIT='d5c6c7f855d9afff9086c09ea706f38c859bc0d4' SHARINGS_THEME_REPO="http://git.lasindias.club/manuel/SharingsTheme" @@ -56,15 +56,15 @@ GNUSOCIAL_NSFW_COMMIT='a096bbe0cfae9a9b177682920ffb58d32a48e136' # script which causes old posts to expire gnusocial_expire_script=/usr/bin/gnusocial-expire -gnusocial_variables=(MICROBLOG_COMMIT +gnusocial_variables=(GNUSOCIAL_COMMIT ONION_ONLY - MICROBLOG_DOMAIN_NAME - MICROBLOG_CODE - MICROBLOG_WELCOME_MESSAGE - MICROBLOG_BACKGROUND_IMAGE_URL + GNUSOCIAL_DOMAIN_NAME + GNUSOCIAL_CODE + GNUSOCIAL_WELCOME_MESSAGE + GNUSOCIAL_BACKGROUND_IMAGE_URL DDNS_PROVIDER - MICROBLOG_MARKDOWN_REPO - MICROBLOG_MARKDOWN_COMMIT + GNUSOCIAL_MARKDOWN_REPO + GNUSOCIAL_MARKDOWN_COMMIT SHARINGS_REPO SHARINGS_COMMIT SHARINGS_THEME_REPO @@ -74,9 +74,9 @@ gnusocial_variables=(MICROBLOG_COMMIT function remove_user_gnusocial { remove_username="$1" - MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') - if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + GNUSOCIAL_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') + if [ -d /var/www/$GNUSOCIAL_DOMAIN_NAME ]; then + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs php scripts/deleteprofile.php -n $remove_username -y fi } @@ -85,11 +85,11 @@ function add_user_gnusocial { new_username="$1" new_user_password="$2" - MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') - if [ -d /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs ]; then - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + GNUSOCIAL_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') + if [ -d /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs ]; then + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs php scripts/registeruser.php -n $new_username -w "$new_user_password" -e "$new_username@$HOSTNAME" - ${PROJECT_NAME}-addemail -u $new_username -e "noreply@$MICROBLOG_DOMAIN_NAME" -g gnusocial --public no + ${PROJECT_NAME}-addemail -u $new_username -e "noreply@$GNUSOCIAL_DOMAIN_NAME" -g gnusocial --public no echo '0' else echo '1' @@ -102,29 +102,29 @@ function install_interactive_gnusocial { fi if [[ $ONION_ONLY != "no" ]]; then - MICROBLOG_DOMAIN_NAME='microblog.local' + GNUSOCIAL_DOMAIN_NAME='gnusocial.local' else - MICROBLOG_DETAILS_COMPLETE= - while [ ! $MICROBLOG_DETAILS_COMPLETE ] + GNUSOCIAL_DETAILS_COMPLETE= + while [ ! $GNUSOCIAL_DETAILS_COMPLETE ] do data=$(tempfile 2>/dev/null) trap "rm -f $data" 0 1 2 5 15 if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then dialog --backtitle $"Freedombone Configuration" \ - --title $"Microblog Configuration" \ - --form $"\nPlease enter your Microblog details. Welcome message and background image URL can be left blank.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 16 65 4 \ - $"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 25 33 40 \ - $"Welcome Message:" 2 1 "$(grep '$MICROBLOG_WELCOME_MESSAGE' temp.cfg | awk -F '=' '{print $2}')" 2 25 255 255 \ - $"Background image URL:" 3 1 "$(grep '$MICROBLOG_BACKGROUND_IMAGE_URL' temp.cfg | awk -F '=' '{print $2}')" 3 25 255 255 \ - $"Code:" 4 1 "$(grep 'MICROBLOG_CODE' temp.cfg | awk -F '=' '{print $2}')" 4 25 33 255 \ + --title $"GNU Social Configuration" \ + --form $"\nPlease enter your GNU Social details. Welcome message and background image URL can be left blank.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 16 65 4 \ + $"Domain:" 1 1 "$(grep 'GNUSOCIAL_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 25 33 40 \ + $"Welcome Message:" 2 1 "$(grep '$GNUSOCIAL_WELCOME_MESSAGE' temp.cfg | awk -F '=' '{print $2}')" 2 25 255 255 \ + $"Background image URL:" 3 1 "$(grep '$GNUSOCIAL_BACKGROUND_IMAGE_URL' temp.cfg | awk -F '=' '{print $2}')" 3 25 255 255 \ + $"Code:" 4 1 "$(grep 'GNUSOCIAL_CODE' temp.cfg | awk -F '=' '{print $2}')" 4 25 33 255 \ 2> $data else dialog --backtitle $"Freedombone Configuration" \ - --title $"Microblog Configuration" \ - --form $"\nPlease enter your Microblog details. Welcome message and background image URL can be left blank.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 16 65 4 \ - $"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 25 33 40 \ - $"Welcome Message:" 2 1 "$(grep '$MICROBLOG_WELCOME_MESSAGE' temp.cfg | awk -F '=' '{print $2}')" 2 25 255 255 \ - $"Background image URL:" 3 1 "$(grep '$MICROBLOG_BACKGROUND_IMAGE_URL' temp.cfg | awk -F '=' '{print $2}')" 3 25 255 255 \ + --title $"GNU Social Configuration" \ + --form $"\nPlease enter your GNU Social details. Welcome message and background image URL can be left blank.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 16 65 4 \ + $"Domain:" 1 1 "$(grep 'GNUSOCIAL_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 25 33 40 \ + $"Welcome Message:" 2 1 "$(grep '$GNUSOCIAL_WELCOME_MESSAGE' temp.cfg | awk -F '=' '{print $2}')" 2 25 255 255 \ + $"Background image URL:" 3 1 "$(grep '$GNUSOCIAL_BACKGROUND_IMAGE_URL' temp.cfg | awk -F '=' '{print $2}')" 3 25 255 255 \ 2> $data fi sel=$? @@ -132,44 +132,44 @@ function install_interactive_gnusocial { 1) exit 1;; 255) exit 1;; esac - MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p) + GNUSOCIAL_DOMAIN_NAME=$(cat $data | sed -n 1p) welcome_msg=$(cat $data | sed -n 2p) if [ ${#welcome_msg} -gt 1 ]; then - MICROBLOG_WELCOME_MESSAGE=$welcome_msg + GNUSOCIAL_WELCOME_MESSAGE=$welcome_msg fi img_url=$(cat $data | sed -n 3p) if [ ${#img_url} -gt 1 ]; then - MICROBLOG_BACKGROUND_IMAGE_URL=$img_url + GNUSOCIAL_BACKGROUND_IMAGE_URL=$img_url fi - if [ $MICROBLOG_DOMAIN_NAME ]; then - if [[ $MICROBLOG_DOMAIN_NAME == "$HUBZILLA_DOMAIN_NAME" ]]; then - MICROBLOG_DOMAIN_NAME="" + if [ $GNUSOCIAL_DOMAIN_NAME ]; then + if [[ $GNUSOCIAL_DOMAIN_NAME == "$HUBZILLA_DOMAIN_NAME" ]]; then + GNUSOCIAL_DOMAIN_NAME="" fi - TEST_DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME + TEST_DOMAIN_NAME=$GNUSOCIAL_DOMAIN_NAME validate_domain_name - if [[ $TEST_DOMAIN_NAME != $MICROBLOG_DOMAIN_NAME ]]; then - MICROBLOG_DOMAIN_NAME= + if [[ $TEST_DOMAIN_NAME != $GNUSOCIAL_DOMAIN_NAME ]]; then + GNUSOCIAL_DOMAIN_NAME= dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 else if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then - MICROBLOG_CODE=$(cat $data | sed -n 4p) - validate_freedns_code "$MICROBLOG_CODE" + GNUSOCIAL_CODE=$(cat $data | sed -n 4p) + validate_freedns_code "$GNUSOCIAL_CODE" if [ ! $VALID_CODE ]; then - MICROBLOG_DOMAIN_NAME= + GNUSOCIAL_DOMAIN_NAME= fi fi fi fi - if [ $MICROBLOG_DOMAIN_NAME ]; then - MICROBLOG_DETAILS_COMPLETE="yes" + if [ $GNUSOCIAL_DOMAIN_NAME ]; then + GNUSOCIAL_DETAILS_COMPLETE="yes" fi done # save the results in the config file - write_config_param "MICROBLOG_CODE" "$MICROBLOG_CODE" - write_config_param "MICROBLOG_WELCOME_MESSAGE" "$MICROBLOG_WELCOME_MESSAGE" - write_config_param "MICROBLOG_BACKGROUND_IMAGE_URL" "$MICROBLOG_BACKGROUND_IMAGE_URL" + write_config_param "GNUSOCIAL_CODE" "$GNUSOCIAL_CODE" + write_config_param "GNUSOCIAL_WELCOME_MESSAGE" "$GNUSOCIAL_WELCOME_MESSAGE" + write_config_param "GNUSOCIAL_BACKGROUND_IMAGE_URL" "$GNUSOCIAL_BACKGROUND_IMAGE_URL" fi - write_config_param "MICROBLOG_DOMAIN_NAME" "$MICROBLOG_DOMAIN_NAME" + write_config_param "GNUSOCIAL_DOMAIN_NAME" "$GNUSOCIAL_DOMAIN_NAME" APP_INSTALLED=1 } @@ -180,10 +180,10 @@ function change_password_gnusocial { function get_mariadb_gnusocial_admin_password { if [ -f /home/$MY_USERNAME/README ]; then if grep -q "MariaDB gnusocial admin password" /home/$MY_USERNAME/README; then - MICROBLOG_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB gnusocial admin password" | awk -F ':' '{print $2}' | sed 's/^ *//') + GNUSOCIAL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB gnusocial admin password" | awk -F ':' '{print $2}' | sed 's/^ *//') fi - if grep -q "Microblog administrator password" /home/$MY_USERNAME/README; then - MICROBLOG_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Microblog administrator password" | awk -F ':' '{print $2}' | sed 's/^ *//') + if grep -q "gnusocial administrator password" /home/$MY_USERNAME/README; then + GNUSOCIAL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "gnusocial administrator password" | awk -F ':' '{print $2}' | sed 's/^ *//') fi fi } @@ -191,19 +191,19 @@ function get_mariadb_gnusocial_admin_password { function gnusocial_create_database { function_check get_mariadb_gnusocial_admin_password get_mariadb_gnusocial_admin_password - if [ ! $MICROBLOG_ADMIN_PASSWORD ]; then + if [ ! $GNUSOCIAL_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - MICROBLOG_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" + GNUSOCIAL_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else - MICROBLOG_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" + GNUSOCIAL_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" fi fi - if [ ! $MICROBLOG_ADMIN_PASSWORD ]; then + if [ ! $GNUSOCIAL_ADMIN_PASSWORD ]; then return fi function_check create_database - create_database gnusocial "$MICROBLOG_ADMIN_PASSWORD" $MY_USERNAME + create_database gnusocial "$GNUSOCIAL_ADMIN_PASSWORD" $MY_USERNAME } function gnusocial_running_script { @@ -219,7 +219,7 @@ function gnusocial_running_script { echo " ADMIN_USER=\$(cat $COMPLETION_FILE | grep 'Admin user' | awk -F ':' '{print \$2}')" >> /etc/cron.hourly/gnusocial-daemons echo ' MY_EMAIL_ADDRESS=$ADMIN_USER@$HOSTNAME' >> /etc/cron.hourly/gnusocial-daemons echo ' echo "Restarting GNU Social daemons" | mail -s "GNU Social daemons not found" $MY_EMAIL_ADDRESS' >> /etc/cron.hourly/gnusocial-daemons - echo " cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs" >> /etc/cron.hourly/gnusocial-daemons + echo " cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs" >> /etc/cron.hourly/gnusocial-daemons echo ' scripts/startdaemons.sh' >> /etc/cron.hourly/gnusocial-daemons echo 'fi' >> /etc/cron.hourly/gnusocial-daemons chmod +x /etc/cron.hourly/gnusocial-daemons @@ -231,12 +231,12 @@ function reconfigure_gnusocial { function upgrade_gnusocial { if grep -q "gnusocial domain" $COMPLETION_FILE; then - MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') + GNUSOCIAL_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 "gnusocial commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO + set_repo_commit /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs "gnusocial commit" "$GNUSOCIAL_COMMIT" $GNUSOCIAL_REPO function_check gnusocial_running_script gnusocial_running_script @@ -244,18 +244,18 @@ function upgrade_gnusocial { function backup_local_gnusocial { - MICROBLOG_DOMAIN_NAME='microblog' + GNUSOCIAL_DOMAIN_NAME='gnusocial' if grep -q "gnusocial domain" $COMPLETION_FILE; then - MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') + GNUSOCIAL_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') fi - source_directory=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs + source_directory=/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs if [ -d $source_directory ]; then dest_directory=gnusocial echo $"Backing up $source_directory to $dest_directory" function_check suspend_site - suspend_site ${MICROBLOG_DOMAIN_NAME} + suspend_site ${GNUSOCIAL_DOMAIN_NAME} function_check backup_directory_to_usb backup_directory_to_usb $source_directory $dest_directory @@ -274,11 +274,11 @@ function restore_local_gnusocial { if ! grep -q "gnusocial domain" $COMPLETION_FILE; then return fi - MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') - if [ $MICROBLOG_DOMAIN_NAME ]; then + GNUSOCIAL_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') + if [ $GNUSOCIAL_DOMAIN_NAME ]; then echo $"Restoring gnusocial" temp_restore_dir=/root/tempgnusocial - gnusocial_dir=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs + gnusocial_dir=/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs # stop the daemons cd $gnusocial_dir scripts/stopdaemons.sh @@ -286,7 +286,7 @@ function restore_local_gnusocial { function_check gnusocial_create_database gnusocial_create_database - restore_database gnusocial ${MICROBLOG_DOMAIN_NAME} + restore_database gnusocial ${GNUSOCIAL_DOMAIN_NAME} if [ -d $temp_restore_dir ]; then rm -rf $temp_restore_dir fi @@ -300,11 +300,11 @@ function restore_local_gnusocial { function backup_remote_gnusocial { 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 + GNUSOCIAL_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "gnusocial domain" | head -n 1 | awk -F ':' '{print $2}') + temp_backup_dir=/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs if [ -d $temp_backup_dir ]; then function_check suspend_site - suspend_site ${MICROBLOG_DOMAIN_NAME} + suspend_site ${GNUSOCIAL_DOMAIN_NAME} function_check backup_database_to_friend backup_database_to_friend gnusocial @@ -325,46 +325,46 @@ function backup_remote_gnusocial { function restore_remote_gnusocial { 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}') + GNUSOCIAL_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 + cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs scripts/stopdaemons.sh function_check gnusocial_create_database gnusocial_create_database function_check restore_database_from_friend - restore_database_from_friend gnusocial ${MICROBLOG_DOMAIN_NAME} + restore_database_from_friend gnusocial ${GNUSOCIAL_DOMAIN_NAME} if [ -d /root/tempgnusocial ]; then rm -rf /root/tempgnusocial fi # start the daemons - cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs + cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs scripts/startdaemons.sh echo $"Restore of gnusocial complete" fi } function remove_gnusocial { - if [ ${#MICROBLOG_DOMAIN_NAME} -eq 0 ]; then + if [ ${#GNUSOCIAL_DOMAIN_NAME} -eq 0 ]; then return fi - read_config_param "MICROBLOG_DOMAIN_NAME" + read_config_param "GNUSOCIAL_DOMAIN_NAME" read_config_param "MY_USERNAME" - echo "Removing $MICROBLOG_DOMAIN_NAME" - nginx_dissite $MICROBLOG_DOMAIN_NAME - if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then - rm -rf /var/www/$MICROBLOG_DOMAIN_NAME + echo "Removing $GNUSOCIAL_DOMAIN_NAME" + nginx_dissite $GNUSOCIAL_DOMAIN_NAME + if [ -d /var/www/$GNUSOCIAL_DOMAIN_NAME ]; then + rm -rf /var/www/$GNUSOCIAL_DOMAIN_NAME fi - if [ -f /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME ]; then - rm /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME + if [ -f /etc/nginx/sites-available/$GNUSOCIAL_DOMAIN_NAME ]; then + rm /etc/nginx/sites-available/$GNUSOCIAL_DOMAIN_NAME fi function_check drop_database drop_database gnusocial function_check remove_onion_service - remove_onion_service gnusocial ${MICROBLOG_ONION_PORT} + remove_onion_service gnusocial ${GNUSOCIAL_ONION_PORT} sed -i '/install_gnusocial/d' $COMPLETION_FILE sed -i '/gnusocial /d' $COMPLETION_FILE if grep -q "gnusocial" /etc/crontab; then @@ -374,8 +374,8 @@ function remove_gnusocial { } function install_gnusocial_main { - if [ ! $MICROBLOG_DOMAIN_NAME ]; then - echo $'No domain name was given for the microblog' + if [ ! $GNUSOCIAL_DOMAIN_NAME ]; then + echo $'No domain name was given for gnusocial' exit 7359 fi @@ -398,29 +398,29 @@ function install_gnusocial_main { apt-get -y install php-gettext php5-curl php5-gd php5-mysql git curl php-xml-parser apt-get -y install php5-memcached php5-intl - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then - mkdir /var/www/$MICROBLOG_DOMAIN_NAME + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME ]; then + mkdir /var/www/$GNUSOCIAL_DOMAIN_NAME fi - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs ]; then + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs ]; then function_check git_clone - git_clone $MICROBLOG_REPO /var/www/$MICROBLOG_DOMAIN_NAME/htdocs - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs ]; then + git_clone $GNUSOCIAL_REPO /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs ]; then echo $'Unable to clone gnusocial repo' exit 87525 fi fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs - git checkout $MICROBLOG_COMMIT -b $MICROBLOG_COMMIT + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs + git checkout $GNUSOCIAL_COMMIT -b $GNUSOCIAL_COMMIT if ! grep -q "gnusocial commit" $COMPLETION_FILE; then - echo "gnusocial commit:$MICROBLOG_COMMIT" >> $COMPLETION_FILE + echo "gnusocial commit:$GNUSOCIAL_COMMIT" >> $COMPLETION_FILE else - sed -i "s/gnusocial commit.*/gnusocial commit:$MICROBLOG_COMMIT/g" $COMPLETION_FILE + sed -i "s/gnusocial commit.*/gnusocial commit:$GNUSOCIAL_COMMIT/g" $COMPLETION_FILE fi - chmod a+w /var/www/$MICROBLOG_DOMAIN_NAME/htdocs - chown www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs - chmod +x /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/scripts/maildaemon.php + chmod a+w /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs + chown www-data:www-data /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs + chmod +x /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/maildaemon.php function_check gnusocial_create_database gnusocial_create_database @@ -431,112 +431,112 @@ function install_gnusocial_main { if ! grep -q "www-data: root" /etc/aliases; then echo 'www-data: root' >> /etc/aliases fi - if ! grep -q "/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/scripts/maildaemon.php" /etc/aliases; then - echo "*: /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/scripts/maildaemon.php" >> /etc/aliases + if ! grep -q "/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/maildaemon.php" /etc/aliases; then + echo "*: /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/maildaemon.php" >> /etc/aliases fi function_check add_ddns_domain - add_ddns_domain $MICROBLOG_DOMAIN_NAME + add_ddns_domain $GNUSOCIAL_DOMAIN_NAME - microblog_nginx_site=/etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME + gnusocial_nginx_site=/etc/nginx/sites-available/$GNUSOCIAL_DOMAIN_NAME if [[ $ONION_ONLY == "no" ]]; then function_check nginx_http_redirect - nginx_http_redirect $MICROBLOG_DOMAIN_NAME - echo 'server {' >> $microblog_nginx_site - echo ' listen 443 ssl;' >> $microblog_nginx_site - echo " server_name $MICROBLOG_DOMAIN_NAME;" >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Security' >> $microblog_nginx_site + nginx_http_redirect $GNUSOCIAL_DOMAIN_NAME + echo 'server {' >> $gnusocial_nginx_site + echo ' listen 443 ssl;' >> $gnusocial_nginx_site + echo " server_name $GNUSOCIAL_DOMAIN_NAME;" >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Security' >> $gnusocial_nginx_site function_check nginx_ssl - nginx_ssl $MICROBLOG_DOMAIN_NAME + nginx_ssl $GNUSOCIAL_DOMAIN_NAME function_check nginx_disable_sniffing - nginx_disable_sniffing $MICROBLOG_DOMAIN_NAME + nginx_disable_sniffing $GNUSOCIAL_DOMAIN_NAME - echo ' add_header Strict-Transport-Security max-age=15768000;' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Logs' >> $microblog_nginx_site - echo ' access_log off;' >> $microblog_nginx_site - echo ' error_log off;' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Root' >> $microblog_nginx_site - echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Index' >> $microblog_nginx_site - echo ' index index.php;' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # PHP' >> $microblog_nginx_site - echo ' location ~ \.php {' >> $microblog_nginx_site - echo ' include snippets/fastcgi-php.conf;' >> $microblog_nginx_site - echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Location' >> $microblog_nginx_site - echo ' location / {' >> $microblog_nginx_site + echo ' add_header Strict-Transport-Security max-age=15768000;' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Logs' >> $gnusocial_nginx_site + echo ' access_log off;' >> $gnusocial_nginx_site + echo ' error_log off;' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Root' >> $gnusocial_nginx_site + echo " root /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs;" >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Index' >> $gnusocial_nginx_site + echo ' index index.php;' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # PHP' >> $gnusocial_nginx_site + echo ' location ~ \.php {' >> $gnusocial_nginx_site + echo ' include snippets/fastcgi-php.conf;' >> $gnusocial_nginx_site + echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Location' >> $gnusocial_nginx_site + echo ' location / {' >> $gnusocial_nginx_site function_check nginx_limits - nginx_limits $MICROBLOG_DOMAIN_NAME '15m' - echo ' try_files $uri $uri/ @gnusocial;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Fancy URLs' >> $microblog_nginx_site - echo ' location @gnusocial {' >> $microblog_nginx_site - echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Restrict access that is unnecessary anyway' >> $microblog_nginx_site - echo ' location ~ /\.(ht|git) {' >> $microblog_nginx_site - echo ' deny all;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '}' >> $microblog_nginx_site + nginx_limits $GNUSOCIAL_DOMAIN_NAME '15m' + echo ' try_files $uri $uri/ @gnusocial;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Fancy URLs' >> $gnusocial_nginx_site + echo ' location @gnusocial {' >> $gnusocial_nginx_site + echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Restrict access that is unnecessary anyway' >> $gnusocial_nginx_site + echo ' location ~ /\.(ht|git) {' >> $gnusocial_nginx_site + echo ' deny all;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '}' >> $gnusocial_nginx_site else - echo -n '' > $microblog_nginx_site + echo -n '' > $gnusocial_nginx_site fi - echo 'server {' >> $microblog_nginx_site - echo " listen 127.0.0.1:$MICROBLOG_ONION_PORT default_server;" >> $microblog_nginx_site - echo " server_name $MICROBLOG_DOMAIN_NAME;" >> $microblog_nginx_site - echo '' >> $microblog_nginx_site + echo 'server {' >> $gnusocial_nginx_site + echo " listen 127.0.0.1:$GNUSOCIAL_ONION_PORT default_server;" >> $gnusocial_nginx_site + echo " server_name $GNUSOCIAL_DOMAIN_NAME;" >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site function_check nginx_disable_sniffing - nginx_disable_sniffing $MICROBLOG_DOMAIN_NAME - echo '' >> $microblog_nginx_site - echo ' # Logs' >> $microblog_nginx_site - echo ' access_log off;' >> $microblog_nginx_site - echo ' error_log off;' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Root' >> $microblog_nginx_site - echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Index' >> $microblog_nginx_site - echo ' index index.php;' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # PHP' >> $microblog_nginx_site - echo ' location ~ \.php {' >> $microblog_nginx_site - echo ' include snippets/fastcgi-php.conf;' >> $microblog_nginx_site - echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Location' >> $microblog_nginx_site - echo ' location / {' >> $microblog_nginx_site + nginx_disable_sniffing $GNUSOCIAL_DOMAIN_NAME + echo '' >> $gnusocial_nginx_site + echo ' # Logs' >> $gnusocial_nginx_site + echo ' access_log off;' >> $gnusocial_nginx_site + echo ' error_log off;' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Root' >> $gnusocial_nginx_site + echo " root /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs;" >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Index' >> $gnusocial_nginx_site + echo ' index index.php;' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # PHP' >> $gnusocial_nginx_site + echo ' location ~ \.php {' >> $gnusocial_nginx_site + echo ' include snippets/fastcgi-php.conf;' >> $gnusocial_nginx_site + echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Location' >> $gnusocial_nginx_site + echo ' location / {' >> $gnusocial_nginx_site function_check nginx_limits - nginx_limits $MICROBLOG_DOMAIN_NAME '15m' - echo ' try_files $uri $uri/ @gnusocial;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Fancy URLs' >> $microblog_nginx_site - echo ' location @gnusocial {' >> $microblog_nginx_site - echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '' >> $microblog_nginx_site - echo ' # Restrict access that is unnecessary anyway' >> $microblog_nginx_site - echo ' location ~ /\.(ht|git) {' >> $microblog_nginx_site - echo ' deny all;' >> $microblog_nginx_site - echo ' }' >> $microblog_nginx_site - echo '}' >> $microblog_nginx_site + nginx_limits $GNUSOCIAL_DOMAIN_NAME '15m' + echo ' try_files $uri $uri/ @gnusocial;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Fancy URLs' >> $gnusocial_nginx_site + echo ' location @gnusocial {' >> $gnusocial_nginx_site + echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '' >> $gnusocial_nginx_site + echo ' # Restrict access that is unnecessary anyway' >> $gnusocial_nginx_site + echo ' location ~ /\.(ht|git) {' >> $gnusocial_nginx_site + echo ' deny all;' >> $gnusocial_nginx_site + echo ' }' >> $gnusocial_nginx_site + echo '}' >> $gnusocial_nginx_site function_check configure_php configure_php function_check create_site_certificate - create_site_certificate $MICROBLOG_DOMAIN_NAME 'yes' + create_site_certificate $GNUSOCIAL_DOMAIN_NAME 'yes' # Ensure that the database gets backed up locally, if remote # backups are not being used @@ -547,7 +547,7 @@ function install_gnusocial_main { backup_database_local gnusocial function_check nginx_ensite - nginx_ensite $MICROBLOG_DOMAIN_NAME + nginx_ensite $GNUSOCIAL_DOMAIN_NAME # NOTE: For the typical case always enable SSL and only # disable it if in onion only mode. This is due to complexities @@ -557,26 +557,26 @@ function install_gnusocial_main { gnusocial_ssl='never' fi - MICROBLOG_ONION_HOSTNAME=$(add_onion_service gnusocial 80 ${MICROBLOG_ONION_PORT}) + GNUSOCIAL_ONION_HOSTNAME=$(add_onion_service gnusocial 80 ${GNUSOCIAL_ONION_PORT}) - MICROBLOG_SERVER=${MICROBLOG_DOMAIN_NAME} + GNUSOCIAL_SERVER=${GNUSOCIAL_DOMAIN_NAME} if [[ $ONION_ONLY != 'no' ]]; then - MICROBLOG_SERVER=${MICROBLOG_ONION_HOSTNAME} + GNUSOCIAL_SERVER=${GNUSOCIAL_ONION_HOSTNAME} fi # Create the configuration - gnusocial_installer=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/scripts/install_cli.php + gnusocial_installer=/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/scripts/install_cli.php if [ ! -f $gnusocial_installer ]; then echo $'No gnusocial commandline installer found' exit 53026 fi - ${gnusocial_installer} --server "${MICROBLOG_SERVER}" \ + ${gnusocial_installer} --server "${GNUSOCIAL_SERVER}" \ --host="localhost" --database="gnusocial" \ --dbtype=mysql --username="root" -v \ --password="$MARIADB_PASSWORD" \ --sitename=$"GNU Social" --fancy='yes' \ --admin-nick="$MY_USERNAME" \ - --admin-pass="$MICROBLOG_ADMIN_PASSWORD" \ + --admin-pass="$GNUSOCIAL_ADMIN_PASSWORD" \ --site-profile="community" \ --ssl=${gnusocial_ssl} # There can be a lot of warnings here so the return value check is disabled @@ -586,74 +586,74 @@ function install_gnusocial_main { # exit 72357 #fi - # check microblog has a config file - microblog_config_file=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php - if [ ! -f $microblog_config_file ]; then - echo $'Microblog config.php not found' + # check gnusocial has a config file + gnusocial_config_file=/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php + if [ ! -f $gnusocial_config_file ]; then + echo $'Gnusocial config.php not found' exit 87586 fi # Some useful settings - if ! grep -q "Recommended GNU social settings" $microblog_config_file; then - 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 - echo "\$config['queue']['enabled'] = true;" >> $microblog_config_file - echo "\$config['queue']['daemon'] = true;" >> $microblog_config_file - echo "\$config['ostatus']['hub_retries'] = 3;" >> $microblog_config_file + if ! grep -q "Recommended GNU social settings" $gnusocial_config_file; then + echo "" >> $gnusocial_config_file + echo "// Recommended GNU social settings" >> $gnusocial_config_file + echo "\$config['thumbnail']['maxsize'] = 3000;" >> $gnusocial_config_file + echo "\$config['profile']['delete'] = true;" >> $gnusocial_config_file + echo "\$config['profile']['changenick'] = true;" >> $gnusocial_config_file + echo "\$config['public']['localonly'] = false;" >> $gnusocial_config_file + echo "addPlugin('StoreRemoteMedia');" >> $gnusocial_config_file + echo "\$config['queue']['enabled'] = true;" >> $gnusocial_config_file + echo "\$config['queue']['daemon'] = true;" >> $gnusocial_config_file + echo "\$config['ostatus']['hub_retries'] = 3;" >> $gnusocial_config_file fi # This improves performance - sed -i "s|//\$config\['db'\]\['schemacheck'\].*|\$config\['db'\]\['schemacheck'\] = 'script';|g" $microblog_config_file + sed -i "s|//\$config\['db'\]\['schemacheck'\].*|\$config\['db'\]\['schemacheck'\] = 'script';|g" $gnusocial_config_file systemctl restart php5-fpm systemctl restart nginx - ${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$MICROBLOG_DOMAIN_NAME" -g gnusocial --public no + ${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$GNUSOCIAL_DOMAIN_NAME" -g gnusocial --public no # some post-install instructions for the user - if ! grep -q $"Microblog administrator" /home/$MY_USERNAME/README; then + if ! grep -q $"Gnusocial administrator" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README - echo $'Microblog' >> /home/$MY_USERNAME/README + echo $'Gnusocial' >> /home/$MY_USERNAME/README echo '=========' >> /home/$MY_USERNAME/README - echo $"Microblog administrator nickname: $MY_USERNAME" >> /home/$MY_USERNAME/README - echo $"Microblog administrator password: $MICROBLOG_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README + echo $"Gnusocial administrator nickname: $MY_USERNAME" >> /home/$MY_USERNAME/README + echo $"Gnusocial administrator password: $GNUSOCIAL_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README chmod 600 /home/$MY_USERNAME/README else if [ -f /home/$MY_USERNAME/README ]; then - sed -i "s|Microblog administrator password.*|Microblog administrator password: $MICROBLOG_ADMIN_PASSWORD|g" /home/$MY_USERNAME/README + sed -i "s|Gnusocial administrator password.*|Gnusocial administrator password: $GNUSOCIAL_ADMIN_PASSWORD|g" /home/$MY_USERNAME/README fi fi - if ! grep -q "Microblog onion domain" /home/$MY_USERNAME/README; then - echo $"Microblog onion domain: ${MICROBLOG_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README + if ! grep -q "Gnusocial onion domain" /home/$MY_USERNAME/README; then + echo $"Gnusocial onion domain: ${GNUSOCIAL_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README chmod 600 /home/$MY_USERNAME/README else if [ -f /home/$MY_USERNAME/README ]; then - sed -i "s|Microblog onion domain.*|Microblog onion domain: ${MICROBLOG_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README + sed -i "s|Gnusocial onion domain.*|Gnusocial onion domain: ${GNUSOCIAL_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README fi fi if ! grep -q "gnusocial domain" $COMPLETION_FILE; then - echo "gnusocial domain:$MICROBLOG_DOMAIN_NAME" >> $COMPLETION_FILE + echo "gnusocial domain:$GNUSOCIAL_DOMAIN_NAME" >> $COMPLETION_FILE else - sed -i "s|gnusocial domain.*|gnusocial domain:$MICROBLOG_DOMAIN_NAME|g" $COMPLETION_FILE + sed -i "s|gnusocial domain.*|gnusocial domain:$GNUSOCIAL_DOMAIN_NAME|g" $COMPLETION_FILE fi install_completed gnusocial_main } function install_gnusocial_plugin_sharings { - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins ]; then - echo $'No local/plugins directory found for the microblog' + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins ]; then + echo $'No local/plugins directory found for the gnusocial' exit 72945 fi @@ -661,59 +661,59 @@ 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 "gnusocial sharings plugin commit" "$SHARINGS_COMMIT" $SHARINGS_REPO + set_repo_commit /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins "gnusocial sharings plugin commit" "$SHARINGS_COMMIT" $SHARINGS_REPO if [[ $(app_is_installed gnusocial_plugin_sharings) == "1" ]]; then return fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins function_check git_clone git_clone $SHARINGS_REPO Sharings - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings ]; then - echo $'Unable to clone microblog sharings plugin' + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Sharings ]; then + echo $'Unable to clone gnusocial sharings plugin' exit 36738 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Sharings git stash git checkout master git branch -D $SHARINGS_COMMIT git checkout $SHARINGS_COMMIT -b $SHARINGS_COMMIT # enable the plugin - if ! grep -q "addPlugin('Sharings');" /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php; then - echo "addPlugin('Sharings');" >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php + if ! grep -q "addPlugin('Sharings');" /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php; then + echo "addPlugin('Sharings');" >> /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs php scripts/checkschema.php - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Sharings php scripts/seedsharings.php - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs php scripts/checkschema.php # Languages - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en/LC_MESSAGES + cd /var/www/$GNUSOCIAL_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 gnusocial sharings plugin were not created' exit 84352 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_GB/LC_MESSAGES + cd /var/www/$GNUSOCIAL_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 gnusocial sharings plugin were not created' exit 84352 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES + cd /var/www/$GNUSOCIAL_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 gnusocial sharings plugin were not created' exit 84352 fi - chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + chown -R www-data:www-data /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs if ! grep -q "gnusocial sharings plugin commit" $COMPLETION_FILE; then echo "gnusocial sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE @@ -724,42 +724,42 @@ function install_gnusocial_plugin_sharings { } function install_gnusocial_plugin_sharings_theme { - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins ]; then - echo $'No local/plugins directory found for the microblog' + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins ]; then + echo $'No local/plugins directory found for the gnusocial' exit 74458 fi # update to the next commit function_check set_repo_commit - set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "gnusocial sharings theme plugin commit" "$SHARINGS_THEME_COMMIT" $SHARINGS_THEME_REPO + set_repo_commit /var/www/$GNUSOCIAL_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 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins function_check git_clone git_clone $SHARINGS_THEME_REPO SharingsTheme - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/SharingsTheme ]; then - echo $'Unable to clone microblog sharings plugin theme' + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/SharingsTheme ]; then + echo $'Unable to clone gnusocial sharings plugin theme' exit 639253 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/SharingsTheme + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/SharingsTheme git stash git checkout master git branch -D $SHARINGS_THEME_COMMIT git checkout $SHARINGS_THEME_COMMIT -b $SHARINGS_THEME_COMMIT # enable the plugin - if ! grep -q "addPlugin('SharingsTheme');" /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php; then - echo "addPlugin('SharingsTheme');" >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php + if ! grep -q "addPlugin('SharingsTheme');" /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php; then + echo "addPlugin('SharingsTheme');" >> /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs php scripts/checkschema.php - chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + chown -R www-data:www-data /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs if ! grep -q "gnusocial sharings plugin theme commit" $COMPLETION_FILE; then echo "gnusocial sharings plugin theme commit:$SHARINGS_THEME_COMMIT" >> $COMPLETION_FILE @@ -772,7 +772,7 @@ function install_gnusocial_plugin_sharings_theme { function expire_gnusocial_posts { # To prevent the database size from growing endlessly this script expires posts # after a number of months - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs ]; then + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs ]; then return fi @@ -817,20 +817,20 @@ function expire_gnusocial_posts { fi # remove old expire script - if [ -f /etc/cron.weekly/clear-microblog-database ]; then - rm /etc/cron.weekly/clear-microblog-database + if [ -f /etc/cron.weekly/clear-gnusocial-database ]; then + rm /etc/cron.weekly/clear-gnusocial-database fi } 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 "gnusocial theme commit" "$MICROBLOG_THEME_COMMIT" $MICROBLOG_THEME_REPO + set_repo_commit /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Qvitter "gnusocial theme commit" "$GNUSOCIAL_THEME_COMMIT" $GNUSOCIAL_THEME_REPO # customise with project logo - if [ -f /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png ]; then + if [ -f /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png ]; then if [ -f ~/freedombone/img/gnusocial_sprite.png ]; then - cp ~/freedombone/img/gnusocial_sprite.png /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png + cp ~/freedombone/img/gnusocial_sprite.png /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png fi fi @@ -840,171 +840,171 @@ function install_gnusocial_theme { apt-get -y install wget - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins ]; then - mkdir -p /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins ]; then + mkdir -p /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins function_check git_clone - git_clone $MICROBLOG_THEME_REPO Qvitter - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter - git checkout $MICROBLOG_THEME_COMMIT -b $MICROBLOG_THEME_COMMIT + git_clone $GNUSOCIAL_THEME_REPO Qvitter + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Qvitter + git checkout $GNUSOCIAL_THEME_COMMIT -b $GNUSOCIAL_THEME_COMMIT # download a custom background image - MICROBLOG_BACKGROUND_IMAGE_URL_EXT= - if [ $MICROBLOG_BACKGROUND_IMAGE_URL ]; then - if [[ $$MICROBLOG_BACKGROUND_IMAGE_URL == *".jpeg" || $$MICROBLOG_BACKGROUND_IMAGE_URL == *".jpg" ]]; then - MICROBLOG_BACKGROUND_IMAGE_URL_EXT="jpg" + GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT= + if [ $GNUSOCIAL_BACKGROUND_IMAGE_URL ]; then + if [[ $$GNUSOCIAL_BACKGROUND_IMAGE_URL == *".jpeg" || $$GNUSOCIAL_BACKGROUND_IMAGE_URL == *".jpg" ]]; then + GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT="jpg" fi - if [[ $$MICROBLOG_BACKGROUND_IMAGE_URL == *".png" ]]; then - MICROBLOG_BACKGROUND_IMAGE_URL_EXT="png" + if [[ $$GNUSOCIAL_BACKGROUND_IMAGE_URL == *".png" ]]; then + GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT="png" fi - if [[ $$MICROBLOG_BACKGROUND_IMAGE_URL == *".gif" ]]; then - MICROBLOG_BACKGROUND_IMAGE_URL_EXT="gif" + if [[ $$GNUSOCIAL_BACKGROUND_IMAGE_URL == *".gif" ]]; then + GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT="gif" fi - if [ $MICROBLOG_BACKGROUND_IMAGE_URL_EXT ]; then - wget $MICROBLOG_BACKGROUND_IMAGE_URL -O img/custom.${MICROBLOG_BACKGROUND_IMAGE_URL_EXT} - if [ ! -f img/custom.${MICROBLOG_BACKGROUND_IMAGE_URL_EXT} ]; then - echo "$MICROBLOG_BACKGROUND_IMAGE_URL" - echo $'Custom background image for microblog could not be downloaded' + if [ $GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT ]; then + wget $GNUSOCIAL_BACKGROUND_IMAGE_URL -O img/custom.${GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT} + if [ ! -f img/custom.${GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT} ]; then + echo "$GNUSOCIAL_BACKGROUND_IMAGE_URL" + echo $'Custom background image for gnusocial could not be downloaded' exit 87524 fi fi fi - microblog_config_file=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php - if ! grep -q "addPlugin('Qvitter')" $microblog_config_file; then - MICROBLOG_WELCOME_MESSAGE=$(echo $MICROBLOG_WELCOME_MESSAGE | sed "s|\$MICROBLOG_DOMAIN_NAME|$MICROBLOG_DOMAIN_NAME|g") - 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'] = 30000; // 30 secs" >> $microblog_config_file + gnusocial_config_file=/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php + if ! grep -q "addPlugin('Qvitter')" $gnusocial_config_file; then + GNUSOCIAL_WELCOME_MESSAGE=$(echo $GNUSOCIAL_WELCOME_MESSAGE | sed "s|\$GNUSOCIAL_DOMAIN_NAME|$GNUSOCIAL_DOMAIN_NAME|g") + echo "" >> $gnusocial_config_file + echo "// Qvitter settings" >> $gnusocial_config_file + echo "addPlugin('Qvitter');" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['enabledbydefault'] = true;" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['defaultbackgroundcolor'] = '#f4f4f4';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['defaultlinkcolor'] = '#0084B4';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['timebetweenpolling'] = 30000; // 30 secs" >> $gnusocial_config_file if [[ $ONION_ONLY != 'no' ]]; then - 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']['urlshortenerapiurl'] = 'http://qttr.at/shortener.php';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['urlshortenersignature'] = 'b6afeec983';" >> $gnusocial_config_file fi - if [ $MICROBLOG_BACKGROUND_IMAGE_URL ]; then - echo "\$config['site']['qvitter']['sitebackground'] = 'img/custom.${MICROBLOG_BACKGROUND_IMAGE_URL_EXT}';" >> $microblog_config_file + if [ $GNUSOCIAL_BACKGROUND_IMAGE_URL ]; then + echo "\$config['site']['qvitter']['sitebackground'] = 'img/custom.${GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT}';" >> $gnusocial_config_file else - echo "\$config['site']['qvitter']['sitebackground'] = 'img/vagnsmossen.jpg';" >> $microblog_config_file + echo "\$config['site']['qvitter']['sitebackground'] = 'img/vagnsmossen.jpg';" >> $gnusocial_config_file fi - 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 + echo "\$config['site']['qvitter']['favicon'] = 'img/favicon.ico?v=4';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['sprite'] = Plugin::staticPath('Qvitter', '').'img/sprite.png?v=40';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['enablewelcometext'] = true;" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['customwelcometext']['en'] = '$GNUSOCIAL_WELCOME_MESSAGE';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['customwelcometext']['de'] = '$GNUSOCIAL_WELCOME_MESSAGE';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['customwelcometext']['fr'] = '$GNUSOCIAL_WELCOME_MESSAGE';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['customwelcometext']['es'] = '$GNUSOCIAL_WELCOME_MESSAGE';" >> $gnusocial_config_file + echo "\$config['site']['qvitter']['blocked_ips'] = array();" >> $gnusocial_config_file else - if [ $MICROBLOG_BACKGROUND_IMAGE_URL_EXT ]; then - if [ -f img/custom.${MICROBLOG_BACKGROUND_IMAGE_URL_EXT} ]; then - sed -i "s|\$config['site']['qvitter']['sitebackground'].*|\$config['site']['qvitter']['sitebackground'] = 'img/custom.${MICROBLOG_BACKGROUND_IMAGE_URL_EXT}';|g" $microblog_config_file + if [ $GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT ]; then + if [ -f img/custom.${GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT} ]; then + sed -i "s|\$config['site']['qvitter']['sitebackground'].*|\$config['site']['qvitter']['sitebackground'] = 'img/custom.${GNUSOCIAL_BACKGROUND_IMAGE_URL_EXT}';|g" $gnusocial_config_file fi fi fi # customise with project logo - if [ -f /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png ]; then + if [ -f /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png ]; then if [ -f ~/freedombone/img/gnusocial_sprite.png ]; then - cp ~/freedombone/img/gnusocial_sprite.png /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png + cp ~/freedombone/img/gnusocial_sprite.png /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/Qvitter/img/sprite.png fi fi if ! grep -q "gnusocial theme commit" $COMPLETION_FILE; then - echo "gnusocial theme commit:$MICROBLOG_THEME_COMMIT" >> $COMPLETION_FILE + echo "gnusocial theme commit:$GNUSOCIAL_THEME_COMMIT" >> $COMPLETION_FILE else - sed -i "s|gnusocial theme commit.*|gnusocial theme commit:$MICROBLOG_THEME_COMMIT|g" $COMPLETION_FILE + sed -i "s|gnusocial theme commit.*|gnusocial theme commit:$GNUSOCIAL_THEME_COMMIT|g" $COMPLETION_FILE fi - chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + chown -R www-data:www-data /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs install_completed gnusocial_theme } function install_gnusocial_markdown { - MICROBLOG_PATH=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs + GNUSOCIAL_PATH=/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs # update to the next commit function_check set_repo_commit - set_repo_commit $MICROBLOG_PATH/local/plugins/Markdown "gnusocial Markdown commit" "$MICROBLOG_MARKDOWN_COMMIT" $MICROBLOG_MARKDOWN_REPO + set_repo_commit $GNUSOCIAL_PATH/local/plugins/Markdown "gnusocial Markdown commit" "$GNUSOCIAL_MARKDOWN_COMMIT" $GNUSOCIAL_MARKDOWN_REPO if [[ $(app_is_installed gnusocial_markdown) == "1" ]]; then return fi - if [ -d $MICROBLOG_PATH/local/plugins/Markdown ]; then - rm -rf $MICROBLOG_PATH/local/plugins/Markdown + if [ -d $GNUSOCIAL_PATH/local/plugins/Markdown ]; then + rm -rf $GNUSOCIAL_PATH/local/plugins/Markdown fi - if [ ! -d $MICROBLOG_PATH/local/plugins ]; then - mkdir -p $MICROBLOG_PATH/local/plugins + if [ ! -d $GNUSOCIAL_PATH/local/plugins ]; then + mkdir -p $GNUSOCIAL_PATH/local/plugins fi - cd $MICROBLOG_PATH/local/plugins + cd $GNUSOCIAL_PATH/local/plugins function_check git_clone - git_clone $MICROBLOG_MARKDOWN_REPO Markdown - cd $MICROBLOG_PATH/local/plugins/Markdown - git checkout $MICROBLOG_MARKDOWN_COMMIT -b $MICROBLOG_MARKDOWN_COMMIT + git_clone $GNUSOCIAL_MARKDOWN_REPO Markdown + cd $GNUSOCIAL_PATH/local/plugins/Markdown + git checkout $GNUSOCIAL_MARKDOWN_COMMIT -b $GNUSOCIAL_MARKDOWN_COMMIT - microblog_config_file=$MICROBLOG_PATH/config.php - if ! grep -q "addPlugin('Markdown'" $microblog_config_file; then - echo "" >> $microblog_config_file - echo "// Markdown settings" >> $microblog_config_file - echo "addPlugin('Markdown');" >> $microblog_config_file + gnusocial_config_file=$GNUSOCIAL_PATH/config.php + if ! grep -q "addPlugin('Markdown'" $gnusocial_config_file; then + echo "" >> $gnusocial_config_file + echo "// Markdown settings" >> $gnusocial_config_file + echo "addPlugin('Markdown');" >> $gnusocial_config_file fi if ! grep -q "gnusocial Markdown commit" $COMPLETION_FILE; then - echo "gnusocial Markdown commit:$MICROBLOG_MARKDOWN_COMMIT" >> $COMPLETION_FILE + echo "gnusocial Markdown commit:$GNUSOCIAL_MARKDOWN_COMMIT" >> $COMPLETION_FILE else - sed -i "s|gnusocial Markdown commit.*|gnusocial Markdown commit:$MICROBLOG_MARKDOWN_COMMIT|g" $COMPLETION_FILE + sed -i "s|gnusocial Markdown commit.*|gnusocial Markdown commit:$GNUSOCIAL_MARKDOWN_COMMIT|g" $COMPLETION_FILE fi - chown -R www-data:www-data $MICROBLOG_PATH + chown -R www-data:www-data $GNUSOCIAL_PATH install_completed gnusocial_markdown } function install_gnusocial_plugin_nsfw { - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins ]; then - echo $'No local/plugins directory found for the microblog' + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins ]; then + echo $'No local/plugins directory found for the gnusocial' exit 37252 fi # update to the next commit function_check set_repo_commit - set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "gnusocial NSFW plugin commit" "$GNUSOCIAL_NSFW_COMMIT" $GNUSOCIAL_NSFW_REPO + set_repo_commit /var/www/$GNUSOCIAL_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 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins function_check git_clone git_clone $GNUSOCIAL_NSFW_REPO SensitiveContent - if [ ! -d /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/SensitiveContent ]; then - echo $'Unable to clone microblog NSFW plugin' + if [ ! -d /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/SensitiveContent ]; then + echo $'Unable to clone gnusocial NSFW plugin' exit 36738 fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/SensitiveContent + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/local/plugins/SensitiveContent git stash git checkout master git branch -D $GNUSOCIAL_NSFW_COMMIT git checkout $GNUSOCIAL_NSFW_COMMIT -b $GNUSOCIAL_NSFW_COMMIT # enable the plugin - if ! grep -q "addPlugin('SensitiveContent');" /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php; then - echo "addPlugin('SensitiveContent');" >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php + if ! grep -q "addPlugin('SensitiveContent');" /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php; then + echo "addPlugin('SensitiveContent');" >> /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/config.php fi - cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs php scripts/checkschema.php - chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs + chown -R www-data:www-data /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs if ! grep -q "gnusocial NSFW plugin commit" $COMPLETION_FILE; then echo "gnusocial NSFW plugin commit:$GNUSOCIAL_NSFW_COMMIT" >> $COMPLETION_FILE diff --git a/src/freedombone-app-rss b/src/freedombone-app-rss index 7e117ace..533261e7 100755 --- a/src/freedombone-app-rss +++ b/src/freedombone-app-rss @@ -511,7 +511,7 @@ function install_rss_main { } function install_rss_gnusocial { - if [ ! $MICROBLOG_DOMAIN_NAME ]; then + if [ ! $GNUSOCIAL_DOMAIN_NAME ]; then return fi diff --git a/src/freedombone-config b/src/freedombone-config index b48487e3..6b6bc2ac 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -78,10 +78,10 @@ MEDIA_SERVER_DOMAIN_NAME= MEDIA_SERVER_CODE= HUBZILLA_DOMAIN_NAME= HUBZILLA_CODE= -MICROBLOG_DOMAIN_NAME= -MICROBLOG_CODE= -MICROBLOG_WELCOME_MESSAGE=$"Another $PROJECT_NAME site
" -MICROBLOG_BACKGROUND_IMAGE_URL= +GNUSOCIAL_DOMAIN_NAME= +GNUSOCIAL_CODE= +GNUSOCIAL_WELCOME_MESSAGE=$"Another $PROJECT_NAME site
" +GNUSOCIAL_BACKGROUND_IMAGE_URL= GIT_DOMAIN_NAME= GIT_CODE= MEDIAGOBLIN_DOMAIN_NAME= diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index 59a57542..72d141b5 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -125,7 +125,7 @@ function set_default_onion_domains { return fi - MICROBLOG_DOMAIN_NAME='microblog.local' + GNUSOCIAL_DOMAIN_NAME='gnusocial.local' HTMLY_DOMAIN_NAME='htmly.local' DOKUWIKI_DOMAIN_NAME='dokuwiki.local' DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.local" @@ -140,9 +140,9 @@ function create_avahi_onion_domains { if [ ! -d /etc/avahi/services ]; then return fi - if [ $MICROBLOG_DOMAIN_NAME ]; then + if [ $GNUSOCIAL_DOMAIN_NAME ]; then function_check create_avahi_service - create_avahi_service microblog http tcp $MICROBLOG_ONION_PORT + create_avahi_service gnusocial http tcp $GNUSOCIAL_ONION_PORT fi if [ $HTMLY_DOMAIN_NAME ]; then function_check create_avahi_service