2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-25 16:08:23 +00:00

Merge pull request #1191 from frappe/staging

chore: Merge staging into v5.x
This commit is contained in:
gavin 2021-07-29 14:51:00 +05:30 committed by GitHub
commit 90e7cd4909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 4 deletions

View File

@ -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:

View File

@ -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):

View File

@ -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))

View File

@ -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;

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}