From 44d77ba03f4c7266a884722f9d303e80eaa4c652 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 16 Jul 2025 19:31:06 +0800 Subject: [PATCH] perf: random password exclude some char --- apps/ops/const.py | 2 +- requirements/static_files.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/ops/const.py b/apps/ops/const.py index ce81235b0..387439d53 100644 --- a/apps/ops/const.py +++ b/apps/ops/const.py @@ -21,7 +21,7 @@ class PasswordStrategy(models.TextChoices): random_all = 'random_all', _('All assets use different random password') -string_punctuation = '!#$%&()*+,-.:;<=>?@[]^_~' +string_punctuation = '!#$%&()*+,-.:;<=?@[]_~' DEFAULT_PASSWORD_LENGTH = 30 DEFAULT_PASSWORD_RULES = { 'length': DEFAULT_PASSWORD_LENGTH, diff --git a/requirements/static_files.sh b/requirements/static_files.sh index ed7f0bf34..435bdfeda 100644 --- a/requirements/static_files.sh +++ b/requirements/static_files.sh @@ -14,8 +14,16 @@ if [[ $1 == "root" ]];then BASE_DIR="${BASE_DIR}/jumpserver" fi - for file in $to_files; do + if [[ "$1" == "clean" ]];then + echo "Clean $file" + file_path="${BASE_DIR}/$file" + if [ -f "$file_path" ]; then + rm -f "$file_path" + fi + continue + fi + # Check if the file already exists file_path="${BASE_DIR}/$file" if [ -f "$file_path" ]; then