diff --git a/src/freedombone b/src/freedombone index 69b3cd8f..3f7b56cb 100755 --- a/src/freedombone +++ b/src/freedombone @@ -8518,32 +8518,29 @@ function install_gnu_social { fi nginx_ensite $MICROBLOG_DOMAIN_NAME + # 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 + gnu_social_ssl='always' + if [[ $ONION_ONLY != 'no' ]]; then + gnu_social_ssl='never' + fi + # Create the configuration - #echo ' /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "if (!defined('GNUSOCIAL')) { exit(1); }" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['site']['name'] = 'Freedombone Social';" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['site']['server'] = '$MICROBLOG_DOMAIN_NAME';" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['site']['path'] = false;" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #if [[ $ONION_ONLY == "no" ]]; then - # echo "$config['site']['ssl'] = 'always'; " >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #else - # echo "$config['site']['ssl'] = 'never'; " >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #fi - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['site']['fancy'] = true;" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['db']['database'] = 'mysqli://root:${MARIADB_PASSWORD}@localhost/gnusocial';" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['db']['type'] = 'mysql';" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '// Uncomment below for better performance. Just remember you must run' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '// php scripts/checkschema.php whenever your enabled plugins change!' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['db']['schemacheck'] = 'script';" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo '' >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php - #echo "$config['site']['profile'] = 'community';" >> /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/config.php + gnu_social_installer=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs/scripts/install_cli.php + ${gnu_social_installer} --host="localhost" --database="gnusocial" \ + --dbtype=mysql --username="root" -v \ + --password="$MARIADB_PASSWORD" \ + --sitename="My Social Network" --fancy \ + --admin-nick="gnusocialadmin" \ + --admin-pass="$MICROBLOG_ADMIN_PASSWORD" \ + --site-profile="community" \ + --ssl=${gnu_social_ssl} + if [ ! "$?" = "0" ]; then + # failed to install + echo $'Could not install GNU Social' + exit 72357 + fi MICROBLOG_ONION_HOSTNAME=$(add_onion_service microblog 80 ${MICROBLOG_ONION_PORT}) @@ -8564,33 +8561,8 @@ function install_gnu_social { echo '' >> /home/$MY_USERNAME/README echo $'Microblog' >> /home/$MY_USERNAME/README echo '=========' >> /home/$MY_USERNAME/README - echo $"To set up your microblog go to" >> /home/$MY_USERNAME/README - echo $"https://$MICROBLOG_DOMAIN_NAME/install.php" >> /home/$MY_USERNAME/README - echo $'and enter the following settings:' >> /home/$MY_USERNAME/README - echo $' - Set a name for the site' >> /home/$MY_USERNAME/README - echo $' - Server SSL: enable' >> /home/$MY_USERNAME/README - echo $' - Hostname: localhost' >> /home/$MY_USERNAME/README - echo $' - Type: MySql/MariaDB' >> /home/$MY_USERNAME/README - echo $' - Name: gnusocial' >> /home/$MY_USERNAME/README - echo $' - DB username: root' >> /home/$MY_USERNAME/README - echo $" - DB Password; $MARIADB_PASSWORD" >> /home/$MY_USERNAME/README - echo $" - Administrator nickname: $MY_USERNAME" >> /home/$MY_USERNAME/README - echo $" - Administrator password: $MICROBLOG_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README - echo $' - Subscribe to announcements: ticked' >> /home/$MY_USERNAME/README - echo $' - Site profile: Community' >> /home/$MY_USERNAME/README - echo '' >> /home/$MY_USERNAME/README - echo $'When the install is complete you will see a lot of warnings' >> /home/$MY_USERNAME/README - echo $'but just ignore those and navigate to ' >> /home/$MY_USERNAME/README - echo $"https://$MICROBLOG_DOMAIN_NAME and you can then " >> /home/$MY_USERNAME/README - echo $'complete the configuration via the *Admin* section on the header' >> /home/$MY_USERNAME/README - echo $'bar. Some recommended admin settings are:' >> /home/$MY_USERNAME/README - echo '' >> /home/$MY_USERNAME/README - echo $'Under the *Site* settings:' >> /home/$MY_USERNAME/README - echo ' Text limit: 140' >> /home/$MY_USERNAME/README - echo ' Dupe Limit: 60000' >> /home/$MY_USERNAME/README - echo '' >> /home/$MY_USERNAME/README - echo $'Under the *User* settings:' >> /home/$MY_USERNAME/README - echo ' Bio limit: 1000' >> /home/$MY_USERNAME/README + echo $"Microblog administrator nickname: gnusocialadmin" >> /home/$MY_USERNAME/README + echo $"Microblog administrator password: $MICROBLOG_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README echo $'Under the *Access* settings:' >> /home/$MY_USERNAME/README echo ' /Invite only/ ticked' >> /home/$MY_USERNAME/README