diff --git a/apps/apifox-runner-team/README.md b/apps/apifox-runner-team/README.md new file mode 100644 index 000000000..6bd73aa45 --- /dev/null +++ b/apps/apifox-runner-team/README.md @@ -0,0 +1,64 @@ +# Apifox Runner + +自动化测试定时任务、接口导入、Mock 服务 + +![Apifox Runner](https://file.lifebus.top/imgs/apifox_runner_cover.png) + +![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue) + +## 简介 + +API 设计、开发、测试一体化协作平台 + +Apifox = Postman + Swagger + Mock + JMeter + +一套系统、一份数据,解决多个 API 工具之间的数据同步问题 +只要定义好 API 文档,API 调试、API Mock、API 自动化测试即可直接使用,无需再次定义。 + +API 文档和 API 开发调试使用同一个工具,API 调试完成后即可保证和 API 文档定义完全一致。高效、及时、准确! + +## 特性 + +- [x] 可视化 API 设计 +- [x] 比 Postman 更强大 +- [x] 零门槛实现自动化测试 +- [x] 分享&发布 API 文档 +- [x] 零配置 Mock 数据 +- [x] CI/CD 持续集成 +- [x] 数据库操作 +- [x] 团队协作 +- [x] 支持 HTTP、TCP、RPC +- [x] 数据导入/导出 +- [x] 自动生成代码 + +## 安装说明 + +### 版本说明 + +- `latest`:通用版 + 包含 Runner 所有功能,及以下外部程序语言环境:Nodejs 18,Java 21,Python 3,PHP 8 + +- `slim`:精简版 + 在精简版中,包含 Runner 所有功能,及以下外部程序语言环境:Nodejs 18 + +### 应用服务地址 + +默认值:`https://api.apifox.cn` + +部署时推荐填写公网地址,以保证应用在团队中正常运行。 + +### 访问令牌 (Access Token) + +请在ApiFox客户端,前往主窗口 `团队资源` >> `通用 Runner` 获取访问令牌 + +### 团队 ID (Team ID) + +请在ApiFox客户端,前往主窗口 `团队设置` 获取团队 ID + +### Runner ID + +请在ApiFox客户端,前往主窗口 `团队资源` >> `通用 Runner` 获取 Runner ID + +--- + +![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png) diff --git a/apps/apifox-runner-team/data.yml b/apps/apifox-runner-team/data.yml new file mode 100644 index 000000000..47ba71808 --- /dev/null +++ b/apps/apifox-runner-team/data.yml @@ -0,0 +1,14 @@ +additionalProperties: + key: apifox-runner-team + name: Apifox Runner (团队版) + tags: + - Runtime + - Local + shortDescZh: 自动化测试定时任务、接口导入、Mock 服务 + shortDescEn: Automated testing, scheduled tasks, interface import, Mock service + type: runtime + crossVersionUpdate: true + limit: 0 + website: https://apifox.com/ + github: https://apifox.com/ + document: https://apifox.com/help/ diff --git a/apps/apifox-runner-team/latest/data.yml b/apps/apifox-runner-team/latest/data.yml new file mode 100644 index 000000000..82139f8c7 --- /dev/null +++ b/apps/apifox-runner-team/latest/data.yml @@ -0,0 +1,45 @@ +additionalProperties: + formFields: + - default: "/home/apifox-runner" + edit: true + envKey: APIFOX_RUNNER_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 4524 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number + - default: "https://api.apifox.cn" + edit: true + envKey: SERVER_APP_BASE_URL + labelZh: 应用服务地址 + labelEn: App Server address + required: true + type: text + - default: "" + edit: true + envKey: ACCESS_TOKEN + labelZh: 访问令牌 + labelEn: Access Token + required: true + type: text + - default: 0 + edit: true + envKey: TEAM_ID + labelZh: 团队 ID + labelEn: Team ID + required: true + type: number + - default: 0 + edit: true + envKey: RUNNER_ID + labelZh: Runner ID + labelEn: Runner ID + required: true + type: number diff --git a/apps/apifox-runner-team/latest/docker-compose.yml b/apps/apifox-runner-team/latest/docker-compose.yml new file mode 100644 index 000000000..170b7f0d7 --- /dev/null +++ b/apps/apifox-runner-team/latest/docker-compose.yml @@ -0,0 +1,22 @@ +networks: + 1panel-network: + external: true + +services: + apifox-runner: + image: registry.cn-hangzhou.aliyuncs.com/apifox/self-hosted-general-runner + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:4524 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${APIFOX_RUNNER_ROOT_PATH}/runner:/opt/runner + environment: + - TZ=Asia/Shanghai diff --git a/apps/apifox-runner-team/latest/envs/default.env b/apps/apifox-runner-team/latest/envs/default.env new file mode 100644 index 000000000..cd05f46e6 --- /dev/null +++ b/apps/apifox-runner-team/latest/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/apifox-runner-team/latest/envs/global.env b/apps/apifox-runner-team/latest/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/apifox-runner-team/latest/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/apifox-runner-team/latest/scripts/init.sh b/apps/apifox-runner-team/latest/scripts/init.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/apifox-runner-team/latest/scripts/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/apifox-runner-team/latest/scripts/uninstall.sh b/apps/apifox-runner-team/latest/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/apifox-runner-team/latest/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/apifox-runner-team/latest/scripts/upgrade.sh b/apps/apifox-runner-team/latest/scripts/upgrade.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/apifox-runner-team/latest/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/apifox-runner-team/logo.png b/apps/apifox-runner-team/logo.png new file mode 100644 index 000000000..2aa3008c2 Binary files /dev/null and b/apps/apifox-runner-team/logo.png differ diff --git a/apps/apifox-runner-team/slim/data.yml b/apps/apifox-runner-team/slim/data.yml new file mode 100644 index 000000000..82139f8c7 --- /dev/null +++ b/apps/apifox-runner-team/slim/data.yml @@ -0,0 +1,45 @@ +additionalProperties: + formFields: + - default: "/home/apifox-runner" + edit: true + envKey: APIFOX_RUNNER_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 4524 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number + - default: "https://api.apifox.cn" + edit: true + envKey: SERVER_APP_BASE_URL + labelZh: 应用服务地址 + labelEn: App Server address + required: true + type: text + - default: "" + edit: true + envKey: ACCESS_TOKEN + labelZh: 访问令牌 + labelEn: Access Token + required: true + type: text + - default: 0 + edit: true + envKey: TEAM_ID + labelZh: 团队 ID + labelEn: Team ID + required: true + type: number + - default: 0 + edit: true + envKey: RUNNER_ID + labelZh: Runner ID + labelEn: Runner ID + required: true + type: number diff --git a/apps/apifox-runner-team/slim/docker-compose.yml b/apps/apifox-runner-team/slim/docker-compose.yml new file mode 100644 index 000000000..549cd4fe2 --- /dev/null +++ b/apps/apifox-runner-team/slim/docker-compose.yml @@ -0,0 +1,22 @@ +networks: + 1panel-network: + external: true + +services: + apifox-runner: + image: registry.cn-hangzhou.aliyuncs.com/apifox/self-hosted-general-runner:slim + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:4524 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${APIFOX_RUNNER_ROOT_PATH}/runner:/opt/runner + environment: + - TZ=Asia/Shanghai diff --git a/apps/apifox-runner-team/slim/envs/default.env b/apps/apifox-runner-team/slim/envs/default.env new file mode 100644 index 000000000..cd05f46e6 --- /dev/null +++ b/apps/apifox-runner-team/slim/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/apifox-runner-team/slim/envs/global.env b/apps/apifox-runner-team/slim/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/apifox-runner-team/slim/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/apifox-runner-team/slim/scripts/init.sh b/apps/apifox-runner-team/slim/scripts/init.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/apifox-runner-team/slim/scripts/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/apifox-runner-team/slim/scripts/uninstall.sh b/apps/apifox-runner-team/slim/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/apifox-runner-team/slim/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/apifox-runner-team/slim/scripts/upgrade.sh b/apps/apifox-runner-team/slim/scripts/upgrade.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/apifox-runner-team/slim/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/apifox-runner/README.md b/apps/apifox-runner/README.md index 6bd73aa45..605774a52 100644 --- a/apps/apifox-runner/README.md +++ b/apps/apifox-runner/README.md @@ -1,4 +1,4 @@ -# Apifox Runner +# Apifox Runner (组织版) 自动化测试定时任务、接口导入、Mock 服务 diff --git a/apps/apifox-runner/data.yml b/apps/apifox-runner/data.yml index e969b6001..72909fa0a 100644 --- a/apps/apifox-runner/data.yml +++ b/apps/apifox-runner/data.yml @@ -1,6 +1,6 @@ additionalProperties: key: apifox-runner - name: Apifox Runner + name: Apifox Runner (组织版) tags: - Runtime - Local diff --git a/apps/apifox-runner/latest/data.yml b/apps/apifox-runner/latest/data.yml index 82139f8c7..beda67ac7 100644 --- a/apps/apifox-runner/latest/data.yml +++ b/apps/apifox-runner/latest/data.yml @@ -31,9 +31,9 @@ additionalProperties: type: text - default: 0 edit: true - envKey: TEAM_ID - labelZh: 团队 ID - labelEn: Team ID + envKey: ORGANIZATION_ID + labelZh: 组织 ID + labelEn: Organization ID required: true type: number - default: 0 diff --git a/apps/apifox-runner/slim/data.yml b/apps/apifox-runner/slim/data.yml index 82139f8c7..beda67ac7 100644 --- a/apps/apifox-runner/slim/data.yml +++ b/apps/apifox-runner/slim/data.yml @@ -31,9 +31,9 @@ additionalProperties: type: text - default: 0 edit: true - envKey: TEAM_ID - labelZh: 团队 ID - labelEn: Team ID + envKey: ORGANIZATION_ID + labelZh: 组织 ID + labelEn: Organization ID required: true type: number - default: 0