加强redis安全

pull/282/head
midoks 2 years ago
parent 992e7445f6
commit f36e540a59
  1. 4
      plugins/redis/config/redis.conf
  2. 3
      plugins/redis/index.py

@ -1,9 +1,9 @@
daemonize yes daemonize yes
pidfile {$SERVER_PATH}/redis/redis_6379.pid pidfile {$SERVER_PATH}/redis/redis_6379.pid
bind 0.0.0.0 bind 127.0.0.1
port 6379 port 6379
requirepass admin requirepass {$REDIS_PASS}
timeout 0 timeout 0
tcp-keepalive 0 tcp-keepalive 0

@ -101,6 +101,9 @@ def initDreplace():
if not os.path.exists(dst_conf_init): if not os.path.exists(dst_conf_init):
conf_content = mw.readFile(getConfTpl()) conf_content = mw.readFile(getConfTpl())
conf_content = conf_content.replace('{$SERVER_PATH}', service_path) 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, conf_content)
mw.writeFile(dst_conf_init, 'ok') mw.writeFile(dst_conf_init, 'ok')

Loading…
Cancel
Save