Просмотр исходного кода

Merge branch 'master' into 'testing'

Master

See merge request Mickael-Martin/zabbix_ynh!12
Mickael-Martin 7 лет назад
Родитель
Сommit
3a6cedc4c2
5 измененных файлов с 29 добавлено и 3 удалено
  1. 2 0
      README.md
  2. 1 1
      check_process
  3. 1 1
      manifest.json
  4. 7 1
      scripts/install
  5. 18 0
      scripts/upgrade

+ 2 - 0
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.*
 

+ 1 - 1
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

+ 1 - 1
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": {

+ 7 - 1
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

+ 18 - 0
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(.*)")