1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpmyadmin_ynh.git synced 2024-09-03 19:56:46 +02:00

[fix] uggly random password not random at all

This commit is contained in:
Matlink 2015-01-05 20:05:47 +01:00
parent 909b5e6045
commit 436841d38d

View file

@ -33,6 +33,7 @@ sudo cp -r ../phpMyAdmin-$version-all-languages/* $final_path
echo "Setting up database..." echo "Setting up database..."
db_user=phpmyadmin db_user=phpmyadmin
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') 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')
cookie_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')
sed -i "s@YNH_PMA_USER@$db_user@g" ../conf/create_db.sql sed -i "s@YNH_PMA_USER@$db_user@g" ../conf/create_db.sql
sudo yunohost app initdb $db_user -p $db_pwd sudo yunohost app initdb $db_user -p $db_pwd
mysql -u root -p$(sudo cat /etc/yunohost/mysql) < ../conf/create_db.sql mysql -u root -p$(sudo cat /etc/yunohost/mysql) < ../conf/create_db.sql
@ -46,6 +47,7 @@ sed -i "s@YNH_DOMAIN@$domain@g" ../conf/config.inc.php
sed -i "s@YNH_PMA_USER@$db_user@g" ../conf/config.inc.php sed -i "s@YNH_PMA_USER@$db_user@g" ../conf/config.inc.php
sed -i "s@YNH_PMA_PASSWORD@$db_pwd@g" ../conf/config.inc.php sed -i "s@YNH_PMA_PASSWORD@$db_pwd@g" ../conf/config.inc.php
sed -i "s@YNH_MYSQL_ROOT_PASSWORD@$(sudo cat /etc/yunohost/mysql)@g" ../conf/config.inc.php sed -i "s@YNH_MYSQL_ROOT_PASSWORD@$(sudo cat /etc/yunohost/mysql)@g" ../conf/config.inc.php
sed -i "s@YNH_COOKIE_PASSWORD@$cookie_pwd@g" ../conf/config.inc.php
sudo cp ../conf/config.inc.php $final_path sudo cp ../conf/config.inc.php $final_path
sudo yunohost app addaccess phpmyadmin -u $admin sudo yunohost app addaccess phpmyadmin -u $admin