From 2ee7d13367be7d69565f34bf938975dd4690e351 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 28 Sep 2026 09:13:47 +0200 Subject: [PATCH] Fill in the nginx resolver SparkyFitness 1.7.3 added (#17556) Upstream's nginx.conf gained a resolver ${NGINX_RESOLVER} line that its Docker entrypoint fills from /etc/resolv.conf; the script substitutes a fixed list of placeholders, so the literal variable reached nginx and the config test failed. Take the nameservers from resolv.conf the same way. --- ct/sparkyfitness.sh | 2 ++ install/sparkyfitness-install.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ct/sparkyfitness.sh b/ct/sparkyfitness.sh index 0ce3e2a0f..356520b46 100644 --- a/ct/sparkyfitness.sh +++ b/ct/sparkyfitness.sh @@ -62,12 +62,14 @@ function update_script() { msg_info "Refreshing Nginx Config" FRONTEND_URL=$(grep -oP '^SPARKY_FITNESS_FRONTEND_URL=\K.*' /etc/sparkyfitness/.env) + NGINX_RESOLVER=$(awk '$1=="nameserver" {ns=$2; sub(/%.*/, "", ns); printf "%s%s", sep, (ns ~ /:/ ? "[" ns "]" : ns); sep=" "}' /etc/resolv.conf) sed \ -e 's|${SPARKY_FITNESS_SERVER_HOST}|127.0.0.1|g' \ -e 's|${SPARKY_FITNESS_SERVER_PORT}|3010|g' \ -e "s|\${SPARKY_FITNESS_FRONTEND_URL}|${FRONTEND_URL}|g" \ -e 's|${NGINX_LISTEN_PORT}|80|g' \ -e 's|${NGINX_RATE_LIMIT}|5r/s|g' \ + -e "s|\${NGINX_RESOLVER}|${NGINX_RESOLVER:-127.0.0.1}|g" \ -e 's|${NGINX_ACCESS_LOG}|/var/log/nginx/sparkyfitness.access.log|g' \ -e 's|${NGINX_ERROR_LOG}|/var/log/nginx/sparkyfitness.error.log|g' \ -e 's|root /usr/share/nginx/html;|root /var/www/sparkyfitness;|g' \ diff --git a/install/sparkyfitness-install.sh b/install/sparkyfitness-install.sh index ffb01de59..582c3f509 100644 --- a/install/sparkyfitness-install.sh +++ b/install/sparkyfitness-install.sh @@ -81,12 +81,14 @@ systemctl enable -q --now sparkyfitness-server msg_ok "Created SparkyFitness Service" msg_info "Configuring Nginx" +NGINX_RESOLVER=$(awk '$1=="nameserver" {ns=$2; sub(/%.*/, "", ns); printf "%s%s", sep, (ns ~ /:/ ? "[" ns "]" : ns); sep=" "}' /etc/resolv.conf) sed \ -e 's|${SPARKY_FITNESS_SERVER_HOST}|127.0.0.1|g' \ -e 's|${SPARKY_FITNESS_SERVER_PORT}|3010|g' \ -e "s|\${SPARKY_FITNESS_FRONTEND_URL}|http://${LOCAL_IP}:80|g" \ -e 's|${NGINX_LISTEN_PORT}|80|g' \ -e 's|${NGINX_RATE_LIMIT}|5r/s|g' \ + -e "s|\${NGINX_RESOLVER}|${NGINX_RESOLVER:-127.0.0.1}|g" \ -e 's|${NGINX_ACCESS_LOG}|/var/log/nginx/sparkyfitness.access.log|g' \ -e 's|${NGINX_ERROR_LOG}|/var/log/nginx/sparkyfitness.error.log|g' \ -e 's|root /usr/share/nginx/html;|root /var/www/sparkyfitness;|g' \