diff --git a/Dockerfiles/agent/alpine/docker-entrypoint.sh b/Dockerfiles/agent/alpine/docker-entrypoint.sh index 27ffc6fd3..192efda4f 100755 --- a/Dockerfiles/agent/alpine/docker-entrypoint.sh +++ b/Dockerfiles/agent/alpine/docker-entrypoint.sh @@ -202,9 +202,18 @@ prepare_zbx_agent_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent/centos/docker-entrypoint.sh b/Dockerfiles/agent/centos/docker-entrypoint.sh index 27ffc6fd3..192efda4f 100755 --- a/Dockerfiles/agent/centos/docker-entrypoint.sh +++ b/Dockerfiles/agent/centos/docker-entrypoint.sh @@ -202,9 +202,18 @@ prepare_zbx_agent_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent/ol/docker-entrypoint.sh b/Dockerfiles/agent/ol/docker-entrypoint.sh index 27ffc6fd3..192efda4f 100755 --- a/Dockerfiles/agent/ol/docker-entrypoint.sh +++ b/Dockerfiles/agent/ol/docker-entrypoint.sh @@ -202,9 +202,18 @@ prepare_zbx_agent_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent/rhel/docker-entrypoint.sh b/Dockerfiles/agent/rhel/docker-entrypoint.sh index 27ffc6fd3..192efda4f 100755 --- a/Dockerfiles/agent/rhel/docker-entrypoint.sh +++ b/Dockerfiles/agent/rhel/docker-entrypoint.sh @@ -202,9 +202,18 @@ prepare_zbx_agent_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent/ubuntu/docker-entrypoint.sh b/Dockerfiles/agent/ubuntu/docker-entrypoint.sh index 27ffc6fd3..192efda4f 100755 --- a/Dockerfiles/agent/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/agent/ubuntu/docker-entrypoint.sh @@ -202,9 +202,18 @@ prepare_zbx_agent_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent2/alpine/docker-entrypoint.sh b/Dockerfiles/agent2/alpine/docker-entrypoint.sh index ee254fc35..a9e4bda60 100755 --- a/Dockerfiles/agent2/alpine/docker-entrypoint.sh +++ b/Dockerfiles/agent2/alpine/docker-entrypoint.sh @@ -206,10 +206,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config prepare_zbx_agent_plugin_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent2/centos/docker-entrypoint.sh b/Dockerfiles/agent2/centos/docker-entrypoint.sh index ee254fc35..a9e4bda60 100755 --- a/Dockerfiles/agent2/centos/docker-entrypoint.sh +++ b/Dockerfiles/agent2/centos/docker-entrypoint.sh @@ -206,10 +206,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config prepare_zbx_agent_plugin_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent2/ol/docker-entrypoint.sh b/Dockerfiles/agent2/ol/docker-entrypoint.sh index ee254fc35..a9e4bda60 100755 --- a/Dockerfiles/agent2/ol/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ol/docker-entrypoint.sh @@ -206,10 +206,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config prepare_zbx_agent_plugin_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent2/rhel/docker-entrypoint.sh b/Dockerfiles/agent2/rhel/docker-entrypoint.sh index ee254fc35..a9e4bda60 100755 --- a/Dockerfiles/agent2/rhel/docker-entrypoint.sh +++ b/Dockerfiles/agent2/rhel/docker-entrypoint.sh @@ -206,10 +206,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config prepare_zbx_agent_plugin_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh index ee254fc35..a9e4bda60 100755 --- a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh @@ -206,10 +206,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_agent() { echo "** Preparing Zabbix agent" prepare_zbx_agent_config prepare_zbx_agent_plugin_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh index 9a03474bd..6366dc772 100755 --- a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh @@ -499,6 +499,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -514,6 +522,7 @@ prepare_proxy() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh index cb86d1b3d..d1d03addd 100755 --- a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh @@ -496,6 +496,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -511,6 +519,7 @@ prepare_proxy() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh index cb86d1b3d..d1d03addd 100755 --- a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh @@ -496,6 +496,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -511,6 +519,7 @@ prepare_proxy() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh index cb86d1b3d..d1d03addd 100755 --- a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh @@ -496,6 +496,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -511,6 +519,7 @@ prepare_proxy() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh index 7cbb32639..66fc6f117 100755 --- a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh @@ -496,6 +496,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -511,6 +519,7 @@ prepare_proxy() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-sqlite3/alpine/docker-entrypoint.sh b/Dockerfiles/proxy-sqlite3/alpine/docker-entrypoint.sh index 4a4552ff7..e551aea25 100755 --- a/Dockerfiles/proxy-sqlite3/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/alpine/docker-entrypoint.sh @@ -246,10 +246,19 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_proxy() { echo "Preparing Zabbix proxy" update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-sqlite3/centos/docker-entrypoint.sh b/Dockerfiles/proxy-sqlite3/centos/docker-entrypoint.sh index 4a4552ff7..e551aea25 100755 --- a/Dockerfiles/proxy-sqlite3/centos/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/centos/docker-entrypoint.sh @@ -246,10 +246,19 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_proxy() { echo "Preparing Zabbix proxy" update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-sqlite3/ol/docker-entrypoint.sh b/Dockerfiles/proxy-sqlite3/ol/docker-entrypoint.sh index 4a4552ff7..e551aea25 100755 --- a/Dockerfiles/proxy-sqlite3/ol/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/ol/docker-entrypoint.sh @@ -246,10 +246,19 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_proxy() { echo "Preparing Zabbix proxy" update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-sqlite3/rhel/docker-entrypoint.sh b/Dockerfiles/proxy-sqlite3/rhel/docker-entrypoint.sh index 4a4552ff7..e551aea25 100755 --- a/Dockerfiles/proxy-sqlite3/rhel/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/rhel/docker-entrypoint.sh @@ -246,10 +246,19 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_proxy() { echo "Preparing Zabbix proxy" update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/proxy-sqlite3/ubuntu/docker-entrypoint.sh b/Dockerfiles/proxy-sqlite3/ubuntu/docker-entrypoint.sh index 179cc72c0..0964de3a9 100755 --- a/Dockerfiles/proxy-sqlite3/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/ubuntu/docker-entrypoint.sh @@ -246,10 +246,19 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_proxy() { echo "Preparing Zabbix proxy" update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh index 09a6107e1..e0e1db0c7 100755 --- a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh @@ -550,6 +550,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -565,6 +573,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh index 6462df4d5..8df2036a6 100755 --- a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh @@ -547,6 +547,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -562,6 +570,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh index 6462df4d5..8df2036a6 100755 --- a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh @@ -547,6 +547,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -562,6 +570,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh index 6462df4d5..8df2036a6 100755 --- a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh @@ -547,6 +547,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -562,6 +570,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh index f2610101a..95d610fe8 100755 --- a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh @@ -547,6 +547,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|MYSQL)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -562,6 +570,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh index 394fb0d04..940fa1ddc 100755 --- a/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh @@ -567,6 +567,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|POSTGRES)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -581,6 +589,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh index 394fb0d04..940fa1ddc 100755 --- a/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh @@ -567,6 +567,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|POSTGRES)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -581,6 +589,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh index 394fb0d04..940fa1ddc 100755 --- a/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh @@ -567,6 +567,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|POSTGRES)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -581,6 +589,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-pgsql/rhel/docker-entrypoint.sh b/Dockerfiles/server-pgsql/rhel/docker-entrypoint.sh index 55862501b..f0e7deed0 100755 --- a/Dockerfiles/server-pgsql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/rhel/docker-entrypoint.sh @@ -573,6 +573,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|POSTGRES)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -587,6 +595,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh index ff28d1d4d..cee63d607 100755 --- a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh @@ -567,6 +567,14 @@ update_zbx_config() { fi } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^(ZBX|DB|POSTGRES)_"); do + unset "${env_var%%=*}" + done +} + prepare_db() { echo "** Preparing database" @@ -581,6 +589,7 @@ prepare_server() { prepare_db update_zbx_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/web-service/alpine/docker-entrypoint.sh b/Dockerfiles/web-service/alpine/docker-entrypoint.sh index f9a2879bc..4ba72eeab 100755 --- a/Dockerfiles/web-service/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-service/alpine/docker-entrypoint.sh @@ -109,9 +109,18 @@ prepare_zbx_web_service_config() { update_config_var $ZBX_CONFIG "IgnoreURLCertErrors" "${ZBX_IGNOREURLCERTERRORS}" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_web_service() { echo "** Preparing Zabbix web service" prepare_zbx_web_service_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/web-service/centos/docker-entrypoint.sh b/Dockerfiles/web-service/centos/docker-entrypoint.sh index f9a2879bc..4ba72eeab 100755 --- a/Dockerfiles/web-service/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-service/centos/docker-entrypoint.sh @@ -109,9 +109,18 @@ prepare_zbx_web_service_config() { update_config_var $ZBX_CONFIG "IgnoreURLCertErrors" "${ZBX_IGNOREURLCERTERRORS}" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_web_service() { echo "** Preparing Zabbix web service" prepare_zbx_web_service_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/web-service/ol/docker-entrypoint.sh b/Dockerfiles/web-service/ol/docker-entrypoint.sh index f9a2879bc..4ba72eeab 100755 --- a/Dockerfiles/web-service/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-service/ol/docker-entrypoint.sh @@ -109,9 +109,18 @@ prepare_zbx_web_service_config() { update_config_var $ZBX_CONFIG "IgnoreURLCertErrors" "${ZBX_IGNOREURLCERTERRORS}" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_web_service() { echo "** Preparing Zabbix web service" prepare_zbx_web_service_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/web-service/rhel/docker-entrypoint.sh b/Dockerfiles/web-service/rhel/docker-entrypoint.sh index f9a2879bc..4ba72eeab 100755 --- a/Dockerfiles/web-service/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-service/rhel/docker-entrypoint.sh @@ -109,9 +109,18 @@ prepare_zbx_web_service_config() { update_config_var $ZBX_CONFIG "IgnoreURLCertErrors" "${ZBX_IGNOREURLCERTERRORS}" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_web_service() { echo "** Preparing Zabbix web service" prepare_zbx_web_service_config + clear_zbx_env } ################################################# diff --git a/Dockerfiles/web-service/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-service/ubuntu/docker-entrypoint.sh index f9a2879bc..4ba72eeab 100755 --- a/Dockerfiles/web-service/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-service/ubuntu/docker-entrypoint.sh @@ -109,9 +109,18 @@ prepare_zbx_web_service_config() { update_config_var $ZBX_CONFIG "IgnoreURLCertErrors" "${ZBX_IGNOREURLCERTERRORS}" } +clear_zbx_env() { + [[ "${ZBX_CLEAR_ENV}" == "false" ]] && return + + for env_var in $(env | grep -E "^ZBX_"); do + unset "${env_var%%=*}" + done +} + prepare_web_service() { echo "** Preparing Zabbix web service" prepare_zbx_web_service_config + clear_zbx_env } #################################################