From ed560b9fdcd2f0096bdc709913ddba79059f60f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 17 Apr 2021 13:28:01 +0200 Subject: [PATCH 1/2] Testing (#13) - Set permissions --- README.md | 4 ++-- README_fr.md | 4 ++-- scripts/install | 11 ++++++++++- scripts/remove | 8 ++++++++ scripts/restore | 19 ++++++++++--------- scripts/upgrade | 11 ++++++++++- 6 files changed, 42 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2b7f9d4..ea2ec67 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README_fr.md b/README_fr.md index c210f72..0ca084c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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 diff --git a/scripts/install b/scripts/install index 024573c..1e56600 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/remove b/scripts/remove index a660b98..f2c5329 100755 --- a/scripts/remove +++ b/scripts/remove @@ -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 #================================================= diff --git a/scripts/restore b/scripts/restore index c2896b5..e1ec9fc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index cf43934..72500ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 From ff3b47f2d262f4f8f1752eb10ee161b776edab3a Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Tue, 11 May 2021 07:23:19 +0200 Subject: [PATCH 2/2] [autopatch] Update issue and PR templates (#15) Co-authored-by: Yunohost-Bot <> --- pull_request_template.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 pull_request_template.md diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Problem -- *Description of why you made this PR* - -## Solution -- *And how do you fix that problem* - -## PR Status -- [ ] Code finished. -- [ ] Tested with Package_check. -- [ ] Fix or enhancement tested. -- [ ] Upgrade from last version tested. -- [ ] Can be reviewed and tested. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*