From c802c45e37557fe3f785fbc6bbcba575e63d9e7f Mon Sep 17 00:00:00 2001 From: ling Date: Sat, 26 Sep 2026 17:22:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20=E7=94=A8=20exec=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=BD=A2=E5=BC=8F=E9=87=8D=E5=86=99=20redis=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参数逐项传递,不再经 sh 拼接,避免密码含 shell 特殊字符时被展开或截断; 空密码时按 redis 语义不设密码。 --- deploy/docker-compose.dev.yml | 22 +++++++++++----------- deploy/docker-compose.local.yml | 22 +++++++++++----------- deploy/docker-compose.yml | 22 +++++++++++----------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/deploy/docker-compose.dev.yml b/deploy/docker-compose.dev.yml index f2acd1ff36..80d9db1785 100644 --- a/deploy/docker-compose.dev.yml +++ b/deploy/docker-compose.dev.yml @@ -147,17 +147,17 @@ services: restart: unless-stopped volumes: - ./redis_data:/data:Z - # The command is one quoted script for the inner `sh -c`. Compose keeps - # the newlines inside the quoted string, so every line needs a trailing - # `\` — without it, `redis-server` on the first line runs with no flags - # at all, and the --save/--appendonly/--appendfsync lines are never read. - command: > - sh -c ' - redis-server \ - --save 60 1 \ - --appendonly yes \ - --appendfsync everysec \ - ${REDIS_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' + command: + - redis-server + - --save + - "60" + - "1" + - --appendonly + - "yes" + - --appendfsync + - everysec + - --requirepass + - ${REDIS_PASSWORD:-} environment: - TZ=${TZ:-Asia/Shanghai} - REDISCLI_AUTH=${REDIS_PASSWORD:-} diff --git a/deploy/docker-compose.local.yml b/deploy/docker-compose.local.yml index 5b6c8d9eb5..672463c4d7 100644 --- a/deploy/docker-compose.local.yml +++ b/deploy/docker-compose.local.yml @@ -264,17 +264,17 @@ services: volumes: # Local directory mapping for easy migration - ./redis_data:/data:Z - # The command is one quoted script for the inner `sh -c`. Compose keeps - # the newlines inside the quoted string, so every line needs a trailing - # `\` — without it, `redis-server` on the first line runs with no flags - # at all, and the --save/--appendonly/--appendfsync lines are never read. - command: > - sh -c ' - redis-server \ - --save 60 1 \ - --appendonly yes \ - --appendfsync everysec \ - ${REDIS_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' + command: + - redis-server + - --save + - "60" + - "1" + - --appendonly + - "yes" + - --appendfsync + - everysec + - --requirepass + - ${REDIS_PASSWORD:-} environment: - TZ=${TZ:-Asia/Shanghai} # REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 1a09032156..3308df0ffe 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -287,17 +287,17 @@ services: hard: 100000 volumes: - redis_data:/data - # The command is one quoted script for the inner `sh -c`. Compose keeps - # the newlines inside the quoted string, so every line needs a trailing - # `\` — without it, `redis-server` on the first line runs with no flags - # at all, and the --save/--appendonly/--appendfsync lines are never read. - command: > - sh -c ' - redis-server \ - --save 60 1 \ - --appendonly yes \ - --appendfsync everysec \ - ${REDIS_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' + command: + - redis-server + - --save + - "60" + - "1" + - --appendonly + - "yes" + - --appendfsync + - everysec + - --requirepass + - ${REDIS_PASSWORD:-} environment: - TZ=${TZ:-Asia/Shanghai} # REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag)