From 2707295ebad7167d92e2fce51582276d6fa05be6 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 10 Apr 2026 10:03:22 +0200 Subject: [PATCH] Homarr: bind Redis to localhost only (#13552) * Homarr: bind Redis to localhost only * fix(homarr): make Redis bind directive idempotent Replace unconditional append with grep guard to prevent duplicate 'bind 127.0.0.1 -::1' entries on repeated updates. * Fix whitespace in homarr install script Clean up minor whitespace issues in install/homarr-install.sh: remove an extra space before the here-path in the Redis config append (>>/etc/redis/redis.conf) and strip a trailing space after the nginx service name in the systemctl disable call. These are whitespace-only edits to keep the script tidy and avoid passing unintended whitespace to commands. --- ct/homarr.sh | 1 + install/homarr-install.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ct/homarr.sh b/ct/homarr.sh index 2b8cf5ded..1af49547d 100644 --- a/ct/homarr.sh +++ b/ct/homarr.sh @@ -65,6 +65,7 @@ EOF msg_info "Updating Homarr" cp /opt/homarr/redis.conf /etc/redis/redis.conf + grep -q '^bind 127.0.0.1 -::1$' /etc/redis/redis.conf || echo "bind 127.0.0.1 -::1" >> /etc/redis/redis.conf rm /etc/nginx/nginx.conf cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf msg_ok "Updated Homarr" diff --git a/install/homarr-install.sh b/install/homarr-install.sh index e8f199ce2..ef6c23616 100644 --- a/install/homarr-install.sh +++ b/install/homarr-install.sh @@ -47,6 +47,7 @@ mkdir -p /appdata/redis chown -R redis:redis /appdata/redis chmod 744 /appdata/redis cp /opt/homarr/redis.conf /etc/redis/redis.conf +grep -q '^bind 127.0.0.1 -::1$' /etc/redis/redis.conf || echo "bind 127.0.0.1 -::1" >>/etc/redis/redis.conf rm /etc/nginx/nginx.conf mkdir -p /etc/nginx/templates cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf @@ -80,7 +81,7 @@ chmod +x /opt/homarr/run.sh systemctl daemon-reload systemctl enable -q --now redis-server systemctl enable -q --now homarr -systemctl disable -q --now nginx +systemctl disable -q --now nginx msg_ok "Created Services" motd_ssh