local api = require "luci.passwall.api" local appname = "passwall" local has_xray = api.finded_com("xray") local has_singbox = api.finded_com("singbox") m = Map(appname) api.set_apply_on_parse(m) -- [[ Rule Settings ]]-- s = m:section(TypedSection, "global_rules", translate("Rule status")) s.anonymous = true --[[ o = s:option(Flag, "adblock", translate("Enable adblock")) o.rmempty = false ]]-- ---- gfwlist URL o = s:option(DynamicList, "gfwlist_url", translate("GFW domains(gfwlist) Update URL")) o:value("https://fastly.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt", translate("v2fly/domain-list-community")) o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/gfw.txt", translate("Loyalsoldier/v2ray-rules-dat")) o:value("https://fastly.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt", translate("Loukky/gfwlist-by-loukky")) o:value("https://fastly.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt", translate("gfwlist/gfwlist")) o.default = "https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/gfw.txt" ----chnroute URL o = s:option(DynamicList, "chnroute_url", translate("China IPs(chnroute) Update URL")) o:value("https://fastly.jsdelivr.net/gh/gaoyifan/china-operator-ip@ip-lists/china.txt", translate("gaoyifan/china-operator-ip/china")) o:value("https://ispip.clang.cn/all_cn.txt", translate("Clang.CN")) o:value("https://ispip.clang.cn/all_cn_cidr.txt", translate("Clang.CN.CIDR")) o:value("https://fastly.jsdelivr.net/gh/soffchen/GeoIP2-CN@release/CN-ip-cidr.txt", translate("soffchen/GeoIP2-CN")) o:value("https://fastly.jsdelivr.net/gh/Hackl0us/GeoIP2-CN@release/CN-ip-cidr.txt", translate("Hackl0us/GeoIP2-CN")) ----chnroute6 URL o = s:option(DynamicList, "chnroute6_url", translate("China IPv6s(chnroute6) Update URL")) o:value("https://fastly.jsdelivr.net/gh/gaoyifan/china-operator-ip@ip-lists/china6.txt", translate("gaoyifan/china-operator-ip/china6")) o:value("https://ispip.clang.cn/all_cn_ipv6.txt", translate("Clang.CN.IPv6")) ----chnlist URL o = s:option(DynamicList, "chnlist_url", translate("China List(Chnlist) Update URL")) o:value("https://fastly.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf", translate("felixonmars/domains.china")) o:value("https://fastly.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf", translate("felixonmars/apple.china")) o:value("https://fastly.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf", translate("felixonmars/google.china")) o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/china-list.txt", translate("Loyalsoldier/china-list")) o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/apple-cn.txt", translate("Loyalsoldier/apple-cn")) o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/google-cn.txt", translate("Loyalsoldier/google-cn")) if has_xray or has_singbox then o = s:option(ListValue, "geoip_url", translate("GeoIP Update URL")) o:value("https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest", translate("Loyalsoldier/geoip")) o:value("https://api.github.com/repos/MetaCubeX/meta-rules-dat/releases/latest", translate("MetaCubeX/geoip")) o.default = "https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest" o = s:option(ListValue, "geosite_url", translate("Geosite Update URL")) o:value("https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest", translate("Loyalsoldier/geosite")) o:value("https://api.github.com/repos/MetaCubeX/meta-rules-dat/releases/latest", translate("MetaCubeX/geosite")) o.default = "https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest" o = s:option(Value, "v2ray_location_asset", translate("Location of Geo rule files"), translate("This variable specifies a directory where geoip.dat and geosite.dat files are.")) o.default = "/usr/share/v2ray/" o.placeholder = "/usr/share/v2ray/" o.rmempty = false if api.is_finded("geoview") then o = s:option(Flag, "enable_geoview", translate("Enable Geo Data Parsing")) o.default = 0 o.rmempty = false o.description = "