mirror of
https://github.com/YunoHost-Apps/yeswiki_ynh.git
synced 2024-09-03 18:05:56 +02:00
Merge pull request #3 from YesWiki/ynh-dir-rigths-v2
Ynh dir rigths v2 for upgrade restore + install a new time
This commit is contained in:
commit
3f00a85037
4 changed files with 17 additions and 16 deletions
|
@ -15,6 +15,19 @@ loginldap_version="2021-03-01-2"
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
# update directory right
|
||||||
|
# | arg: app - The application's name ; default : yeswiki
|
||||||
|
# | arg: final_path - The path of the application's folder
|
||||||
|
# yeswiki_update_dir_rights yeswiki /var/www/yeswiki
|
||||||
|
yeswiki_update_dir_rights() {
|
||||||
|
local app="${1:-yeswiki}"
|
||||||
|
local final_path="${2}"
|
||||||
|
|
||||||
|
chown -R $app:$app $final_path
|
||||||
|
chmod -R u=rwX,g=rX,o=rX $final_path
|
||||||
|
chmod -R g+rwX,o+rwX $final_path/{cache,files}
|
||||||
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -107,7 +107,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set right permissions for cURL install
|
# Set right permissions for cURL install
|
||||||
chown -R $app: $final_path
|
chown -R $app:$app $final_path
|
||||||
|
|
||||||
# Set the app as temporarily public for cURL call
|
# Set the app as temporarily public for cURL call
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
|
@ -165,11 +165,7 @@ ynh_replace_string --match_string=");"\
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R root: $final_path
|
yeswiki_update_dir_rights $app $final_path
|
||||||
chown -R $app $final_path/{cache,files,themes,tools,wakka.config.php}
|
|
||||||
|
|
||||||
chown $app:www-data $final_path
|
|
||||||
chmod o-rwx $final_path
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -70,11 +70,7 @@ ynh_restore_file --origin_path="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Restore permissions on app files
|
# Restore permissions on app files
|
||||||
chown -R root: $final_path
|
yeswiki_update_dir_rights $app $final_path
|
||||||
chown -R $app $final_path/{cache,files,themes,tools,wakka.config.php}
|
|
||||||
|
|
||||||
chown $app:www-data $final_path
|
|
||||||
chmod o-rwx $final_path
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
|
|
|
@ -147,11 +147,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
chown -R root: $final_path
|
yeswiki_update_dir_rights $app $final_path
|
||||||
chown -R $app $final_path/{cache,files,themes,tools,wakka.config.php}
|
|
||||||
|
|
||||||
chown $app:www-data $final_path
|
|
||||||
chmod o-rwx $final_path
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue