From f36e540a5929b51ab09c8201e16fe681d82db028 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 30 Nov 2022 11:46:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=BC=BAredis=E5=AE=89=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/redis/config/redis.conf | 4 ++-- plugins/redis/index.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/redis/config/redis.conf b/plugins/redis/config/redis.conf index be9d6f5b1..d38e0e7fe 100644 --- a/plugins/redis/config/redis.conf +++ b/plugins/redis/config/redis.conf @@ -1,9 +1,9 @@ daemonize yes pidfile {$SERVER_PATH}/redis/redis_6379.pid -bind 0.0.0.0 +bind 127.0.0.1 port 6379 -requirepass admin +requirepass {$REDIS_PASS} timeout 0 tcp-keepalive 0 diff --git a/plugins/redis/index.py b/plugins/redis/index.py index b3e08ef94..8b6cc7de7 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -101,6 +101,9 @@ def initDreplace(): if not os.path.exists(dst_conf_init): conf_content = mw.readFile(getConfTpl()) conf_content = conf_content.replace('{$SERVER_PATH}', service_path) + conf_content = conf_content.replace( + '{$REDIS_PASS}', mw.getRandomString(10)) + mw.writeFile(dst_conf, conf_content) mw.writeFile(dst_conf_init, 'ok')