1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/20euros_ynh.git synced 2024-09-03 18:05:53 +02:00
- Set permissions
This commit is contained in:
Éric Gaspar 2021-04-17 13:28:01 +02:00 committed by GitHub
parent f8c5f11894
commit ed560b9fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 15 deletions

View file

@ -18,8 +18,8 @@ Clone of 2048 game with euro coins and bills.
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/20euros%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/20euros/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/20euros%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/20euros/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/20euros.svg)](https://ci-apps.yunohost.org/ci/apps/20euros/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/20euros.svg)](https://ci-apps-arm.yunohost.org/ci/apps/20euros/)
## Links

View file

@ -18,8 +18,8 @@ Clone du jeu 2048 avec pièces et billets en euros.
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/20euros%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/20euros/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/20euros%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/20euros/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/20euros.svg)](https://ci-apps.yunohost.org/ci/apps/20euros/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/20euros.svg)](https://ci-apps-arm.yunohost.org/ci/apps/20euros/)
## Liens

View file

@ -45,6 +45,14 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=2
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# STANDARD MODIFICATIONS
#=================================================
@ -73,7 +81,8 @@ ynh_add_nginx_config
#=================================================
# Set permissions to app files
chown -R root: $final_path
chown -R $app:www-data $final_path
chmod o-rwx $final_path
#=================================================
# SETUP SSOWAT

View file

@ -36,6 +36,14 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
# Delete a system user
ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -44,6 +44,14 @@ test ! -d $final_path \
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -51,20 +59,13 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=2
ynh_restore_file --origin_path="$final_path"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# RESTORE USER RIGHTS
#=================================================
# Restore permissions on app files
chown -R root: $final_path
chown -R $app:www-data $final_path
chmod o-rwx $final_path
#=================================================
# GENERIC FINALIZATION

View file

@ -57,6 +57,14 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -83,7 +91,8 @@ ynh_add_nginx_config
#=================================================
# Set permissions on app files
chown -R root: $final_path
chown -R $app:www-data $final_path
chmod o-rwx $final_path
#=================================================
# RELOAD NGINX