update 2024-03-11 12:19:54
This commit is contained in:
parent
ca31009e45
commit
2c2c8904d1
|
@ -145,5 +145,5 @@ reload_service() {
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers() {
|
service_triggers() {
|
||||||
procd_add_reload_trigger "xray_core"
|
procd_add_reload_trigger "xray_core" "dhcp"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { direct_outbound } from "./outbound.mjs";
|
||||||
const fallback_fast_dns = "223.5.5.5:53";
|
const fallback_fast_dns = "223.5.5.5:53";
|
||||||
const fallback_secure_dns = "8.8.8.8:53";
|
const fallback_secure_dns = "8.8.8.8:53";
|
||||||
const fallback_default_dns = "1.1.1.1:53";
|
const fallback_default_dns = "1.1.1.1:53";
|
||||||
|
const geoip_existence = access("/usr/share/xray/geoip.dat") || false;
|
||||||
const geosite_existence = access("/usr/share/xray/geosite.dat") || false;
|
const geosite_existence = access("/usr/share/xray/geosite.dat") || false;
|
||||||
|
|
||||||
function parse_ip_port(val, port_default) {
|
function parse_ip_port(val, port_default) {
|
||||||
|
@ -161,7 +162,7 @@ export function dns_conf(proxy, config, manual_tproxy, fakedns) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (server["domain_resolve_dns"]) {
|
if (server["domain_resolve_dns"]) {
|
||||||
domain_extra_options[server["server"]] = `${server["domain_resolve_dns_method"] || "udp"};${server["domain_resolve_dns"]}`;
|
domain_extra_options[server["server"]] = `${server["domain_resolve_dns_method"] || "udp"};${server["domain_resolve_dns"]};${join(",", server["domain_resolve_expect_ips"] || [])}`;
|
||||||
} else {
|
} else {
|
||||||
domain_names_set[`domain:${server["server"]}`] = true;
|
domain_names_set[`domain:${server["server"]}`] = true;
|
||||||
}
|
}
|
||||||
|
@ -180,12 +181,24 @@ export function dns_conf(proxy, config, manual_tproxy, fakedns) {
|
||||||
...map(keys(resolve_merged), function (k) {
|
...map(keys(resolve_merged), function (k) {
|
||||||
const dns_split = split(k, ";");
|
const dns_split = split(k, ";");
|
||||||
const resolve_dns_object = format_dns(dns_split[0], dns_split[1]);
|
const resolve_dns_object = format_dns(dns_split[0], dns_split[1]);
|
||||||
return {
|
let result = {
|
||||||
address: resolve_dns_object["address"],
|
address: resolve_dns_object["address"],
|
||||||
port: resolve_dns_object["port"],
|
port: resolve_dns_object["port"],
|
||||||
domains: uniq(resolve_merged[k]),
|
domains: uniq(resolve_merged[k]),
|
||||||
skipFallback: true,
|
skipFallback: true,
|
||||||
};
|
};
|
||||||
|
if (length(dns_split[2]) > 0) {
|
||||||
|
const expect_ips = filter(split(dns_split[2], ",") || [], function (i) {
|
||||||
|
if (!geoip_existence) {
|
||||||
|
if (substr(i, 0, 6) === "geoip:") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
result["expectIPs"] = expect_ips;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}),
|
}),
|
||||||
default_dns_object,
|
default_dns_object,
|
||||||
{
|
{
|
||||||
|
|
|
@ -227,6 +227,9 @@ return view.extend({
|
||||||
o.default = "udp";
|
o.default = "udp";
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
|
o = ss.taboption('resolving', form.DynamicList, 'domain_resolve_expect_ips', _('Expected Server IPs'), _("Filter resolved IPs by GeoIP or CIDR. Resource file <code>geoip.dat</code> is required for GeoIP filtering."));
|
||||||
|
o.modalonly = true;
|
||||||
|
|
||||||
ss.tab('protocol', _('Protocol Settings'));
|
ss.tab('protocol', _('Protocol Settings'));
|
||||||
|
|
||||||
o = ss.taboption('protocol', form.ListValue, "protocol", _("Protocol"));
|
o = ss.taboption('protocol', form.ListValue, "protocol", _("Protocol"));
|
||||||
|
|
|
@ -30,13 +30,13 @@ define Download/geosite
|
||||||
HASH:=43e32e704c9b8f9d8103df87cd18e637c817dbdd5bc75f1a1e7ba0368064839e
|
HASH:=43e32e704c9b8f9d8103df87cd18e637c817dbdd5bc75f1a1e7ba0368064839e
|
||||||
endef
|
endef
|
||||||
|
|
||||||
GEOSITE_IRAN_VER:=202403040025
|
GEOSITE_IRAN_VER:=202403110026
|
||||||
GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER)
|
GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER)
|
||||||
define Download/geosite-ir
|
define Download/geosite-ir
|
||||||
URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/
|
URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/
|
||||||
URL_FILE:=iran.dat
|
URL_FILE:=iran.dat
|
||||||
FILE:=$(GEOSITE_IRAN_FILE)
|
FILE:=$(GEOSITE_IRAN_FILE)
|
||||||
HASH:=c4def60743502b5350a3b6d632b1bbd48ff523ec9e4096fa98d07a508e853389
|
HASH:=4878b48160668bdd20528b0246502c9b2160ddf195c113ba4d13041c114331e7
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/v2ray-geodata/template
|
define Package/v2ray-geodata/template
|
||||||
|
|
Loading…
Reference in New Issue