1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00

Set config file permissions

This commit is contained in:
ericgaspar 2021-03-23 23:12:12 +01:00
parent fc3e7cebb6
commit f7e9ddedb9
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 9 additions and 12 deletions

View file

@ -23,7 +23,6 @@
upgrade=1 from_commit=c06f6235a93587e16524fa5b124e4d9e138a8109
backup_restore=1
multi_instance=0
port_already_use=1
change_url=1
;;; Options
Email=

View file

@ -215,13 +215,10 @@ mkdir -p "$groups"
#=================================================
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
ynh_store_file_checksum --file="$final_path/data/passwd"
ynh_add_config --template="../conf/groupname.json" --destination="$final_path/groups/$group_name.json"
ynh_store_file_checksum --file="$final_path/groups/$group_name.json"
ynh_add_config --template="../conf/ice-servers.json" --destination="$final_path/data/ice-servers.json"
ynh_store_file_checksum --file="$final_path/data/ice-servers.json"
#=================================================
# ADD SCRIPT FOR COTURN CRON AND APP SERVICE
@ -230,8 +227,7 @@ ynh_store_file_checksum --file="$final_path/data/ice-servers.json"
# WARNING : theses command are used in INSTALL, UPGRADE
# For any update do it in all files
cp ../sources/Coturn_config_rotate.sh $final_path/Coturn_config_rotate.sh
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$final_path/Coturn_config_rotate.sh"
ynh_add_config --template="../sources/Coturn_config_rotate.sh" --destination="$final_path/Coturn_config_rotate.sh"
chmod +x $final_path/Coturn_config_rotate.sh
#=================================================
@ -249,6 +245,8 @@ chmod -R u=rwX,g=rX,o= /etc/$app
chmod 770 $final_path/Coturn_config_rotate.sh
setfacl -R -m user:turnserver:rX /etc/$app
setfacl -R -m user:turnserver:rwX /var/log/$app
chmod 600 $final_path/data/passwd
chmod 600 $final_path/data/ice-servers.json
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -146,6 +146,9 @@ chmod -R u=rwX,g=rX,o= /etc/$app
chmod 770 $final_path/Coturn_config_rotate.sh
setfacl -R -m user:turnserver:rX /etc/$app
setfacl -R -m user:turnserver:rwX /var/log/$app
# Set permissions on config files
chmod 600 $final_path/data/passwd
chmod 600 $final_path/data/ice-servers.json
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION

View file

@ -110,13 +110,11 @@ then
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
ynh_backup_if_checksum_is_different --file="$final_path/data/passwd"
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
ynh_store_file_checksum --file="$final_path/data/passwd"
chmod 600 $final_path/data/passwd
ynh_backup_if_checksum_is_different --file="$final_path/data/ice-servers.json"
ynh_add_config --template="../conf/ice-servers.json" --destination="$final_path/data/ice-servers.json"
ynh_store_file_checksum --file="$final_path/data/ice-servers.json"
chmod 600 $final_path/data/ice-servers.json
# Recreate certificates
pushd "$final_path/data"
@ -206,8 +204,7 @@ ynh_store_file_checksum --file="$coturn_config_path"
# WARNING : theses command are used in INSTALL, UPGRADE
# For any update do it in all files
cp ../sources/Coturn_config_rotate.sh $final_path/Coturn_config_rotate.sh
ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$final_path/Coturn_config_rotate.sh"
ynh_add_config --template="../sources/Coturn_config_rotate.sh" --destination="$final_path/Coturn_config_rotate.sh"
chmod +x $final_path/Coturn_config_rotate.sh
#=================================================