diff --git a/0003-old-token-is-invalid.patch b/0003-old-token-is-invalid.patch new file mode 100644 index 0000000000000000000000000000000000000000..4243943bd9caab335c8a3f6b2cd1fbc235d3b655 --- /dev/null +++ b/0003-old-token-is-invalid.patch @@ -0,0 +1,29 @@ +From: gongzt +Date: Sat, 6 May 2023 10:12:42 +0800 +Subject:[PATCH] fix old token can still be used normally +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + vulcanus/restful/response.py | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/vulcanus/restful/response.py b/vulcanus/restful/response.py +index 0cb8c4b..f21e6ca 100644 +--- a/vulcanus/restful/response.py ++++ b/vulcanus/restful/response.py +@@ -139,9 +139,8 @@ class BaseResponse(Resource): + except ValueError: + return state.TOKEN_ERROR + +- cache_token = RedisProxy.redis_connect.get( +- "token_" + verify_info["key"]) +- if not cache_token: ++ cache_token = RedisProxy.redis_connect.get("token_" + verify_info["key"]) ++ if not cache_token or cache_token != token: + return state.TOKEN_ERROR + + args['username'] = verify_info["key"] +-- +Gitee diff --git a/0004-add-gevent-config-item-for-uwsgi.patch b/0004-add-gevent-config-item-for-uwsgi.patch new file mode 100644 index 0000000000000000000000000000000000000000..6717066935c170a31870e1970c3ba85525781cea --- /dev/null +++ b/0004-add-gevent-config-item-for-uwsgi.patch @@ -0,0 +1,40 @@ +From: rabbitali +Date: Mon, 8 May 2023 10:34:39 +0800 +Subject: [PATCH] add gevent conf item when create uwsgi conf file + +--- + aops-vulcanus | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/aops-vulcanus b/aops-vulcanus +index 368c57f..d7e4cb9 100644 +--- a/aops-vulcanus ++++ b/aops-vulcanus +@@ -42,6 +42,7 @@ function create_config_file() { + harakiri=$(get_config "${config_file}" "uwsgi" "harakiri") + processes=$(get_config "${config_file}" "uwsgi" "processes") + threads=$(get_config "${config_file}" "uwsgi" "threads") ++ gevent=$(get_config "${config_file}" "uwsgi" "gevent") + + check_file $daemonize + echo "[INFO] run ${service_name} under path: ${wsgi_file}" +@@ -65,10 +66,16 @@ pidfile=${OUT_PATH}/${service_name}.pid + callable=app + http-timeout=${http_timeout} + harakiri=${harakiri} +-threads=${threads} + processes=${processes} + lazy-apps=true + daemonize=${daemonize}" >"${OUT_PATH}"/"${service_name}".ini ++ if [ ${gevent} ] ++ then ++ echo "gevent=${gevent} ++gevent-monkey-patch=true" >>"${OUT_PATH}"/"${service_name}".ini ++ else ++ echo "threads=${threads}" >>"${OUT_PATH}"/"${service_name}".ini ++ fi + chown root: ${OUT_PATH}/"${service_name}".ini + chmod 750 ${OUT_PATH}/"${service_name}".ini + echo "[INFO] create ${service_name} uwsgi file ok,path is ${OUT_PATH}/${service_name}.ini" +-- + diff --git a/aops-vulcanus.spec b/aops-vulcanus.spec index 92740bbb0b7ba7becc411359c14ef2ab0dab458f..93557917bb2388c90abe01665a6790e58f51c1ee 100644 --- a/aops-vulcanus.spec +++ b/aops-vulcanus.spec @@ -1,12 +1,14 @@ Name: aops-vulcanus Version: v1.2.0 -Release: 2 +Release: 3 Summary: A basic tool libraries of aops, including logging, configure and response, etc. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} Source0: %{name}-%{version}.tar.gz Patch0001: 0001-fix-script-docker-install-error.patch Patch0002: 0002-add-custom-validation-rules.patch +Patch0003: 0003-old-token-is-invalid.patch +Patch0004: 0004-add-gevent-config-item-for-uwsgi.patch BuildRequires: python3-setuptools Requires: python3-concurrent-log-handler python3-xmltodict python3-pyyaml python3-marshmallow >= 3.13.0 @@ -61,6 +63,9 @@ cp -r scripts %{buildroot}/opt/aops/ %changelog +* Mon May 8 2023 gongzhengtang - v1.2.0-3 +- add gevent config item for uwsgi; fix old token is invalid + * Thu Apr 27 2023 wenixn - v1.2.0-2 - add custom validation rules;fix script docker install error