Skip to content

feat: Switch to higress-hosted image repo and update README.md#3

Merged
lexburner merged 1 commit intohigress-group:mainfrom
CH3CHO:feat/higress-repo
Jun 17, 2025
Merged

feat: Switch to higress-hosted image repo and update README.md#3
lexburner merged 1 commit intohigress-group:mainfrom
CH3CHO:feat/higress-repo

Conversation

@CH3CHO
Copy link
Contributor

@CH3CHO CH3CHO commented Jun 17, 2025

No description provided.

@CH3CHO CH3CHO had a problem deploying to image-registry-plugin-server June 17, 2025 02:36 — with GitHub Actions Failure
@lingma-agents
Copy link

lingma-agents bot commented Jun 17, 2025

更新镜像仓库来源及完善插件服务器文档说明

变更概述

依赖更新

  • Dockerfile: 更换基础镜像来源
    • 构建阶段基础镜像从 python:3.11-alpine 切换为 higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/python:3.11-alpine
    • 目的:使用Higress官方托管镜像确保构建环境一致性

文档

  • README.md: 完善全流程使用文档
    • 新增架构构建/多架构构建的命令示例
    • 补充本地运行命令 docker run 的具体参数
    • 增加Higress Console和Controller的配置说明
      • 环境变量 HIGRESS_ADMIN_WASM_PLUGIN_CUSTOM_IMAGE_URL_PATTERN
      • 环境变量 MCP_SERVER_WASM_IMAGE_URL 的配置模板
    • 添加官方文档链接参考

配置调整

  • 环境变量配置指导:
    • 定义插件地址模板使用 ${name}${version} 占位符
    • 示例配置包含服务发现地址 higress-plugin-server.higress-system.svc
变更统计
  • 📁 修改文件: 2 个文件

  • ✅ 新增代码: +49 行

  • ❌ 删除代码: -5 行

变更文件
文件路径 变更说明
Dockerfile 更换基础镜像仓库为Higress托管的镜像
README.md 补充构建流程、运行命令和环境变量配置说明

💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @lingma-agents 分析这个方法的性能瓶颈并提供优化建议。

  • @lingma-agents 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @lingma-agents 请总结上述讨论并提出解决方案。

  • @lingma-agents 请根据讨论内容生成优化代码。

Copy link

@lingma-agents lingma-agents bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔎 代码评审报告

🎯 评审意见概览
严重度 数量 说明
🔴 Blocker 0 阻断性问题,需立即修复。例如:系统崩溃、关键功能不可用或严重安全漏洞。
🟠 Critical 1 严重问题,高优先级修复。例如:核心功能异常或性能瓶颈影响用户体验。
🟡 Major 0 主要问题,建议修复。例如:非核心功能缺陷或代码维护性较差。
🟢 Minor 1 次要问题,酬情优化。例如:代码格式不规范或注释缺失。

总计: 2 个问题

📋 评审意见详情
💡 代码实现建议
以下是文件级别的代码建议,聚焦于代码的可读性、可维护性和潜在问题。
📖 README.md (2 💬)
🚀 架构设计建议
以下是对代码架构和设计的综合分析,聚焦于跨文件交互、系统一致性和潜在优化空间。
🔍1. 配置地址说明重复,需统一管理

在README.md中,配置插件地址的说明在两个不同位置(配置Higress Console和Higress Controller)重复出现,导致维护时容易出现不一致。例如,两处均要求替换higress-plugin-server.higress-system.svc地址,但未抽象为公共说明或配置模板。建议将地址配置逻辑集中管理,避免分散在多个环境变量说明中,降低未来维护成本。

📌 关键代码

> `higress-plugin-server.higress-system.svc` 替换为 Higress Gateway 可以用来访问插件服务器的地址。
> `higress-plugin-server.higress-system.svc` 替换为 Higress Gateway 可以用来访问插件服务器的地址。

⚠️ 潜在风险

重复说明可能导致配置不一致,例如后续需修改地址格式时,可能遗漏某个位置的更新,引发插件加载失败。

🔍2. 系统配置使用HTTP协议存在安全风险

README.md中多个示例配置(如HIGRESS_ADMIN_WASM_PLUGIN_CUSTOM_IMAGE_URL_PATTERN和MCP_SERVER_WASM_IMAGE_URL)均使用HTTP协议,未强制使用HTTPS。Wasm插件加载涉及敏感配置,应统一采用加密协议以防止中间人攻击或数据泄露。

📌 关键代码

http://higress-plugin-server.higress-system.svc/plugins/${name}/${version}/plugin.wasm
http://higress-plugin-server.higress-system.svc/plugins/mcp-server/1.0.0/plugin.wasm

⚠️ 潜在风险

HTTP传输可能暴露插件地址或敏感数据,增加安全风险。若插件包含机密逻辑,未加密传输可能导致信息泄露。

🔍3. 镜像仓库切换缺乏架构说明

Dockerfile中基础镜像从公共仓库python:3.11-alpine切换为Higress私有仓库higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/python:3.11-alpine,但未在文档中说明此架构变更的原因(如镜像定制化、合规性要求等)。此变更可能增加对外部依赖的耦合性,需补充说明以确保团队对架构决策的理解。

📌 关键代码

FROM higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/python:3.11-alpine AS builder

⚠️ 潜在风险

未记录架构变更可能导致未来维护者误用公共镜像或无法理解私有仓库的依赖关系,增加维护成本。

审查详情
📒 文件清单 (2 个文件)
📝 变更: 2 个文件

📝 变更文件:

  • Dockerfile
  • README.md

💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @lingma-agents 分析这个方法的性能瓶颈并提供优化建议。

  • @lingma-agents 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @lingma-agents 请总结上述讨论并提出解决方案。

  • @lingma-agents 请根据讨论内容生成优化代码。

Comment on lines +38 to +62

```bash
HIGRESS_ADMIN_WASM_PLUGIN_CUSTOM_IMAGE_URL_PATTERN=http://higress-plugin-server.higress-system.svc/plugins/${name}/${version}/plugin.wasm
```

> `higress-plugin-server.higress-system.svc` 替换为 Higress Gateway 可以用来访问插件服务器的地址。

Higress Console 针对 key-rate-limit 插件生成的镜像地址将为:http://higress-plugin-server.higress-system.svc/plugins/key-rate-limit/1.0.0/plugin.wasm

### 修改对接 Nacos 3.x 所生成的 MCP Server 插件地址配置

要满足这一需求,只需要为 Higress Controller 容器添加 MCP_SERVER_WASM_IMAGE_URL 环境变量,值为根据自定义镜像地址格式模版生成的 mcp-server 插件地址。

示例:

```bash
MCP_SERVER_WASM_IMAGE_URL=http://higress-plugin-server.higress-system.svc/plugins/mcp-server/1.0.0/plugin.wasm
```

> `higress-plugin-server.higress-system.svc` 替换为 Higress Gateway 可以用来访问插件服务器的地址。

## 参考文档

- 如何修改内置插件镜像地址:https://higress.cn/docs/latest/ops/how-tos/builtin-plugin-url/
- 如何使用 HTTP/HTTPS 协议加载 Wasm 插件:https://higress.cn/docs/latest/ops/how-tos/load-wasm-with-http/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

示例配置中使用HTTP协议存在安全风险

🟠 Critical | 🔓 Vulnerabilities

📋 问题详情

在配置Wasm插件地址时,示例使用了HTTP协议,这可能导致中间人攻击和数据泄露。建议在生产环境中使用HTTPS协议确保传输安全。

💡 解决方案

将HTTP协议改为HTTPS:

-http://higress-plugin-server.higress-system.svc/plugins/${name}/${version}/plugin.wasm
+https://higress-plugin-server.higress-system.svc/plugins/${name}/${version}/plugin.wasm

您的反馈对我们很重要!(建议右键在新标签页中打开以下链接)

有用意见👍无用意见👎错误意见❌

HIGRESS_ADMIN_WASM_PLUGIN_CUSTOM_IMAGE_URL_PATTERN=http://higress-plugin-server.higress-system.svc/plugins/${name}/${version}/plugin.wasm
```

> `higress-plugin-server.higress-system.svc` 替换为 Higress Gateway 可以用来访问插件服务器的地址。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档中存在重复的地址替换说明

🟢 Minor | 🧹 Code Smells

📋 问题详情

在Higress Console和MCP Server配置章节都出现了相同的地址替换说明,存在重复内容。建议将重复的说明合并到统一位置,提升文档可读性。

💡 解决方案

合并重复说明:

-在Higress Console章节保留原说明
-删除MCP Server章节的重复说明
+将两个章节的说明合并为统一提示:
> `higress-plugin-server.higress-system.svc` 需替换为Higress Gateway可访问的实际地址(如服务域名或IP:端口)

您的反馈对我们很重要!(建议右键在新标签页中打开以下链接)

有用意见👍无用意见👎错误意见❌

@lexburner
Copy link
Contributor

pr 可以不触发 action,该 check 可以先忽略,我先合并,后续优化 github action

@lexburner lexburner merged commit 0df0e7e into higress-group:main Jun 17, 2025
2 of 3 checks passed
@CH3CHO CH3CHO deleted the feat/higress-repo branch June 17, 2025 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants