Browse Source

chore: add global params for DNS (#2713)

parameter list: `disableCache`, `disableFallback`, `disableFallbackIfMatch`, `clientIp`
Shishkevich D. 1 month ago
parent
commit
f5aea03765

+ 101 - 9
web/html/xui/xray.html

@@ -673,9 +673,7 @@
                                     <a-switch v-model="enableDNS"></a-switch>
                                 </a-col>
                             </a-row>
-                        </a-list-item>
-                        <template v-if="enableDNS">  
-                            <a-list-item>
+                            <template v-if="enableDNS">
                                 <a-row style="padding: 10px 20px;">
                                     <a-col :lg="24" :xl="12">
                                         <a-list-item-meta title='{{ i18n "pages.xray.dns.tag" }}'
@@ -685,8 +683,15 @@
                                         <a-input type="text" v-model="dnsTag"></a-input>
                                     </a-col>
                                 </a-row>
-                            </a-list-item>
-                            <a-list-item>
+                                <a-row style="padding: 10px 20px;">
+                                    <a-col :lg="24" :xl="12">
+                                        <a-list-item-meta title='{{ i18n "pages.xray.dns.clientIp" }}' 
+                                            description='{{ i18n "pages.xray.dns.clientIpDesc" }}'/>
+                                    </a-col>
+                                    <a-col :lg="24" :xl="12">
+                                        <a-input type="text" v-model="dnsClientIp"></a-input>
+                                    </a-col>
+                                </a-row>
                                 <a-row style="padding: 10px 20px;">
                                     <a-col :lg="24" :xl="12">
                                         <a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}'
@@ -701,8 +706,35 @@
                                         </a-select>
                                     </a-col>
                                 </a-row>
-                            </a-list-item>
-                        </template>
+                                <a-row style="padding: 10px 20px;">
+                                    <a-col :lg="24" :xl="12">
+                                        <a-list-item-meta title='{{ i18n "pages.xray.dns.disableCache" }}' 
+                                            description='{{ i18n "pages.xray.dns.disableCacheDesc" }}'/>
+                                    </a-col>
+                                    <a-col :lg="24" :xl="12">
+                                        <a-switch v-model="dnsDisableCache"></a-switch>
+                                    </a-col>
+                                </a-row>
+                                <a-row style="padding: 10px 20px;">
+                                    <a-col :lg="24" :xl="12">
+                                        <a-list-item-meta title='{{ i18n "pages.xray.dns.disableFallback" }}' 
+                                            description='{{ i18n "pages.xray.dns.disableFallbackDesc" }}'/>
+                                    </a-col>
+                                    <a-col :lg="24" :xl="12">
+                                        <a-switch v-model="dnsDisableFallback"></a-switch>
+                                    </a-col>
+                                </a-row>
+                                <a-row style="padding: 10px 20px;">
+                                    <a-col :lg="24" :xl="12">
+                                        <a-list-item-meta title='{{ i18n "pages.xray.dns.disableFallbackIfMatch" }}' 
+                                            description='{{ i18n "pages.xray.dns.disableFallbackIfMatchDesc" }}'/>
+                                    </a-col>
+                                    <a-col :lg="24" :xl="12">
+                                        <a-switch v-model="dnsDisableFallbackIfMatch"></a-switch>
+                                    </a-col>
+                                </a-row>
+                            </template>
+                        </a-list-item>
                     </a-collapse-panel>
                     <template v-if="enableDNS">
                         <a-collapse-panel header='DNS'>
@@ -1971,7 +2003,11 @@
                 set: function (newValue) {
                     newTemplateSettings = this.templateSettings;
                     if (newValue) {
-                        newTemplateSettings.dns = { servers: [], queryStrategy: "UseIP", tag: "dns_inbound" };
+                        newTemplateSettings.dns = { 
+                            servers: [], 
+                            queryStrategy: "UseIP", 
+                            tag: "dns_inbound"
+                        };
                         newTemplateSettings.fakedns = null; 
                     } else {
                         delete newTemplateSettings.dns;
@@ -1986,7 +2022,63 @@
                 },
                 set: function (newValue) {
                     newTemplateSettings = this.templateSettings;
-                    newTemplateSettings.dns.tag =  newValue;
+                    newTemplateSettings.dns.tag = newValue;
+                    this.templateSettings = newTemplateSettings;
+                }
+            },
+            dnsClientIp: {
+                get: function () {
+                    return this.enableDNS ? this.templateSettings.dns.clientIp : null;
+                },
+                set: function (newValue) {
+                    newTemplateSettings = this.templateSettings;
+                    if (newValue) {
+                        newTemplateSettings.dns.clientIp = newValue;
+                    } else {
+                        delete newTemplateSettings.dns.clientIp;
+                    }
+                    this.templateSettings = newTemplateSettings;
+                }
+            },
+            dnsDisableCache: {
+                get: function () {
+                    return this.enableDNS ? this.templateSettings.dns.disableCache : false;
+                },
+                set: function (newValue) {
+                    newTemplateSettings = this.templateSettings;
+                    if (newValue) {
+                        newTemplateSettings.dns.disableCache = newValue;
+                    } else {
+                        delete newTemplateSettings.dns.disableCache
+                    }
+                    this.templateSettings = newTemplateSettings;
+                }
+            },
+            dnsDisableFallback: {
+                get: function () {
+                    return this.enableDNS ? this.templateSettings.dns.disableFallback : false;
+                },
+                set: function (newValue) {
+                    newTemplateSettings = this.templateSettings;
+                    if (newValue) {
+                        newTemplateSettings.dns.disableFallback = newValue;
+                    } else {
+                        delete newTemplateSettings.dns.disableFallback
+                    }
+                    this.templateSettings = newTemplateSettings;
+                }
+            },
+            dnsDisableFallbackIfMatch: {
+                get: function () {
+                    return this.enableDNS ? this.templateSettings.dns.disableFallbackIfMatch : false;
+                },
+                set: function (newValue) {
+                    newTemplateSettings = this.templateSettings;
+                    if (newValue) {
+                        newTemplateSettings.dns.disableFallbackIfMatch = newValue;
+                    } else {
+                        delete newTemplateSettings.dns.disableFallbackIfMatch
+                    }
                     this.templateSettings = newTemplateSettings;
                 }
             },

+ 8 - 0
web/translation/translate.en_US.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Enable built-in DNS server"
 "tag" = "DNS Inbound Tag"
 "tagDesc" = "This tag will be available as an Inbound tag in routing rules."
+"clientIp" = "Client IP"
+"clientIpDesc" = "Used to notify the server of the specified IP location during DNS queries"
+"disableCache" = "Disable cache"
+"disableCacheDesc" = "Disables DNS caching"
+"disableFallback" = "Disable Fallback"
+"disableFallbackDesc" = "Disables fallback DNS queries"
+"disableFallbackIfMatch" = "Disable Fallback If Match"
+"disableFallbackIfMatchDesc" = "Disables fallback DNS queries when the matching domain list of the DNS server is hit"
 "strategy" = "Query Strategy"
 "strategyDesc" = "Overall strategy to resolve domain names"
 "add" = "Add Server"

+ 8 - 0
web/translation/translate.es_ES.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Habilitar servidor DNS incorporado"
 "tag" = "Etiqueta de Entrada DNS"
 "tagDesc" = "Esta etiqueta estará disponible como una etiqueta de entrada en las reglas de enrutamiento."
+"clientIp" = "IP del cliente"
+"clientIpDesc" = "Se utiliza para notificar al servidor la ubicación IP especificada durante las consultas DNS"
+"disableCache" = "Desactivar caché"
+"disableCacheDesc" = "Desactiva el almacenamiento en caché de DNS"
+"disableFallback" = "Desactivar respaldo"
+"disableFallbackDesc" = "Desactiva las consultas DNS de respaldo"
+"disableFallbackIfMatch" = "Desactivar respaldo si coincide"
+"disableFallbackIfMatchDesc" = "Desactiva las consultas DNS de respaldo cuando se acierta en la lista de dominios coincidentes del servidor DNS"
 "strategy" = "Estrategia de Consulta"
 "strategyDesc" = "Estrategia general para resolver nombres de dominio"
 "add" = "Agregar Servidor"

+ 8 - 0
web/translation/translate.fa_IR.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "سرور حل دامنه داخلی را فعال کنید"
 "tag" = "برچسب"
 "tagDesc" = "این برچسب در قوانین مسیریابی به عنوان یک برچسب ورودی قابل استفاده خواهد بود"
+"clientIp" = "آی‌پی کلاینت"
+"clientIpDesc" = "برای اطلاع‌رسانی به سرور درباره مکان IP مشخص‌شده در طول درخواست‌های DNS استفاده می‌شود"
+"disableCache" = "غیرفعال‌سازی کش"
+"disableCacheDesc" = "کش DNS را غیرفعال می‌کند"
+"disableFallback" = "غیرفعال‌سازی Fallback"
+"disableFallbackDesc" = "درخواست‌های DNS Fallback را غیرفعال می‌کند"
+"disableFallbackIfMatch" = "غیرفعال‌سازی Fallback در صورت تطابق"
+"disableFallbackIfMatchDesc" = "درخواست‌های DNS Fallback را زمانی که لیست دامنه‌های مطابقت‌یافته سرور DNS فعال است، غیرفعال می‌کند"
 "strategy" = "استراتژی پرس‌وجو"
 "strategyDesc" = "استراتژی کلی برای حل نام دامنه"
 "add" = "افزودن سرور"

+ 8 - 0
web/translation/translate.id_ID.toml

@@ -432,6 +432,14 @@
 "enableDesc" = "Aktifkan server DNS bawaan"
 "tag" = "Tanda DNS Masuk"
 "tagDesc" = "Tanda ini akan tersedia sebagai tanda masuk dalam aturan penataan."
+"clientIp" = "IP Klien"
+"clientIpDesc" = "Digunakan untuk memberi tahu server tentang lokasi IP yang ditentukan selama kueri DNS"
+"disableCache" = "Nonaktifkan cache"
+"disableCacheDesc" = "Menonaktifkan caching DNS"
+"disableFallback" = "Nonaktifkan Fallback"
+"disableFallbackDesc" = "Menonaktifkan kueri DNS fallback"
+"disableFallbackIfMatch" = "Nonaktifkan Fallback Jika Cocok"
+"disableFallbackIfMatchDesc" = "Menonaktifkan kueri DNS fallback ketika daftar domain yang cocok dari server DNS terpenuhi"
 "strategy" = "Strategi Kueri"
 "strategyDesc" = "Strategi keseluruhan untuk menyelesaikan nama domain"
 "add" = "Tambahkan Server"

+ 8 - 0
web/translation/translate.ja_JP.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "組み込みDNSサーバーを有効にする"
 "tag" = "DNSインバウンドタグ"
 "tagDesc" = "このタグはルーティングルールでインバウンドタグとして使用できます"
+"clientIp" = "クライアントIP"
+"clientIpDesc" = "DNSクエリ中に指定されたIPの位置をサーバーに通知するために使用されます"
+"disableCache" = "キャッシュを無効にする"
+"disableCacheDesc" = "DNSキャッシュを無効にします"
+"disableFallback" = "フォールバックを無効にする"
+"disableFallbackDesc" = "フォールバックDNSクエリを無効にします"
+"disableFallbackIfMatch" = "一致した場合にフォールバックを無効にする"
+"disableFallbackIfMatchDesc" = "DNSサーバーの一致するドメインリストにヒットした場合、フォールバックDNSクエリを無効にします"
 "strategy" = "クエリ戦略"
 "strategyDesc" = "ドメイン名解決の全体的な戦略"
 "add" = "サーバー追加"

+ 8 - 0
web/translation/translate.pt_BR.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Ativar o servidor DNS integrado"
 "tag" = "Tag de Entrada DNS"
 "tagDesc" = "Esta tag estará disponível como uma tag de Entrada nas regras de roteamento."
+"clientIp" = "IP do Cliente"
+"clientIpDesc" = "Usado para notificar o servidor sobre a localização IP especificada durante consultas DNS"
+"disableCache" = "Desativar cache"
+"disableCacheDesc" = "Desativa o cache de DNS"
+"disableFallback" = "Desativar Fallback"
+"disableFallbackDesc" = "Desativa consultas DNS de fallback"
+"disableFallbackIfMatch" = "Desativar Fallback Se Corresponder"
+"disableFallbackIfMatchDesc" = "Desativa consultas DNS de fallback quando a lista de domínios correspondentes do servidor DNS é atingida"
 "strategy" = "Estratégia de Consulta"
 "strategyDesc" = "Estratégia geral para resolver nomes de domínio"
 "add" = "Adicionar Servidor"

+ 8 - 0
web/translation/translate.ru_RU.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Включить встроенный DNS-сервер"
 "tag" = "Входящий тег DNS"
 "tagDesc" = "Этот тег будет доступен как входящий тег в правилах маршрутизации."
+"clientIp" = "IP клиента"
+"clientIpDesc" = "Используется для уведомления сервера о указанном местоположении IP во время DNS-запросов"
+"disableCache" = "Отключить кэш"
+"disableCacheDesc" = "Отключает кэширование DNS"
+"disableFallback" = "Отключить резервный DNS"
+"disableFallbackDesc" = "Отключает резервные DNS-запросы"
+"disableFallbackIfMatch" = "Отключить резервный DNS при совпадении"
+"disableFallbackIfMatchDesc" = "Отключает резервные DNS-запросы при совпадении списка доменов DNS-сервера"
 "strategy" = "Стратегия запроса"
 "strategyDesc" = "Общая стратегия разрешения доменных имен"
 "add" = "Добавить сервер"

+ 8 - 0
web/translation/translate.tr_TR.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Dahili DNS sunucusunu etkinleştir"
 "tag" = "DNS Gelen Etiketi"
 "tagDesc" = "Bu etiket, yönlendirme kurallarında Gelen etiketi olarak kullanılabilir."
+"clientIp" = "İstemci IP"
+"clientIpDesc" = "DNS sorguları sırasında belirtilen IP konumunu sunucuya bildirmek için kullanılır"
+"disableCache" = "Önbelleği devre dışı bırak"
+"disableCacheDesc" = "DNS önbelleğini devre dışı bırakır"
+"disableFallback" = "Yedeklemeyi devre dışı bırak"
+"disableFallbackDesc" = "Yedek DNS sorgularını devre dışı bırakır"
+"disableFallbackIfMatch" = "Eşleşirse Yedeklemeyi Devre Dışı Bırak"
+"disableFallbackIfMatchDesc" = "DNS sunucusunun eşleşen alan adı listesi vurulduğunda yedek DNS sorgularını devre dışı bırakır"
 "strategy" = "Sorgu Stratejisi"
 "strategyDesc" = "Alan adlarını çözmek için genel strateji"
 "add" = "Sunucu Ekle"

+ 8 - 0
web/translation/translate.uk_UA.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Увімкнути вбудований DNS-сервер"
 "tag" = "Мітка вхідного DNS"
 "tagDesc" = "Ця мітка буде доступна як вхідна мітка в правилах маршрутизації."
+"clientIp" = "IP клієнта"
+"clientIpDesc" = "Використовується для повідомлення серверу про вказане місцезнаходження IP під час DNS-запитів"
+"disableCache" = "Вимкнути кеш"
+"disableCacheDesc" = "Вимкнути кешування DNS"
+"disableFallback" = "Вимкнути резервний DNS"
+"disableFallbackDesc" = "Вимкнути резервні DNS-запити"
+"disableFallbackIfMatch" = "Вимкнути резервний DNS при збігу"
+"disableFallbackIfMatchDesc" = "Вимкнути резервні DNS-запити при збігу списку доменів DNS-сервера"
 "strategy" = "Стратегія запиту"
 "strategyDesc" = "Загальна стратегія вирішення доменних імен"
 "add" = "Додати сервер"

+ 8 - 0
web/translation/translate.vi_VN.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "Kích hoạt máy chủ DNS tích hợp"
 "tag" = "Thẻ gửi đến DNS"
 "tagDesc" = "Thẻ này sẽ có sẵn dưới dạng thẻ Gửi đến trong quy tắc định tuyến."
+"clientIp" = "IP khách hàng"
+"clientIpDesc" = "Được sử dụng để thông báo cho máy chủ về vị trí IP được chỉ định trong các truy vấn DNS"
+"disableCache" = "Tắt bộ nhớ đệm"
+"disableCacheDesc" = "Tắt bộ nhớ đệm DNS"
+"disableFallback" = "Tắt Fallback"
+"disableFallbackDesc" = "Tắt các truy vấn DNS Fallback"
+"disableFallbackIfMatch" = "Tắt Fallback Nếu Khớp"
+"disableFallbackIfMatchDesc" = "Tắt các truy vấn DNS Fallback khi danh sách tên miền khớp của máy chủ DNS được kích hoạt"
 "strategy" = "Chiến lược truy vấn"
 "strategyDesc" = "Chiến lược tổng thể để phân giải tên miền"
 "add" = "Thêm máy chủ"

+ 8 - 0
web/translation/translate.zh_CN.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "启用内置 DNS 服务器"
 "tag" = "DNS 入站标签"
 "tagDesc" = "此标签将在路由规则中可用作入站标签"
+"clientIp" = "客户端IP"
+"clientIpDesc" = "用于在DNS查询期间通知服务器指定的IP位置"
+"disableCache" = "禁用缓存"
+"disableCacheDesc" = "禁用DNS缓存"
+"disableFallback" = "禁用回退"
+"disableFallbackDesc" = "禁用回退DNS查询"
+"disableFallbackIfMatch" = "匹配时禁用回退"
+"disableFallbackIfMatchDesc" = "当DNS服务器的匹配域名列表命中时,禁用回退DNS查询"
 "strategy" = "查询策略"
 "strategyDesc" = "解析域名的总体策略"
 "add" = "添加服务器"

+ 8 - 0
web/translation/translate.zh_TW.toml

@@ -433,6 +433,14 @@
 "enableDesc" = "啟用內建 DNS 伺服器"
 "tag" = "DNS 入站標籤"
 "tagDesc" = "此標籤將在路由規則中可用作入站標籤"
+"clientIp" = "客戶端IP"
+"clientIpDesc" = "用於在DNS查詢期間通知伺服器指定的IP位置"
+"disableCache" = "禁用快取"
+"disableCacheDesc" = "禁用DNS快取"
+"disableFallback" = "禁用回退"
+"disableFallbackDesc" = "禁用回退DNS查詢"
+"disableFallbackIfMatch" = "匹配時禁用回退"
+"disableFallbackIfMatchDesc" = "當DNS伺服器的匹配域名列表命中時,禁用回退DNS查詢"
 "strategy" = "查詢策略"
 "strategyDesc" = "解析域名的總體策略"
 "add" = "新增伺服器"