Skip to content

feat(dify): make public URLs individually overridable - #172

Merged
LeoQuote merged 1 commit into
douban:masterfrom
this-is-eis:feat/dify-per-url-overrides
Jul 3, 2026
Merged

feat(dify): make public URLs individually overridable#172
LeoQuote merged 1 commit into
douban:masterfrom
this-is-eis:feat/dify-per-url-overrides

Conversation

@this-is-eis

@this-is-eis this-is-eis commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

dify.commonEnvs currently derives all public URL env vars from a single dify.baseUrl (global.host / baseUrlOverride), so the chart is effectively single-domain:

{{- range tuple "CONSOLE_API_URL" "CONSOLE_WEB_URL" "SERVICE_API_URL" "APP_API_URL" "APP_WEB_URL" }}
- name: {{ . }}
  value: {{ include "dify.baseUrl" $ }}
{{- end }}

Dify itself supports serving the console, the published WebApp, and the service API on different hostnames. Today the only way to do that with this chart is to fork it or resort to duplicate-env hacks. This PR lets each URL be set independently, while keeping the single-domain default untouched.

fix #171

Changes

  • Emit each public URL from its own optional global.* value, defaulting to dify.baseUrl when unset.
  • Add three new optional vars that are emitted only when set (Dify's own defaults apply otherwise): FILES_URL, TRIGGER_URL, NEXT_PUBLIC_SOCKET_URL.
  • Document the new values in values.yaml (commented, under global:) and README.md.
  • Bump chart version 0.9.10.10.0.

New global.* values

value env var default when unset
consoleApiUrl CONSOLE_API_URL dify.baseUrl
consoleWebUrl CONSOLE_WEB_URL dify.baseUrl
serviceApiUrl SERVICE_API_URL dify.baseUrl
appApiUrl APP_API_URL dify.baseUrl
appWebUrl APP_WEB_URL dify.baseUrl
endpointUrlTemplate ENDPOINT_URL_TEMPLATE <baseUrl>/e/{hook_id}
filesUrl FILES_URL (not emitted)
triggerUrl TRIGGER_URL (not emitted)
nextPublicSocketUrl NEXT_PUBLIC_SOCKET_URL (not emitted)

Backward compatibility

100% — with no new values set, the rendered env is byte-identical to the current chart. Verified with helm template: a full render with default values diffs clean against master (aside from the helm.sh/chart version label). The five console/app/service URLs equal baseUrl, ENDPOINT_URL_TEMPLATE equals <baseUrl>/e/{hook_id}, and the three new vars stay absent.

Testing

helm template dify charts/dify                              # matches master when no new values set
helm template dify charts/dify --set global.consoleApiUrl=https://console.example.com \
  --set global.serviceApiUrl=https://api.example.com       # each URL reflects its override; unset ones fall back to baseUrl
helm lint charts/dify                                       # passes

`dify.commonEnvs` derived all public URL env vars (CONSOLE_API_URL,
CONSOLE_WEB_URL, SERVICE_API_URL, APP_API_URL, APP_WEB_URL,
ENDPOINT_URL_TEMPLATE) from a single `dify.baseUrl`, so the chart was
single-domain only. Dify itself supports serving the console, published
WebApp, and service API on different hosts.

Emit each URL from its own optional `global.*` value, defaulting to
`dify.baseUrl` so unset behavior is byte-identical to before. Also add
optional FILES_URL, TRIGGER_URL, and NEXT_PUBLIC_SOCKET_URL, emitted only
when set.

Verified with `helm template`: a render with no new values set is identical
to the previous chart.
@LeoQuote
LeoQuote merged commit 776a0d4 into douban:master Jul 3, 2026
1 check passed
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.

[BUG] Public URLs cannot be set independently — chart is single-domain only

2 participants