Ignore case for boolean vars

This commit is contained in:
Alexey Pustovalov
2021-04-13 06:07:14 -04:00
83 changed files with 520 additions and 409 deletions

View File

@ -14,10 +14,10 @@ Zabbix web interface is a part of Zabbix software. It is used to manage resource
# Zabbix web interface images
These are the only official Zabbix web interface Docker images. They are based on Alpine Linux v3.11, Ubuntu 18.04 (bionic) and CentOS 7 images. The available versions of Zabbix web interface are:
These are the only official Zabbix web interface Docker images. They are based on Alpine Linux v3.12, Ubuntu 20.04 (focal) and CentOS 8 images. The available versions of Zabbix web interface are:
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest)
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*)
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) (unsupported)
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) (unsupported)
Zabbix web interface 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported)
Zabbix web interface 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported)
Zabbix web interface 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported)

View File

@ -5,7 +5,7 @@ set -o pipefail
set +e
# Script trace mode
if [ "${DEBUG_MODE}" == "true" ]; then
if [ "${DEBUG_MODE,,}" == "true" ]; then
set -o xtrace
fi
@ -66,17 +66,17 @@ check_variables() {
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then
if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then
echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password"
exit 1
fi
if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then
if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then
echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty"
exit 1
fi
if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then
if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then
USE_DB_ROOT_USER=true
DB_SERVER_ROOT_USER="root"
DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""}
@ -86,7 +86,7 @@ check_variables() {
# If root password is not specified use provided credentials
: ${DB_SERVER_ROOT_USER:=${MYSQL_USER}}
[ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}}
[ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}}
DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"}
DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"}
@ -96,7 +96,7 @@ check_variables() {
db_tls_params() {
local result=""
if [ "${ZBX_DB_ENCRYPTION}" == "true" ]; then
if [ "${ZBX_DB_ENCRYPTION,,}" == "true" ]; then
result="--ssl-mode=required"
if [ -n "${ZBX_DB_CA_FILE}" ]; then
@ -120,7 +120,7 @@ check_db_connect() {
echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}"
echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}"
echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}"
if [ "${DEBUG_MODE}" == "true" ]; then
if [ "${DEBUG_MODE,,}" == "true" ]; then
if [ "${USE_DB_ROOT_USER}" == "true" ]; then
echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}"
echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}"
@ -180,7 +180,8 @@ prepare_zbx_web_config() {
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
fi
export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"}
ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"}
export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,}
export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"}
export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."}
@ -202,13 +203,16 @@ prepare_zbx_web_config() {
export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
export ZBX_SERVER_NAME=${ZBX_SERVER_NAME}
export ZBX_DB_ENCRYPTION=${ZBX_DB_ENCRYPTION:-"false"}
ZBX_DB_ENCRYPTION=${ZBX_DB_ENCRYPTION:-"false"}
export ZBX_DB_ENCRYPTION=${ZBX_DB_ENCRYPTION,,}
export ZBX_DB_KEY_FILE=${ZBX_DB_KEY_FILE}
export ZBX_DB_CERT_FILE=${ZBX_DB_CERT_FILE}
export ZBX_DB_CA_FILE=${ZBX_DB_CA_FILE}
export ZBX_DB_VERIFY_HOST=${ZBX_DB_VERIFY_HOST-"false"}
ZBX_DB_VERIFY_HOST=${ZBX_DB_VERIFY_HOST:-"false"}
export ZBX_DB_VERIFY_HOST=${ZBX_DB_VERIFY_HOST,,}
export DB_DOUBLE_IEEE754=${DB_DOUBLE_IEEE754:-"true"}
DB_DOUBLE_IEEE754=${DB_DOUBLE_IEEE754:-"true"}
export DB_DOUBLE_IEEE754=${DB_DOUBLE_IEEE754,,}
export ZBX_HISTORYSTORAGEURL=${ZBX_HISTORYSTORAGEURL}
export ZBX_HISTORYSTORAGETYPES=${ZBX_HISTORYSTORAGETYPES:-"[]"}
@ -232,7 +236,9 @@ prepare_zbx_web_config() {
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi
if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then
ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"}
if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \
"/etc/nginx/nginx.conf"