1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/domoticz_ynh.git synced 2024-09-03 18:26:17 +02:00

Standardize permission management

This commit is contained in:
Krakinou 2024-01-21 17:11:51 +01:00
parent 1c5730f6ab
commit 76b51ec840
3 changed files with 7 additions and 10 deletions

View file

@ -84,6 +84,9 @@ if [ "$domain" != "$mqtt_domain" ]; then
mosquitto_passwd -U "/etc/mosquitto/conf.d/"$app"_credentials"
ynh_print_info --message="The credential to the mosquitto server has been saved in the settings of the app"
else
#If no MQTT have been set, we delete the mqtt permission.
ynh_permission_delete --permission="mqtt"
fi
@ -161,15 +164,6 @@ fi
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="$log_file" --failregex="^.*Error: Failed login attempt from <HOST>.*$" --max_retry=5
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..."
#If no MQTT have been set, we delete the mqtt permission.
[[ "$domain" == "$mqtt_domain" ]] && ynh_permission_delete --permission="mqtt"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -70,6 +70,9 @@ chown -R "$app":"$app" "$install_dir"
if [ "$domain" != "$mqtt_domain" ]; then
ynh_script_progression --message="Reinstalling up mosquitto..." --weight=5
ynh_restore_file --origin_path="/etc/mosquitto/conf.d" --not_mandatory
else
#If no MQTT have been set, we delete the mqtt permission.
ynh_permission_delete --permission="mqtt"
fi
#=================================================

View file

@ -124,7 +124,7 @@ if [ "$domain" != "$mqtt_domain" ]; then
fi
else
#If no MQTT have been set, we delete the mqtt permission.
[[ "$domain" == "$mqtt_domain" ]] && ynh_permission_delete --permission="mqtt"
ynh_permission_delete --permission="mqtt"
fi
#=================================================