Skip to content

Commit

Permalink
update 2025-03-05 14:16:22
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzok8 committed Mar 5, 2025
1 parent ecbce12 commit 3c9ebe8
Show file tree
Hide file tree
Showing 9 changed files with 1,658 additions and 1,472 deletions.
2 changes: 2 additions & 0 deletions luci-app-fchomo/htdocs/luci-static/resources/fchomo.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const inbound_type = [
['vmess', _('VMess')],
['vless', _('VLESS')],
['trojan', _('Trojan')],
['anytls', _('AnyTLS')],
['tuic', _('TUIC')],
['hysteria2', _('Hysteria2')],
//['tunnel', _('Tunnel')]
Expand Down Expand Up @@ -101,6 +102,7 @@ const outbound_type = [
['vmess', _('VMess')],
['vless', _('VLESS')],
['trojan', _('Trojan')],
['anytls', _('AnyTLS')],
//['hysteria', _('Hysteria')],
['hysteria2', _('Hysteria2')],
['tuic', _('TUIC')],
Expand Down
38 changes: 30 additions & 8 deletions luci-app-fchomo/htdocs/luci-static/resources/view/fchomo/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ return view.extend({
so = ss.taboption('field_general', form.Value, 'password', _('Password'));
so.password = true;
so.validate = L.bind(hm.validateAuthPassword, so);
so.depends({type: /^(http|socks5|mieru|trojan|hysteria2|tuic|ssh)$/});
so.depends({type: /^(http|socks5|mieru|trojan|anytls|hysteria2|tuic|ssh)$/});
so.modalonly = true;

so = ss.taboption('field_general', hm.TextValue, 'headers', _('HTTP header'));
Expand Down Expand Up @@ -285,6 +285,27 @@ return view.extend({
so.depends({type: 'trojan', trojan_ss_enabled: '1'});
so.modalonly = true;

/* AnyTLS fields */
so = ss.taboption('field_general', form.Value, 'anytls_idle_session_check_interval', _('Idle session check interval'),
_('In seconds.'));
so.placeholder = '30';
so.validate = L.bind(hm.validateTimeDuration, so);
so.depends('type', 'anytls');
so.modalonly = true;

so = ss.taboption('field_general', form.Value, 'anytls_idle_session_timeout', _('Idle session timeout'),
_('In seconds.'));
so.placeholder = '30';
so.validate = L.bind(hm.validateTimeDuration, so);
so.depends('type', 'anytls');
so.modalonly = true;

so = ss.taboption('field_general', form.Value, 'anytls_min_idle_session', _('Min of idle sessions to keep'));
so.datatype = 'uinteger';
so.placeholder = '0';
so.depends('type', 'anytls');
so.modalonly = true;

/* VMess / VLESS fields */
so = ss.taboption('field_general', form.Value, 'vmess_uuid', _('UUID'));
so.rmempty = false;
Expand Down Expand Up @@ -453,7 +474,7 @@ return view.extend({
/* Extra fields */
so = ss.taboption('field_general', form.Flag, 'udp', _('UDP'));
so.default = so.disabled;
so.depends({type: /^(direct|socks5|ss|vmess|vless|trojan|wireguard)$/});
so.depends({type: /^(direct|socks5|ss|vmess|vless|trojan|anytls|wireguard)$/});
so.modalonly = true;

so = ss.taboption('field_general', form.Flag, 'uot', _('UoT'),
Expand All @@ -478,7 +499,7 @@ return view.extend({
let tls_alpn = this.section.getUIElement(section_id, 'tls_alpn');

// Force enabled
if (['trojan', 'hysteria', 'hysteria2', 'tuic'].includes(type)) {
if (['trojan', 'anytls', 'hysteria', 'hysteria2', 'tuic'].includes(type)) {
tls.checked = true;
tls.disabled = true;
} else {
Expand All @@ -498,6 +519,7 @@ return view.extend({
case 'vmess':
case 'vless':
case 'trojan':
case 'anytls':
def_alpn = ['h2', 'http/1.1'];
break;
default:
Expand All @@ -509,7 +531,7 @@ return view.extend({

return true;
}
so.depends({type: /^(http|socks5|vmess|vless|trojan|hysteria|hysteria2|tuic)$/});
so.depends({type: /^(http|socks5|vmess|vless|trojan|anytls|hysteria|hysteria2|tuic)$/});
so.modalonly = true;

so = ss.taboption('field_tls', form.Flag, 'tls_disable_sni', _('Disable SNI'),
Expand All @@ -520,13 +542,13 @@ return view.extend({

so = ss.taboption('field_tls', form.Value, 'tls_sni', _('TLS SNI'),
_('Used to verify the hostname on the returned certificates.'));
so.depends({tls: '1', type: /^(http|vmess|vless|trojan|hysteria|hysteria2)$/});
so.depends({tls: '1', type: /^(http|vmess|vless|trojan|anytls|hysteria|hysteria2)$/});
so.depends({tls: '1', tls_disable_sni: '0', type: /^(tuic)$/});
so.modalonly = true;

so = ss.taboption('field_tls', form.DynamicList, 'tls_alpn', _('TLS ALPN'),
_('List of supported application level protocols, in order of preference.'));
so.depends({tls: '1', type: /^(vmess|vless|trojan|hysteria|hysteria2|tuic)$/});
so.depends({tls: '1', type: /^(vmess|vless|trojan|anytls|hysteria|hysteria2|tuic)$/});
so.modalonly = true;

so = ss.taboption('field_tls', form.Value, 'tls_fingerprint', _('Cert fingerprint'),
Expand All @@ -547,7 +569,7 @@ return view.extend({
'<br/>' +
_('This is <strong>DANGEROUS</strong>, your traffic is almost like <strong>PLAIN TEXT</strong>! Use at your own risk!'));
so.default = so.disabled;
so.depends({tls: '1', type: /^(http|socks5|vmess|vless|trojan|hysteria|hysteria2|tuic)$/});
so.depends({tls: '1', type: /^(http|socks5|vmess|vless|trojan|anytls|hysteria|hysteria2|tuic)$/});
so.modalonly = true;

// uTLS fields
Expand All @@ -556,7 +578,7 @@ return view.extend({
hm.tls_client_fingerprints.forEach((res) => {
so.value.apply(so, res);
})
so.depends({tls: '1', type: /^(vmess|vless|trojan)$/});
so.depends({tls: '1', type: /^(vmess|vless|trojan|anytls)$/});
so.depends({type: 'ss', plugin: /^(shadow-tls|restls)$/});
so.modalonly = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,14 @@ return view.extend({
/* hm.validateAuth */
o = s.taboption('field_general', form.Value, 'username', _('Username'));
o.validate = L.bind(hm.validateAuthUsername, o);
o.depends({type: /^(http|socks|mixed|hysteria2)$/});
o.depends({type: /^(http|socks|mixed|trojan|anytls|hysteria2)$/});
o.modalonly = true;

o = s.taboption('field_general', hm.GenValue, 'password', _('Password'));
o.password = true;
o.validate = L.bind(hm.validateAuthPassword, o);
o.rmempty = false;
o.depends({type: /^(http|socks|mixed|hysteria2)$/, username: /.+/});
o.depends('type', 'trojan');
o.depends({type: /^(http|socks|mixed|trojan|anytls|hysteria2)$/, username: /.+/});
o.depends({type: /^(tuic)$/, uuid: /.+/});
o.modalonly = true;

Expand Down Expand Up @@ -234,6 +233,11 @@ return view.extend({
o.depends({type: 'trojan', trojan_ss_enabled: '1'});
o.modalonly = true;

/* AnyTLS fields */
o = s.taboption('field_general', form.TextValue, 'anytls_padding_scheme', _('Padding scheme'));
o.depends('type', 'anytls');
o.modalonly = true;

/* VMess / VLESS fields */
o = s.taboption('field_general', hm.GenValue, 'vmess_uuid', _('UUID'));
o.rmempty = false;
Expand Down Expand Up @@ -272,7 +276,7 @@ return view.extend({
let tls_reality = this.section.getUIElement(section_id, 'tls_reality').node.querySelector('input');

// Force enabled
if (['vless', 'trojan', 'tuic', 'hysteria2'].includes(type)) {
if (['vless', 'trojan', 'anytls', 'tuic', 'hysteria2'].includes(type)) {
tls.checked = true;
tls.disabled = true;
if (['tuic', 'hysteria2'].includes(type) && !`${tls_alpn.getValue()}`)
Expand All @@ -291,7 +295,7 @@ return view.extend({

return true;
}
o.depends({type: /^(http|socks|mixed|vmess|vless|trojan|tuic|hysteria2)$/});
o.depends({type: /^(http|socks|mixed|vmess|vless|trojan|anytls|tuic|hysteria2)$/});
o.modalonly = true;

o = s.taboption('field_tls', form.DynamicList, 'tls_alpn', _('TLS ALPN'),
Expand Down
Loading

0 comments on commit 3c9ebe8

Please sign in to comment.