From 7a12c3737fef63bbff57780e0f51fce3b3ef70a1 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 9 Jul 2024 11:02:52 +0800 Subject: [PATCH] perf: xpack can disable force --- apps/jumpserver/settings/_xpack.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/jumpserver/settings/_xpack.py b/apps/jumpserver/settings/_xpack.py index 6e43c7501..497e2c45d 100644 --- a/apps/jumpserver/settings/_xpack.py +++ b/apps/jumpserver/settings/_xpack.py @@ -11,7 +11,10 @@ current_year = datetime.datetime.now().year corporation = f'FIT2CLOUD 飞致云 © 2014-{current_year}' XPACK_DIR = os.path.join(const.BASE_DIR, 'xpack') -XPACK_ENABLED = os.path.isdir(XPACK_DIR) +XPACK_DISABLED = os.environ.get('XPACK_ENABLED') in ['0', 'false', 'False', 'no', 'No'] +XPACK_ENABLED = False +if not XPACK_DISABLED: + XPACK_ENABLED = os.path.isdir(XPACK_DIR) XPACK_TEMPLATES_DIR = [] XPACK_CONTEXT_PROCESSOR = [] XPACK_LICENSE_IS_VALID = False