1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/zabbix_ynh.git synced 2024-09-03 20:36:14 +02:00
This commit is contained in:
ericgaspar 2021-09-11 11:05:12 +02:00
parent 3d25d5c41e
commit 99c06cbdad
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 8 additions and 32 deletions

View file

@ -42,8 +42,6 @@ ynh_script_progression --message="Validating restoration parameters..."
remove_previous_zabbix remove_previous_zabbix
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path " || ynh_die --message="There is already a directory: $final_path "

View file

@ -24,14 +24,6 @@ db_user=$(ynh_app_setting_get --app=$app --key=db_user)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
trustedversion="4.4-1+stretch"
if ynh_permission_has_user --permission=main --user=visitors
then
is_public=0
else
is_public=1
fi
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
@ -148,6 +140,13 @@ fi
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php"
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -168,11 +167,6 @@ then
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
fi fi
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
chmod 750 "/usr/share/zabbix" chmod 750 "/usr/share/zabbix"
chmod -R o-rwx "/usr/share/zabbix" chmod -R o-rwx "/usr/share/zabbix"
chown -R $app:www-data "/usr/share/zabbix" chown -R $app:www-data "/usr/share/zabbix"
@ -205,10 +199,7 @@ ynh_script_progression --message="Setuping application with CURL..."
# Set the app as temporarily public for curl call # Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
# Making the app public for curl # Making the app public for curl
if [ $is_public -eq 0 ] ynh_permission_update --permission="main" --add="visitors"
then
ynh_permission_update --permission="main" --add="visitors"
fi
enable_admin_user enable_admin_user
@ -255,19 +246,6 @@ ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-server --action="restart" --log_path="/var/log/$app/${app}_server.log" ynh_systemd_action --service_name=$app-server --action="restart" --log_path="/var/log/$app/${app}_server.log"
ynh_systemd_action --service_name=$app-agent --action="restart" --log_path="/var/log/$app/${app}_agent.log" ynh_systemd_action --service_name=$app-agent --action="restart" --log_path="/var/log/$app/${app}_agent.log"
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================