feat: добавлена возможность обхода правил для трафика
All checks were successful
Build and Deploy Gateway / build-and-deploy (push) Successful in 19s
All checks were successful
Build and Deploy Gateway / build-and-deploy (push) Successful in 19s
- Реализована функция для включения и отключения обхода правил. - Обновлены компоненты интерфейса для управления режимом обхода. - Добавлена обработка состояния обхода в API. Refs: None
This commit is contained in:
@@ -166,7 +166,11 @@ function routeRules(customRules, vpnTag) {
|
||||
return rules;
|
||||
}
|
||||
|
||||
export function buildGatewayConfig(subscriptionConfig, selectedTag) {
|
||||
export function buildGatewayConfig(
|
||||
subscriptionConfig,
|
||||
selectedTag,
|
||||
{ bypassAll = false } = {},
|
||||
) {
|
||||
const selectedOutbound = findOutbound(subscriptionConfig, selectedTag);
|
||||
if (!selectedOutbound) {
|
||||
throw new Error(`Outbound не найден: ${selectedTag}`);
|
||||
@@ -218,9 +222,11 @@ export function buildGatewayConfig(subscriptionConfig, selectedTag) {
|
||||
{ type: "block", tag: "block" },
|
||||
],
|
||||
route: {
|
||||
rule_set: ruleSets(customRuleSets),
|
||||
rules: routeRules(subscriptionConfig.customRules, vpnOutbound.tag),
|
||||
final: vpnOutbound.tag,
|
||||
rule_set: bypassAll ? [] : ruleSets(customRuleSets),
|
||||
rules: bypassAll
|
||||
? [{ ip_is_private: true, outbound: "direct" }]
|
||||
: routeRules(subscriptionConfig.customRules, vpnOutbound.tag),
|
||||
final: bypassAll ? "direct" : vpnOutbound.tag,
|
||||
auto_detect_interface: true,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user