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

Fix rights

This commit is contained in:
yalh76 2021-07-16 13:46:14 +02:00
parent 8de5272b68
commit f9f2d24cb4
3 changed files with 32 additions and 25 deletions

View file

@ -159,6 +159,11 @@ name: ${db_name}\nuser: ${db_name}\npass: ${db_pwd}" > ../sources/db_access.txt
cp -r "../sources/db_access.txt" "$final_path/db_access.txt"
fi
#=================================================
# APPLY RIGHTS
#=================================================
ynh_script_progression --message="Apply rights..."
chown -R $app:www-data "$final_path"
# Home directory of the user needs to be owned by root to allow
@ -176,8 +181,6 @@ ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="../conf/server.toml" --destination="/etc/gemserv/config.d/$domain.toml"
chown gemserv:gemserv "/etc/gemserv/config.d/$domain.toml"
ynh_systemd_action --service_name=gemserv --action=reload
#=================================================

View file

@ -80,16 +80,6 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
# Restore permissions on app files
chown -R $app:www-data "$final_path"
# Home directory of the user needs to be owned by root to allow
# SFTP connections
chown root:root "$final_path"
setfacl -m g:$app:r-x "$final_path"
setfacl -m g:www-data:r-x "$final_path"
setfacl -m g:gemserv:r-x "$final_path"
chmod o-rwx "$final_path"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
@ -135,6 +125,21 @@ ynh_restore_file --origin_path="/etc/gemserv/config.d/$domain.toml"
ynh_systemd_action --service_name=gemserv --action=reload
#=================================================
# APPLY RIGHTS
#=================================================
ynh_script_progression --message="Apply rights..."
chown -R $app:www-data "$final_path"
# Home directory of the user needs to be owned by root to allow
# SFTP connections
chown root:root "$final_path"
setfacl -m g:$app:r-x "$final_path"
setfacl -m g:www-data:r-x "$final_path"
setfacl -m g:gemserv:r-x "$final_path"
chmod o-rwx "$final_path"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -90,16 +90,6 @@ then
ynh_setup_source --dest_dir="$final_path/www/htmgem"
fi
chown -R $app:www-data "$final_path"
# Home directory of the user needs to be owned by root to allow
# SFTP connections
chown root:root "$final_path"
setfacl -m g:$app:r-x "$final_path"
setfacl -m g:www-data:r-x "$final_path"
setfacl -m g:gemserv:r-x "$final_path"
chmod o-rwx "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -126,8 +116,19 @@ ynh_add_fpm_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# ...
# APPLY RIGHTS
#=================================================
ynh_script_progression --message="Apply rights..."
chown -R $app:www-data "$final_path"
# Home directory of the user needs to be owned by root to allow
# SFTP connections
chown root:root "$final_path"
setfacl -m g:$app:r-x "$final_path"
setfacl -m g:www-data:r-x "$final_path"
setfacl -m g:gemserv:r-x "$final_path"
chmod o-rwx "$final_path"
#=================================================
# UPDATE A CONFIG FILE
@ -136,8 +137,6 @@ ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="../conf/server.toml" --destination="/etc/gemserv/config.d/$domain.toml"
chown gemserv:gemserv "/etc/gemserv/config.d/$domain.toml"
ynh_systemd_action --service_name=gemserv --action=reload
#=================================================