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

Merge pull request #4 from YunoHost-Apps/testing

Fix rights
This commit is contained in:
yalh76 2021-07-16 17:49:13 +02:00 committed by GitHub
commit 31629d4fcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 35 deletions

View file

@ -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. 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/ **Demo:** https://gmi.sbgodin.fr/htmgem/

View file

@ -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/ **Démo :** https://gmi.sbgodin.fr/htmgem/

View file

@ -14,6 +14,8 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 1.4.0~ynh1
upgrade=1 from_commit=fb4715fb8e60e6daddf6652bf563ad7c231deb74
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
@ -44,5 +46,5 @@
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=CommitHash ; commit=fb4715fb8e60e6daddf6652bf563ad7c231deb74
name=Name and date of the commit. name=1.4.0~ynh1.

View file

@ -5,8 +5,8 @@
"description": { "description": {
"en": "Custom Gemini capsule with SFTP access and HtmGem to make your Gemini pages reachable on the web." "en": "Custom Gemini capsule with SFTP access and HtmGem to make your Gemini pages reachable on the web."
}, },
"version": "1.4.0~ynh1", "version": "1.4.0~ynh2",
"url": "https://github.com/YunoHost-Apps/my_capsule_ynh", "url": "https://tildegit.org/Sbgodin/htmgem",
"upstream": { "upstream": {
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"demo": "https://gmi.sbgodin.fr/htmgem/", "demo": "https://gmi.sbgodin.fr/htmgem/",
@ -56,10 +56,6 @@
"name": "password", "name": "password",
"type": "password", "type": "password",
"optional": true, "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" "example": "Choose a password"
}, },
{ {

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" 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
#================================================= #=================================================

View file

@ -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
#================================================= #=================================================

View file

@ -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
#================================================= #=================================================