安装指南
在服务器上部署 NDPR 的完整指南
<div class="custom-block info">
<div class="custom-block-title">环境要求</div>
- Python 3.6+
- MySQL 5.7+
- 网络连接到互联网
</div>
第一步:克隆项目
Bash
git clone https://github.com/ndpreforged/NDPReforged.git
cd NDPReforged
第二步:安装依赖
Bash
pip install flask pymysql werkzeug
第三步:配置数据库
编辑 config/sql_config.json:
JSON
{
"host": "localhost",
"port": 3306,
"user": "your_username",
"password": "your_password",
"database": "ndp_reforged"
}
<div class="custom-block warning">
<div class="custom-block-title">创建数据库</div>
请确保在 MySQL 中创建对应的数据库:
<code>CREATE DATABASE ndp_reforged;</code>
</div>
第四步:配置认证密钥
编辑 config/http_key.json:
JSON
{
"key": "your_secure_key"
}
<div class="custom-block tip">
<div class="custom-block-title">安全建议</div>
请使用强密钥,避免使用默认或简单的密钥。
</div>
第五步:启动服务
Bash
python core.py
端口说明
| 服务 | 默认端口 | 说明 |
|---|---|---|
| API 服务 | 5030 | 主 API 服务 |
| v1 兼容 | 5020 | 兼容旧版协议 |
验证安装
访问健康检查端点:
Bash
curl http://localhost:5030/
响应应该显示:
JSON
{"status": "running"}