Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 8ec49a1

Browse files
authored
Merge pull request #371 from Bidaya0/Bidaya0-DOC-UPDATE
Develop Document Update thanks for @xzy9999
2 parents 3fe34ef + 35d554e commit 8ec49a1

File tree

2 files changed

+85
-6
lines changed

2 files changed

+85
-6
lines changed

README.ZH_CN.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DongTai-WebAPI 用于处理DongTai用户资源管理的相关请求,包括:
3030
1.安装所需的依赖
3131

3232
```
33-
python -m pip install -r requirements-test.txt
33+
python -m pip install -r requirements-prod.txt
3434
```
3535

3636
2.初始化数据库
@@ -41,8 +41,8 @@ python -m pip install -r requirements-test.txt
4141
或采用docker部署数据库
4242
- 拉取版本对应的数据库镜像并启动镜像
4343
```
44-
docker pull registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest
45-
docker run -itd --name dongtai-mysql -p 3306:3306 registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest
44+
docker pull dongtai/dongtai-mysql:latest
45+
docker run -itd --name dongtai-mysql -p 3306:3306 dongtai/dongtai-mysql:latest
4646
```
4747

4848

@@ -105,6 +105,43 @@ Redoc地址为 `http://<containerip:port>/api/XZPcGFKoxYXScwGjQtJx8u/schema/redo
105105

106106
3. 具体的API鉴权模式已包含在API文档中,可在web的安装agent界面找到对应的token。
107107

108+
### 开发
109+
110+
1.安装所需的依赖
111+
112+
```
113+
python -m pip install -r requirements-test.txt
114+
```
115+
116+
注释:windows下无法安装jq,jq用于处理敏感信息的json解析,若非开发相关功能可忽略,或是在windows下采用WSL进行开发
117+
118+
119+
2.初始化数据库
120+
121+
122+
- 拉取版本对应的数据库镜像并启动镜像
123+
```
124+
docker pull dongtai/dongtai-mysql:latest
125+
docker run -itd --name dongtai-mysql -p 3306:3306 dongtai/dongtai-mysql:latest
126+
```
127+
128+
若需要创建或修改数据库表,请参照[DongTai-Base-Image](https://github.com/HXSecurity/Dongtai-Base-Image)仓库规范,并提交相关更改的.sql文件
129+
130+
131+
3.修改配置文件
132+
133+
- 复制配置文件`conf/config.ini.example``conf/config.ini`并需改其中的配置;其中,`engine`对应的url为`DongTai-engine`的服务地址,`apiserver`对应的url为`DongTai-openapi`的服务地址
134+
- 只开发webapi相关的功能时可以不填engine和apiserver
135+
136+
4.运行服务调试
137+
138+
开发相关的环境变量
139+
PYTHONAGENT=TRUE 开启pythonagent,需要手动安装,参照[PythonAgent安装](http://doc.dongtai.io/02_start/03_agent.html#python-agent)
140+
DOC=TRUE 开启swagger 路径为 `/api/XZPcGFKoxYXScwGjQtJx8u/schema/swagger-ui/`
141+
debug=true 开启debug模式
142+
143+
- 运行`python manage.py runserver`启动服务
144+
108145

109146
- [官方文档](https://doc.dongtai.io/)
110147
- [快速体验](https://iast.io)

README.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DongTai-WebAPI is used to user resource management ,including:
3030
1.Install the required dependencies
3131

3232
```
33-
python -m pip install -r requirements-test.txt
33+
python -m pip install -r requirements-prod.txt
3434
```
3535

3636
2.Initialize the database
@@ -42,8 +42,8 @@ OR use docker way to host a database
4242

4343
- Pull the corresponding database images and run it
4444
```
45-
docker pull registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest
46-
docker run -itd --name dongtai-mysql -p 3306:3306 registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest
45+
docker pull dongtai/dongtai-mysql:latest
46+
docker run -itd --name dongtai-mysql -p 3306:3306 dongtai/dongtai-mysql:latest
4747
```
4848

4949

@@ -107,6 +107,48 @@ The address is `http://<containerip:port>/api/XZPcGFKoxYXScwGjQtJx8u/schema/`
107107

108108
3. The specific API authentication mode has been included in the API document, and the corresponding token can be found on the installation agent part of the web.
109109

110+
111+
112+
### Development
113+
114+
1. Install the required dependencies
115+
116+
```
117+
python -m pip install -r requirements-test.txt
118+
```
119+
120+
Note: jq cannot be installed under windows, jq is used to process json parsing of sensitive information, if it is not develop related functions, it can be ignored, or WSL is used for development under windows
121+
122+
123+
2. Initialize the database
124+
125+
126+
- Pull the database mirror corresponding to the version and start the mirror
127+
```
128+
docker pull dongtai/dongtai-mysql:latest
129+
docker run -itd --name dongtai-mysql -p 3306:3306 dongtai/dongtai-mysql:latest
130+
```
131+
132+
If you need to create or modify the database table, please refer to the [DongTai-Base-Image](https://github.com/HXSecurity/Dongtai-Base-Image) specification and submit the relevant modified .sql file
133+
134+
135+
3. Modify the configuration file
136+
137+
- Copy the configuration file `conf/config.ini.example` to `conf/config.ini` and change the configuration; among them, the url corresponding to `engine` is the service address of `DongTai-engine`, and `apiserver` corresponds to The url is the service address of `DongTai-openapi`
138+
- You can leave out engine and apiserver when you only develop webapi-related functions
139+
140+
4. Run service debugging
141+
142+
- Development related environment variables
143+
144+
`PYTHONAGENT=TRUE` Open pythonagent, need to be installed manually, refer to [Python Agent IOnstallation](http://doc.dongtai.io/02_start/03_agent.html#python-agent)
145+
146+
`DOC=TRUE` Open swagger path is `/api/XZPcGFKoxYXScwGjQtJx8u/schema/swagger-ui/`
147+
148+
`debug=true` enable debug mode
149+
150+
- Run `python manage.py runserver` to start the service
151+
110152
### More resources
111153
- [Documentation](https://doc.dongtai.io/)
112154
- [DongTai WebSite](https://iast.io)

0 commit comments

Comments
 (0)