mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
Fix permissions
This commit is contained in:
parent
aed0e14467
commit
f7bc34fde9
2 changed files with 17 additions and 30 deletions
|
@ -64,8 +64,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
|
|
||||||
chown -R $app:$app $final_path
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -101,19 +99,14 @@ else
|
||||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# permissions on files and directories
|
# Permissions on files and directories
|
||||||
chmod 400 $final_path/config.dist.php $final_path/index.php $final_path/sous-domaine.html $final_path/VERSION
|
chmod -R o-rwx "$final_path"
|
||||||
chmod 644 $final_path/config.local.php
|
chown -R $app:www-data "$final_path"
|
||||||
find $final_path/scripts -type d -exec chmod 500 {} +
|
find "$final_path" -type d -exec chmod 550 {} +
|
||||||
find $final_path/scripts -type f -exec chmod 400 {} +
|
find "$final_path" -type f -exec chmod 440 {} +
|
||||||
find $final_path/templates -type d -exec chmod 500 {} +
|
find "$final_path/data" -type d -exec chmod 770 {} +
|
||||||
find $final_path/templates -type f -exec chmod 400 {} +
|
find "$final_path/data" -type f -exec chmod 660 {} +
|
||||||
find $final_path/include -type d -exec chmod 500 {} +
|
chmod 660 "$final_path/config.local.php"
|
||||||
find $final_path/include -type f -exec chmod 400 {} +
|
|
||||||
find $final_path/data -type d -exec chmod 700 {} +
|
|
||||||
find $final_path/data -type f -exec chmod 600 {} +
|
|
||||||
find /var/www/garradin/www -type d -exec chmod 505 {} +
|
|
||||||
find /var/www/garradin/www -type f -exec chmod 644 {} +
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -193,8 +193,6 @@ then
|
||||||
ynh_secure_remove $backup_bdd
|
ynh_secure_remove $backup_bdd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown -R $app:$app $final_path
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -209,19 +207,14 @@ else
|
||||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set permissions on app files
|
# Permissions on files and directories
|
||||||
chmod 400 $final_path/config.dist.php $final_path/index.php $final_path/sous-domaine.html $final_path/VERSION
|
chmod -R o-rwx "$final_path"
|
||||||
chmod 644 $final_path/config.local.php
|
chown -R $app:www-data "$final_path"
|
||||||
find $final_path/scripts -type d -exec chmod 500 {} +
|
find "$final_path" -type d -exec chmod 550 {} +
|
||||||
find $final_path/scripts -type f -exec chmod 400 {} +
|
find "$final_path" -type f -exec chmod 440 {} +
|
||||||
find $final_path/templates -type d -exec chmod 500 {} +
|
find "$final_path/data" -type d -exec chmod 770 {} +
|
||||||
find $final_path/templates -type f -exec chmod 400 {} +
|
find "$final_path/data" -type f -exec chmod 660 {} +
|
||||||
find $final_path/include -type d -exec chmod 500 {} +
|
chmod 660 "$final_path/config.local.php"
|
||||||
find $final_path/include -type f -exec chmod 400 {} +
|
|
||||||
find $final_path/data -type d -exec chmod 700 {} +
|
|
||||||
find $final_path/data -type f -exec chmod 600 {} +
|
|
||||||
find /var/www/garradin/www -type d -exec chmod 505 {} +
|
|
||||||
find /var/www/garradin/www -type f -exec chmod 644 {} +
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
@ -236,6 +229,7 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
ynh_script_progression --message="Finalise upgrade" --weight=1
|
ynh_script_progression --message="Finalise upgrade" --weight=1
|
||||||
|
|
||||||
ynh_local_curl "/admin/index.php"
|
ynh_local_curl "/admin/index.php"
|
||||||
|
chmod 440 "$final_path/config.local.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue