Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.
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
14 changes: 1 addition & 13 deletions en/plugins/publish-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,4 @@ For detailed instructions, please refer to:
* **Open-source sharing project** → **Recommended to use GitHub**, convenient for version management and community collaboration.
* **Quick distribution or internal testing** → **Recommended to use plugin file**, allowing for straightforward and efficient installation and sharing.

## Third-Party Signature Verification

{% hint style="warning" %}
This feature is only available in the Dify Community Edition. Third-party signature verification is not supported in Dify Cloud Edition at this time.
{% endhint %}

With third-party signature verification, Dify administrators can safely permit the installation of plugins not listed on the Dify Marketplace without completely disabling signature validation.

Dify administrators can add signatures to verified plugins using pre-approved private keys. In addition, Dify can be configured to verify plugins using pre-approved public keys during installation.

For more details, please refer to:

[Sign Plugins for Third-Party Signature Verification](./sign-plugin-for-third-party-signature-verification)
> When installing plugins that are not from the Dify Marketplace, you may encounter third-party signature verification issues. For solutions, please refer to [Signing Plugins for Third-Party Signature Verification](./signing-plugins-for-third-party-signature-verification.md).
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ cd docker
docker compose down
docker compose up -d
```

After restarting the service, the third-party signature verification feature will be enabled in the current Community Edition environment.
14 changes: 1 addition & 13 deletions jp/plugins/publish-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,4 @@
* オープンソースプロジェクトの共有 → GitHubの利用を推奨。バージョン管理とコミュニティコラボレーションが容易です。
* 迅速な配布や内部テスト → プラグインファイルの利用を推奨。簡単かつ効率的なインストールと共有が可能です。

## 第三者署名検証

{% hint style="warning" %}
この機能はコミュニティ版でのみ利用できます。クラウドサービスでは、現時点では第三者署名検証はサポートされていません。
{% endhint %}

第三者署名検証により、Dify の管理者は、Dify Marketplace にリストされていないプラグインのインストールを、署名の検証を完全に無効化することなく、安全に許可できるようになります。

Dify の管理者は、事前に許可した秘密鍵で、検証済みのプラグインに署名を追加できます。また、プラグインのインストール時に、事前に許可した公開鍵による検証を行うように Dify を構成できます。

詳細については以下をご参照ください:

[第三者署名検証のためにプラグインに署名する](./sign-plugin-for-third-party-signature-verification)
> Difyマーケットプレイス以外のプラグインをインストールする際、サードパーティの署名検証に関する問題が発生する可能性があります。対処方法については、[第三者署名検証のためにプラグインに署名する](./signing-plugins-for-third-party-signature-verification.md)をご参照ください。
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ cd docker
docker compose down
docker compose up -d
```

サービスを再起動すると、現在のコミュニティ版環境でサードパーティ署名の検証機能が有効になります。
1 change: 1 addition & 0 deletions zh_CN/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
* [插件隐私政策准则](plugins/publish-plugins/publish-to-dify-marketplace/plugin-privacy-protection-guidelines.md)
* [发布至个人 GitHub 仓库](plugins/publish-plugins/publish-plugin-on-personal-github-repo.md)
* [本地发布与分享](plugins/publish-plugins/package-plugin-file-and-publish.md)
* [第三方签名验证](plugins/publish-plugins/signing-plugins-for-third-party-signature-verification.md)
* [常见问题](plugins/faq.md)

## 研发 <a href="#development" id="development"></a>
Expand Down
2 changes: 2 additions & 0 deletions zh_CN/plugins/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ docker compose up -d
添加该字段后,Dify 平台将允许安装所有未在 Dify Marketplace 上架(审核)的插件,可能存在安全隐患。

建议在测试 / 沙箱环境内安装插件,确认安全后再安装至生产环境。

如果你希望采取更加严格的措施控制插件的安装,请参考[第三方签名验证](/zh_CN/plugins/publish-plugins/signing-plugins-for-third-party-signature-verification.md)。
2 changes: 2 additions & 0 deletions zh_CN/plugins/publish-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@
* **想要推广插件** → **推荐使用 Marketplace**,通过官方审核保障插件质量,提升曝光度。
* **开源共享项目** → **推荐使用 GitHub**,方便版本管理与社区协作。
* **快速分发或内部测试** → **推荐使用插件文件**,简单高效地安装和分享。

> 安装非 Dify 市场内的插件时,有可能遇到第三方签名验证问题。解决办法请参考[第三方签名验证](./signing-plugins-for-third-party-signature-verification.md)。
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 第三方签名验证

{% hint style="warning" %}
此功能仅在 Dify 社区版中可用,Dify 云端版目前不支持第三方签名验证。
{% endhint %}

第三方签名验证允许 Dify 管理员安全地安装尚未在 Dify 市场上提供的插件,而无需修改 `.env` 文件绕开签名验证安全限制。详细说明请参考[常见问题](/zh-hans/plugins/faq)。

**使用场景:**

* 一经同意,Dfy 管理员可以为插件添加由开发者发送的签名。
* 插件开发者可以为他们的插件添加签名,并将其与公钥一起发布给无法禁用签名验证的 Dify 管理员。

Dify 管理员和插件开发者都可以使用预先生成的密钥对为插件添加签名。此外,管理员可以配置 Dify 在插件安装过程中使用特定公钥强制执行签名验证。

## 生成用于签名和验证的密钥对

使用以下命令生成新的密钥对,用于添加和验证插件签名:

```bash
dify signature generate -f your_key_pair
```

运行此命令后,将在当前目录中生成两个文件:

* **私钥**:`your_key_pair.private.pem`
* **公钥**:`your_key_pair.public.pem`

私钥用于签名插件,公钥用于验证插件的签名。

{% hint style="warning" %}
请妥善保管私钥。如果私钥被泄露,攻击者可以为任何插件添加有效签名,这将危及 Dify 社区版的安全性。
{% endhint %}

## 为插件添加签名并验证

运行以下命令为插件添加签名。请注意,你需要指定**待签名的插件文件**和**私钥**:

```bash
dify signature sign your_plugin_project.difypkg -p your_key_pair.private.pem
```

执行命令后,将在同一目录中生成一个新的插件文件,文件名中添加了 `signed`:`your_plugin_project.signed.difypkg`

你可以使用以下命令验证插件是否已正确签名。运行命令时需要指定**已签名的插件文件**和**公钥**:

```bash
dify signature verify your_plugin_project.signed.difypkg -p your_key_pair.public.pem
```

{% hint style="info" %}
如果省略公钥参数,验证将使用 Dify 市场公钥。在这种情况下,对于任何未从 Dify 市场下载的插件文件,签名验证将失败。
{% endhint %}

## 启用第三方签名验证

Dify 管理员可以在安装插件前强制使用预先批准的公钥进行签名验证。

### 放置公钥

将用于签名的私钥对应的**公钥**放在插件守护程序可以访问的位置。

例如,在 `docker/volumes/plugin_daemon` 下创建 `public_keys` 目录,并将公钥文件复制到对应路径:

```bash
mkdir docker/volumes/plugin_daemon/public_keys
cp your_key_pair.public.pem docker/volumes/plugin_daemon/public_keys
```

### 环境变量配置

在 `plugin_daemon` 容器中,配置以下环境变量:

* `THIRD_PARTY_SIGNATURE_VERIFICATION_ENABLED`
* 启用第三方签名验证。
* 将此项设置为 `true` 以启用此功能。
* `THIRD_PARTY_SIGNATURE_VERIFICATION_PUBLIC_KEYS`
* 指定用于签名验证的公钥文件路径。
* 你可以列出多个公钥文件,用逗号分隔。

以下是配置这些变量的 Docker Compose 覆盖文件 (`docker-compose.override.yaml`) 示例:

```yaml
services:
plugin_daemon:
environment:
FORCE_VERIFYING_SIGNATURE: true
THIRD_PARTY_SIGNATURE_VERIFICATION_ENABLED: true
THIRD_PARTY_SIGNATURE_VERIFICATION_PUBLIC_KEYS: /app/storage/public_keys/your_key_pair.public.pem
```

{% hint style="info" %}
请注意,`docker/volumes/plugin_daemon` 在 `plugin_daemon` 容器中被挂载到 `/app/storage`。确保在 `THIRD_PARTY_SIGNATURE_VERIFICATION_PUBLIC_KEYS` 中指定的路径对应于容器内的路径。
{% endhint %}

要应用这些更改,请重启 Dify 服务:

```bash
cd docker
docker compose down
docker compose up -d
```

重启服务后,第三方签名验证功能将在当前社区版环境中启用。
Loading