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:
parent
8de5272b68
commit
f9f2d24cb4
3 changed files with 32 additions and 25 deletions
|
@ -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"
|
cp -r "../sources/db_access.txt" "$final_path/db_access.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# APPLY RIGHTS
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Apply rights..."
|
||||||
|
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
# Home directory of the user needs to be owned by root to allow
|
# 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"
|
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
|
ynh_systemd_action --service_name=gemserv --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -80,16 +80,6 @@ ynh_script_progression --message="Restoring the app main directory..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
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
|
# 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
|
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
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -90,16 +90,6 @@ then
|
||||||
ynh_setup_source --dest_dir="$final_path/www/htmgem"
|
ynh_setup_source --dest_dir="$final_path/www/htmgem"
|
||||||
fi
|
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
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -126,8 +116,19 @@ ynh_add_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# 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
|
# 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"
|
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
|
ynh_systemd_action --service_name=gemserv --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue