From e4505c36badc73850a50bcb233e90ade6d3359a9 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Sat, 4 Oct 2025 12:21:36 +0700 Subject: [PATCH 1/5] fix: geoip standalone script should check on CONTAINER_ENGINE variable first Closes https://github.com/getsentry/self-hosted/issues/3953 --- install/geoip.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/install/geoip.sh b/install/geoip.sh index 0d1b2efc0aa..a1e4400d9e8 100644 --- a/install/geoip.sh +++ b/install/geoip.sh @@ -1,3 +1,15 @@ +# If `$CONTAINER_ENGINE` is not set, we assume that we are running this script independently +# to update the geoip database as written on the documentation. +# Therefore we need to `source _detect-container-engine.sh` to detect the container engine. +if [[ -z "$CONTAINER_ENGINE" ]]; then + if [[ -f "install/_detect-container-engine.sh" ]]; then + source install/_detect-container-engine.sh + else + echo "Error: Cannot find install/_detect-container-engine.sh. Defaulting to docker." + export CONTAINER_ENGINE="docker" + fi +fi + echo "${_group}Setting up GeoIP integration ..." install_geoip() { From 76a447b3fb5d492a83882d805a3423dd3f3c8c9f Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 15 Oct 2025 15:13:05 +0700 Subject: [PATCH 2/5] fix: use absolute path for sourcing script --- install/geoip.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install/geoip.sh b/install/geoip.sh index a1e4400d9e8..c38019a7aeb 100644 --- a/install/geoip.sh +++ b/install/geoip.sh @@ -1,17 +1,18 @@ +echo "${_group}Setting up GeoIP integration ..." + # If `$CONTAINER_ENGINE` is not set, we assume that we are running this script independently # to update the geoip database as written on the documentation. # Therefore we need to `source _detect-container-engine.sh` to detect the container engine. +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) if [[ -z "$CONTAINER_ENGINE" ]]; then - if [[ -f "install/_detect-container-engine.sh" ]]; then - source install/_detect-container-engine.sh + if [[ -f "$script_dir/install/_detect-container-engine.sh" ]]; then + source $script_dir/install/_detect-container-engine.sh else echo "Error: Cannot find install/_detect-container-engine.sh. Defaulting to docker." export CONTAINER_ENGINE="docker" fi fi -echo "${_group}Setting up GeoIP integration ..." - install_geoip() { local mmdb=geoip/GeoLite2-City.mmdb local conf=geoip/GeoIP.conf From 24b908841587feb2f72df059e66c41566e74efe3 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 15 Oct 2025 19:46:59 +0700 Subject: [PATCH 3/5] Update geoip.sh Co-authored-by: Amin Vakil --- install/geoip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/geoip.sh b/install/geoip.sh index c38019a7aeb..ba67a04345d 100644 --- a/install/geoip.sh +++ b/install/geoip.sh @@ -5,7 +5,7 @@ echo "${_group}Setting up GeoIP integration ..." # Therefore we need to `source _detect-container-engine.sh` to detect the container engine. script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) if [[ -z "$CONTAINER_ENGINE" ]]; then - if [[ -f "$script_dir/install/_detect-container-engine.sh" ]]; then + if [[ -f "$script_dir/_detect-container-engine.sh" ]]; then source $script_dir/install/_detect-container-engine.sh else echo "Error: Cannot find install/_detect-container-engine.sh. Defaulting to docker." From eefa15f1436ef430bc573915117b92aee3fbc808 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 15 Oct 2025 19:47:14 +0700 Subject: [PATCH 4/5] Update geoip.sh Co-authored-by: Amin Vakil --- install/geoip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/geoip.sh b/install/geoip.sh index ba67a04345d..ec5734e930a 100644 --- a/install/geoip.sh +++ b/install/geoip.sh @@ -6,7 +6,7 @@ echo "${_group}Setting up GeoIP integration ..." script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) if [[ -z "$CONTAINER_ENGINE" ]]; then if [[ -f "$script_dir/_detect-container-engine.sh" ]]; then - source $script_dir/install/_detect-container-engine.sh + source $script_dir/_detect-container-engine.sh else echo "Error: Cannot find install/_detect-container-engine.sh. Defaulting to docker." export CONTAINER_ENGINE="docker" From 34ccf9c437dce1f282276df7174666fcbe986c8c Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 15 Oct 2025 19:47:25 +0700 Subject: [PATCH 5/5] Update geoip.sh Co-authored-by: Amin Vakil --- install/geoip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/geoip.sh b/install/geoip.sh index ec5734e930a..9cea3082409 100644 --- a/install/geoip.sh +++ b/install/geoip.sh @@ -8,7 +8,7 @@ if [[ -z "$CONTAINER_ENGINE" ]]; then if [[ -f "$script_dir/_detect-container-engine.sh" ]]; then source $script_dir/_detect-container-engine.sh else - echo "Error: Cannot find install/_detect-container-engine.sh. Defaulting to docker." + echo "Error: Cannot find _detect-container-engine.sh. Defaulting to docker." export CONTAINER_ENGINE="docker" fi fi