diff --git a/requirements.txt b/requirements.txt index 0b79c7fd..bb562ac5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,4 +49,5 @@ openai~=0.27.2 cacheout~=0.14.1 click~=8.1.6 requests_cache~=0.5.2 -parse==1.19.0 \ No newline at end of file +parse==1.19.0 +PySocks~=1.7.1 \ No newline at end of file diff --git a/update b/update index 6789d830..c6510d75 100644 --- a/update +++ b/update @@ -34,8 +34,23 @@ if [[ "${old_version}" == *APP_VERSION* ]]; then rm -rf /public mv /tmp/dist /public # 重新安装依赖 - pip install -r /app/requirements.txt - echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + if [ -n "${PROXY_HOST}" ]; then + pip install -r /app/requirements.txt --proxy=${PROXY_HOST} + if [ $? -eq 0 ]; then + echo "安装依赖成功" + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + else + echo "安装依赖失败,请重新拉取镜像" + fi + else + pip install -r /app/requirements.txt + if [ $? -eq 0 ]; then + echo "安装依赖成功" + echo "程序更新成功,前端版本:${frontend_version},后端版本:${release_version}" + else + echo "安装依赖失败,请重新拉取镜像" + fi + fi else echo "前端程序下载失败,继续使用旧的程序来启动..." fi