mirror of
https://github.com/YunoHost-Apps/wordpress_ynh.git
synced 2024-09-03 20:36:10 +02:00
Corrections droits pour maj
This commit is contained in:
parent
8346dc7d36
commit
802a15a056
3 changed files with 14 additions and 40 deletions
|
@ -203,29 +203,21 @@ then
|
||||||
sudo sed -i "s@//--MULTISITE1--define@define@g" $final_path/wp-config.php
|
sudo sed -i "s@//--MULTISITE1--define@define@g" $final_path/wp-config.php
|
||||||
|
|
||||||
# Active le multisite via wp-cli.
|
# Active le multisite via wp-cli.
|
||||||
php $final_path/wp-cli.phar core multisite-convert --path=$final_path --base=$path/
|
php $final_path/wp-cli.phar core multisite-convert --path=$final_path --base=$path/ > /dev/null 2>&1
|
||||||
echo "The 2 warnings of php about \"Permission denied\" on wp-config.php are normal. The install script writing into this file, not wp-cli!"
|
# echo "The 2 warnings of php about \"Permission denied\" on wp-config.php are normal. The install script writing into this file, not wp-cli!"
|
||||||
|
|
||||||
# Active le multisite wordpress
|
# Active le multisite wordpress
|
||||||
sudo sed -i "s@//--MULTISITE2--define@define@g" $final_path/wp-config.php
|
sudo sed -i "s@//--MULTISITE2--define@define@g" $final_path/wp-config.php
|
||||||
|
|
||||||
# Charge les commandes sql pour activer les plugins
|
# Charge les commandes sql pour activer les plugins
|
||||||
# if [ "$is_public" = "No" ];
|
|
||||||
# then
|
|
||||||
# sudo sed -i "s@#--PRIVATE--@@g" ../conf/sql/multisite.sql
|
|
||||||
# else
|
|
||||||
# sudo sed -i "s@#--PUBLIC--@@g" ../conf/sql/multisite.sql
|
|
||||||
# fi
|
|
||||||
mysql --debug-check -u $db_user -p$db_pwd $db_user < ../conf/sql/multisite.sql
|
mysql --debug-check -u $db_user -p$db_pwd $db_user < ../conf/sql/multisite.sql
|
||||||
else
|
else
|
||||||
if [ "$is_public" = "No" ];
|
if [ "$is_public" = "No" ];
|
||||||
then
|
then
|
||||||
sudo sed -i "s@#--PRIVATE--@@g" /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo sed -i "s@#--PRIVATE--@@g" /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
# sudo sed -i "s@#--PRIVATE--@@g" ../conf/sql/single.sql
|
|
||||||
else
|
else
|
||||||
sudo sed -i "s@//--PUBLIC--define@define@g" $final_path/wp-config.php
|
sudo sed -i "s@//--PUBLIC--define@define@g" $final_path/wp-config.php
|
||||||
sudo sed -i "s@#--PRIVATE--@#@g" /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo sed -i "s@#--PRIVATE--@#@g" /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
# sudo sed -i "s@#--PUBLIC--@@g" ../conf/sql/single.sql
|
|
||||||
fi
|
fi
|
||||||
# Charge les commandes sql pour activer les plugins
|
# Charge les commandes sql pour activer les plugins
|
||||||
mysql --debug-check -u $db_user -p$db_pwd $db_user < ../conf/sql/single.sql
|
mysql --debug-check -u $db_user -p$db_pwd $db_user < ../conf/sql/single.sql
|
||||||
|
@ -238,14 +230,10 @@ mysql --debug-check -u $db_user -p$db_pwd $db_user < ../conf/sql/common.sql
|
||||||
sudo sed -i "s@//add_filter@add_filter@g" $final_path/wp-config.php
|
sudo sed -i "s@//add_filter@add_filter@g" $final_path/wp-config.php
|
||||||
|
|
||||||
# Configure les droits d'accès au fichiers
|
# Configure les droits d'accès au fichiers
|
||||||
# -rw-r--r-- sur les fichiers
|
# Les fichiers appartiennent à www-data, pour permettre les mises à jour.
|
||||||
sudo find $final_path -type f -print0 | xargs -0 sudo chmod 644
|
sudo chown -R www-data: $final_path
|
||||||
# drwxr-xr-x sur les dossiers
|
# Sauf le fichier de config wp-config.php qui appartient à root
|
||||||
sudo find $final_path -type d -print0 | xargs -0 sudo chmod 755
|
sudo chown root: $final_path/wp-config.php
|
||||||
# Les fichiers appartiennent à root
|
|
||||||
sudo chown -R root: $final_path
|
|
||||||
# Sauf le dossier wp-content qui appartient à www-data
|
|
||||||
sudo chown -R www-data:root $final_path/wp-content
|
|
||||||
|
|
||||||
if [ "$is_public" = "No" ];
|
if [ "$is_public" = "No" ];
|
||||||
then
|
then
|
||||||
|
@ -258,5 +246,6 @@ fi
|
||||||
sudo sed -i '/#wordpress_yunohost/d' /etc/hosts
|
sudo sed -i '/#wordpress_yunohost/d' /etc/hosts
|
||||||
|
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
||||||
# wp-cli me semble un peu trop permissif... Il a terminé son travail...
|
# wp-cli me semble un peu trop permissif... Il a terminé son travail...
|
||||||
sudo rm -f $final_path/wp-cli.phar
|
sudo rm -f $final_path/wp-cli.phar
|
||||||
|
|
|
@ -36,7 +36,10 @@ sudo sed -i -e "s/'DB_USER', *'[^']*'/'DB_USER', '$app'/g" $final_path/wp-config
|
||||||
sudo sed -i -e "s/'DB_NAME', *'[^']*'/'DB_NAME', '$app'/g" $final_path/wp-config.php
|
sudo sed -i -e "s/'DB_NAME', *'[^']*'/'DB_NAME', '$app'/g" $final_path/wp-config.php
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
|
# Les fichiers appartiennent à www-data, pour permettre les mises à jour.
|
||||||
sudo chown -R www-data: $final_path
|
sudo chown -R www-data: $final_path
|
||||||
|
# Sauf le fichier de config wp-config.php qui appartient à root
|
||||||
|
sudo chown root: $final_path/wp-config.php
|
||||||
|
|
||||||
# Restore conf files
|
# Restore conf files
|
||||||
conf=/etc/nginx/conf.d/$domain.d/$app.conf
|
conf=/etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
|
@ -37,20 +37,6 @@ then
|
||||||
sudo yunohost app setting $app language -v $language
|
sudo yunohost app setting $app language -v $language
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$is_public" = "" ]];
|
|
||||||
then
|
|
||||||
mysql -u root -p$root_pwd $db_name -e "select option_value from wp_options WHERE option_name='active_plugins' INTO OUTFILE '/tmp/wordpressispublic';"
|
|
||||||
grep -q http-authentication /tmp/wordpressispublic
|
|
||||||
if [[ $? -eq 0 ]];
|
|
||||||
then
|
|
||||||
is_public=Yes
|
|
||||||
else
|
|
||||||
is_public=No
|
|
||||||
fi
|
|
||||||
sudo rm -f /tmp/wordpressispublic
|
|
||||||
sudo yunohost app setting $app is_public -v $is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if admin is not null
|
# Check if admin is not null
|
||||||
if [[ "$admin_wordpress" = "" || "$is_public" = "" || "$language" = "" ]]; then
|
if [[ "$admin_wordpress" = "" || "$is_public" = "" || "$language" = "" ]]; then
|
||||||
echo "Unable to upgrade, please contact support"
|
echo "Unable to upgrade, please contact support"
|
||||||
|
@ -91,14 +77,10 @@ fi
|
||||||
sudo yunohost app setting $app multisite -v $multisite
|
sudo yunohost app setting $app multisite -v $multisite
|
||||||
|
|
||||||
# Configure les droits d'accès au fichiers
|
# Configure les droits d'accès au fichiers
|
||||||
# -rw-r--r-- sur les fichiers
|
# Les fichiers appartiennent à www-data, pour permettre les mises à jour.
|
||||||
sudo find $final_path -type f -print0 | xargs -0 sudo chmod 644
|
sudo chown -R www-data: $final_path
|
||||||
# drwxr-xr-x sur les dossiers
|
# Sauf le fichier de config wp-config.php qui appartient à root
|
||||||
sudo find $final_path -type d -print0 | xargs -0 sudo chmod 755
|
sudo chown root: $final_path/wp-config.php
|
||||||
# Les fichiers appartiennent à root
|
|
||||||
sudo chown -R root: $final_path
|
|
||||||
# Sauf le dossier wp-content qui appartient à www-data
|
|
||||||
sudo chown -R www-data:root $final_path/wp-content
|
|
||||||
|
|
||||||
|
|
||||||
sudo yunohost app setting $app skipped_uris -d # Retire le skipped_uris si il existe encore.
|
sudo yunohost app setting $app skipped_uris -d # Retire le skipped_uris si il existe encore.
|
||||||
|
|
Loading…
Add table
Reference in a new issue