From a514a0e97b0ffe707a9aa26746d20b535719227e Mon Sep 17 00:00:00 2001 From: Roberto Murguia Date: Mon, 14 Jun 2021 15:20:03 -0500 Subject: [PATCH 1/3] fix: ssl nginx directive deprecation --- bench/config/templates/nginx.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bench/config/templates/nginx.conf b/bench/config/templates/nginx.conf index 82f16d46..1879be63 100644 --- a/bench/config/templates/nginx.conf +++ b/bench/config/templates/nginx.conf @@ -35,7 +35,6 @@ server { proxy_busy_buffers_size 256k; {% if ssl_certificate and ssl_certificate_key %} - ssl on; ssl_certificate {{ ssl_certificate }}; ssl_certificate_key {{ ssl_certificate_key }}; ssl_session_timeout 5m; From 5eb71ed024c2d9b1c5e76496d54367eea7881faa Mon Sep 17 00:00:00 2001 From: gavin Date: Thu, 8 Jul 2021 13:55:31 +0530 Subject: [PATCH 2/3] docs: Update README info about easy install script Bench playbooks haven't been updated with Frappe Version 13 requirements. And they are untested at this point. The only up to date methods of install are [Frappe Docker](https://github.com/frappe/frappe_docker) and [the installation guide in Frappe Docs](https://frappeframework.com/docs/user/en/installation). --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1caa71b7..16fdc2b1 100755 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ The Easy Install script should get you going with a Frappe/ERPNext setup with mi **Note:** This script works only on GNU/Linux based server distributions, and has been designed and tested to work on Ubuntu 16.04+, CentOS 7+, and Debian-based systems. +> This script installs Version 12 by default. It is untested with Version 13 and above. Containerized or manual installs are recommended for newer setups. + #### Prerequisites You need to install the following packages for the script to run: From 46e66226c24523761d15352d7eb01c6d48550c5d Mon Sep 17 00:00:00 2001 From: leela Date: Mon, 19 Jul 2021 14:47:43 +0530 Subject: [PATCH 3/3] feat: Redis ACL config is added to conf templates --- bench/config/common_site_config.py | 3 ++- bench/config/redis.py | 22 ++++++++++++++++++++-- bench/config/templates/redis_cache.conf | 3 +++ bench/config/templates/redis_queue.conf | 3 +++ bench/config/templates/redis_socketio.conf | 3 +++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/bench/config/common_site_config.py b/bench/config/common_site_config.py index 6c621080..8f64f541 100644 --- a/bench/config/common_site_config.py +++ b/bench/config/common_site_config.py @@ -12,7 +12,8 @@ default_config = { 'rebase_on_pull': False, 'frappe_user': getpass.getuser(), 'shallow_clone': True, - 'background_workers': 1 + 'background_workers': 1, + 'use_redis_auth': False } def make_config(bench_path): diff --git a/bench/config/redis.py b/bench/config/redis.py index 753a4251..43d99770 100644 --- a/bench/config/redis.py +++ b/bench/config/redis.py @@ -12,6 +12,7 @@ def generate_config(bench_path): from urllib.parse import urlparse config = get_config(bench_path) + redis_version = get_redis_version() ports = {} for key in ('redis_cache', 'redis_queue', 'redis_socketio'): @@ -22,6 +23,7 @@ def generate_config(bench_path): context={ "port": ports['redis_queue'], "bench_path": os.path.abspath(bench_path), + "redis_version": redis_version }, bench_path=bench_path ) @@ -30,6 +32,7 @@ def generate_config(bench_path): template_name='redis_socketio.conf', context={ "port": ports['redis_socketio'], + "redis_version": redis_version }, bench_path=bench_path ) @@ -39,7 +42,7 @@ def generate_config(bench_path): context={ "maxmemory": config.get('cache_maxmemory', get_max_redis_memory()), "port": ports['redis_cache'], - "redis_version": get_redis_version(), + "redis_version": redis_version }, bench_path=bench_path ) @@ -49,11 +52,26 @@ def generate_config(bench_path): if not os.path.exists(pid_path): os.makedirs(pid_path) + # ACL feature is introduced in Redis 6.0 + if redis_version < 6.0: + return + + # make ACL files + acl_rq_path = os.path.join(bench_path, "config", "redis_queue.acl") + acl_redis_cache_path = os.path.join(bench_path, "config", "redis_cache.acl") + acl_redis_socketio_path = os.path.join(bench_path, "config", "redis_socketio.acl") + open(acl_rq_path, 'a').close() + open(acl_redis_cache_path, 'a').close() + open(acl_redis_socketio_path, 'a').close() + def write_redis_config(template_name, context, bench_path): template = bench.config.env().get_template(template_name) + if "config_path" not in context: + context["config_path"] = os.path.abspath(os.path.join(bench_path, "config")) + if "pid_path" not in context: - context["pid_path"] = os.path.abspath(os.path.join(bench_path, "config", "pids")) + context["pid_path"] = os.path.join(context["config_path"], "pids") with open(os.path.join(bench_path, 'config', template_name), 'w') as f: f.write(template.render(**context)) diff --git a/bench/config/templates/redis_cache.conf b/bench/config/templates/redis_cache.conf index be55c122..bb89b902 100644 --- a/bench/config/templates/redis_cache.conf +++ b/bench/config/templates/redis_cache.conf @@ -9,3 +9,6 @@ appendonly no {% if redis_version and redis_version >= 2.2 %} save "" {% endif %} +{% if redis_version and redis_version >= 6.0 %} +aclfile {{ config_path }}/redis_cache.acl +{% endif %} diff --git a/bench/config/templates/redis_queue.conf b/bench/config/templates/redis_queue.conf index cd5fae3b..f4667c99 100644 --- a/bench/config/templates/redis_queue.conf +++ b/bench/config/templates/redis_queue.conf @@ -3,3 +3,6 @@ dir {{ pid_path }} pidfile {{ pid_path }}/redis_queue.pid bind 127.0.0.1 port {{ port }} +{% if redis_version and redis_version >= 6.0 %} +aclfile {{ config_path }}/redis_queue.acl +{% endif %} diff --git a/bench/config/templates/redis_socketio.conf b/bench/config/templates/redis_socketio.conf index ac177161..ff3db75b 100644 --- a/bench/config/templates/redis_socketio.conf +++ b/bench/config/templates/redis_socketio.conf @@ -3,3 +3,6 @@ dir {{ pid_path }} pidfile {{ pid_path }}/redis_socketio.pid bind 127.0.0.1 port {{ port }} +{% if redis_version and redis_version >= 6.0 %} +aclfile {{ config_path }}/redis_socketio.acl +{% endif %}