diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..761e5331 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,14 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +polar: # Replace with a single Polar username +buy_me_a_coffee: alireza7 +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 596ff6c6..eb31ad87 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -891,18 +891,28 @@ Outbound.BlackholeSettings = class extends CommonClass { } }; Outbound.DNSSettings = class extends CommonClass { - constructor(network='udp', address='1.1.1.1', port=53) { + constructor( + network = 'udp', + address = '1.1.1.1', + port = 53, + nonIPQuery = 'drop', + blockTypes = [] + ) { super(); this.network = network; this.address = address; this.port = port; + this.nonIPQuery = nonIPQuery; + this.blockTypes = blockTypes; } - static fromJson(json={}){ + static fromJson(json = {}) { return new Outbound.DNSSettings( json.network, json.address, json.port, + json.nonIPQuery, + json.blockTypes, ); } }; diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index e6143254..00b85448 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -2137,9 +2137,14 @@ Inbound.SocksSettings.SocksAccount = class extends XrayCommonClass { }; Inbound.HttpSettings = class extends Inbound.Settings { - constructor(protocol, accounts=[new Inbound.HttpSettings.HttpAccount()]) { + constructor( + protocol, + accounts = [new Inbound.HttpSettings.HttpAccount()], + allowTransparent = false, + ) { super(protocol); this.accounts = accounts; + this.allowTransparent = allowTransparent; } addAccount(account) { @@ -2150,16 +2155,18 @@ Inbound.HttpSettings = class extends Inbound.Settings { this.accounts.splice(index, 1); } - static fromJson(json={}) { + static fromJson(json = {}) { return new Inbound.HttpSettings( Protocols.HTTP, json.accounts.map(account => Inbound.HttpSettings.HttpAccount.fromJson(account)), + json.allowTransparent, ); } toJson() { return { accounts: Inbound.HttpSettings.toJsonArray(this.accounts), + allowTransparent: this.allowTransparent, }; } }; diff --git a/web/html/xui/dns_modal.html b/web/html/xui/dns_modal.html index b5314cb7..f61cd8b2 100644 --- a/web/html/xui/dns_modal.html +++ b/web/html/xui/dns_modal.html @@ -1,96 +1,114 @@ {{define "dnsModal"}} - - - - - - - + - - - - - - [[ l ]] - - - - - - - + + + + + + + + + + + + [[ l ]] + + + + + + + + + + -{{end}} +{{end}} \ No newline at end of file diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 0bca0ff6..339d2497 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -81,24 +81,28 @@ diff --git a/web/html/xui/form/protocol/http.html b/web/html/xui/form/protocol/http.html index ff266de5..106ff8e7 100644 --- a/web/html/xui/form/protocol/http.html +++ b/web/html/xui/form/protocol/http.html @@ -1,21 +1,25 @@ {{define "form/http"}} - - - - - - -
{{ i18n "username" }}{{ i18n "password" }}+
- - - - - - - - + + + + + + +
{{ i18n "username" }}{{ i18n "password" }}+
+ + + + + + + + + + +
{{end}} \ No newline at end of file diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index fe4d93c7..83247d17 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -160,41 +160,69 @@ - + + description='{{ i18n "pages.xray.logLevelDesc" }}'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - @@ -657,6 +685,9 @@ + Fake DNS {{ i18n "pages.xray.fakedns.add" }} @@ -766,6 +797,7 @@ { title: "#", align: 'center', width: 20, scopedSlots: { customRender: 'action' } }, { title: '{{ i18n "pages.xray.outbound.address"}}', align: 'center', width: 50, scopedSlots: { customRender: 'address' } }, { title: '{{ i18n "pages.xray.dns.domains"}}', align: 'center', width: 50, scopedSlots: { customRender: 'domain' } }, + { title: '{{ i18n "pages.xray.dns.expectIPs"}}', align: 'center', width: 50, scopedSlots: { customRender: 'expectIPs' } }, ]; const fakednsColumns = [ @@ -825,6 +857,13 @@ protocol: "freedom" }, routingDomainStrategies: ["AsIs", "IPIfNonMatch", "IPOnDemand"], + log: { + loglevel: ["none", "debug", "info", "warning", "error"], + access: ["none", "./access.log"], + error: ["none", "./error.log"], + dnsLog: false, + maskAddress: ["quarter", "half", "full"], + }, settingsData: { protocols: { bittorrent: ["bittorrent"], @@ -1458,28 +1497,59 @@ }, }, logLevel: { - get: function () { return this.logSettings?.loglevel?? 'none'; }, - set: function (newValue) { - newLogSettings = this.logSettings; - newLogSettings.loglevel = newValue; - this.logSettings = newLogSettings; + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.loglevel) return "warning"; + return this.templateSettings.log.loglevel; }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.loglevel = newValue; + this.templateSettings = newTemplateSettings; + } }, - logAccess: { - get: function () { return this.logSettings?.access?? ''; }, - set: function (newValue) { - newLogSettings = this.logSettings; - newValue == "" ? delete newLogSettings.access : newLogSettings.access = newValue; - this.logSettings = newLogSettings; + accessLog: { + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.access) return ""; + return this.templateSettings.log.access; }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.access = newValue; + this.templateSettings = newTemplateSettings; + } }, - logError: { - get: function () { return this.logSettings?.error?? ''; }, - set: function (newValue) { - newLogSettings = this.logSettings; - newValue == "" ? delete newLogSettings.error : newLogSettings.error = newValue; - this.logSettings = newLogSettings; + errorLog: { + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.error) return ""; + return this.templateSettings.log.error; }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.error = newValue; + this.templateSettings = newTemplateSettings; + } + }, + dnslog: { + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.dnsLog) return false; + return this.templateSettings.log.dnsLog; + }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.dnsLog = newValue; + this.templateSettings = newTemplateSettings; + } + }, + maskAddressLog: { + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.maskAddress) return ""; + return this.templateSettings.log.maskAddress; + }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.maskAddress = newValue; + this.templateSettings = newTemplateSettings; + } }, inboundSettings: { get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; }, diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 1526bfae..8185cd2e 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -359,6 +359,10 @@ "accessLogDesc" = "The file path for the access log." "errorLog" = "Error Log" "errorLogDesc" = "The file path for the error log." +"dnsLog" = "DNS Log" +"dnsLogDesc" = "Whether to enable DNS query logs" +"maskAddress" = "Mask Address" +"maskAddressDesc" = "IP address mask, when enabled, will automatically replace the IP address that appears in the log." [pages.xray.rules] "first" = "First" @@ -422,6 +426,7 @@ "add" = "Add Server" "edit" = "Edit Server" "domains" = "Domains" +"expectIPs" = "Expect IPs" [pages.xray.fakedns] "add" = "Add Fake DNS" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 5c8a0503..120d8926 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -357,6 +357,10 @@ "accessLogDesc" = "مسیر فایل گزارش دسترسی" "errorLog" = "گزارش خطا" "errorLogDesc" = "مسیر فایل گزارش خطا" +"dnsLog" = "گزارش DNS" +"dnsLogDesc" = "آیا ثبت‌های درخواست DNS را فعال کنید" +"maskAddress" = "پنهان کردن آدرس" +"maskAddressDesc" = "پوشش آدرس IP، هنگامی که فعال می‌شود، به طور خودکار آدرس IP که در لاگ ظاهر می‌شود را جایگزین می‌کند." [pages.xray.rules] "first" = "اولین" @@ -420,6 +424,7 @@ "add" = "افزودن سرور" "edit" = "ویرایش سرور" "domains" = "دامنه‌ها" +"expectIPs" = "آی‌پی‌های مورد انتظار" [pages.xray.fakedns] "add" = "افزودن دی‌ان‌اس جعلی" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 2df075cd..c0fda94c 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -360,6 +360,10 @@ "accessLogDesc" = "Путь к файлу журнала доступа." "errorLog" = "Журнал ошибок" "errorLogDesc" = "Путь к файлу журнала ошибок." +"dnsLog" = "DNS Журнал" +"dnsLogDesc" = "Включить логи запросов DNS" +"maskAddress" = "Маскировать Адрес" +"maskAddressDesc" = "Маска IP-адреса, при активации автоматически заменяет IP-адрес, который появляется в логе." [pages.xray.rules] "first" = "Первый" @@ -423,6 +427,7 @@ "add" = "Добавить сервер" "edit" = "Редактировать сервер" "domains" = "Домены" +"expectIPs" = "Ожидаемые IP" [pages.xray.fakedns] "add" = "Добавить поддельный DNS" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index 53712fa9..2b4d7afa 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -360,6 +360,10 @@ "accessLogDesc" = "Đường dẫn tệp cho nhật ký truy cập." "errorLog" = "Nhật ký lỗi" "errorLogDesc" = "Đường dẫn tệp cho nhật ký lỗi." +"dnsLog" = "Nhật ký DNS" +"dnsLogDesc" = "Có bật nhật ký truy vấn DNS không" +"maskAddress" = "Ẩn Địa Chỉ" +"maskAddressDesc" = "Mặt nạ địa chỉ IP, khi được bật, sẽ tự động thay thế địa chỉ IP xuất hiện trong nhật ký." [pages.xray.rules] "first" = "Đầu tiên" @@ -423,6 +427,7 @@ "add" = "Thêm máy chủ" "edit" = "Chỉnh sửa máy chủ" "domains" = "Tên miền" +"expectIPs" = "Các IP Dự Kiến" [pages.xray.fakedns] "add" = "Thêm DNS giả" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index ea55bc6f..70d77a72 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -360,6 +360,10 @@ "accessLogDesc" = "访问日志的文件路径。" "errorLog" = "错误日志" "errorLogDesc" = "错误日志的文件路径。" +"dnsLog" = "DNS 日志" +"dnsLogDesc" = "是否启用 DNS 查询日志" +"maskAddress" = "隐藏地址" +"maskAddressDesc" = "IP 地址掩码,启用时会自动替换日志中出现的 IP 地址。" [pages.xray.rules] "first" = "第一个" @@ -423,6 +427,7 @@ "add" = "添加服务器" "edit" = "编辑服务器" "domains" = "域" +"expectIPs" = "预期 IP" [pages.xray.fakedns] "add" = "添加假 DNS"