Skip to content

Commit

Permalink
update 2024-09-04 00:15:57
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzok8 committed Sep 3, 2024
1 parent 1f96dc7 commit b8c70bb
Show file tree
Hide file tree
Showing 11 changed files with 765 additions and 711 deletions.
1 change: 0 additions & 1 deletion luci-app-homeproxy/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
TODO:
- Subscription page slow response with a large number of nodes
- Refactor nft rules
- Support Clash selector, urltest etc.
- Move ACL settings to a dedicated page
- Any other improvements
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ return view.extend({
var features = data[1],
hosts = data[2]?.hosts;

/* Cache all configured proxy nodes, they will be called multiple times */
var proxy_nodes = {};
uci.sections(data[0], 'node', (res) => {
var nodeaddr = ((res.type === 'direct') ? res.override_address : res.address) || '',
nodeport = ((res.type === 'direct') ? res.override_port : res.port) || '';

proxy_nodes[res['.name']] =
String.format('[%s] %s', res.type, res.label || ((stubValidator.apply('ip6addr', nodeaddr) ?
String.format('[%s]', nodeaddr) : nodeaddr) + ':' + nodeport));
});

m = new form.Map('homeproxy', _('HomeProxy'),
_('The modern ImmortalWrt proxy platform for ARM64/AMD64.'));

Expand All @@ -123,17 +134,6 @@ return view.extend({
]);
}

/* Cache all configured proxy nodes, they will be called multiple times */
var proxy_nodes = {};
uci.sections(data[0], 'node', (res) => {
var nodeaddr = ((res.type === 'direct') ? res.override_address : res.address) || '',
nodeport = ((res.type === 'direct') ? res.override_port : res.port) || '';

proxy_nodes[res['.name']] =
String.format('[%s] %s', res.type, res.label || ((stubValidator.apply('ip6addr', nodeaddr) ?
String.format('[%s]', nodeaddr) : nodeaddr) + ':' + nodeport));
});

s = m.section(form.NamedSection, 'config', 'homeproxy');

s.tab('routing', _('Routing Settings'));
Expand Down Expand Up @@ -234,14 +234,11 @@ return view.extend({

o = s.taboption('routing', form.Value, 'routing_port', _('Routing ports'),
_('Specify target ports to be proxied. Multiple ports must be separated by commas.'));
o.value('all', _('All ports'));
o.value('', _('All ports'));
o.value('common', _('Common ports only (bypass P2P traffic)'));
o.default = 'common';
o.rmempty = false;
o.validate = function(section_id, value) {
if (section_id && value !== 'all' && value !== 'common') {
if (!value)
return _('Expecting: %s').format(_('valid port value'));
if (section_id && value && value !== 'common') {

var ports = [];
for (var i of value.split(',')) {
Expand Down Expand Up @@ -383,7 +380,7 @@ return view.extend({
so.editable = true;

so = ss.option(form.ListValue, 'domain_strategy', _('Domain strategy'),
_('If set, the server domain name will be resolved to IP before connecting.<br/>dns.strategy will be used if empty.'));
_('If set, the server domain name will be resolved to IP before connecting.<br/>'));
for (var i in hp.dns_strategy)
so.value(i, hp.dns_strategy[i]);
so.modalonly = true;
Expand Down Expand Up @@ -725,7 +722,7 @@ return view.extend({
so.modalonly = true;

so = ss.option(form.ListValue, 'address_strategy', _('Address strategy'),
_('The domain strategy for resolving the domain name in the address. dns.strategy will be used if empty.'));
_('The domain strategy for resolving the domain name in the address.'));
for (var i in hp.dns_strategy)
so.value(i, hp.dns_strategy[i]);
so.modalonly = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only
/*
* SPDX-License-Identifier: GPL-2.0-only
*
* Copyright (C) 2022-2023 ImmortalWrt.org
*/
Expand Down
Loading

0 comments on commit b8c70bb

Please sign in to comment.