Files
zjpb.net/docs/deployment/CHECK_GIT.md
Jowe 939717fa57 feat: v2.6.0 - API安全优化和文档整合
## 核心优化
- 移除详情页自动调用博查API的逻辑,改为按需加载
- 添加基于IP的频率限制(每小时3次)
- 实现验证码防护机制(超过阈值后要求验证)
- 新增频率限制工具类 utils/rate_limiter.py

## 成本控制
- API调用减少约90%+(只在用户点击时调用)
- 防止恶意滥用和攻击
- 可配置的频率限制和验证码策略

## 文档整合
- 创建 docs/ 目录结构
- 归档历史版本文档到 docs/archive/
- 移动部署文档到 docs/deployment/
- 添加文档索引 docs/README.md

## 技术变更
- 新增依赖: Flask-Limiter==3.5.0
- 修改: app.py (移除自动调用,新增API端点)
- 修改: templates/detail_new.html (按需加载UI)
- 新增: utils/rate_limiter.py (频率限制和验证码)
- 新增: docs/archive/DEVELOP_v2.6.0_API_SECURITY.md

## 部署说明
1. pip install Flask-Limiter==3.5.0
2. 重启应用
3. 无需数据库迁移

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 15:54:13 +08:00

93 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 检查生产服务器Git配置
## 方法1通过SSH命令检查
```bash
# SSH登录到生产服务器
ssh root@your-server-ip
# 检查git是否安装
git --version
# 如果显示版本号,说明已安装,例如:
# git version 2.30.2
# 如果显示 "command not found",说明未安装
```
## 方法2通过1Panel面板检查
```bash
# 1. 登录1Panel管理面板
# 2. 进入 "主机" -> "终端"
# 3. 输入命令:
git --version
```
## 方法3检查项目目录是否有.git
```bash
# SSH登录后
cd /www/wwwroot/zjpb
ls -la | grep .git
# 如果显示 .git 目录说明项目已经是git仓库
# 可以直接使用 git pull
```
---
## 如果Git未安装
### CentOS/RHEL系统
```bash
yum install -y git
```
### Ubuntu/Debian系统
```bash
apt update
apt install -y git
```
### 验证安装:
```bash
git --version
```
---
## 如果项目目录没有.git需要初始化
```bash
cd /www/wwwroot/zjpb
# 初始化git仓库
git init
# 添加远程仓库如果你有GitHub/Gitee等
git remote add origin https://github.com/yourusername/zjpb.git
# 或者使用SSH方式
git remote add origin git@github.com:yourusername/zjpb.git
# 拉取代码
git pull origin master
```
---
## 推荐使用Git部署的优势
**版本控制** - 可以随时回滚到之前的版本
**增量更新** - 只传输修改的文件,速度快
**操作简单** - 一条命令完成更新
**团队协作** - 多人开发更方便
## 如果不用Git手动部署也可以
可以使用FTP/SFTP工具上传文件
- FileZilla免费
- WinSCP免费
- 1Panel自带的文件管理器