1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Avoid to set whole permission on data dir when change-url and config

This commit is contained in:
Josué Tille 2024-02-29 08:12:20 +01:00
parent f7a9ef38fc
commit 42b6143104
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5
4 changed files with 10 additions and 8 deletions

View file

@ -148,11 +148,13 @@ set_permissions() {
chmod 700 $code_dir/update_synapse_for_appservice.sh
chmod 700 $code_dir/set_admin_user.sh
find $data_dir \( \! -perm -o= \
-o \! -user $app \
-o \! -group $app \) \
-exec chown $app:$app {} \; \
-exec chmod o= {} \;
if [ "${1:-}" == data ]; then
find $data_dir \( \! -perm -o= \
-o \! -user $app \
-o \! -group $app \) \
-exec chown $app:$app {} \; \
-exec chmod o= {} \;
fi
chown $app:$app -R /etc/matrix-$app
chmod u=rwX,g=rX,o= -R /etc/matrix-$app

View file

@ -274,7 +274,7 @@ ynh_replace_string __DOMAIN__ $domain ../hooks/post_cert_update
#=================================================
ynh_script_progression --message="Protecting directories..." --weight=3
set_permissions
set_permissions data
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL

View file

@ -113,7 +113,7 @@ ynh_use_logrotate --logfile /var/log/matrix-$app
#=================================================
ynh_script_progression --message="Protecting directories..." --weight=3
set_permissions
set_permissions data
#=================================================
# RELOAD NGINX, SYNAPSE AND COTURN

View file

@ -498,7 +498,7 @@ fi
#=================================================
ynh_script_progression --message="Protecting directories... (note that it could take a long time depending of your install size)" --weight=3
set_permissions
set_permissions data
#=================================================
# UPDATE HOOKS