From 31131980fcf8c31f73943c3d96b4d5b35d22c2f8 Mon Sep 17 00:00:00 2001 From: Endial Fang Date: Thu, 7 Sep 2023 08:26:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0ALLOW=5FANONYMOUS?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/usr/local/bin/common.sh | 10 +++++----- customer/usr/local/bin/environment.sh | 2 +- docker-compose.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/customer/usr/local/bin/common.sh b/customer/usr/local/bin/common.sh index b2f2d96..6140971 100644 --- a/customer/usr/local/bin/common.sh +++ b/customer/usr/local/bin/common.sh @@ -216,10 +216,10 @@ redis_verify_minimum_env() { } # Redis authentication validations - if is_boolean_yes "$ALLOW_ANONYMOUS_LOGIN"; then - LOG_W "You set the environment variable ALLOW_ANONYMOUS_LOGIN=${ALLOW_ANONYMOUS_LOGIN}. For safety reasons, do not use this flag in a production environment." + if is_boolean_yes "$ALLOW_ANONYMOUS"; then + LOG_W "You set the environment variable ALLOW_ANONYMOUS=${ALLOW_ANONYMOUS}. For safety reasons, do not use this flag in a production environment." elif [[ -z "$REDIS_PASSWORD" ]]; then - print_validation_error "The REDIS_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_ANONYMOUS_LOGIN=yes to allow the container to be started with blank passwords. This is recommended only for development." + print_validation_error "The REDIS_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_ANONYMOUS=yes to allow the container to be started with blank passwords. This is recommended only for development." fi if [[ -n "$REDIS_REPLICATION_MODE" ]]; then @@ -229,8 +229,8 @@ redis_verify_minimum_env() { print_validation_error "An invalid port was specified in the environment variable REDIS_MASTER_PORT_NUMBER: $err" fi fi - if ! is_boolean_yes "$ALLOW_ANONYMOUS_LOGIN" && [[ -z "$REDIS_MASTER_PASSWORD" ]]; then - print_validation_error "The REDIS_MASTER_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_ANONYMOUS_LOGIN=yes to allow the container to be started with blank passwords. This is recommended only for development." + if ! is_boolean_yes "$ALLOW_ANONYMOUS" && [[ -z "$REDIS_MASTER_PASSWORD" ]]; then + print_validation_error "The REDIS_MASTER_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_ANONYMOUS=yes to allow the container to be started with blank passwords. This is recommended only for development." fi elif [[ "$REDIS_REPLICATION_MODE" != "master" ]]; then print_validation_error "Invalid replication mode. Available options are 'master/replica'" diff --git a/customer/usr/local/bin/environment.sh b/customer/usr/local/bin/environment.sh index 5e84716..bbc6514 100644 --- a/customer/usr/local/bin/environment.sh +++ b/customer/usr/local/bin/environment.sh @@ -5,7 +5,7 @@ # 通用设置 export ENV_DEBUG=${ENV_DEBUG:-false} -export ALLOW_ANONYMOUS_LOGIN="${ALLOW_ANONYMOUS_LOGIN:-no}" +export ALLOW_ANONYMOUS="${ALLOW_ANONYMOUS:-no}" # 通过读取变量名对应的 *_FILE 文件,获取变量值;如果对应文件存在,则通过传入参数设置的变量值会被文件中对应的值覆盖 # 变量优先级: *_FILE > 传入变量 > 默认值 diff --git a/docker-compose.yml b/docker-compose.yml index 71181cb..9500cb5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,12 +4,12 @@ version: '3.8' # 当前配置仅保证可以启动容器;更多配置参数请参考镜像 README.md 文档中说明 services: redis: - image: 'colovu/redis:latest' + image: 'registry.cn-shenzhen.aliyuncs.com/colovu/redis:latest' ports: - '6379:6379' environment: - # ALLOW_ANONYMOUS_LOGIN is recommended only for development. - - ALLOW_ANONYMOUS_LOGIN=yes + # ALLOW_ANONYMOUS is recommended only for development. + - ALLOW_ANONYMOUS=yes - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL volumes: - 'redis_data:/srv/data'