diff --git a/README.md b/README.md index 05a9156..fd1a450 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Integration level](https://dash.yunohost.org/integration/zabbix.svg)](https://dash.yunohost.org/appci/app/zabbix) +[![Install zabbix with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=zabbix) > *This package allow you to install zabbix quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* diff --git a/check_process b/check_process index 8c0af72..e06dd2e 100644 --- a/check_process +++ b/check_process @@ -32,7 +32,7 @@ # https://framagit.org/Mickael-Martin/zabbix_ynh/blob/master/scripts/install#L141 Level 4=1 Level 5=auto - Level 6=auto + Level 6=1 Level 7=auto Level 8=0 Level 9=0 diff --git a/manifest.json b/manifest.json index 4381359..79ff7ad 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "YunoHost port for Zabbix", "fr": "Zabbix pour Yunohost" }, - "version": "1.0~ynh1", + "version": "1.2", "url": "https://framagit.org/Mickael-Martin/zabbix_ynh", "license": "free", "maintainer": { diff --git a/scripts/install b/scripts/install index 0b69a65..d060113 100644 --- a/scripts/install +++ b/scripts/install @@ -168,6 +168,11 @@ do fi done +#disable default guest +lastid=$(mysql -u$db_user -p$db_pwd $db_name -BN -e "SELECT max(id) from \`users_groups\`") +lastid=$(($lastid + 1 )) +mysql -u$db_user -p$db_pwd $db_name -e "INSERT INTO \`users_groups\` (\`id\` , \`usrgrpid\`, \`userid\`) VALUES ($lastid ,9, 2);" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -346,7 +351,8 @@ yunohost service add zabbix-agent -d "Management of Zabbix Agent" ### - And the section "SETUP LOGROTATE" in the upgrade script # Use logrotate to manage application logfile(s) -ynh_use_logrotate +#native logrotate because install officials packages. +#ynh_use_logrotate #================================================= # ADVERTISE SERVICE IN ADMIN PANEL diff --git a/scripts/upgrade b/scripts/upgrade index 9acf0ca..2215534 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -158,6 +158,21 @@ else fi +#================================================= +# Disable default guest for security issue +#================================================= +haveDefaultGuestDisabled=$(mysql -BN -u$db_user -p$db_pwd $db_name -BN -e "SELECT count(id) from \`users_groups\` where userid=2 and usrgrpid=9") + +if [ "$haveDefaultGuestDisabled" -eq 0 ] ;then + echo "Disable default guest" + #disable default guest + lastid=$(mysql -u$db_user -p$db_pwd $db_name -BN -e "SELECT max(id) from \`users_groups\`") + lastid=$(($lastid + 1 )) + mysql -u$db_user -p$db_pwd $db_name -e "INSERT INTO \`users_groups\` (\`id\` , \`usrgrpid\`, \`userid\`) VALUES ($lastid ,9, 2);" +else + echo "default guest already disabled" +fi + #================================================= # CHECK THE PATH #================================================= @@ -171,6 +186,9 @@ path_url=$(ynh_normalize_url_path $path_url) ynh_print_info "Check if new zabbix version is available on repo" ynh_package_update +#REMOVE DUPLICATE LOG ENTRY IN LOGROTATE PATCH IF NEEDED +ynh_remove_logrotate + zabbixServerInstalledVersion=$(apt-cache policy zabbix-server-mysql | grep -Po "Installed: \K(.*)") zabbixServerCandidateVersion=$(apt-cache policy zabbix-server-mysql | grep -Po "Candidate: \K(.*)")