From 6179fd2f1435f96f310c595823b605b67868c5b9 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 13:14:53 +0100 Subject: [PATCH 1/9] Update LICENSE just test for cloning --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2def0e8..6fae7d0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 + Version 3, 19 November 2007 ! Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies From 00771f7c586d3db8d03ee0aa0e3cf49848fa49c9 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 13:29:37 +0100 Subject: [PATCH 2/9] Revert "Update post_user_delete" This reverts commit fe30b2868e943fad0e1314d68b70fa3f5f35d46f --- hooks/post_user_delete | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/post_user_delete b/hooks/post_user_delete index 5a2af87..5ac3e13 100644 --- a/hooks/post_user_delete +++ b/hooks/post_user_delete @@ -2,7 +2,7 @@ source /usr/share/yunohost/helpers user=$1 -app="zabbix" +app="ynhzabbix" db_name=$(ynh_app_setting_get $app db_name) db_user=$(ynh_app_setting_get $app db_user) From 30ae26c3f8dbc447e9dcacd5c8d32b406f6c22ab Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 13:40:00 +0100 Subject: [PATCH 3/9] disable default admin --- scripts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install b/scripts/install index af1def0..a178f90 100644 --- a/scripts/install +++ b/scripts/install @@ -165,6 +165,11 @@ do fi done +#disable default admin +lastid=$(mysql -u$db_user -p$db_pwd $db_name -e "mysql -BN -u root -p zabbix -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, 1);" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From c5df35c9b04f7fa1f9583a247d557248da258505 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 13:46:21 +0100 Subject: [PATCH 4/9] disable default admin #2 --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index a178f90..ee24abe 100644 --- a/scripts/install +++ b/scripts/install @@ -166,7 +166,7 @@ do done #disable default admin -lastid=$(mysql -u$db_user -p$db_pwd $db_name -e "mysql -BN -u root -p zabbix -e "SELECT max(id) from \`users_groups\`"") +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, 1);" From 39e7880769cb81046b5938db3a84e4cef06edf5e Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 13:50:41 +0100 Subject: [PATCH 5/9] Upload the zabbix template file for yunohost --- sources/extra_files/app/Template_Yunohost.xml | 1402 +++++++++++++++++ 1 file changed, 1402 insertions(+) create mode 100644 sources/extra_files/app/Template_Yunohost.xml diff --git a/sources/extra_files/app/Template_Yunohost.xml b/sources/extra_files/app/Template_Yunohost.xml new file mode 100644 index 0000000..f7121a0 --- /dev/null +++ b/sources/extra_files/app/Template_Yunohost.xml @@ -0,0 +1,1402 @@ + + + 4.0 + 2019-01-15T12:48:48Z + + + Templates/Applications + + + + + + + + {Template Yunohost:yunohost.migrations.lastavailable.last()}<>{Template Yunohost:yunohost.migrations.lastinstalled.last()} + 0 + + Yunhost has migration in pending state + 0 + + + 0 + 1 + + 0 + 1 + + + + + {Template Yunohost:yunohost.backups.ageoflastbackup.last()}>=7 + 0 + + Yunhost hasn't backup since 7 days + 0 + + + 0 + 4 + + 0 + 1 + + + + + {Template Yunohost:yunohost.backups.number.last()}=0 + 0 + + Yunhost hasn't backup yet + 0 + + + 0 + 4 + + 0 + 1 + + + + + + + Service state + + + 0 + Down + + + 1 + Up + + + + + Yunohost : certificates + + + 0 + unknown + + + 1 + critical + + + 2 + warning + + + 3 + attention + + + 4 + good + + + 5 + great + + + + + Yunohost : services + + + 0 + inactive + + + 1 + active + + + 2 + unknow + + + 3 + disabled + + + + + From 96dc6fc4fbf8e1be49225edc092d41e79e6a4c0b Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 13:56:56 +0100 Subject: [PATCH 6/9] disable admin user (security issue) --- scripts/upgrade | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 84f1e3f..ed66a8f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,6 +48,21 @@ if [ -z $final_path ]; then ynh_app_setting_set $app final_path $final_path fi +#================================================= +# Disable default admin for security issue +#================================================= +haveDefaultAdminEnabled=$(mysql -BN -u root -psMquHFoRof zabbix -e "SELECT count(id) from \`users_groups\` where userid=1 and usrgrpid=9") + +if [ "$haveDefaultAdminEnabled" -eq 1 ] ;then + echo "Disable default admin" + #disable default admin + 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, 1);" +else + echo "default admin already disabled" +fi + #================================================= # CHECK THE PATH #================================================= From f7f65d15e96e2aca476ec7ca99e70631f4d31812 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 14:02:07 +0100 Subject: [PATCH 7/9] disable default admin #3 --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ed66a8f..de08749 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,9 +51,9 @@ fi #================================================= # Disable default admin for security issue #================================================= -haveDefaultAdminEnabled=$(mysql -BN -u root -psMquHFoRof zabbix -e "SELECT count(id) from \`users_groups\` where userid=1 and usrgrpid=9") +haveDefaultAdminDisabled=$(mysql -BN -u root -psMquHFoRof zabbix -e "SELECT count(id) from \`users_groups\` where userid=1 and usrgrpid=9") -if [ "$haveDefaultAdminEnabled" -eq 1 ] ;then +if [ "$haveDefaultAdminDisabled" -eq 0 ] ;then echo "Disable default admin" #disable default admin lastid=$(mysql -u$db_user -p$db_pwd $db_name -BN -e "SELECT max(id) from \`users_groups\`") From a032a827e467076ae651a6b5aa669afe7d61e1cc Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 14:04:13 +0100 Subject: [PATCH 8/9] delete credentials testing --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index de08749..1698679 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,7 +51,7 @@ fi #================================================= # Disable default admin for security issue #================================================= -haveDefaultAdminDisabled=$(mysql -BN -u root -psMquHFoRof zabbix -e "SELECT count(id) from \`users_groups\` where userid=1 and usrgrpid=9") +haveDefaultAdminDisabled=$(mysql -BN -u$db_user -p$db_pwd $db_name -BN -e "SELECT count(id) from \`users_groups\` where userid=1 and usrgrpid=9") if [ "$haveDefaultAdminDisabled" -eq 0 ] ;then echo "Disable default admin" From 8ede5cb8ddb63dd700bb8451b4f67007946f69d2 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Tue, 15 Jan 2019 14:11:17 +0100 Subject: [PATCH 9/9] disable default admin #4 --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 1698679..e3c7182 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,9 @@ is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) language=$(ynh_app_setting_get $app language) db_name=$(ynh_app_setting_get $app db_name) +db_user=$(ynh_app_setting_get $app db_user) +db_pwd=$(ynh_app_setting_get $app mysqlpwd) + #================================================= # ENSURE DOWNWARD COMPATIBILITY