|
1 | | -# DongTai-openapi |
2 | | - |
3 | | -[](https://www.djangoproject.com/) |
4 | | -[](https://huoxianclub.github.io/LingZhi/) |
5 | | -[](https://huoxianclub.github.io/LingZhi/#/doc/tutorial/quickstart) |
6 | | - |
7 | | -[](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws_test.yml) |
8 | | -[](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws.yml) |
9 | | -[](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/release_openapi.yml) |
10 | | - |
11 | | -[中文版本(Chinese version)](README.ZH-CN.MD) |
12 | | - |
13 | | -## Whit is DongTai-Engine? |
14 | | -DongTai-OpenAPI is used to process DongTai probe related requests, including: |
15 | | -- Process agent registration request |
16 | | -- Processing heartbeat data |
17 | | -- Processing error log data |
18 | | -- Processing third-party component data |
19 | | -- Processing method call data |
20 | | -- Processing authority registration/change and other data |
21 | | -- Send probe control commands |
22 | | -- Send hook strategy |
23 | | -- Download detection engine, etc. |
24 | | - |
25 | | -## Deploy |
26 | | - |
27 | | -Basic services:MySql、DongTai-Engine |
28 | | - |
29 | | -The basic service configuration is as follows: |
30 | | - |
31 | | -| service name | ip | port | additional | |
32 | | -| --- | --- | --- | --- | |
33 | | -| MySql | 127.0.0.1 | 3306 | account:dongtai<br>password:dongtai-iast<br>database name:dongtai_webapi | |
34 | | -| DongTai-Engine | 127.0.0.1 | 8081 | | |
35 | | - |
36 | | -### Official image |
37 | | - |
38 | | -1. Pull image |
39 | | -```shell script |
40 | | -$ docker pull registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-openapi:1.0.0 |
41 | | -``` |
42 | | - |
43 | | -2. Create a configuration file:`/etc/dongtai/config.ini`,The content is as follows: |
44 | | -```ini |
45 | | -[mysql] |
46 | | -host = 127.0.0.1 |
47 | | -port = 3306 |
48 | | -name = dongtai_webapi |
49 | | -user = dongtai |
50 | | -password = dongtai-iast |
51 | | - |
52 | | -[redis] |
53 | | -host = redis |
54 | | -port = port |
55 | | -password = password |
56 | | -db = 0 |
57 | | - |
58 | | - |
59 | | -[engine] |
60 | | -url = http://127.0.0.1:8081 |
61 | | - |
62 | | -; The following content unused, keep the default |
63 | | -[apiserver] |
64 | | -url = http://api_server_url |
65 | | - |
66 | | -[smtp] |
67 | | -server = server |
68 | | -user = user |
69 | | -password = password |
70 | | -from_addr = from_addr |
71 | | -ssl = False |
72 | | -cc_addr = cc_addr |
73 | | - |
74 | | -[aliyun_oss] |
75 | | -access_key = access_key |
76 | | -access_key_secret = access_key |
77 | | -``` |
78 | | - |
79 | | -3. Start the `dongtai-openapi` container and map the configuration file |
80 | | -```shell script |
81 | | -$ docker run -d --name dongtai-openapi -p 8000:8000 -v /etc/dongtai/config.ini:/opt/dongtai/openapi/conf/config.ini --restart=always huoxian_pub/dongtai-openapi:1.0.0 |
82 | | -``` |
83 | | - |
84 | | -### Build custom image |
85 | | - |
86 | | -1. Build image |
87 | | -```shell script |
88 | | -$ docker build -t huoxian_pub/dongtai-openapi:1.0.0 . |
89 | | -``` |
90 | | - |
91 | | -2. Create a configuration file:`/etc/dongtai/config.ini`,The content is as follows: |
92 | | -```ini |
93 | | -[mysql] |
94 | | -host = 127.0.0.1 |
95 | | -port = 3306 |
96 | | -name = dongtai_webapi |
97 | | -user = dongtai |
98 | | -password = dongtai-iast |
99 | | - |
100 | | -[redis] |
101 | | -host = redis |
102 | | -port = port |
103 | | -password = password |
104 | | -db = 0 |
105 | | - |
106 | | - |
107 | | -[engine] |
108 | | -url = http://127.0.0.1:8081 |
109 | | - |
110 | | -; The following content unused, keep the default |
111 | | -[apiserver] |
112 | | -url = http://api_server_url |
113 | | - |
114 | | -[smtp] |
115 | | -server = server |
116 | | -user = user |
117 | | -password = password |
118 | | -from_addr = from_addr |
119 | | -ssl = False |
120 | | -cc_addr = cc_addr |
121 | | - |
122 | | -[aliyun_oss] |
123 | | -access_key = access_key |
124 | | -access_key_secret = access_key |
125 | | -``` |
126 | | - |
127 | | -3. Start the `dongtai-openapi` container and map the configuration file |
128 | | -```shell script |
129 | | -$ docker run -d --name dongtai-openapi -p 8000:8000 -v /etc/dongtai/config.ini:/opt/dongtai/openapi/conf/config.ini --restart=always huoxian_pub/dongtai-openapi:1.0.0 |
130 | | -``` |
131 | | - |
132 | | -### Contributing |
133 | | -Contributions are welcomed and greatly appreciated. See [CONTRIBUTING.md](https://github.com/HXSecurity/DongTai/blob/main/CONTRIBUTING.md) for details on submitting patches and the contribution workflow. |
134 | | - |
135 | | -Any questions? Let's discuss in [#DongTai discussions](https://github.com/HXSecurity/DongTai/discussions) |
136 | | - |
137 | | -### More resources |
138 | | -- [Documentation](https://hxsecurity.github.io/DongTai-Doc/#/) |
139 | | -- [DongTai WebSite](https://iast.huoxian.cn/) |
0 commit comments