Skip to content

Commit

Permalink
Merge pull request #12 from robberphex/prepare-2.2.1
Browse files Browse the repository at this point in the history
Prepare 2.2.1
  • Loading branch information
robberphex committed Jun 13, 2023
2 parents b0c6182 + 4aa58e7 commit 12f911d
Show file tree
Hide file tree
Showing 27 changed files with 174 additions and 117 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-v2ray
PKG_VERSION:=2.2.0
PKG_VERSION:=2.2.1
PKG_RELEASE:=0

PKG_LICENSE:=MIT
Expand All @@ -20,10 +20,10 @@ LUCI_DEPENDS:=+jshn +ip +ipset +iptables +iptables-mod-tproxy +resolveip \
LUCI_PKGARCH:=all

define Package/$(PKG_NAME)/conffiles
/etc/config/v2ray
/etc/v2ray/transport.json
/etc/v2ray/directlist.txt
/etc/v2ray/proxylist.txt
/etc/config/luci_v2ray
/etc/luci_v2ray/transport.json
/etc/luci_v2ray/directlist.txt
/etc/luci_v2ray/proxylist.txt
endef

include $(TOPDIR)/feeds/luci/luci.mk
Expand All @@ -39,8 +39,8 @@ if [ -z "$${IPKG_INSTROOT}" ] ; then
killall -HUP rpcd 2>/dev/null
fi

chmod 755 "$${IPKG_INSTROOT}/etc/init.d/v2ray" >/dev/null 2>&1
ln -sf "../init.d/v2ray" \
chmod 755 "$${IPKG_INSTROOT}/etc/init.d/luci_v2ray" >/dev/null 2>&1
ln -sf "../init.d/luci_v2ray" \
"$${IPKG_INSTROOT}/etc/rc.d/S99v2ray" >/dev/null 2>&1

exit 0
Expand Down
8 changes: 4 additions & 4 deletions htdocs/luci-static/resources/v2ray.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ return L.Class.extend({
}));
},
getSections: function(r, t) {
return void 0 === t && (t = "alias"), uci.load("v2ray").then((function() {
return void 0 === t && (t = "alias"), uci.load("luci_v2ray").then((function() {
var n = [];
return uci.sections("v2ray", r, (function(r) {
return uci.sections("luci_v2ray", r, (function(r) {
var e;
(e = r[t]) && n.push({
caption: e,
Expand All @@ -37,9 +37,9 @@ return L.Class.extend({
}));
},
getDokodemoDoorPorts: function() {
return uci.load("v2ray").then((function() {
return uci.load("luci_v2ray").then((function() {
var r = [];
return uci.sections("v2ray", "inbound", (function(t) {
return uci.sections("luci_v2ray", "inbound", (function(t) {
var n;
if ("dokodemo-door" == t.protocol && (n = t.port)) {
var e;
Expand Down
44 changes: 28 additions & 16 deletions htdocs/luci-static/resources/view/v2ray/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,36 @@

"require uci";

"require view";

"require ui";

// "require view";
// @ts-ignore
return L.view.extend({
load: function() {
return uci.load("v2ray").then((function() {
var a = uci.get("v2ray", "main", "config_file");
return a || (a = "/var/etc/v2ray/v2ray.main.json"), Promise.all([ Promise.resolve(a), L.resolveDefault(fs.read(a), "") ]);
return view.extend({
load: function () {
return uci.load("luci_v2ray").then((function () {
var a = uci.get("luci_v2ray", "main", "config_file");
return a || (a = "/var/etc/luci_v2ray/v2ray.main.json"), Promise.all([Promise.resolve(a), L.resolveDefault(fs.read(a), "")]);
}));
},
render: function(a) {
var e = void 0 === a ? [] : a, r = e[0], t = void 0 === r ? "" : r, o = e[1], s = void 0 === o ? "" : o;
return E([ E("h2", "%s - %s".format(_("V2Ray"), _("About"))), E("p", _("LuCI support for V2Ray and Xray-core.")), E("p", _("Version: %s").format("2.2.0" + "-" + "0")), E("p", _("Author: %s").format("Xingwang Liao & BI7PRK")), E("p", _("Source: %s").format('<a href="https://github.com/BI7PRK/luci-app-v2ray" target="_blank">https://github.com/BI7PRK/luci-app-v2ray</a>')), E("p", _("Latest: %s").format('<a href="https://github.com/BI7PRK/luci-app-v2ray/releases/latest" target="_blank">https://github.com/BI7PRK/luci-app-v2ray/releases/latest</a>')), E("p", _("Report Bugs: %s").format('<a href="https://github.com/kuoruan/luci-app-v2ray/issues" target="_blank">https://github.com/kuoruan/luci-app-v2ray/issues</a>')), E("p", _("Donate: %s").format('<a href="https://blog.kuoruan.com/donate" target="_blank">https://blog.kuoruan.com/donate</a>')), E("p", _("Current Config File: %s").format(t)), E("pre", {
style: "-moz-tab-size: 4;-o-tab-size: 4;tab-size: 4;word-break: break-all;"
}, s || _("Failed to open file.")) ]);
},
handleReset: null,
handleSave: null,
handleSaveApply: null
render: function (data) {
var e = void 0 === data ? [] : data;
var r = e[0];
var t = void 0 === r ? "" : r;
var o = e[1];
var s = void 0 === o ? "" : o;
return E([
E("h2", "%s - %s".format(_("V2Ray"), _("About"))),
E("p", _("LuCI support for V2Ray.")),
E("p", _("Version: %s").format("2.2.1" + "-" + "0")),
E("p", _("Author: %s").format("Xingwang Liao & BI7PRK")),
E("p", _("Source: %s").format('<a href="https://github.com/BI7PRK/luci-app-v2ray" target="_blank">https://github.com/BI7PRK/luci-app-v2ray</a>')),
E("p", _("Latest: %s").format('<a href="https://github.com/BI7PRK/luci-app-v2ray/releases/latest" target="_blank">https://github.com/BI7PRK/luci-app-v2ray/releases/latest</a>')),
E("p", _("Report Bugs: %s").format('<a href="https://github.com/kuoruan/luci-app-v2ray/issues" target="_blank">https://github.com/kuoruan/luci-app-v2ray/issues</a>')),
E("p", _("Donate: %s").format('<a href="https://blog.kuoruan.com/donate" target="_blank">https://blog.kuoruan.com/donate</a>')),
E("p", _("Current Config File: %s").format(t)),
E("pre", {
style: "-moz-tab-size: 4;-o-tab-size: 4;tab-size: 4;word-break: break-all;"
}, s || _("Failed to open file."))
]);
}
});
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/v2ray/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ return L.view.extend({
},
render: function(e) {
void 0 === e && (e = []);
var a, o = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("DNS")), _("Details: %s").format('<a href="https://www.v2fly.org/config/dns.html#dnsobject" target="_blank">DnsObject</a>')), r = o.section(form.NamedSection, "main_dns", "dns");
var a, o = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("DNS")), _("Details: %s").format('<a href="https://www.v2fly.org/config/dns.html#dnsobject" target="_blank">DnsObject</a>')), r = o.section(form.NamedSection, "main_dns", "dns");
r.anonymous = !0, r.addremove = !1, (a = r.option(form.Flag, "enabled", _("Enabled"))).rmempty = !1,
a = r.option(form.Value, "tag", _("Tag")), a = r.option(form.Flag, "disable_cache", _("Disable Cache")),
a = r.option(form.Flag, "disable_fallback", _("Disable Fallback")), a = r.option(form.Flag, "disable_fallback_if_match", _("Disable Fallback If Match")),
Expand Down
34 changes: 24 additions & 10 deletions htdocs/luci-static/resources/view/v2ray/inbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@ return L.view.extend({
load: function() {
return v2ray.getLocalIPs();
},
render: function(o) {
void 0 === o && (o = []);
var e, s = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("Inbound"))), t = s.section(form.GridSection, "inbound");
t.anonymous = !0, t.addremove = !0, t.sortable = !0, t.modaltitle = function(o) {
var e = uci.get("v2ray", o, "alias");
render: function(localIPs) {
const m = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("Inbound")));

if (localIPs === 0) {
localIPs = [];
}
var o = localIPs;
var e, t = m.section(form.GridSection, "inbound");
t.anonymous = !0, t.addremove = !0, t.sortable = !0;
t.modaltitle = function(section_id) {
var e = uci.get("luci_v2ray", section_id, "alias");
return _("Inbound") + " » " + (null != e ? e : _("Add"));
}, t.nodescriptions = !0, t.tab("general", _("General Settings")), t.tab("stream", _("Stream Settings")),
t.tab("other", _("Other Settings")), (
};
t.nodescriptions = true;

t.tab("general", _("General Settings"));
t.tab("stream", _("Stream Settings"));
t.tab("other", _("Other Settings"));

(
/** General settings */
e = t.taboption("general", form.Value, "alias", _("Alias"))).rmempty = !1, (e = t.taboption("general", form.Value, "listen", _("Listen"))).datatype = "ipaddr";
for (var a = 0, r = o; a < r.length; a++) {
Expand Down Expand Up @@ -87,7 +99,7 @@ return L.view.extend({
l = d[n];
e.value(l);
}
return e.datatype = "host", e.placeholder = "127.0.0.1", (e = t.taboption("general", form.Value, "s_socks_user_level", "%s - %s".format("Socks", _("User level")), _("All connections share this level"))).modalonly = !0,
e.datatype = "host", e.placeholder = "127.0.0.1", (e = t.taboption("general", form.Value, "s_socks_user_level", "%s - %s".format("Socks", _("User level")), _("All connections share this level"))).modalonly = !0,
e.depends("protocol", "socks"), e.datatype = "uinteger", (
// Settings - Trojan
e = t.taboption("general", form.Value, "s_trojan_address", "%s - %s".format("Trojan", _("Address")))).modalonly = !0,
Expand Down Expand Up @@ -216,7 +228,9 @@ return L.view.extend({
(e = t.taboption("other", form.Flag, "metadata_only", "%s - %s".format(_("metadata only"), _("Enabled")))).modalonly = !0,
(e = t.taboption("other", form.ListValue, "allocate_strategy", "%s - %s".format(_("Allocate"), _("Strategy")))).modalonly = !0,
e.value(""), e.value("always"), e.value("random"), (e = t.taboption("other", form.Value, "allocate_refresh", "%s - %s".format(_("Allocate"), _("Refresh")))).modalonly = !0,
e.datatype = "uinteger", (e = t.taboption("other", form.Value, "allocate_concurrency", "%s - %s".format(_("Allocate"), _("Concurrency")))).modalonly = !0,
e.datatype = "uinteger", s.render();
e.datatype = "uinteger", (e = t.taboption("other", form.Value, "allocate_concurrency", "%s - %s".format(_("Allocate"), _("Concurrency")))).modalonly = !0;
e.datatype = "uinteger";

return m.render();
}
});
46 changes: 38 additions & 8 deletions htdocs/luci-static/resources/view/v2ray/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// @ts-ignore
return L.view.extend({
handleServiceReload: function(e) {
return fs.exec("/etc/init.d/v2ray", [ "reload" ]).then(L.bind((function(e, o) {
return fs.exec("/etc/init.d/luci_v2ray", [ "reload" ]).then(L.bind((function(e, o) {
0 !== o.code && (ui.addNotification(null, [ E("p", _("Reload service failed with code %d").format(o.code)), o.stderr ? E("pre", {}, [ o.stderr ]) : "" ]),
L.raise("Error", "Reload failed"));
}), this, e.target)).catch((function(e) {
Expand All @@ -31,8 +31,25 @@ return L.view.extend({
return Promise.all([ v2ray.getSections("inbound"), v2ray.getSections("outbound") ]);
},
render: function(e) {
var o, a = void 0 === e ? [] : e, r = a[0], t = void 0 === r ? [] : r, n = a[1], i = void 0 === n ? [] : n, l = new form.Map("v2ray", "%s - %s".format(_("V2ray"), _("Global Settings")), "<p>%s</p><p>%s</p>".format(_("A platform for building proxies to bypass network restrictions."), _("For more information, please visit: %s").format('<a href="https://www.v2fly.org" target="_blank">https://www.v2fly.org</a>'))), s = l.section(form.NamedSection, "main", "v2ray");
s.addremove = !1, s.anonymous = !0, s.option(custom.RunningStatus, "_status"), (o = s.option(form.Flag, "enabled", _("Enabled"))).rmempty = !1,
const m = new form.Map(
"luci_v2ray",
"%s - %s".format(_("V2ray"), _("Global Settings")),
"<p>%s</p><p>%s</p>".format(
_("A platform for building proxies to bypass network restrictions."),
_("For more information, please visit: %s").format(
'<a href="https://www.v2fly.org" target="_blank">https://www.v2fly.org</a>'
)
)
);

const s = m.section(form.NamedSection, "main", "v2ray");
s.addremove = false;
s.anonymous = true;

var o;
var a = void 0 === e ? [] : e, r = a[0], t = void 0 === r ? [] : r, n = a[1], i = void 0 === n ? [] : n;

s.option(custom.RunningStatus, "_status"), (o = s.option(form.Flag, "enabled", _("Enabled"))).rmempty = !1,
(o = s.option(form.Button, "_reload", _("Reload Service"), _("This will restart service when config file changes."))).inputstyle = "action reload",
o.inputtitle = _("Reload"), o.onclick = L.bind(this.handleServiceReload, this),
(o = s.option(form.Value, "v2ray_file", _("V2Ray file"), _("Set the V2Ray executable file path."))).datatype = "file",
Expand All @@ -56,10 +73,23 @@ return L.view.extend({
var g = p[c];
o.value(g.value, g.caption);
}
return (o = s.option(form.Flag, "stats_enabled", "%s - %s".format(_("Stats"), _("Enabled")))).depends("config_file", ""),
(o = s.option(form.Flag, "transport_enabled", "%s - %s".format(_("Transport"), _("Enabled")))).depends("config_file", ""),
(o = s.option(custom.TextValue, "_transport", "%s - %s".format(_("Transport"), _("Settings")), _("<code>transport</code> field in top level configuration, JSON string"))).depends("transport_enabled", "1"),
o.wrap = "off", o.rows = 5, o.datatype = "string", o.filepath = "/etc/v2ray/transport.json",
o.required = !0, o.isjson = !0, l.render();
(o = s.option(form.Flag, "stats_enabled", "%s - %s".format(_("Stats"), _("Enabled")))).depends("config_file", ""),
(o = s.option(form.Flag, "transport_enabled", "%s - %s".format(_("Transport"), _("Enabled")))).depends("config_file", "");

o = s.option(
custom.TextValue,
"_transport",
"%s - %s".format(_("Transport"), _("Settings")),
_("<code>transport</code> field in top level configuration, JSON string")
);
o.depends("transport_enabled", "1");
o.wrap = "off";
o.rows = 5;
o.datatype = "string";
o.filepath = "/etc/luci_v2ray/transport.json";
o.required = true;
o.isjson = true;

return m.render();
}
});
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/v2ray/observatory.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// @ts-ignore
return L.view.extend({
render: function() {
var e = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("Observatory")), _("Details: %s").format('<a href="https://www.v2fly.org/config/observatory.html#observatoryobject" target="_blank">ObservatoryObject</a>')), r = e.section(form.NamedSection, "main_observatory", "observatory");
var e = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("Observatory")), _("Details: %s").format('<a href="https://www.v2fly.org/config/observatory.html#observatoryobject" target="_blank">ObservatoryObject</a>')), r = e.section(form.NamedSection, "main_observatory", "observatory");
return r.addremove = !1, r.option(form.Flag, "enabled", _("Enabled")).rmempty = !1,
r.option(form.Value, "probeURL", _("ProbeURL"), _("A valid URL, it will be get request to testing. eg: <code>%s</code>.").format("https://api.github.com/_private/browser/stats")).placeholder = _("empty use the built-in value"),
r.option(form.Value, "probeInterval", _("ProbeInterval")), r.option(form.DynamicList, "subjectSelector", _("SubjectSelector")),
Expand Down
6 changes: 3 additions & 3 deletions htdocs/luci-static/resources/view/v2ray/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ return L.view.extend({
for (var s = e.split(/\r?\n/), o = 0, t = 0, a = s; t < a.length; t++) {
var r = a[t], l = void 0;
if (r && (l = converters.vmessLinkToVmess(r)) && "2" === l.v) {
var n = uci.add("v2ray", "outbound");
var n = uci.add("luci_v2ray", "outbound");
if (n) {
const tls = l.tls || "";
var d = l.add || "0.0.0.0", p = l.port || "0", i = l.net || "", u = l.type || "", c = l.path || "", v = l.ps || "%s:%s".format(d, p);
Expand Down Expand Up @@ -119,9 +119,9 @@ return L.view.extend({
return Promise.all([ v2ray.getLocalIPs() ]);
},
render: function(e) {
var s, o = e[0], t = void 0 === o ? [] : o, a = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("Outbound"))), r = a.section(form.GridSection, "outbound");
var s, o = e[0], t = void 0 === o ? [] : o, a = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("Outbound"))), r = a.section(form.GridSection, "outbound");
r.anonymous = !0, r.addremove = !0, r.sortable = !0, r.modaltitle = function(e) {
var s = uci.get("v2ray", e, "alias");
var s = uci.get("luci_v2ray", e, "alias");
return _("Outbound") + " » " + (null != s ? s : _("Add"));
}, r.nodescriptions = !0, r.tab("general", _("General Settings")), r.tab("stream", _("Stream Settings")),
r.tab("other", _("Other Settings")), (
Expand Down
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/v2ray/policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ return L.view.extend({
},
render: function(e) {
void 0 === e && (e = []);
var o, n = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("Policy")), _("Details: %s").format('<a href="https://www.v2fly.org/config/policy.html#policyobject" target="_blank">PolicyObject</a>')), l = n.section(form.NamedSection, "main_policy", "policy");
var o, n = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("Policy")), _("Details: %s").format('<a href="https://www.v2fly.org/config/policy.html#policyobject" target="_blank">PolicyObject</a>')), l = n.section(form.NamedSection, "main_policy", "policy");
l.anonymous = !0, l.addremove = !1, (o = l.option(form.Flag, "enabled", _("Enabled"))).rmempty = !1,
o = l.option(form.MultiValue, "levels", _("Levels"), _("Select policy levels"));
for (var t = 0, a = e; t < a.length; t++) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/v2ray/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// @ts-ignore
return L.view.extend({
render: function() {
var e = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("Reverse")), _("Details: %s").format('<a href="https://www.v2fly.org/config/reverse.html#reverseobject" target="_blank">ReverseObject</a>')), r = e.section(form.NamedSection, "main_reverse", "reverse");
var e = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("Reverse")), _("Details: %s").format('<a href="https://www.v2fly.org/config/reverse.html#reverseobject" target="_blank">ReverseObject</a>')), r = e.section(form.NamedSection, "main_reverse", "reverse");
return r.addremove = !1, r.option(form.Flag, "enabled", _("Enabled")).rmempty = !1,
r.option(form.DynamicList, "bridges", _("Bridges"), _("A list of bridges, format: <code>tag|domain</code>. eg: %s").format("bridge|test.v2ray.com")),
r.option(form.DynamicList, "portals", _("Portals"), _("A list of portals, format: <code>tag|domain</code>. eg: %s").format("portal|test.v2ray.com")),
Expand Down
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/v2ray/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ return L.view.extend({
return Promise.all([ v2ray.getSections("routing_rule"), v2ray.getSections("routing_balancer", "tag"), v2ray.getSections("outbound", "tag") ]);
},
render: function(o) {
var a, t = void 0 === o ? [] : o, e = t[0], n = void 0 === e ? [] : e, r = t[1], i = void 0 === r ? [] : r, l = t[2], u = void 0 === l ? [] : l, m = new form.Map("v2ray", "%s - %s".format(_("V2Ray"), _("Routing")), _("Details: %s").format('<a href="https://www.v2fly.org/config/routing.html#routingobject" target="_blank">RoutingObject</a>')), s = m.section(form.NamedSection, "main_routing", "routing");
var a, t = void 0 === o ? [] : o, e = t[0], n = void 0 === e ? [] : e, r = t[1], i = void 0 === r ? [] : r, l = t[2], u = void 0 === l ? [] : l, m = new form.Map("luci_v2ray", "%s - %s".format(_("V2Ray"), _("Routing")), _("Details: %s").format('<a href="https://www.v2fly.org/config/routing.html#routingobject" target="_blank">RoutingObject</a>')), s = m.section(form.NamedSection, "main_routing", "routing");
s.anonymous = !0, s.addremove = !1, a = s.option(form.Flag, "enabled", _("Enabled")),
(a = s.option(form.ListValue, "domain_strategy", _("Domain resolution strategy"))).value(""),
a.value("AsIs"), a.value("IPIfNonMatch"), a.value("IPOnDemand"), (a = s.option(form.ListValue, "domain_matcher", _("Domain name matching algorithm"))).value("linear"),
Expand Down
Loading

0 comments on commit 12f911d

Please sign in to comment.