Unset default value for GITLAB_MONITORING_IP_WHITELIST

On upstream, expected default value is `127.0.0.1/8`
and it is already listed in corresponding configuration.
`GITLAB_MONITORING_IP_WHITELIST` is used to allow monitoring from hosts other than loopback (localhost).

So just unset default value for it.
If the value is not set, the line specifying this "additional" IP range will be removed.
This commit is contained in:
Kazunori Kimura 2024-09-20 12:03:56 +09:00 committed by Steven Achilles
parent b321150da5
commit 5e97a14f89
3 changed files with 6 additions and 2 deletions

View File

@ -1611,7 +1611,7 @@ Time between sampling of unicorn socket metrics, in seconds, defaults to `10`
##### `GITLAB_MONITORING_IP_WHITELIST`
IP whitelist to access monitoring endpoints, defaults to `0.0.0.0/8`
IP whitelist to access monitoring endpoints. No defaults.
##### `GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED`

View File

@ -629,7 +629,7 @@ GITLAB_SHELL_CUSTOM_HOOKS_DIR=${GITLAB_SHELL_CUSTOM_HOOKS_DIR:-"$GITLAB_SHELL_IN
## MONITORING
GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL=${GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL:-10}
GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-"0.0.0.0/8"}
GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED:-true}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS:-"0.0.0.0"}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT:-3807}

View File

@ -351,6 +351,10 @@ gitlab_configure_gitaly() {
gitlab_configure_monitoring() {
echo "Configuring gitlab::monitoring..."
if [ "${GITLAB_MONITORING_IP_WHITELIST}" == "" ]; then
exec_as_git sed -i "/{{GITLAB_MONITORING_IP_WHITELIST}}/d" ${GITLAB_CONFIG}
fi
update_template ${GITLAB_CONFIG} \
GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL \
GITLAB_MONITORING_IP_WHITELIST \