From 6a3c2be4926c319871124b7d3099eb058ff9d0b0 Mon Sep 17 00:00:00 2001 From: Andy Steed Date: Mon, 12 Jan 2026 10:15:30 -0800 Subject: [PATCH 1/2] fix: revert removal of env vars required for active/active --- init.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/init.sh b/init.sh index 710b14d..3cb602f 100755 --- a/init.sh +++ b/init.sh @@ -26,6 +26,15 @@ log_level=${LOG_LEVEL:-warn} marathon_host=${MARATHON_HOST} sleep_duration=${MARATHON_POLL_INTERVAL:-5} force_reload_interval_s=${FORCE_RELOAD_INTERVAL_S:--1} +active_active_api_gateway_token=${ACTIVE_ACTIVE_API_GATEWAY_TOKEN} +active_active_namespace_0=${ACTIVE_ACTIVE_NAMESPACE_0} +active_active_namespace_1=${ACTIVE_ACTIVE_NAMESPACE_1} +active_active_set_upstream_interval=${ACTIVE_ACTIVE_SET_UPSTREAM_INTERVAL} +active_active_status_check_interval=${ACTIVE_ACTIVE_STATUS_CHECK_INTERVAL} +active_active_upstreams_csv_path=${ACTIVE_ACTIVE_UPSTREAMS_CSV_PATH} +active_active_weight_0=${ACTIVE_ACTIVE_WEIGHT_0} +active_active_weight_1=${ACTIVE_ACTIVE_WEIGHT_1} +active_active=${ACTIVE_ACTIVE:-false} # # location for a remote /etc/api-gateway folder. @@ -124,4 +133,4 @@ else fi echo " ... using log level: '${log_level}'. Override it with -e 'LOG_LEVEL=' " -sudo -E api-gateway -p /usr/local/api-gateway/ -c /etc/api-gateway/api-gateway.conf -g "daemon off; error_log /dev/stderr ${log_level};" +sudo -E api-gateway -p /usr/local/api-gateway/ -c /etc/api-gateway/api-gateway.conf -g "daemon off; error_log /dev/stderr ${log_level}; env ACTIVE_ACTIVE=${active_active}; env ACTIVE_ACTIVE_API_GATEWAY_TOKEN=${active_active_api_gateway_token}; env ACTIVE_ACTIVE_NAMESPACE_0=${active_active_namespace_0}; env ACTIVE_ACTIVE_NAMESPACE_1=${active_active_namespace_1}; env ACTIVE_ACTIVE_SET_UPSTREAM_INTERVAL=${active_active_set_upstream_interval}; env ACTIVE_ACTIVE_STATUS_CHECK_INTERVAL=${active_active_status_check_interval}; env ACTIVE_ACTIVE_UPSTREAMS_CSV_PATH=${active_active_upstreams_csv_path}; env ACTIVE_ACTIVE_WEIGHT_0=${active_active_weight_0}; env ACTIVE_ACTIVE_WEIGHT_1=${active_active_weight_1};" \ No newline at end of file From 3a75562dffb5f17fdf3e848d0222110e82fa0a8f Mon Sep 17 00:00:00 2001 From: Andy Steed Date: Mon, 12 Jan 2026 11:49:34 -0800 Subject: [PATCH 2/2] fix: add SETENV for nginx-api-gateway user in sudoers --- Dockerfile-debian | 2 +- init.sh | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Dockerfile-debian b/Dockerfile-debian index 18f05b4..41ff339 100644 --- a/Dockerfile-debian +++ b/Dockerfile-debian @@ -312,7 +312,7 @@ RUN groupadd --gid 1000 nginx-api-gateway \ RUN mkdir -p /usr/local/api-gateway \ && chown -R nginx-api-gateway:nginx-api-gateway /etc/init-container.sh /etc/api-gateway /var/log/api-gateway /usr/local \ && chmod 755 -R /etc/api-gateway /var/log/api-gateway /usr/local \ - && echo "nginx-api-gateway ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + && echo "nginx-api-gateway ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers RUN apt-get update && apt-get install -y inotify-tools diff --git a/init.sh b/init.sh index 3cb602f..710b14d 100755 --- a/init.sh +++ b/init.sh @@ -26,15 +26,6 @@ log_level=${LOG_LEVEL:-warn} marathon_host=${MARATHON_HOST} sleep_duration=${MARATHON_POLL_INTERVAL:-5} force_reload_interval_s=${FORCE_RELOAD_INTERVAL_S:--1} -active_active_api_gateway_token=${ACTIVE_ACTIVE_API_GATEWAY_TOKEN} -active_active_namespace_0=${ACTIVE_ACTIVE_NAMESPACE_0} -active_active_namespace_1=${ACTIVE_ACTIVE_NAMESPACE_1} -active_active_set_upstream_interval=${ACTIVE_ACTIVE_SET_UPSTREAM_INTERVAL} -active_active_status_check_interval=${ACTIVE_ACTIVE_STATUS_CHECK_INTERVAL} -active_active_upstreams_csv_path=${ACTIVE_ACTIVE_UPSTREAMS_CSV_PATH} -active_active_weight_0=${ACTIVE_ACTIVE_WEIGHT_0} -active_active_weight_1=${ACTIVE_ACTIVE_WEIGHT_1} -active_active=${ACTIVE_ACTIVE:-false} # # location for a remote /etc/api-gateway folder. @@ -133,4 +124,4 @@ else fi echo " ... using log level: '${log_level}'. Override it with -e 'LOG_LEVEL=' " -sudo -E api-gateway -p /usr/local/api-gateway/ -c /etc/api-gateway/api-gateway.conf -g "daemon off; error_log /dev/stderr ${log_level}; env ACTIVE_ACTIVE=${active_active}; env ACTIVE_ACTIVE_API_GATEWAY_TOKEN=${active_active_api_gateway_token}; env ACTIVE_ACTIVE_NAMESPACE_0=${active_active_namespace_0}; env ACTIVE_ACTIVE_NAMESPACE_1=${active_active_namespace_1}; env ACTIVE_ACTIVE_SET_UPSTREAM_INTERVAL=${active_active_set_upstream_interval}; env ACTIVE_ACTIVE_STATUS_CHECK_INTERVAL=${active_active_status_check_interval}; env ACTIVE_ACTIVE_UPSTREAMS_CSV_PATH=${active_active_upstreams_csv_path}; env ACTIVE_ACTIVE_WEIGHT_0=${active_active_weight_0}; env ACTIVE_ACTIVE_WEIGHT_1=${active_active_weight_1};" \ No newline at end of file +sudo -E api-gateway -p /usr/local/api-gateway/ -c /etc/api-gateway/api-gateway.conf -g "daemon off; error_log /dev/stderr ${log_level};"