Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat: update privacy policy URL and add validation for privacy policy link (#18422)

Ethanc768d9763771
diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx
index 896229d4337..679d616e548 100644
--- a/web/app/components/app/overview/settings/index.tsx
+++ b/web/app/components/app/overview/settings/index.tsx
@@ -162,11 +162,22 @@ const SettingsModal: FC<ISettingsModalProps> = ({
return check
}
+ const validatePrivacyPolicy = (privacyPolicy: string | null) => {
+ if (privacyPolicy === null || privacyPolicy?.length === 0)
+ return true
+
+ return privacyPolicy.startsWith('http://') || privacyPolicy.startsWith('https://')
+ }
+
if (inputInfo !== null) {
if (!validateColorHex(inputInfo.chatColorTheme)) {
notify({ type: 'error', message: t(`${prefixSettings}.invalidHexMessage`) })
return
}
+ if (!validatePrivacyPolicy(inputInfo.privacyPolicy)) {
+ notify({ type: 'error', message: t(`${prefixSettings}.invalidPrivacyPolicy`) })
+ return
+ }
}
setSaveLoading(true)
@@ -410,7 +421,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
<p className={cn('body-xs-regular pb-0.5 text-text-tertiary')}>
<Trans
i18nKey={`${prefixSettings}.more.privacyPolicyTip`}
- components={{ privacyPolicyLink: <Link href={'https://docs.dify.ai/user-agreement/privacy-policy'} target='_blank' rel='noopener noreferrer' className='text-text-accent' /> }}
+ components={{ privacyPolicyLink: <Link href={'https://dify.ai/privacy'} target='_blank' rel='noopener noreferrer' className='text-text-accent' /> }}
/>
</p>
<Input
diff --git a/web/i18n/de-DE/app-overview.ts b/web/i18n/de-DE/app-overview.ts
index 018925720f1..fea278dad7c 100644
--- a/web/i18n/de-DE/app-overview.ts
+++ b/web/i18n/de-DE/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Legen Sie das Farbschema des Chatbots fest',
chatColorThemeInverted: 'Invertiert',
invalidHexMessage: 'Ungültiger Hex-Wert',
+ invalidPrivacyPolicy: 'Ungültiger Link zur Datenschutzrichtlinie. Bitte verwenden Sie einen gültigen Link, der mit http oder https beginnt',
more: {
entry: 'Mehr Einstellungen anzeigen',
copyright: 'Urheberrecht',
diff --git a/web/i18n/en-US/app-overview.ts b/web/i18n/en-US/app-overview.ts
index 565805a2719..0261f4cd4ea 100644
--- a/web/i18n/en-US/app-overview.ts
+++ b/web/i18n/en-US/app-overview.ts
@@ -57,6 +57,7 @@ const translation = {
chatColorThemeDesc: 'Set the color theme of the chatbot',
chatColorThemeInverted: 'Inverted',
invalidHexMessage: 'Invalid hex value',
+ invalidPrivacyPolicy: 'Invalid privacy policy link. Please use a valid link that starts with http or https',
sso: {
label: 'SSO Enforcement',
title: 'WebApp SSO',
diff --git a/web/i18n/es-ES/app-overview.ts b/web/i18n/es-ES/app-overview.ts
index 62be19f6d84..97f32b1a7a7 100644
--- a/web/i18n/es-ES/app-overview.ts
+++ b/web/i18n/es-ES/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Establece el tema de color del chatbot',
chatColorThemeInverted: 'Invertido',
invalidHexMessage: 'Valor hexadecimal no válido',
+ invalidPrivacyPolicy: 'Enlace de política de privacidad no válido. Por favor, utiliza un enlace válido que comience con http o https',
more: {
entry: 'Mostrar más configuraciones',
copyright: 'Derechos de autor',
diff --git a/web/i18n/fa-IR/app-overview.ts b/web/i18n/fa-IR/app-overview.ts
index 018336cb2a0..cf3368dd6f5 100644
--- a/web/i18n/fa-IR/app-overview.ts
+++ b/web/i18n/fa-IR/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'تم رنگی چت‌بات را تنظیم کنید',
chatColorThemeInverted: 'معکوس',
invalidHexMessage: 'مقدار هگز نامعتبر',
+ invalidPrivacyPolicy: 'لینک سیاست حفظ حریم خصوصی نامعتبر است. لطفاً از یک لینک معتبر که با http یا https شروع میشود استفاده کنید',
more: {
entry: 'نمایش تنظیمات بیشتر',
copyright: 'حق نسخه‌برداری',
diff --git a/web/i18n/fr-FR/app-overview.ts b/web/i18n/fr-FR/app-overview.ts
index 5252bb86b5c..43cbdf499c1 100644
--- a/web/i18n/fr-FR/app-overview.ts
+++ b/web/i18n/fr-FR/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Définir le thème de couleur du chatbot',
chatColorThemeInverted: 'Inversé',
invalidHexMessage: 'Valeur hexadécimale invalide',
+ invalidPrivacyPolicy: 'Lien de politique de confidentialité invalide. Veuillez utiliser un lien valide commençant par http ou https',
more: {
entry: 'Afficher plus de paramètres',
copyright: 'Droits d\'auteur',
diff --git a/web/i18n/hi-IN/app-overview.ts b/web/i18n/hi-IN/app-overview.ts
index c8848d6331b..0b514543acc 100644
--- a/web/i18n/hi-IN/app-overview.ts
+++ b/web/i18n/hi-IN/app-overview.ts
@@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'चैटबॉट का रंग थीम निर्धारित करें',
chatColorThemeInverted: 'उल्टा',
invalidHexMessage: 'अमान्य हेक्स मान',
+ invalidPrivacyPolicy: 'गोपनीयता नीति लिंक अमान्य है। कृपया http या https से शुरू होने वाला एक वैध लिंक उपयोग करें।',
more: {
entry: 'अधिक सेटिंग्स दिखाएं',
copyright: 'कॉपीराइट',
diff --git a/web/i18n/it-IT/app-overview.ts b/web/i18n/it-IT/app-overview.ts
index 8021bb19760..a8fe7f639e5 100644
--- a/web/i18n/it-IT/app-overview.ts
+++ b/web/i18n/it-IT/app-overview.ts
@@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'Imposta il tema colore del chatbot',
chatColorThemeInverted: 'Inverso',
invalidHexMessage: 'Valore esadecimale non valido',
+ invalidPrivacyPolicy: 'Link alla privacy policy non valido. Si prega di utilizzare un link valido che inizi con http o https',
more: {
entry: 'Mostra più impostazioni',
copyright: 'Copyright',
diff --git a/web/i18n/ja-JP/app-overview.ts b/web/i18n/ja-JP/app-overview.ts
index 7e750a47757..d67860ff379 100644
--- a/web/i18n/ja-JP/app-overview.ts
+++ b/web/i18n/ja-JP/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'チャットボットのカラーテーマを設定します',
chatColorThemeInverted: '反転',
invalidHexMessage: '無効な16進数値',
+ invalidPrivacyPolicy: '無効なプライバシーポリシーのリンクです。http または https で始まる有効なリンクを使用してください',
more: {
entry: 'その他の設定を表示',
copyright: '著作権',
diff --git a/web/i18n/ko-KR/app-overview.ts b/web/i18n/ko-KR/app-overview.ts
index 775818909a0..be6e5117cf6 100644
--- a/web/i18n/ko-KR/app-overview.ts
+++ b/web/i18n/ko-KR/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: '챗봇의 색상 테마를 설정하세요',
chatColorThemeInverted: '반전',
invalidHexMessage: '잘못된 16진수 값',
+ invalidPrivacyPolicy: '유효하지 않은 개인정보처리방침 링크입니다. http 또는 https로 시작하는 유효한 링크를 사용해 주세요',
more: {
entry: '추가 설정 보기',
copyright: '저작권',
diff --git a/web/i18n/pl-PL/app-overview.ts b/web/i18n/pl-PL/app-overview.ts
index 7726927565a..7459c0fe05f 100644
--- a/web/i18n/pl-PL/app-overview.ts
+++ b/web/i18n/pl-PL/app-overview.ts
@@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'Ustaw motyw kolorystyczny czatu',
chatColorThemeInverted: 'Odwrócony',
invalidHexMessage: 'Nieprawidłowa wartość heksadecymalna',
+ invalidPrivacyPolicy: 'Nieprawidłowy link do polityki prywatności. Proszę użyć prawidłowego linku zaczynającego się od http lub https',
more: {
entry: 'Pokaż więcej ustawień',
copyright: 'Prawa autorskie',
diff --git a/web/i18n/pt-BR/app-overview.ts b/web/i18n/pt-BR/app-overview.ts
index a23163fc89e..10e47a750b4 100644
--- a/web/i18n/pt-BR/app-overview.ts
+++ b/web/i18n/pt-BR/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Defina o tema de cor do chatbot',
chatColorThemeInverted: 'Inve',
invalidHexMessage: 'Valor hex inválido',
+ invalidPrivacyPolicy: 'Link de política de privacidade inválido. Por favor, use um link válido que comece com http ou https',
more: {
entry: 'Mostrar mais configurações',
copyright: 'Direitos autorais',
diff --git a/web/i18n/ro-RO/app-overview.ts b/web/i18n/ro-RO/app-overview.ts
index a5dee765080..35ee79d61cc 100644
--- a/web/i18n/ro-RO/app-overview.ts
+++ b/web/i18n/ro-RO/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Setați tema de culoare a chatbotului',
chatColorThemeInverted: 'Inversat',
invalidHexMessage: 'Valoare hex nevalidă',
+ invalidPrivacyPolicy: 'Link politică de confidențialitate invalid. Vă rugăm să folosiți un link valid care începe cu http sau https',
more: {
entry: 'Afișați mai multe setări',
copyright: 'Drepturi de autor',
diff --git a/web/i18n/ru-RU/app-overview.ts b/web/i18n/ru-RU/app-overview.ts
index 7de8a475269..5816c37c404 100644
--- a/web/i18n/ru-RU/app-overview.ts
+++ b/web/i18n/ru-RU/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Установите цветовую тему чат-бота',
chatColorThemeInverted: 'Инвертированные цвета',
invalidHexMessage: 'Неверное HEX-значение',
+ invalidPrivacyPolicy: 'Недопустимая ссылка на политику конфиденциальности. Пожалуйста, используйте действительную ссылку, начинающуюся с http или https',
sso: {
label: 'SSO аутентификация',
title: 'WebApp SSO',
diff --git a/web/i18n/sl-SI/app-overview.ts b/web/i18n/sl-SI/app-overview.ts
index 94fb788a943..8d577300d02 100644
--- a/web/i18n/sl-SI/app-overview.ts
+++ b/web/i18n/sl-SI/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Nastavite barvno temo klepetalnega bota',
chatColorThemeInverted: 'Inverzna',
invalidHexMessage: 'Neveljavna vrednost heksa',
+ invalidPrivacyPolicy: 'Neveljavna povezava do pravilnika o zasebnosti. Uporabite veljavno povezavo, ki se začne z http ali https',
sso: {
label: 'SSO avtentikacija',
title: 'SSO spletne aplikacije',
diff --git a/web/i18n/th-TH/app-overview.ts b/web/i18n/th-TH/app-overview.ts
index 27792e16c9d..92b002e4a58 100644
--- a/web/i18n/th-TH/app-overview.ts
+++ b/web/i18n/th-TH/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'กําหนดธีมสีของแชทบอท',
chatColorThemeInverted: 'คว่ำ',
invalidHexMessage: 'ค่าฐานสิบหกไม่ถูกต้อง',
+ invalidPrivacyPolicy: 'ลิงก์นโยบายความเป็นส่วนตัวไม่ถูกต้อง โปรดใช้ลิงก์ที่ถูกต้องขึ้นต้นด้วย http หรือ https',
sso: {
label: 'การรับรองความถูกต้องของ SSO',
title: 'เว็บแอป SSO',
diff --git a/web/i18n/tr-TR/app-overview.ts b/web/i18n/tr-TR/app-overview.ts
index 0b4311ae453..f7203e2f593 100644
--- a/web/i18n/tr-TR/app-overview.ts
+++ b/web/i18n/tr-TR/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Sohbet botunun renk temasını ayarlayın',
chatColorThemeInverted: 'Tersine çevrilmiş',
invalidHexMessage: 'Geçersiz hex değeri',
+ invalidPrivacyPolicy: 'Geçersiz gizlilik politikası bağlantısı. Lütfen http veya https ile başlayan geçerli bir bağlantı kullanın',
more: {
entry: 'Daha fazla ayarı göster',
copyright: 'Telif Hakkı',
diff --git a/web/i18n/uk-UA/app-overview.ts b/web/i18n/uk-UA/app-overview.ts
index e6a14854805..002ab5da964 100644
--- a/web/i18n/uk-UA/app-overview.ts
+++ b/web/i18n/uk-UA/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Встановіть тему кольору чат-бота',
chatColorThemeInverted: 'Інвертовано',
invalidHexMessage: 'Недійсне шістнадцяткове значення',
+ invalidPrivacyPolicy: 'Недійсне посилання на політику конфіденційності. Будь ласка, використовуйте дійсне посилання, яке починається з http або https',
more: {
entry: 'Показати додаткові налаштування',
copyright: 'Авторське право',
diff --git a/web/i18n/vi-VN/app-overview.ts b/web/i18n/vi-VN/app-overview.ts
index 5f060c869a0..a0b7bd006dd 100644
--- a/web/i18n/vi-VN/app-overview.ts
+++ b/web/i18n/vi-VN/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Thiết lập giao diện màu của chatbot',
chatColorThemeInverted: 'Đảo ngược',
invalidHexMessage: 'Giá trị mã màu không hợp lệ',
+ invalidPrivacyPolicy: 'Liên kết chính sách bảo mật không hợp lệ. Vui lòng sử dụng liên kết hợp lệ bắt đầu bằng http hoặc https',
more: {
entry: 'Hiển thị thêm cài đặt',
copyright: 'Bản quyền',
diff --git a/web/i18n/zh-Hans/app-overview.ts b/web/i18n/zh-Hans/app-overview.ts
index 32b2639f38f..aebee63ed61 100644
--- a/web/i18n/zh-Hans/app-overview.ts
+++ b/web/i18n/zh-Hans/app-overview.ts
@@ -57,6 +57,7 @@ const translation = {
chatColorThemeDesc: '设置聊天机器人的颜色主题',
chatColorThemeInverted: '反转',
invalidHexMessage: '无效的十六进制值',
+ invalidPrivacyPolicy: '无效的隐私政策链接,请使用以 http 或 https 开头的有效链接',
sso: {
label: '单点登录认证',
title: 'WebApp SSO 认证',
diff --git a/web/i18n/zh-Hant/app-overview.ts b/web/i18n/zh-Hant/app-overview.ts
index cbe2eb504c7..609c3a5dda0 100644
--- a/web/i18n/zh-Hant/app-overview.ts
+++ b/web/i18n/zh-Hant/app-overview.ts
@@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: '設定聊天機器人的顏色主題',
chatColorThemeInverted: '反轉',
invalidHexMessage: '無效的十六進制值',
+ invalidPrivacyPolicy: '無效的隱私政策連結,請使用以 http 或 https 開頭的有效連結',
more: {
entry: '展示更多設定',
copyright: '版權',