diff --git a/conf/config.inc.php b/conf/config.inc.php new file mode 100644 index 0000000..8365c50 --- /dev/null +++ b/conf/config.inc.php @@ -0,0 +1,8 @@ + /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 +sudo yunohost app setting $app mysqlpassword -v $db_pwd + +# Generate random password + +cp ../conf/config.inc.php $final_path/config/ +sudo sed -i "s/USER_DB_VALUE/$db_user/g" $final_path/config/config.inc.php +sudo sed -i "s/PWD_DB_VALUE/$db_pwd/g" $final_path/config/config.inc.php +sudo sed -i "s/NAME_DB_VALUE/$db_user/g" $final_path/config/config.inc.php + +#################################################### +# Nginx configuration # +#################################################### -# Modify Nginx configuration file and copy it to Nginx conf directory sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf -# If a dedicated php-fpm process is used : -# Don't forget to modify ../conf/nginx.conf accordingly or your app will not work ! -# -#sudo sed -i "s@YNH_WWW_APP@$app@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf -# If a dedicated php-fpm process is used : -# Adjustment and copy dedicated php-fpm conf file -# Don't forget to modify ../conf/php-fpm.conf accordingly or your app will not work ! -# -#sed -i "s@YNH_WWW_APP@$app@g" ../conf/php-fpm.conf -#sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/php-fpm.conf -#finalphpconf=/etc/php5/fpm/pool.d/$app.conf -#sudo cp ../conf/php-fpm.conf $finalphpconf -#sudo chown root: $finalphpconf -#sudo chmod 644 $finalphpconf +#################################################### +# SSOWat configuration # +#################################################### -# If app is public, add url to SSOWat conf as skipped_uris if [ "$is_public" = "Yes" ]; then # unprotected_uris allows SSO credentials to be passed anyway. sudo yunohost app setting $app unprotected_uris -v "/" fi +#################################################### +# Restart services # +#################################################### -# If dedicated php-fpm process : -# -#sudo service php5-fpm reload - -# Restart services sudo service nginx reload sudo yunohost app ssowatconf - diff --git a/scripts/remove b/scripts/remove index e43b9f7..0138d86 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,23 +1,16 @@ #!/bin/bash -app=ynhexample -# Retrieve arguments -domain=$(sudo yunohost app setting $app domain) -path=$(sudo yunohost app setting $app path) -admin=$(sudo yunohost app setting $app admin) -is_public=$(sudo yunohost app setting $app is_public) +app=galette +db_user=galette +db_name=galett +e +root_pwd=$(sudo cat /etc/yunohost/mysql) +domain=$(sudo yunohost app setting galette domain) -# Remove sources +mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" sudo rm -rf /var/www/$app - -# Remove configuration files sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf -# If a dedicated php-fpm process is used : -# -#sudo rm -f /etc/php5/fpm/pool.d/$app.conf -#sudo service php5-fpm reload - # Restart services sudo service nginx reload sudo yunohost app ssowatconf diff --git a/sources/README.md b/sources/README.md deleted file mode 100644 index bd2bfad..0000000 --- a/sources/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Place the sources of the webapp in this folder. - -This file can be removed. diff --git a/sources/galette-0.8.2.tar.bz2 b/sources/galette-0.8.2.tar.bz2 new file mode 100644 index 0000000..74fac12 Binary files /dev/null and b/sources/galette-0.8.2.tar.bz2 differ