feat: 更新ALLOW_ANONYMOUS变量名称
This commit is contained in:
@@ -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'"
|
||||
|
||||
@@ -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 > 传入变量 > 默认值
|
||||
|
||||
+3
-3
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user