Added secrets for Zabbix images

This commit is contained in:
Alexey Pustovalov 2019-07-14 00:50:22 +03:00
parent be195c5861
commit 20cfe04184
54 changed files with 1814 additions and 117 deletions

1
.MYSQL_PASSWORD Normal file
View File

@ -0,0 +1 @@
zabbix

1
.MYSQL_ROOT_PASSWORD Normal file
View File

@ -0,0 +1 @@
root_pwd

1
.MYSQL_USER Normal file
View File

@ -0,0 +1 @@
zabbix

1
.POSTGRES_PASSWORD Normal file
View File

@ -0,0 +1 @@
zabbix

1
.POSTGRES_USER Normal file
View File

@ -0,0 +1 @@
zabbix

View File

@ -1,11 +1,14 @@
# DB_SERVER_HOST=mysql-server
# DB_SERVER_PORT=3306
# MYSQL_USER=zabbix
MYSQL_USER=zabbix
# MYSQL_USER=zabbix
MYSQL_USER_FILE=/run/secrets/MYSQL_USER
# MYSQL_PASSWORD=zabbix
MYSQL_PASSWORD=zabbix
# MYSQL_PASSWORD=zabbix
MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD
# MYSQL_ROOT_PASSWORD=
MYSQL_ROOT_PASSWORD=root_pwd
# MYSQL_ROOT_PASSWORD=root_pwd
MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
# MYSQL_ALLOW_EMPTY_PASSWORD=false
# MYSQL_DATABASE=zabbix
MYSQL_DATABASE=zabbix

View File

@ -2,10 +2,13 @@
# DB_SERVER_PORT=3306
# MYSQL_USER=zabbix
MYSQL_USER=zabbix
# MYSQL_USER_FILE=/run/secrets/MYSQL_USER
# MYSQL_PASSWORD=zabbix
MYSQL_PASSWORD=zabbix
# MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD
# MYSQL_ROOT_PASSWORD=
MYSQL_ROOT_PASSWORD=root_pwd
# MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
# MYSQL_ALLOW_EMPTY_PASSWORD=false
# MYSQL_DATABASE=zabbix_proxy
MYSQL_DATABASE=zabbix_proxy

View File

@ -2,8 +2,10 @@
# DB_SERVER_PORT=5432
# POSTGRES_USER=zabbix
POSTGRES_USER=zabbix
# POSTGRES_USER_FILE=/run/secrets/POSTGRES_USER
# POSTGRES_PASSWORD=zabbix
POSTGRES_PASSWORD=zabbix
# POSTGRES_PASSWORD_FILE=/run/secrets/POSTGRES_PASSWORD
# POSTGRES_DB=zabbix
POSTGRES_DB=zabbix
# DB_SERVER_SCHEMA=public

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -33,6 +33,10 @@ services:
env_file:
- .env_db_mysql
- .env_srv
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -56,7 +60,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "alpine"
@ -107,7 +111,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "alpine"
@ -160,7 +164,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "alpine"
@ -188,6 +192,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -210,7 +217,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "mysql"
@ -239,6 +246,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -261,7 +271,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "mysql"
@ -303,7 +313,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "alpine"
@ -330,7 +340,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "alpine"
@ -357,7 +367,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -368,6 +378,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -400,3 +414,11 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD

View File

@ -37,6 +37,10 @@ services:
env_file:
- .env_db_mysql
- .env_srv
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -60,7 +64,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "alpine"
@ -115,7 +119,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "alpine"
@ -172,7 +176,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "alpine"
@ -204,6 +208,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -226,7 +233,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "mysql"
@ -259,6 +266,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -281,7 +291,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "mysql"
@ -327,7 +337,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "alpine"
@ -358,7 +368,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "alpine"
@ -389,7 +399,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -400,6 +410,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -432,3 +446,11 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD

View File

@ -33,6 +33,9 @@ services:
env_file:
- .env_db_pgsql
- .env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -56,7 +59,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "alpine"
@ -107,7 +110,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "alpine"
@ -145,6 +148,10 @@ services:
- .env_db_mysql_proxy
- .env_prx
- .env_prx_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -160,7 +167,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "alpine"
@ -188,6 +195,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -210,7 +220,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "pgsql"
@ -239,6 +249,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -261,7 +274,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
@ -303,7 +316,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "alpine"
@ -330,7 +343,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "alpine"
@ -357,7 +370,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -368,6 +381,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -383,6 +400,9 @@ services:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- .env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -420,3 +440,15 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD
POSTGRES_USER:
file: ./.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./.POSTGRES_PASSWORD

View File

@ -37,6 +37,9 @@ services:
env_file:
- .env_db_pgsql
- .env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -60,7 +63,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "alpine"
@ -115,7 +118,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "alpine"
@ -157,6 +160,10 @@ services:
- .env_db_mysql_proxy
- .env_prx
- .env_prx_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -172,7 +179,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "alpine"
@ -205,6 +212,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -227,7 +237,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "pgsql"
@ -260,6 +270,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -282,7 +295,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
@ -328,7 +341,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "alpine"
@ -359,7 +372,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "alpine"
@ -390,7 +403,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -401,6 +414,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -416,6 +433,9 @@ services:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- .env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -453,3 +473,15 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD
POSTGRES_USER:
file: ./.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./.POSTGRES_PASSWORD

View File

@ -33,6 +33,10 @@ services:
env_file:
- .env_db_mysql
- .env_srv
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -56,7 +60,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "centos"
@ -107,7 +111,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "centos"
@ -160,7 +164,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "centos"
@ -188,6 +192,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -210,7 +217,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "mysql"
@ -239,6 +246,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -261,7 +271,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "mysql"
@ -303,7 +313,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "centos"
@ -330,7 +340,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "centos"
@ -357,7 +367,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -368,6 +378,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -400,3 +414,11 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD

View File

@ -37,6 +37,10 @@ services:
env_file:
- .env_db_mysql
- .env_srv
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -60,7 +64,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "centos"
@ -115,7 +119,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "centos"
@ -172,7 +176,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "centos"
@ -204,6 +208,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -226,7 +233,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "mysql"
@ -259,6 +266,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -281,7 +291,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "mysql"
@ -327,7 +337,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "centos"
@ -358,7 +368,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "centos"
@ -389,7 +399,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -400,6 +410,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -432,3 +446,11 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD

View File

@ -33,6 +33,9 @@ services:
env_file:
- .env_db_pgsql
- .env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -56,7 +59,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "centos"
@ -107,7 +110,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "centos"
@ -145,6 +148,10 @@ services:
- .env_db_mysql_proxy
- .env_prx
- .env_prx_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -160,7 +167,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "centos"
@ -188,6 +195,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -210,7 +220,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "pgsql"
@ -239,6 +249,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -261,7 +274,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
@ -303,7 +316,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "centos"
@ -330,7 +343,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "centos"
@ -357,7 +370,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -368,6 +381,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -383,6 +400,9 @@ services:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- .env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -420,3 +440,15 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD
POSTGRES_USER:
file: ./.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./.POSTGRES_PASSWORD

View File

@ -34,6 +34,9 @@ services:
env_file:
- .env_db_pgsql
- .env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -57,7 +60,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "centos"
@ -109,7 +112,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "centos"
@ -148,6 +151,10 @@ services:
- .env_db_mysql_proxy
- .env_prx
- .env_prx_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -163,7 +170,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "centos"
@ -193,6 +200,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -215,7 +225,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "pgsql"
@ -245,6 +255,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -267,7 +280,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
@ -310,7 +323,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "centos"
@ -338,7 +351,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "centos"
@ -369,7 +382,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -380,6 +393,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -395,6 +412,9 @@ services:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- .env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -432,3 +452,15 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD
POSTGRES_USER:
file: ./.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./.POSTGRES_PASSWORD

View File

@ -32,6 +32,10 @@ services:
env_file:
- .env_db_mysql
- .env_srv
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -184,6 +188,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -234,6 +241,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -362,6 +372,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -394,3 +408,11 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD

View File

@ -36,6 +36,10 @@ services:
env_file:
- .env_db_mysql
- .env_srv
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -200,6 +204,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -254,6 +261,9 @@ services:
env_file:
- .env_db_mysql
- .env_web
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
user: root
depends_on:
- mysql-server
@ -394,6 +404,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -426,3 +440,11 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD

View File

@ -32,6 +32,9 @@ services:
env_file:
- .env_db_pgsql
- .env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -55,7 +58,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "ubuntu"
@ -105,7 +108,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "ubuntu"
@ -142,6 +145,10 @@ services:
- .env_db_mysql_proxy
- .env_prx
- .env_prx_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -157,7 +164,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "ubuntu"
@ -184,6 +191,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -206,7 +216,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "pgsql"
@ -234,6 +244,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -256,7 +269,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
@ -297,7 +310,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "ubuntu"
@ -324,7 +337,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "ubuntu"
@ -351,7 +364,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -362,6 +375,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -377,6 +394,9 @@ services:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- .env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -414,3 +434,15 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD
POSTGRES_USER:
file: ./.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./.POSTGRES_PASSWORD

View File

@ -33,6 +33,9 @@ services:
env_file:
- .env_db_pgsql
- .env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -56,7 +59,7 @@ services:
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "ubuntu"
@ -107,7 +110,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with SQLite3 database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "sqlite3"
com.zabbix.os: "ubuntu"
@ -145,6 +148,10 @@ services:
- .env_db_mysql_proxy
- .env_prx
- .env_prx_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
depends_on:
- mysql-server
@ -160,7 +167,7 @@ services:
stop_grace_period: 30s
labels:
com.zabbix.description: "Zabbix proxy with MySQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-proxy"
com.zabbix.dbtype: "mysql"
com.zabbix.os: "ubuntu"
@ -189,6 +196,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -211,7 +221,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Apache web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "apache2"
com.zabbix.dbtype: "pgsql"
@ -240,6 +250,9 @@ services:
env_file:
- .env_db_pgsql
- .env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
depends_on:
- postgres-server
@ -262,7 +275,7 @@ services:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
@ -304,7 +317,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "ubuntu"
@ -332,7 +345,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix Java Gateway"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "java-gateway"
com.zabbix.os: "ubuntu"
@ -360,7 +373,7 @@ services:
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix snmptraps"
com.zabbix.company: "Zabbix SIA"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "snmptraps"
com.zabbix.os: "ubuntu"
@ -371,6 +384,10 @@ services:
- ./zbx_env/var/lib/mysql:/var/lib/mysql:rw
env_file:
- .env_db_mysql
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -386,6 +403,9 @@ services:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- .env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
user: root
stop_grace_period: 1m
networks:
@ -423,3 +443,15 @@ networks:
driver: default
config:
- subnet: 172.16.239.0/24
secrets:
MYSQL_USER:
file: ./.MYSQL_USER
MYSQL_PASSWORD:
file: ./.MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD:
file: ./.MYSQL_ROOT_PASSWORD
POSTGRES_USER:
file: ./.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./.POSTGRES_PASSWORD

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}

View File

@ -38,6 +38,37 @@ ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
# (will allow for "$MYSQL_PASSWORD_FILE" to fill in the value of "$MYSQL_PASSWORD" from a file)
# unsets the VAR_FILE afterwards and just leaving VAR
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local defaultValue="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo "**** Both variables $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$defaultValue"
if [ "${!var:-}" ]; then
val="${!var}"
echo "** Using ${var} variable from ENV"
elif [ "${!fileVar:-}" ]; then
if [ ! -f "${!fileVar}" ]; then
echo "**** Secret file \"${!fileVar}\" is not found"
exit 1
fi
val="$(< "${!fileVar}")"
echo "** Using ${var} variable from secret file"
fi
export "$var"="$val"
unset "$fileVar"
}
configure_db_mysql() {
[ "${DB_SERVER_HOST}" != "localhost" ] && return
@ -138,7 +169,7 @@ escape_spec_char() {
var_value="${var_value//\[/\\[}"
var_value="${var_value//\]/\\]}"
echo $var_value
echo "$var_value"
}
update_config_var() {
@ -213,6 +244,12 @@ check_variables_mysql() {
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false
file_env MYSQL_USER
file_env MYSQL_PASSWORD
if [ "$type" != "" ]; then
file_env MYSQL_ROOT_PASSWORD
fi
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"
@ -249,6 +286,9 @@ check_variables_mysql() {
check_variables_postgresql() {
local type=$1
file_env POSTGRES_USER
file_env POSTGRES_PASSWORD
DB_SERVER_HOST=${DB_SERVER_HOST:-"postgres-server"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"5432"}
CREATE_ZBX_DB_USER=${CREATE_ZBX_DB_USER:-"false"}