Skip to content

Commit 2707295

Browse files
authored
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.
1 parent 82cc074 commit 2707295

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ct/homarr.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ EOF
6565

6666
msg_info "Updating Homarr"
6767
cp /opt/homarr/redis.conf /etc/redis/redis.conf
68+
grep -q '^bind 127.0.0.1 -::1$' /etc/redis/redis.conf || echo "bind 127.0.0.1 -::1" >> /etc/redis/redis.conf
6869
rm /etc/nginx/nginx.conf
6970
cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf
7071
msg_ok "Updated Homarr"

install/homarr-install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ mkdir -p /appdata/redis
4747
chown -R redis:redis /appdata/redis
4848
chmod 744 /appdata/redis
4949
cp /opt/homarr/redis.conf /etc/redis/redis.conf
50+
grep -q '^bind 127.0.0.1 -::1$' /etc/redis/redis.conf || echo "bind 127.0.0.1 -::1" >>/etc/redis/redis.conf
5051
rm /etc/nginx/nginx.conf
5152
mkdir -p /etc/nginx/templates
5253
cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf
@@ -80,7 +81,7 @@ chmod +x /opt/homarr/run.sh
8081
systemctl daemon-reload
8182
systemctl enable -q --now redis-server
8283
systemctl enable -q --now homarr
83-
systemctl disable -q --now nginx
84+
systemctl disable -q --now nginx
8485
msg_ok "Created Services"
8586

8687
motd_ssh

0 commit comments

Comments
 (0)