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 4da444858..dd464bd31 100755 --- a/Dockerfiles/agent2/alpine/docker-entrypoint.sh +++ b/Dockerfiles/agent2/alpine/docker-entrypoint.sh @@ -207,10 +207,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" } +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 4da444858..dd464bd31 100755 --- a/Dockerfiles/agent2/centos/docker-entrypoint.sh +++ b/Dockerfiles/agent2/centos/docker-entrypoint.sh @@ -207,10 +207,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" } +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 4da444858..dd464bd31 100755 --- a/Dockerfiles/agent2/ol/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ol/docker-entrypoint.sh @@ -207,10 +207,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" } +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 4da444858..dd464bd31 100755 --- a/Dockerfiles/agent2/rhel/docker-entrypoint.sh +++ b/Dockerfiles/agent2/rhel/docker-entrypoint.sh @@ -207,10 +207,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" } +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 4da444858..dd464bd31 100755 --- a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh @@ -207,10 +207,19 @@ prepare_zbx_agent_plugin_config() { update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" } +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 49249fac9..69e109bdf 100755 --- a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh @@ -513,6 +513,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -528,6 +536,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 9f689ecaa..e59e63895 100755 --- a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh @@ -510,6 +510,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -525,6 +533,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 9f689ecaa..e59e63895 100755 --- a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh @@ -510,6 +510,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -525,6 +533,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 9f689ecaa..e59e63895 100755 --- a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh @@ -510,6 +510,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -525,6 +533,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 a483f0e92..e999c9797 100755 --- a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh @@ -510,6 +510,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -525,6 +533,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 ed5a049cf..984ea8fdb 100755 --- a/Dockerfiles/proxy-sqlite3/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/alpine/docker-entrypoint.sh @@ -259,10 +259,19 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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 ed5a049cf..984ea8fdb 100755 --- a/Dockerfiles/proxy-sqlite3/centos/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/centos/docker-entrypoint.sh @@ -259,10 +259,19 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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 ed5a049cf..984ea8fdb 100755 --- a/Dockerfiles/proxy-sqlite3/ol/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/ol/docker-entrypoint.sh @@ -259,10 +259,19 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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 ed5a049cf..984ea8fdb 100755 --- a/Dockerfiles/proxy-sqlite3/rhel/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/rhel/docker-entrypoint.sh @@ -259,10 +259,19 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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 f08950f3b..35d51e022 100755 --- a/Dockerfiles/proxy-sqlite3/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/proxy-sqlite3/ubuntu/docker-entrypoint.sh @@ -259,10 +259,19 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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 f3b27bca3..a76b1cffe 100755 --- a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh @@ -563,6 +563,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -578,6 +586,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 ab4de8033..a8565f493 100755 --- a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh @@ -560,6 +560,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -575,6 +583,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 ab4de8033..a8565f493 100755 --- a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh @@ -560,6 +560,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -575,6 +583,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 ab4de8033..a8565f493 100755 --- a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh @@ -560,6 +560,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -575,6 +583,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 8d898397f..254389bb9 100755 --- a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh @@ -560,6 +560,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -575,6 +583,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 a62cd0118..da20d5e6c 100755 --- a/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh @@ -580,6 +580,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -594,6 +602,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 a62cd0118..da20d5e6c 100755 --- a/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh @@ -580,6 +580,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -594,6 +602,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 a62cd0118..da20d5e6c 100755 --- a/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh @@ -580,6 +580,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -594,6 +602,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 a62cd0118..da20d5e6c 100755 --- a/Dockerfiles/server-pgsql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/rhel/docker-entrypoint.sh @@ -580,6 +580,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -594,6 +602,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 33c740d0b..5b4d238b7 100755 --- a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh @@ -580,6 +580,14 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartBrowserPollers" "${ZBX_STARTBROWSERPOLLERS}" } +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" @@ -594,6 +602,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 } #################################################