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 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) diff --git a/scripts/install b/scripts/install index af1def0..ee24abe 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 -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);" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 84f1e3f..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 @@ -48,6 +51,21 @@ if [ -z $final_path ]; then ynh_app_setting_set $app final_path $final_path fi +#================================================= +# Disable default admin for security issue +#================================================= +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" + #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 #================================================= 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 + + + + +