diff --git a/manifest.json b/manifest.json index bad1e4c..3ead178 100644 --- a/manifest.json +++ b/manifest.json @@ -40,16 +40,7 @@ }, "choices": ["Yes", "No"], "default": "Yes" - }, - { - "name": "db_pwd", - "type": "password", - "ask": { - "en": "Indicate a password fot phpBB's MySQL database", - "fr": "Choisissez un mot de passe pour la base MySQL de phpBB" - }, - "example": "strong_password" - } + } ] } } diff --git a/scripts/install b/scripts/install index 70cc332..f363eae 100644 --- a/scripts/install +++ b/scripts/install @@ -15,13 +15,13 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi -#db_user=$app +db_user=$app +db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') # Initialize database and store mysql password for upgrade #sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e ../sources/SQL/mysql.initial.sql) -#sudo yunohost app setting rainloop mysqlpwd -v $db_pwd - -#mysql -u $db_user -p$db_pwd $db_user < ../sources/plugins/automatic_addressbook/SQL/mysql.initial.sql +sudo yunohost app initdb $db_user -p $db_pwd +sudo yunohost app setting $app mysqlpwd -v $db_pwd # Copy files to the right place final_path=/var/www/$app diff --git a/scripts/remove b/scripts/remove index 1fff30a..f94d6db 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,12 +1,13 @@ #!/bin/bash -#db_user=rainloop -#db_name=rainloop -#root_pwd=$(sudo cat /etc/yunohost/mysql) app=phpBB + +db_user=$app +db_name=$app +root_pwd=$(sudo cat /etc/yunohost/mysql) domain=$(sudo yunohost app setting $app domain) -#mysql -u root -p $root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" +sudo mysql -u root -p $root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" sudo rm -rf /var/www/$app sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf sudo rm -f /etc/php5/fpm/pool.d/$app.conf