From 9bba651bd2a60ea2df0c376a6b0905be3c9f4b7f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Jul 2021 22:54:17 -0400 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=8E=2007-14=2022:54=20?= =?UTF-8?q?=20=20=E6=96=B0=E5=A2=9E=E8=84=9A=E6=9C=AC=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E9=99=90=E5=88=B6=EF=BC=88=E5=AE=89=E5=85=A8=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd.sh | 28 ++-------------------------- sample/config.sh.sample | 12 +++++++++--- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/jd.sh b/jd.sh index 3308115..3c8a4ae 100755 --- a/jd.sh +++ b/jd.sh @@ -1677,32 +1677,8 @@ run_normal() { log_path="$dir_log/$file_name/$log_time.log" make_dir "$dir_log/$file_name" cd $which_path - echo "执行${which_program},路径$file_name_all" - [ ${TasksTerminateTime} = 0 ] && $which_program $file_name_all 2>&1 | tee $log_path - [ ${TasksTerminateTime} -ne 0 ] && timeout ${TasksTerminateTime} $which_program $file_name_all 2>&1 | tee $log_path - run_task_finish "$file_name" 2>&1 | tee -a $log_path - else - echo -e "\n $p 脚本不存在,请确认...\n" - usage - fi -} - -run_normaltest() { - local p=$1 - define_program "$p" - #ps -ef | grep $p | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 - find_file_and_path $p - if [[ $file_name ]] && [[ $which_path ]]; then - import_config_and_check "$file_name" - count_user_sum - export_all_env all - [[ $# -eq 1 ]] && random_delay - log_time=$(date "+%Y-%m-%d-%H-%M-%S") - log_path="$dir_log/$file_name/$log_time.log" - make_dir "$dir_log/$file_name" - cd $which_path - echo "执行${which_program},路径$file_name_all" - SecureJs $file_name_all + echo "执行${which_program},路径$which_path/$file_name_all" + [[ $which_program = node ]] && [[ $IsSecure = true ]] && SecureJs $file_name_all [ ${TasksTerminateTime} = 0 ] && $which_program $file_name_all 2>&1 | tee $log_path [ ${TasksTerminateTime} -ne 0 ] && timeout ${TasksTerminateTime} $which_program $file_name_all 2>&1 | tee $log_path run_task_finish "$file_name" 2>&1 | tee -a $log_path diff --git a/sample/config.sh.sample b/sample/config.sh.sample index 8b42ed7..f19b4aa 100755 --- a/sample/config.sh.sample +++ b/sample/config.sh.sample @@ -1,6 +1,6 @@ -## Version: v0.14.1 -## Date: 2021-07-09 -## Update Content: 新增面板端口设置(仅适用于非Docker) +## Version: v0.15.2 +## Date: 2021-07-15 +## Update Content: 新增脚本域名限制(安全选项) ## 上面版本号中,如果第2位数字有变化,那么代表增加了新的参数,如果只有第3位数字有变化,仅代表更新了注释,没有增加新的参数,可更新可不更新 ## 如需更新,请参考WIKI(https://github.com/lan-tianxiang/js_tool/wiki)中"如何更新配置文件"部分的操作说明,进行智能比对后修改。 @@ -22,6 +22,12 @@ JD_SCRIPTS_URL="" ## 默认为5678 PanelPort="5678" +################################## 脚本域名限制(选填) ################################## +## 是否限制所有.js结尾的脚本访问域名,防止第三方作者偷取用户的隐私数据 +## 想要增加限制的域名,请编辑目录下jd/.AutoConfig/Env.js的canRequest +## 默认为false关闭,打开请输入true +IsSecure="false" + ################################## 定义是否自动删除失效的脚本与定时任务(选填) ################################## ## 有的时候,某些JS脚本只在特定的时间有效,过了时间就失效了,需要自动删除失效的本地定时任务,则设置为 "true" ,否则请设置为 "false" ## 当设置为 "true" 时,会自动从检测文件中读取比对删除的任务(识别以“jd_”、“jr_”、“jx_”开头的任务)