diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index 385e7f3bbbe5bae74f5e99b9991fa0f4e008aa1c..8bd524c3959c7ed026a05b1861e0dfed15ffe5d0 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -315,11 +315,13 @@ function configure_interactive_gnusocial { trap "rm -f $data" 0 1 2 5 15 dialog --backtitle $"Freedombone Control Panel" \ --title $"GNU Social" \ - --radiolist $"Choose an operation:" 13 70 4 \ + --radiolist $"Choose an operation:" 15 70 6 \ 1 $"Set a background image" off \ 2 $"Set the title" off \ 3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)" off \ - 4 $"Exit" on 2> $data + 4 $"Select Qvitter user interface" off \ + 5 $"Select Pleroma user interface" off \ + 6 $"Exit" on 2> $data sel=$? case $sel in 1) return;; @@ -329,7 +331,9 @@ function configure_interactive_gnusocial { 1) gnusocial_set_background_image;; 2) gnusocial_set_title;; 3) gnusocial_set_expire_months;; - 4) break;; + 4) gnusocial_use_qvitter gnusocial;; + 5) gnusocial_use_pleroma gnusocial;; + 6) break;; esac done } diff --git a/src/freedombone-app-postactiv b/src/freedombone-app-postactiv index 5f3dfc4ce145f916c45d104a45fb4e35b1d6e1a1..6e0821fdac8968a52561b52437e675002a97030f 100755 --- a/src/freedombone-app-postactiv +++ b/src/freedombone-app-postactiv @@ -313,11 +313,13 @@ function configure_interactive_postactiv { trap "rm -f $data" 0 1 2 5 15 dialog --backtitle $"Freedombone Control Panel" \ --title $"PostActiv" \ - --radiolist $"Choose an operation:" 13 70 4 \ + --radiolist $"Choose an operation:" 15 70 6 \ 1 $"Set a background image" off \ 2 $"Set the title" off \ 3 $"Set post expiry period (currently $POSTACTIV_EXPIRE_MONTHS months)" off \ - 4 $"Exit" on 2> $data + 4 $"Select Qvitter user interface" off \ + 5 $"Select Pleroma user interface" off \ + 6 $"Exit" on 2> $data sel=$? case $sel in 1) return;; @@ -327,7 +329,9 @@ function configure_interactive_postactiv { 1) postactiv_set_background_image;; 2) postactiv_set_title;; 3) postactiv_set_expire_months;; - 4) break;; + 4) gnusocial_use_qvitter postactiv;; + 5) gnusocial_use_pleroma postactiv;; + 6) break;; esac done } diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index a7d66958696d3f2d71a3ac6a21eda8e610456ee8..912cfa052748493758d835504da2cb15020509f0 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -463,4 +463,40 @@ function expire_gnusocial_posts { fi } +function gnusocial_use_qvitter { + database_name=$1 + + domain_name=$(get_completion_param "$database_name domain") + + if [ -f /var/www/$domain_name/htdocs/index_qvitter.php ]; then + mv /var/www/$domain_name/htdocs/index_qvitter.php /var/www/$domain_name/htdocs/index.php + fi + + if [ -f /etc/nginx/sites-available/$domain_name ]; then + sed -i 's|index_qvitter.php|index.php|g' /etc/nginx/sites-available/$domain_name + sed -i 's|index.html|index.php|g' /etc/nginx/sites-available/$domain_name + fi + systemctl restart nginx +} + +function gnusocial_use_pleroma { + database_name=$1 + + domain_name=$(get_completion_param "$database_name domain") + + if [ ! -d /var/www/$domain_name/htdocs/static ]; then + return + fi + + if [ -f /var/www/$domain_name/htdocs/index.php ]; then + mv /var/www/$domain_name/htdocs/index.php /var/www/$domain_name/htdocs/index_qvitter.php + fi + + if [ -f /etc/nginx/sites-available/$domain_name ]; then + sed -i 's|index.php|index_qvitter.php|g' /etc/nginx/sites-available/$domain_name + sed -i 's|index index_qvitter.php|index index.html|g' /etc/nginx/sites-available/$domain_name + fi + systemctl restart nginx +} + # NOTE: deliberately there is no "exit 0"