mirror of
https://github.com/cytopia/devilbox.git
synced 2025-02-21 09:51:49 +00:00
Redis-custom-pass
This commit is contained in:
parent
3ee0649275
commit
47b3491f3a
@ -128,7 +128,13 @@ function loadClass($class) {
|
|||||||
|
|
||||||
case 'Redis':
|
case 'Redis':
|
||||||
loadFile($class, $cnt_dir);
|
loadFile($class, $cnt_dir);
|
||||||
$_LOADED_LIBS[$class] = \devilbox\Redis::getInstance($GLOBALS['REDIS_HOST_NAME']);
|
if(loadClass('Helper')->getEnv('REDIS_ROOT_PASSWORD') == ''){
|
||||||
|
$_LOADED_LIBS[$class] = \devilbox\Redis::getInstance($GLOBALS['REDIS_HOST_NAME']);
|
||||||
|
}else{
|
||||||
|
$_LOADED_LIBS[$class] = \devilbox\Redis::getInstance($GLOBALS['REDIS_HOST_NAME'], array(
|
||||||
|
'pass' => loadClass('Helper')->getEnv('REDIS_ROOT_PASSWORD'),
|
||||||
|
));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Memcd':
|
case 'Memcd':
|
||||||
|
@ -44,6 +44,9 @@ class Redis extends BaseClass implements BaseInterface
|
|||||||
$this->setConnectErrno(1);
|
$this->setConnectErrno(1);
|
||||||
//loadClass('Logger')->error($this->_connect_error);
|
//loadClass('Logger')->error($this->_connect_error);
|
||||||
} else {
|
} else {
|
||||||
|
if(array_key_exists('pass', $data)){
|
||||||
|
$redis->auth($data['pass']);
|
||||||
|
}
|
||||||
$redis->set('devilbox-version', $GLOBALS['DEVILBOX_VERSION'].' ('.$GLOBALS['DEVILBOX_DATE'].')');
|
$redis->set('devilbox-version', $GLOBALS['DEVILBOX_VERSION'].' ('.$GLOBALS['DEVILBOX_DATE'].')');
|
||||||
$this->_redis = $redis;
|
$this->_redis = $redis;
|
||||||
}
|
}
|
||||||
|
@ -394,6 +394,12 @@ services:
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
redis:
|
redis:
|
||||||
image: redis:${REDIS_SERVER:-3.2}
|
image: redis:${REDIS_SERVER:-3.2}
|
||||||
|
|
||||||
|
# REDIS CUSTOM PASSWORD SETUP
|
||||||
|
#comment out the following 3 lines if you want to set a custom redis password, also set the redis pass variable in .env
|
||||||
|
#command: redis-server --requirepass ${REDIS_ROOT_PASSWORD}
|
||||||
|
#environment:
|
||||||
|
# - ALLOW_EMPTY_PASSWORD=yes
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
# [local-machine:]local-port:docker-port
|
# [local-machine:]local-port:docker-port
|
||||||
|
@ -541,6 +541,11 @@ HOST_PORT_PGSQL=5432
|
|||||||
###
|
###
|
||||||
HOST_PORT_REDIS=6379
|
HOST_PORT_REDIS=6379
|
||||||
|
|
||||||
|
###
|
||||||
|
### Comment out to set the redis custom password also, in docker-compose.yml comment out the REDIS CUSTOM PASSWORD SETUP section
|
||||||
|
###
|
||||||
|
#REDIS_ROOT_PASSWORD=root
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user