Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持dify 1.1及以上版本,修改版本号为1.1.0 #108

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

xieyos
Copy link

@xieyos xieyos commented Mar 15, 2025

支持dify 1.0级以上版本,修改版本号为1.0.1
fix #106

Comment on lines 387 to 388
- name: SERVER_KEY
value: "lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi"
Copy link
Contributor

Choose a reason for hiding this comment

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

该键值需要同样写进其他服务, 如 worker, 建议提供统一配置方式, 比如统一的 plaintext, 或统一引用 secret key

Comment on lines 395 to 396
- name: DIFY_INNER_API_KEY
value: "QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1"
Copy link
Contributor

Choose a reason for hiding this comment

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

SERVER_KEY 相同, 需要在其他位置渲染

- Introduce conditional logic in PVC, Deployment, and Service templates to handle embedded plugin daemon.
- Update values.yaml to include new environment variables and configuration options for the plugin daemon.
- Ensure proper handling of environment variables for the plugin daemon in the deployment configuration.
@xieyos xieyos requested a review from LeoQuote March 18, 2025 07:38
Copy link
Contributor

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

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

谢谢修改, 另外还请 bump version

Comment on lines 39 to 44
- name: SERVER_KEY
value: "lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi"
- name: PLUGIN_DAEMON_KEY
value: "lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi"
- name: DIFY_INNER_API_KEY
value: "QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1"
Copy link
Contributor

Choose a reason for hiding this comment

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

请参照 sandbox.apiKeysandbox.apiKeySecret 的实现方式进行实现 , 参考 https://github.com/douban/charts/blob/4642a9f68e1fac36d3018f45eb82234573735c75/charts/dify/values.yaml#L303C1-L307C19 此处的实现需要用户重复写一个key, 且需要用户来保证这两个环境变量完全相同

…ronment variable handling for API keys

- Change condition from `pluginDaemon.embedded` to `pluginDaemon.enabled` in PVC and Service templates.
- Introduce environment variable `PLUGIN_DAEMON_KEY` in Deployment templates, supporting both secret reference and direct value.
- Update `values.yaml` to reflect changes in plugin daemon configuration, including enabling the daemon and specifying API keys.
- Increment chart version to 0.5.2 and app version to 0.6.12.

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.6.11"
appVersion: "0.6.12"
Copy link
Contributor

Choose a reason for hiding this comment

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

appversion 请bump 至 dify 最新版

@@ -20,13 +20,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.1
version: 0.5.2
Copy link
Contributor

Choose a reason for hiding this comment

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

新version选 0.6.0 因为提供了新功能

replicaCount: 1
# please change to avoid abuse 对应官方配置 SERVER_KEY PLUGIN_DAEMON_KEY
apiKey: "lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi"
Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/search?q=repo%3Alanggenius%2Fdify+PLUGIN_DIFY_INNER_API_KEY&type=code

PLUGIN_DIFY_INNER_API_KEY 同样需要在worker/api 等区域进行注入,并且环境变量名字不同,请设计不同的名字防止混淆

{{- else if .Values.pluginDaemon.apiKey }}
value: {{ .Values.pluginDaemon.apiKey | quote }}
{{- else }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

此处代码和上面一处重复,如果需要同时在dify api 和 dify worker 内注入,请修改 dify.commonBackendEnvs 来尽可能进行代码复用

@notz
Copy link

notz commented Mar 19, 2025

I'm missing some required env. For me, REDIS_PORT was required on plugin daemon, also the plugin daemon url needs to be added to api and probably worker.

master...notz:douban-charts:master

@LeoQuote
Copy link
Contributor

LeoQuote commented Mar 19, 2025

@notz thanks for your suggestion, this pr is still WIP and currently I have no time to test it for real, definitely will do a real install test before it's merged. Any kind of help would be appriciated, including drafting a brand new pull request.

This commit refactors the plugin daemon configuration and adds a new environment variable for the Redis port.

Changes:

- Rename `apiKey` and `apiKeySecret` to `serverKey`, `serverKeySecret`, `difyInnerApiKey`, and `difyInnerApiKeySecret` in `values.yaml` and `deployment.yaml`.
- Add `MARKETPLACE_API_URL`, `PLUGIN_DAEMON_KEY`, and `PLUGIN_DIFY_INNER_API_KEY` environment variables to `_helpers.tpl` when plugin daemon is enabled.
- Add `REDIS_PORT` environment variable to `_helpers.tpl` when embedded Redis is enabled.
- Update dify and plugin-daemon image tags.
- Update chart and app versions.
@notz
Copy link

notz commented Mar 19, 2025

@xieyos the PLUGIN_DAEMON_URL is still missing. Should be added to commonBackendEnvs

@xieyos xieyos changed the title 支持dify 1.0级以上版本,修改版本号为1.0.1 支持dify 1.1及以上版本,修改版本号为1.1.0 Mar 20, 2025
Adds the `PLUGIN_DAEMON_URL` environment variable to the helper template when plugin daemon is enabled.
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.

[FR] Dify1.0 support
3 participants