Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 构建阶段:处理插件和元数据
FROM python:3.11-alpine AS builder
FROM higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/python:3.11-alpine AS builder

# 安装系统依赖
RUN apk add --no-cache \
Expand Down
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# plugin-server
http server for higress wasmplugin
# Higress Plugin Server
=======

HTTP server for Higress Wasm plugins

## 构建插件服务器镜像并推送

### 构建本地架构镜像

```bash
docker build -t higress-plugin-server:1.0.0 -f Dockerfile .
```

### 构建多架构镜像并推送至仓库

```bash
docker buildx build \
--platform linux/amd64,linux/arm64 \
Expand All @@ -9,10 +21,42 @@ docker buildx build \
--push \
.
```
## 在 higress-console 中配置插件下载地址

## 本地启动插件服务器

```bash
docker run -d --name higress-plugin-server --rm -p 8080:8080 higress-plugin-server:1.0.0
```

## 配置插件地址

### 在 Higress Console 中配置插件下载地址

要满足这一需求,只需要为 Higress Console 容器添加 HIGRESS_ADMIN_WASM_PLUGIN_CUSTOM_IMAGE_URL_PATTERN 环境变量,值为自定义镜像地址的格式模版。模版可以按需使用 ${name} 和 ${version} 作为插件名称和镜像版本的占位符。
在进行了以下配置后,

示例:

```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 可以用来访问插件服务器的地址。
Copy link
Copy Markdown

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:端口)

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

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


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/
Comment on lines +38 to +62
Copy link
Copy Markdown

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

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

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

Loading