mirror of
https://github.com/YunoHost-Apps/zabbix_ynh.git
synced 2024-09-03 20:36:14 +02:00
Merge branch 'testing' into 'master'
Fix issue with admin user See merge request Mickael-Martin/zabbix_ynh!6
This commit is contained in:
commit
693713535e
5 changed files with 1427 additions and 2 deletions
2
LICENSE
2
LICENSE
|
@ -1,5 +1,5 @@
|
||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
Version 3, 19 November 2007
|
Version 3, 19 November 2007 !
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
user=$1
|
user=$1
|
||||||
app="zabbix"
|
app="ynhzabbix"
|
||||||
|
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
db_user=$(ynh_app_setting_get $app db_user)
|
db_user=$(ynh_app_setting_get $app db_user)
|
||||||
|
|
|
@ -165,6 +165,11 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,6 +22,9 @@ is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
language=$(ynh_app_setting_get $app language)
|
language=$(ynh_app_setting_get $app language)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
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
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
@ -48,6 +51,21 @@ if [ -z $final_path ]; then
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
fi
|
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
|
# CHECK THE PATH
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
1402
sources/extra_files/app/Template_Yunohost.xml
Normal file
1402
sources/extra_files/app/Template_Yunohost.xml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue