From f9f2d24cb4548486594687203dd3d4e2e60edd60 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Jul 2021 13:46:14 +0200 Subject: [PATCH 1/4] Fix rights --- scripts/install | 7 +++++-- scripts/restore | 25 +++++++++++++++---------- scripts/upgrade | 25 ++++++++++++------------- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/scripts/install b/scripts/install index c1f195b..2d184d7 100755 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= diff --git a/scripts/restore b/scripts/restore index 64469fa..dff1cc6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5b6cd85..33a376e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #================================================= From ace20bb090906d5512e18e62ba9dfb7414ab8696 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Jul 2021 13:50:02 +0200 Subject: [PATCH 2/4] Upgrade to 1.4.0~ynh2 --- check_process | 6 ++++-- manifest.json | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index f5ed8b8..f5369e6 100644 --- a/check_process +++ b/check_process @@ -14,6 +14,8 @@ setup_private=1 setup_public=1 upgrade=1 + # 1.4.0~ynh1 + upgrade=1 from_commit=fb4715fb8e60e6daddf6652bf563ad7c231deb74 backup_restore=1 multi_instance=1 port_already_use=0 @@ -44,5 +46,5 @@ Email= Notification=none ;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. + ; commit=fb4715fb8e60e6daddf6652bf563ad7c231deb74 + name=1.4.0~ynh1. diff --git a/manifest.json b/manifest.json index f6f14ca..9e942fd 100644 --- a/manifest.json +++ b/manifest.json @@ -5,8 +5,8 @@ "description": { "en": "Custom Gemini capsule with SFTP access and HtmGem to make your Gemini pages reachable on the web." }, - "version": "1.4.0~ynh1", - "url": "https://github.com/YunoHost-Apps/my_capsule_ynh", + "version": "1.4.0~ynh2", + "url": "https://tildegit.org/Sbgodin/htmgem", "upstream": { "license": "GPL-3.0-only", "demo": "https://gmi.sbgodin.fr/htmgem/", From 7855e99727e1769245c1a81ee934365b6929ced0 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 16 Jul 2021 11:50:09 +0000 Subject: [PATCH 3/4] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19e68ac..b832765 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Custom Gemini capsule with SFTP access and HtmGem to make your Gemini pages reachable on the web. -**Shipped version:** 1.4.0~ynh1 +**Shipped version:** 1.4.0~ynh2 **Demo:** https://gmi.sbgodin.fr/htmgem/ diff --git a/README_fr.md b/README_fr.md index 3db1a75..3bf0167 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour -**Version incluse :** 1.4.0~ynh1 +**Version incluse :** 1.4.0~ynh2 **Démo :** https://gmi.sbgodin.fr/htmgem/ From c616190cc9ad9b22fe393091551c1624f83aa88b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Jul 2021 17:48:58 +0200 Subject: [PATCH 4/4] Update manifest.json --- manifest.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifest.json b/manifest.json index 9e942fd..502ff4b 100644 --- a/manifest.json +++ b/manifest.json @@ -56,10 +56,6 @@ "name": "password", "type": "password", "optional": true, - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - }, "example": "Choose a password" }, {