1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/drupal7_ynh.git synced 2024-09-03 18:26:19 +02:00

Fix chmod

This commit is contained in:
yalh76 2021-04-15 20:23:54 +02:00
parent e8e2cb6181
commit a04c55f276
3 changed files with 45 additions and 39 deletions

View file

@ -54,7 +54,6 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil
@ -93,7 +92,7 @@ ynh_script_progression --message="Creating final path..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
mkdir -p "$final_path/$app"
chmod 750 "$final_path"
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
@ -143,7 +142,7 @@ export PATH="$final_path/.composer/vendor/bin:$PATH"
#=================================================
ynh_script_progression --message="Installing Drupal..."
chmod 750 "$final_path"
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
@ -151,24 +150,30 @@ update-alternatives --set php /usr/bin/php$phpversion
pushd "$final_path"
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush pm-download -y drupal-7 --drupal-project-rename=$app
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app site-install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download drush_language
#ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download ldap
#ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-enable -y ldap_servers ldap_user ldap_authentication ldap_authorization ldap_authorization_drupal_role
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download l10n_update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-enable -y l10n_update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app language-add $language
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app language-default $language
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear drush
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app core-cron
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
popd
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app site-install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download drush_language
#ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download ldap
#ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-enable -y ldap_servers ldap_user ldap_authentication ldap_authorization ldap_authorization_drupal_role
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download l10n_update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-enable -y l10n_update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app language-add $language
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app language-default $language
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear drush
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app core-cron
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
#=================================================
# SETUP THE CRON FILE
#=================================================
@ -176,14 +181,6 @@ ynh_script_progression --message="Setuping the cron file..."
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_script_progression --message="Storing the config file checksum..."
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -68,7 +68,7 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"

View file

@ -23,6 +23,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK VERSION
@ -76,7 +77,7 @@ then
mkdir -p "$final_path/$app"
fi
chmod 750 "$final_path"
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
@ -120,32 +121,40 @@ ynh_script_progression --message="Upgrading Composer..."
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path/.composer"
export PATH="$final_path/.composer/vendor/bin:$PATH"
#=================================================
# UPGRADE DRUPAL
#=================================================
ynh_script_progression --message="Upgrading Drupal..."
ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php"
export PATH="$final_path/.composer/vendor/bin:$PATH"
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
update-alternatives --set php /usr/bin/php$phpversion
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear all
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update -y drupal
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear all
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 0
pushd "$final_path"
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear all
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update -y drupal
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear all
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 0
chmod -R 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
popd
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# GENERIC FINALIZATION
#=================================================