Added dialer proxy option to my server pool
This commit is contained in:
parent
fd2a2dad87
commit
d030d7e23c
@ -420,6 +420,15 @@ mihomo разбирает подписку (`luci/servers.js` — перенос
|
|||||||
сверяет с ним): reality, xhttp, ws, grpc и прочее — как в приложении. «Скопировать» отдаёт
|
сверяет с ним): reality, xhttp, ws, grpc и прочее — как в приложении. «Скопировать» отдаёт
|
||||||
сервер как YAML для другого роутера.
|
сервер как YAML для другого роутера.
|
||||||
|
|
||||||
|
«Вход» в карточке — через что подключаться к самому серверу. «Как обычно» — как остальные
|
||||||
|
свои серверы: на `main` напрямую, на `whitelist` и телефоне через `MY-EXIT`, с CSQTT через
|
||||||
|
`UPLINK`. «Через FOREIGN», «через RU», «напрямую» или «через пул» действует только для этого
|
||||||
|
сервера и во всех профилях и в конфиге телефона: например, сервер, до которого напрямую не
|
||||||
|
достучаться, идёт через ноды FOREIGN, а остальные свои серверы — как раньше. Хранится как
|
||||||
|
`dialer-proxy` в строке сервера (`/etc/nikki/my-servers`); `dialer-proxy`, вписанный в
|
||||||
|
«Настройки (YAML)», становится тем же «Входом». Пул, в который сервер входит сам, как вход
|
||||||
|
нельзя — это петля.
|
||||||
|
|
||||||
AmneziaWG: туда же вставляется ключ AmneziaVPN `vpn://…` («Поделиться» в приложении; файл
|
AmneziaWG: туда же вставляется ключ AmneziaVPN `vpn://…` («Поделиться» в приложении; файл
|
||||||
`.vpn` тоже можно выбрать) или `.conf` AmneziaWG / обычного WireGuard (текст `[Interface]` …
|
`.vpn` тоже можно выбрать) или `.conf` AmneziaWG / обычного WireGuard (текст `[Interface]` …
|
||||||
`[Peer]` … или файл — тогда сервер называется по имени файла). Получается сервер
|
`[Peer]` … или файл — тогда сервер называется по имени файла). Получается сервер
|
||||||
|
|||||||
@ -752,17 +752,39 @@ return view.extend({
|
|||||||
servers.forEach(function(e) { t[e.name.value.trim()] = true; });
|
servers.forEach(function(e) { t[e.name.value.trim()] = true; });
|
||||||
return t;
|
return t;
|
||||||
};
|
};
|
||||||
|
// "Вход" of an own server (its own dialer-proxy): what it dials through in every
|
||||||
|
// profile instead of what the kit puts in front (MY-EXIT, UPLINK, directly)
|
||||||
|
var entryOptions = function(sel) {
|
||||||
|
var cur = sel.value || sel.getAttribute('data-entry') || '';
|
||||||
|
var names = pools.map(function(p) { return p.name.value.trim().toUpperCase(); }).filter(Boolean);
|
||||||
|
var opts = [ [ '', 'вход: как обычно' ], [ 'FOREIGN', 'вход: через FOREIGN' ], [ 'RU', 'вход: через RU' ],
|
||||||
|
[ 'DIRECT', 'вход: напрямую' ] ].concat(names.map(function(n) { return [ n, 'вход: через пул ' + n ]; }));
|
||||||
|
if (cur && !opts.some(function(o) { return o[0] == cur; }))
|
||||||
|
opts.push([ cur, 'вход: ' + cur + ' (такого нет)' ]);
|
||||||
|
dom.content(sel, opts.map(function(o) { return E('option', { 'value': o[0] }, o[1]); }));
|
||||||
|
sel.value = cur;
|
||||||
|
};
|
||||||
var addServer = function(p, open) {
|
var addServer = function(p, open) {
|
||||||
var e = { proxy: {}, error: null };
|
var e = { proxy: {}, error: null };
|
||||||
Object.keys(p).forEach(function(k) {
|
Object.keys(p).forEach(function(k) {
|
||||||
if (k != 'name' && k != 'dialer-proxy')
|
if (k != 'name' && k != 'dialer-proxy')
|
||||||
e.proxy[k] = p[k];
|
e.proxy[k] = p[k];
|
||||||
});
|
});
|
||||||
|
e.entry = E('select', { 'class': 'cbi-input-select', 'data-entry': p['dialer-proxy'] || '',
|
||||||
|
'title': 'через что подключаться к этому серверу, во всех профилях и на телефоне: например, через FOREIGN, ' +
|
||||||
|
'если сам сервер напрямую недоступен. «Как обычно» — как остальные свои серверы' });
|
||||||
|
entryOptions(e.entry);
|
||||||
|
e.entry.addEventListener('focus', function() { entryOptions(e.entry); });
|
||||||
|
e.entry.addEventListener('mousedown', function() { entryOptions(e.entry); });
|
||||||
|
// "как обычно" is an empty value: keep the choice for the next rebuild of the list
|
||||||
|
e.entry.addEventListener('change', function() { e.entry.setAttribute('data-entry', e.entry.value); });
|
||||||
e.name = text(S.freeName(p.name, taken()), 'имя в дашборде');
|
e.name = text(S.freeName(p.name, taken()), 'имя в дашборде');
|
||||||
e.name.style.width = '16em';
|
e.name.style.width = '16em';
|
||||||
e.get = function() {
|
e.get = function() {
|
||||||
var o = { name: e.name.value.trim() };
|
var o = { name: e.name.value.trim() };
|
||||||
Object.keys(e.proxy).forEach(function(k) { o[k] = e.proxy[k]; });
|
Object.keys(e.proxy).forEach(function(k) { o[k] = e.proxy[k]; });
|
||||||
|
if (e.entry.value)
|
||||||
|
o['dialer-proxy'] = e.entry.value;
|
||||||
return o;
|
return o;
|
||||||
};
|
};
|
||||||
var info = E('code', {}, S.summary(e.proxy));
|
var info = E('code', {}, S.summary(e.proxy));
|
||||||
@ -778,6 +800,12 @@ return view.extend({
|
|||||||
if (!v.type || v.server === undefined || v.server === null || v.server === '')
|
if (!v.type || v.server === undefined || v.server === null || v.server === '')
|
||||||
throw new Error('нужны type и server');
|
throw new Error('нужны type и server');
|
||||||
delete v.name;
|
delete v.name;
|
||||||
|
// dialer-proxy typed in the YAML: the same as the entry select
|
||||||
|
if (v['dialer-proxy']) {
|
||||||
|
e.entry.setAttribute('data-entry', v['dialer-proxy']);
|
||||||
|
e.entry.value = '';
|
||||||
|
entryOptions(e.entry);
|
||||||
|
}
|
||||||
delete v['dialer-proxy'];
|
delete v['dialer-proxy'];
|
||||||
e.proxy = v;
|
e.proxy = v;
|
||||||
e.error = null;
|
e.error = null;
|
||||||
@ -791,7 +819,7 @@ return view.extend({
|
|||||||
});
|
});
|
||||||
var el = E('div', { 'style': 'border:1px solid #8884;border-radius:4px;padding:.5em;margin-bottom:.5em' }, [
|
var el = E('div', { 'style': 'border:1px solid #8884;border-radius:4px;padding:.5em;margin-bottom:.5em' }, [
|
||||||
E('div', { 'style': 'display:flex;gap:.5em;align-items:center;flex-wrap:wrap' }, [
|
E('div', { 'style': 'display:flex;gap:.5em;align-items:center;flex-wrap:wrap' }, [
|
||||||
e.name, info,
|
e.name, info, e.entry,
|
||||||
E('button', { 'class': 'btn cbi-button', 'click': function() {
|
E('button', { 'class': 'btn cbi-button', 'click': function() {
|
||||||
e.yaml.style.display = e.yaml.style.display == 'none' ? '' : 'none';
|
e.yaml.style.display = e.yaml.style.display == 'none' ? '' : 'none';
|
||||||
} }, 'Настройки (YAML)'),
|
} }, 'Настройки (YAML)'),
|
||||||
@ -1057,6 +1085,12 @@ return view.extend({
|
|||||||
errors.push('Свой сервер ' + n + ': ' + e.error);
|
errors.push('Свой сервер ' + n + ': ' + e.error);
|
||||||
else if (e.proxy.server === undefined || e.proxy.server === null || e.proxy.server === '')
|
else if (e.proxy.server === undefined || e.proxy.server === null || e.proxy.server === '')
|
||||||
errors.push('Свой сервер ' + n + ': пустой server (открой «Настройки (YAML)»)');
|
errors.push('Свой сервер ' + n + ': пустой server (открой «Настройки (YAML)»)');
|
||||||
|
// the entry: a pool that exists and does not hold the server itself (a loop)
|
||||||
|
var en = e.entry.value, ep = poolData.filter(function(v) { return v.name.toUpperCase() == en; })[0];
|
||||||
|
if (en && !/^(FOREIGN|RU|DIRECT)$/.test(en) && !ep)
|
||||||
|
errors.push('Свой сервер ' + n + ': вход через пул ' + en + ', а такого пула нет');
|
||||||
|
else if (ep && ep.servers.split(';').map(function(x) { return x.trim(); }).indexOf(n) >= 0)
|
||||||
|
errors.push('Свой сервер ' + n + ': вход через пул ' + en + ', в который он сам входит — так нельзя');
|
||||||
srvLines.push(S.toLine(e.get()));
|
srvLines.push(S.toLine(e.get()));
|
||||||
});
|
});
|
||||||
if (errors.length) {
|
if (errors.length) {
|
||||||
|
|||||||
@ -1654,13 +1654,14 @@
|
|||||||
return { servers: servers, errors: errors };
|
return { servers: servers, errors: errors };
|
||||||
}
|
}
|
||||||
|
|
||||||
// one stored line: JSON with "name" first (mihomo-kit.sh reads it with sed), no
|
// one stored line: JSON with "name" first (mihomo-kit.sh reads it with sed), a
|
||||||
// dialer-proxy (the kit sets it per profile), "$" as \u0024 (no ${...} for the
|
// dialer-proxy only as the server's own entry (LuCI "Вход"; otherwise the kit sets
|
||||||
// template engine; JSON and YAML both read \u escapes)
|
// it per profile), "$" as \u0024 (no ${...} for the template engine; JSON and YAML
|
||||||
|
// both read \u escapes)
|
||||||
function toLine(p) {
|
function toLine(p) {
|
||||||
var o = { name: String(p.name) };
|
var o = { name: String(p.name) };
|
||||||
Object.keys(p).forEach(function (k) {
|
Object.keys(p).forEach(function (k) {
|
||||||
if (k != 'name' && k != 'dialer-proxy')
|
if (k != 'name' && (k != 'dialer-proxy' || p[k]))
|
||||||
o[k] = p[k];
|
o[k] = p[k];
|
||||||
});
|
});
|
||||||
return JSON.stringify(o).replace(/\$/g, '\\u0024');
|
return JSON.stringify(o).replace(/\$/g, '\\u0024');
|
||||||
|
|||||||
@ -400,12 +400,14 @@ hy2_json() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Own servers (LuCI "Свои серверы"): MY_SERVERS_FILE holds one JSON proxy per line
|
# Own servers (LuCI "Свои серверы"): MY_SERVERS_FILE holds one JSON proxy per line
|
||||||
# with "name" first (luci/servers.js), plus the old HY2_* keys -> OWN_BODIES, the
|
# with "name" first (luci/servers.js), plus the old HY2_* keys -> OWN_PLAIN, the lines
|
||||||
# lines without the leading "{" (templates/proxies puts dialer-proxy in front), and
|
# without an entry of their own and without the leading "{" (templates/proxies puts the
|
||||||
# OWN_LIST '"a", "b"' for group MY. "$" becomes \u0024: the template engine would read
|
# kit's dialer-proxy in front), OWN_ENTRY, the lines with one (LuCI "Вход": their own
|
||||||
|
# "dialer-proxy", kept in every profile), OWN_BODIES, all lines as OWN_PLAIN (for the
|
||||||
|
# chains' copies, which dial through their entry), and OWN_LIST '"a", "b"' for group MY. "$" becomes \u0024: the template engine would read
|
||||||
# ${...} in a password, JSON and YAML both read the escape.
|
# ${...} in a password, JSON and YAML both read the escape.
|
||||||
own_servers_vars() {
|
own_servers_vars() {
|
||||||
OWN_BODIES="" OWN_LIST="" OWN_NAMES=""
|
OWN_BODIES="" OWN_PLAIN="" OWN_ENTRY="" OWN_LIST="" OWN_NAMES=""
|
||||||
_lines=$(
|
_lines=$(
|
||||||
[ -f "$MY_SERVERS_FILE" ] && grep -v '^[[:space:]]*$' "$MY_SERVERS_FILE"
|
[ -f "$MY_SERVERS_FILE" ] && grep -v '^[[:space:]]*$' "$MY_SERVERS_FILE"
|
||||||
for _n in $HY2; do hy2_json "$_n"; done
|
for _n in $HY2; do hy2_json "$_n"; done
|
||||||
@ -417,10 +419,26 @@ own_servers_vars() {
|
|||||||
_dup=$(printf '%s\n' "$_names" | sort | uniq -d | head -n 1)
|
_dup=$(printf '%s\n' "$_names" | sort | uniq -d | head -n 1)
|
||||||
[ -z "$_dup" ] || die "own servers: the name $_dup repeats"
|
[ -z "$_dup" ] || die "own servers: the name $_dup repeats"
|
||||||
OWN_NAMES=$_names
|
OWN_NAMES=$_names
|
||||||
OWN_BODIES=$(printf '%s\n' "$_lines" | sed 's/^{//; s/\$/\\u0024/g')
|
OWN_BODIES=$(printf '%s\n' "$_lines" | sed 's/^{//; s/,"dialer-proxy":"[^"]*"//; s/\$/\\u0024/g')
|
||||||
|
OWN_PLAIN=$(printf '%s\n' "$_lines" | grep -v '"dialer-proxy":' | sed 's/^{//; s/\$/\\u0024/g')
|
||||||
|
OWN_ENTRY=$(printf '%s\n' "$_lines" | grep '"dialer-proxy":' | sed 's/^/- /; s/\$/\\u0024/g')
|
||||||
OWN_LIST=$(printf '%s\n' "$_names" | sed 's/\$/\\u0024/g' | awk '{ printf "%s%s", (NR > 1 ? ", " : ""), $0 }')
|
OWN_LIST=$(printf '%s\n' "$_names" | sed 's/\$/\\u0024/g' | awk '{ printf "%s%s", (NR > 1 ? ", " : ""), $0 }')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# own_entries_check (after pools_vars): an own server's entry is FOREIGN, RU, DIRECT
|
||||||
|
# or a pool that does not hold the server itself (that would be a loop)
|
||||||
|
own_entries_check() {
|
||||||
|
printf '%s\n' "$OWN_ENTRY" | sed -nE 's/^- \{"name":("([^"\\]|\\.)*"),.*"dialer-proxy":"([^"]*)".*/\3 \1/p' |
|
||||||
|
while read -r _oe _on; do
|
||||||
|
case " FOREIGN RU DIRECT$POOL_GROUPS" in *" $_oe "*) ;; *) die "own server $_on: entry $_oe is not FOREIGN, RU, DIRECT or a pool" ;; esac
|
||||||
|
case "$_oe" in FOREIGN | RU | DIRECT) continue ;; esac
|
||||||
|
# pool_vars sets _n, _e and others of its own
|
||||||
|
pool_vars "$(printf '%s' "$_oe" | tr 'A-Z' 'a-z')"
|
||||||
|
printf '%s\n' "$POOL_JSON" | grep -qxF "$_on" && die "own server $_on: its entry is the pool $_oe that holds it (a loop)"
|
||||||
|
true
|
||||||
|
done || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# Services (SERVICES="claude ..."): a site or app that always takes its own way, with
|
# Services (SERVICES="claude ..."): a site or app that always takes its own way, with
|
||||||
# a group of its own in the dashboard. Per service, keys SVC_<NAME>_* (upper case, - -> _):
|
# a group of its own in the dashboard. Per service, keys SVC_<NAME>_* (upper case, - -> _):
|
||||||
# _GEOSITE geosite lists of MetaCubeX/meta-rules-dat (GEOSITE_URL), e.g. "anthropic"
|
# _GEOSITE geosite lists of MetaCubeX/meta-rules-dat (GEOSITE_URL), e.g. "anthropic"
|
||||||
@ -963,6 +981,7 @@ render() {
|
|||||||
# after compute_tags: pools use SUB_LIST / MY_SUB_LIST
|
# after compute_tags: pools use SUB_LIST / MY_SUB_LIST
|
||||||
services_fixed_vars
|
services_fixed_vars
|
||||||
pools_vars
|
pools_vars
|
||||||
|
own_entries_check
|
||||||
services_vars
|
services_vars
|
||||||
[ -n "$GEOSITE_ITEMS" ] && TAGS="$TAGS geosite "
|
[ -n "$GEOSITE_ITEMS" ] && TAGS="$TAGS geosite "
|
||||||
variants_build
|
variants_build
|
||||||
@ -971,7 +990,7 @@ render() {
|
|||||||
BOOT_PBK BOOT_SID TS_HOSTNAME TS_DOMAINS OVPN_PROVIDER OVPN_GROUP OVPN_SERVER_HOST \
|
BOOT_PBK BOOT_SID TS_HOSTNAME TS_DOMAINS OVPN_PROVIDER OVPN_GROUP OVPN_SERVER_HOST \
|
||||||
OVPN_SERVER_IPS OVPN_ROUTES OVPN_CHECK_URL TS_CHECK_URL CSQTT_IFACE CSQTT_PROCESS \
|
OVPN_SERVER_IPS OVPN_ROUTES OVPN_CHECK_URL TS_CHECK_URL CSQTT_IFACE CSQTT_PROCESS \
|
||||||
RU_IPS FOREIGN_IPS MY_IPS RU_DOMAINS FOREIGN_DOMAINS MY_DOMAINS LOCAL_DOMAINS LOCAL_HOSTS_YAML \
|
RU_IPS FOREIGN_IPS MY_IPS RU_DOMAINS FOREIGN_DOMAINS MY_DOMAINS LOCAL_DOMAINS LOCAL_HOSTS_YAML \
|
||||||
OWN_BODIES OWN_LIST GEOSITE_URL
|
OWN_PLAIN OWN_ENTRY OWN_LIST GEOSITE_URL
|
||||||
_first=1
|
_first=1
|
||||||
for s in head proxies:proxies providers:proxy-providers rule-providers:rule-providers sniffer dns \
|
for s in head proxies:proxies providers:proxy-providers rule-providers:rule-providers sniffer dns \
|
||||||
groups:proxy-groups rules:rules; do
|
groups:proxy-groups rules:rules; do
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
- {"dialer-proxy": "MY-EXIT", ${@@OWN_BODIES} #@my_exit
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "UPLINK", ${@@OWN_BODIES} #@uplink,!my_exit
|
- {"dialer-proxy": "MY-EXIT", ${@@OWN_PLAIN} #@my_exit
|
||||||
- {${@@OWN_BODIES} #@!my_exit,!uplink
|
- {"dialer-proxy": "UPLINK", ${@@OWN_PLAIN} #@uplink,!my_exit
|
||||||
|
- {${@@OWN_PLAIN} #@!my_exit,!uplink
|
||||||
|
${@@OWN_ENTRY}
|
||||||
|
|||||||
@ -16,12 +16,14 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
- {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
- {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
- {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
- {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"m1","type":"hysteria2","server":"m.example.com","port":443,"password":"p","udp":true}
|
- {"dialer-proxy": "MY-EXIT", "name":"m1","type":"hysteria2","server":"m.example.com","port":443,"password":"p","udp":true}
|
||||||
|
- {"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"}
|
||||||
|
|
||||||
# copies of own servers for the chains (SVC_<NAME>_CHAIN, POOL_<NAME>_UPLINK): the same
|
# copies of own servers for the chains (SVC_<NAME>_CHAIN, POOL_<NAME>_UPLINK): the same
|
||||||
# server dialing through another entry, named "<server> ⟶ <entry>" (group "<pool> ⟶ <entry>")
|
# server dialing through another entry, named "<server> ⟶ <entry>" (group "<pool> ⟶ <entry>")
|
||||||
@ -260,7 +262,7 @@ proxy-groups:
|
|||||||
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
||||||
- name: MY
|
- name: MY
|
||||||
type: url-test
|
type: url-test
|
||||||
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "m1"]
|
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "via-foreign", "m1"]
|
||||||
use: [example-my, example2-my]
|
use: [example-my, example2-my]
|
||||||
url: "https://www.gstatic.com/generate_204"
|
url: "https://www.gstatic.com/generate_204"
|
||||||
interval: 300
|
interval: 300
|
||||||
|
|||||||
@ -17,12 +17,14 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "UPLINK", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
- {"dialer-proxy": "UPLINK", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
||||||
- {"dialer-proxy": "UPLINK", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
- {"dialer-proxy": "UPLINK", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
- {"dialer-proxy": "UPLINK", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
- {"dialer-proxy": "UPLINK", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
- {"dialer-proxy": "UPLINK", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
- {"dialer-proxy": "UPLINK", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
- {"dialer-proxy": "UPLINK", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
- {"dialer-proxy": "UPLINK", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
||||||
|
- {"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"}
|
||||||
|
|
||||||
# CSQTT (star-panel-csqtt): tunnel interface csqtt0 on the router, mihomo
|
# CSQTT (star-panel-csqtt): tunnel interface csqtt0 on the router, mihomo
|
||||||
# just sends the connection out of it (the interface does not change routes)
|
# just sends the connection out of it (the interface does not change routes)
|
||||||
@ -230,7 +232,7 @@ proxy-groups:
|
|||||||
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
||||||
- name: MY
|
- name: MY
|
||||||
type: url-test
|
type: url-test
|
||||||
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "nl-1"]
|
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "via-foreign", "nl-1"]
|
||||||
use: [example-my, example2-my]
|
use: [example-my, example2-my]
|
||||||
url: "https://www.gstatic.com/generate_204"
|
url: "https://www.gstatic.com/generate_204"
|
||||||
interval: 300
|
interval: 300
|
||||||
|
|||||||
@ -17,11 +17,13 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
- {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
- {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
- {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
- {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
|
- {"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"}
|
||||||
|
|
||||||
# CSQTT (star-panel-csqtt): tunnel interface csqtt0 on the router, mihomo
|
# CSQTT (star-panel-csqtt): tunnel interface csqtt0 on the router, mihomo
|
||||||
# just sends the connection out of it (the interface does not change routes)
|
# just sends the connection out of it (the interface does not change routes)
|
||||||
@ -232,7 +234,7 @@ proxy-groups:
|
|||||||
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
||||||
- name: MY
|
- name: MY
|
||||||
type: url-test
|
type: url-test
|
||||||
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own"]
|
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "via-foreign"]
|
||||||
use: [example-my, example2-my]
|
use: [example-my, example2-my]
|
||||||
url: "https://www.gstatic.com/generate_204"
|
url: "https://www.gstatic.com/generate_204"
|
||||||
interval: 300
|
interval: 300
|
||||||
|
|||||||
@ -27,7 +27,8 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
- {"name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
||||||
|
|
||||||
proxy-providers:
|
proxy-providers:
|
||||||
|
|||||||
@ -24,7 +24,8 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
- {"dialer-proxy": "MY-EXIT", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
||||||
|
|
||||||
proxy-providers:
|
proxy-providers:
|
||||||
|
|||||||
@ -27,12 +27,14 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
- {"name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
||||||
- {"name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
- {"name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
- {"name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
- {"name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
- {"name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
- {"name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
- {"name":"home-hy","type":"hysteria2","server":"1.1.1.1","port":443,"password":"x","udp":true}
|
- {"name":"home-hy","type":"hysteria2","server":"1.1.1.1","port":443,"password":"x","udp":true}
|
||||||
|
- {"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"}
|
||||||
|
|
||||||
proxy-providers:
|
proxy-providers:
|
||||||
example:
|
example:
|
||||||
@ -268,7 +270,7 @@ proxy-groups:
|
|||||||
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
||||||
- name: MY
|
- name: MY
|
||||||
type: url-test
|
type: url-test
|
||||||
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "home-hy"]
|
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "via-foreign", "home-hy"]
|
||||||
use: [example-my, example2-my]
|
use: [example-my, example2-my]
|
||||||
url: "https://www.gstatic.com/generate_204"
|
url: "https://www.gstatic.com/generate_204"
|
||||||
interval: 300
|
interval: 300
|
||||||
|
|||||||
@ -32,11 +32,13 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
- {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
- {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
- {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
- {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
|
- {"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"}
|
||||||
|
|
||||||
# copies of own servers for the chains (SVC_<NAME>_CHAIN, POOL_<NAME>_UPLINK): the same
|
# copies of own servers for the chains (SVC_<NAME>_CHAIN, POOL_<NAME>_UPLINK): the same
|
||||||
# server dialing through another entry, named "<server> ⟶ <entry>" (group "<pool> ⟶ <entry>")
|
# server dialing through another entry, named "<server> ⟶ <entry>" (group "<pool> ⟶ <entry>")
|
||||||
@ -46,6 +48,7 @@ proxies:
|
|||||||
- {"dialer-proxy": "FOREIGN", "name":"tr \"q\" ⟶ FOREIGN","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
- {"dialer-proxy": "FOREIGN", "name":"tr \"q\" ⟶ FOREIGN","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
- {"dialer-proxy": "FOREIGN", "name":"hy-own ⟶ FOREIGN","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
- {"dialer-proxy": "FOREIGN", "name":"hy-own ⟶ FOREIGN","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
- {"dialer-proxy": "FOREIGN", "name":"awg-own ⟶ FOREIGN","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
- {"dialer-proxy": "FOREIGN", "name":"awg-own ⟶ FOREIGN","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
|
- {"dialer-proxy": "FOREIGN", "name":"via-foreign ⟶ FOREIGN","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x"}
|
||||||
|
|
||||||
proxy-providers:
|
proxy-providers:
|
||||||
example:
|
example:
|
||||||
@ -421,7 +424,7 @@ proxy-groups:
|
|||||||
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
# the subscriptions (providers <id>-my); the fastest alive one; pin one in the dashboard if needed
|
||||||
- name: MY
|
- name: MY
|
||||||
type: url-test
|
type: url-test
|
||||||
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own"]
|
proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "via-foreign"]
|
||||||
use: [example-my, example2-my, my-links]
|
use: [example-my, example2-my, my-links]
|
||||||
url: "https://www.gstatic.com/generate_204"
|
url: "https://www.gstatic.com/generate_204"
|
||||||
interval: 300
|
interval: 300
|
||||||
@ -481,7 +484,7 @@ proxy-groups:
|
|||||||
# nodes, each dialing through FOREIGN
|
# nodes, each dialing through FOREIGN
|
||||||
- name: "MY ⟶ FOREIGN"
|
- name: "MY ⟶ FOREIGN"
|
||||||
type: fallback
|
type: fallback
|
||||||
proxies: ["🇩🇪 de 1 ⟶ FOREIGN", "tr \"q\" ⟶ FOREIGN", "hy-own ⟶ FOREIGN", "awg-own ⟶ FOREIGN"]
|
proxies: ["🇩🇪 de 1 ⟶ FOREIGN", "tr \"q\" ⟶ FOREIGN", "hy-own ⟶ FOREIGN", "awg-own ⟶ FOREIGN", "via-foreign ⟶ FOREIGN"]
|
||||||
use: [example-my@FOREIGN, example2-my@FOREIGN, my-links@FOREIGN]
|
use: [example-my@FOREIGN, example2-my@FOREIGN, my-links@FOREIGN]
|
||||||
url: "https://www.gstatic.com/generate_204"
|
url: "https://www.gstatic.com/generate_204"
|
||||||
interval: 300
|
interval: 300
|
||||||
|
|||||||
@ -31,7 +31,8 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
- {"dialer-proxy": "MY-EXIT", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p","udp":true}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"de-2","type":"hysteria2","server":"5.6.7.8","port":443,"password":"q","udp":true}
|
- {"dialer-proxy": "MY-EXIT", "name":"de-2","type":"hysteria2","server":"5.6.7.8","port":443,"password":"q","udp":true}
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,8 @@ proxies:
|
|||||||
|
|
||||||
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
# own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON
|
||||||
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
# proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in
|
||||||
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it
|
# front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it.
|
||||||
|
# A server with an entry of its own (LuCI "Вход") keeps it in every profile
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p\"w\\1","obfs":"salamander","obfs-password":"obfs","sni":"vpn.example.com","up":"50 mbps","down":"100 mbps","udp":true}
|
- {"dialer-proxy": "MY-EXIT", "name":"nl-1","type":"hysteria2","server":"vpn.example.com","port":443,"password":"p\"w\\1","obfs":"salamander","obfs-password":"obfs","sni":"vpn.example.com","up":"50 mbps","down":"100 mbps","udp":true}
|
||||||
- {"dialer-proxy": "MY-EXIT", "name":"de_2","type":"hysteria2","server":"5.6.7.8","port":8443,"password":"x","sni":"www.bing.com","skip-cert-verify":true,"udp":true}
|
- {"dialer-proxy": "MY-EXIT", "name":"de_2","type":"hysteria2","server":"5.6.7.8","port":8443,"password":"x","sni":"www.bing.com","skip-cert-verify":true,"udp":true}
|
||||||
|
|
||||||
|
|||||||
1
tests/fixtures/own.servers
vendored
1
tests/fixtures/own.servers
vendored
@ -2,3 +2,4 @@
|
|||||||
{"name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
{"name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"}
|
||||||
{"name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
{"name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"}
|
||||||
{"name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
{"name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":"<r 2><b 0x858000010001000000000669636c6f756403636f6d0000010001c00c000100010000105a00044d583737>"}}
|
||||||
|
{"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"}
|
||||||
|
|||||||
@ -44,9 +44,9 @@ for (const f of fs.readdirSync(path.join(root, "amnezia"))) {
|
|||||||
check("amnezia/" + f, JSON.parse(fs.readFileSync(exp, "utf8")),
|
check("amnezia/" + f, JSON.parse(fs.readFileSync(exp, "utf8")),
|
||||||
s.parseText(fs.readFileSync(path.join(root, "amnezia", f), "utf8"), f.replace(/\.[^.]+$/, "")));
|
s.parseText(fs.readFileSync(path.join(root, "amnezia", f), "utf8"), f.replace(/\.[^.]+$/, "")));
|
||||||
}
|
}
|
||||||
// a stored line reads back the same, without dialer-proxy, with no "$" left
|
// a stored line reads back the same (dialer-proxy: the server's own entry), with no "$" left
|
||||||
const p = { name: "a$b", type: "ss", server: "h", port: 1, password: "x${Y}", "dialer-proxy": "Z" };
|
const p = { name: "a$b", type: "ss", server: "h", port: 1, password: "x${Y}", "dialer-proxy": "Z" };
|
||||||
const line = s.toLine(p);
|
const line = s.toLine(p);
|
||||||
check("toLine", { name: "a$b", type: "ss", server: "h", port: 1, password: "x${Y}" },
|
check("toLine", { name: "a$b", type: "ss", server: "h", port: 1, password: "x${Y}", "dialer-proxy": "Z" },
|
||||||
line.includes("$") || !line.startsWith('{"name":') ? null : JSON.parse(line));
|
line.includes("$") || !line.startsWith('{"name":') ? null : JSON.parse(line));
|
||||||
process.exit(fail);
|
process.exit(fail);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user