refactor: Полное удаление функционала Tor и очистка локализаций

This commit is contained in:
Dushnilin
2026-07-21 21:34:23 +03:00
parent 142f4d1f4f
commit 662df112fd
12 changed files with 54 additions and 175 deletions
+1 -6
View File
@@ -2,7 +2,7 @@ name: Build packages
on:
push:
tags:
- '*'
- "*"
workflow_dispatch:
inputs:
release_tag:
@@ -87,11 +87,6 @@ jobs:
name: release-files-${{ needs.preparation.outputs.version }}
path: ./filtered-bin/release
- name: Delete old release
run: gh release delete ${{ needs.preparation.outputs.version }} --cleanup-tag --yes || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
if: ${{ inputs.release_notes == '' }}
uses: softprops/action-gh-release@v2
-28
View File
@@ -2843,32 +2843,4 @@ msgstr "Закрыть"
msgid "Cannot save settings"
msgstr "Не удалось сохранить настройки"
msgid "Install Tor"
msgstr "Установить Tor"
msgid "The tor package is required to use the Darknet gateway. Do you want to install it automatically? (This will take about a minute)"
msgstr "Для работы шлюза Darknet необходим пакет tor. Хотите установить его автоматически? (Это займёт около минуты)"
msgid "Cancel"
msgstr "Отмена"
msgid "Installing Tor..."
msgstr "Установка Tor..."
msgid "Please wait. Installing via package manager..."
msgstr "Пожалуйста, подождите. Идёт установка через пакетный менеджер..."
msgid "Tor successfully installed! Please select the action again."
msgstr "Tor успешно установлен! Пожалуйста, выберите действие снова."
msgid "Failed to install Tor. Code: "
msgstr "Не удалось установить Tor. Код: "
msgid "Command execution error: "
msgstr "Ошибка выполнения команды: "
msgid "Install"
msgstr "Установить"
msgid "The tor package is not installed."
msgstr "Пакет tor не установлен."
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "fe-app-tachyon",
"version": "1.2.12",
"version": "1.2.17",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "fe-app-tachyon",
"version": "1.2.12",
"version": "1.2.17",
"license": "MIT",
"devDependencies": {
"@babel/parser": "7.28.4",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "fe-app-tachyon",
"version": "1.2.12",
"version": "1.2.17",
"license": "MIT",
"type": "module",
"scripts": {
@@ -2627,8 +2627,6 @@ var Tachyon;
AvailableMethods2["CHECK_ZAPRET_RUNTIME"] = "check_zapret_runtime";
AvailableMethods2["CHECK_ZAPRET2_RUNTIME"] = "check_zapret2_runtime";
AvailableMethods2["CHECK_BYEDPI_RUNTIME"] = "check_byedpi_runtime";
AvailableMethods2["CHECK_TOR_RUNTIME"] = "check_tor_runtime";
AvailableMethods2["INSTALL_TOR"] = "install_tor";
AvailableMethods2["CHECK_INBOUNDS_CONFIG"] = "check_inbounds_config";
AvailableMethods2["GET_STATUS"] = "get_status";
AvailableMethods2["GET_OUTBOUND_METADATA"] = "get_outbound_metadata";
@@ -2849,15 +2847,6 @@ var TachyonShellMethods = {
checkByedpiRuntime: async () => callBaseMethod(
Tachyon.AvailableMethods.CHECK_BYEDPI_RUNTIME
),
checkTorRuntime: async () => callBaseMethod(
Tachyon.AvailableMethods.CHECK_TOR_RUNTIME
),
installTor: async () => callBaseMethod(
Tachyon.AvailableMethods.INSTALL_TOR,
[],
"/usr/bin/tachyon",
{ timeout: 120000 }
),
checkInboundsConfig: async () => callBaseMethod(
Tachyon.AvailableMethods.CHECK_INBOUNDS_CONFIG
),
@@ -13496,8 +13485,7 @@ function notifyActionProvidersAvailabilityChanged(systemInfo) {
detail: {
zapretInstalled: Boolean(systemInfo.zapret_installed),
zapret2Installed: Boolean(systemInfo.zapret2_installed),
byedpiInstalled: Boolean(systemInfo.byedpi_installed),
torInstalled: Boolean(systemInfo.tor_installed)
byedpiInstalled: Boolean(systemInfo.byedpi_installed)
}
})
);
@@ -3998,9 +3998,8 @@ function ensureActionProvidersAvailabilityLoaded() {
main.TachyonShellMethods.checkZapretRuntime(),
main.TachyonShellMethods.checkZapret2Runtime(),
main.TachyonShellMethods.checkByedpiRuntime(),
main.TachyonShellMethods.checkTorRuntime(),
])
.then(([zapretResult, zapret2Result, byedpiResult, torResult]) => {
.then(([zapretResult, zapret2Result, byedpiResult]) => {
const zapret =
zapretResult && zapretResult.status === "fulfilled"
? zapretResult.value
@@ -4013,10 +4012,7 @@ function ensureActionProvidersAvailabilityLoaded() {
byedpiResult && byedpiResult.status === "fulfilled"
? byedpiResult.value
: null;
const tor =
torResult && torResult.status === "fulfilled"
? torResult.value
: null;
actionProvidersAvailabilityState.loaded = true;
actionProvidersAvailabilityState.zapretInstalled = Boolean(
@@ -4031,9 +4027,7 @@ function ensureActionProvidersAvailabilityLoaded() {
actionProvidersAvailabilityState.byedpiInstalled = Boolean(
byedpi && byedpi.success && byedpi.data && byedpi.data.byedpi_installed,
);
actionProvidersAvailabilityState.torInstalled = Boolean(
tor && tor.success && tor.data && tor.data.tor_installed,
);
return actionProvidersAvailabilityState;
})
.catch(() => {
@@ -4041,7 +4035,7 @@ function ensureActionProvidersAvailabilityLoaded() {
actionProvidersAvailabilityState.zapretInstalled = false;
actionProvidersAvailabilityState.zapret2Installed = false;
actionProvidersAvailabilityState.byedpiInstalled = false;
actionProvidersAvailabilityState.torInstalled = false;
// singBoxExtended is set via systemInfo, keep existing value
return actionProvidersAvailabilityState;
})
@@ -4064,9 +4058,7 @@ function isByedpiInstalledForUi() {
return actionProvidersAvailabilityState.byedpiInstalled;
}
function isTorInstalledForUi() {
return actionProvidersAvailabilityState.torInstalled;
}
function isSingBoxExtendedForUi() {
return actionProvidersAvailabilityState.singBoxExtended;
@@ -4099,8 +4091,7 @@ function getActionOptionLabel(action) {
return "Zapret2";
case "byedpi":
return "ByeDPI";
case "tor":
return "Route via Tor Darknet";
case "awg":
return "AmneziaWG";
case "warp":
@@ -4206,7 +4197,7 @@ function populateActionOptionValues(option) {
if (isByedpiInstalledForUi()) {
option.value("byedpi", getActionOptionLabel("byedpi"));
}
option.value("tor", getActionOptionLabel("tor"));
}
function getConfigListValues(section_id, key) {
@@ -7123,38 +7114,7 @@ function createSectionContent(section) {
const super_validate = o.validate;
o.validate = function(section_id, value) {
if (value === "tor" && !isTorInstalledForUi()) {
ui.showModal(_("Install Tor"), [
E("p", _("The tor package is required to use the Darknet gateway. Do you want to install it automatically? (This will take about a minute)")),
E("div", { class: "right" }, [
E("button", {
class: "cbi-button cbi-button-neutral",
click: ui.hideModal
}, _("Cancel")),
E("button", {
class: "cbi-button cbi-button-action important",
click: function() {
ui.showModal(_("Installing Tor..."), [
E("p", { class: "spinning" }, _("Please wait. Installing via package manager..."))
]);
main.TachyonShellMethods.installTor().then(function(res) {
ui.hideModal();
if (res && res.success) {
ui.addNotification(null, E("p", _("Tor successfully installed! Please select the action again.")));
actionProvidersAvailabilityState.torInstalled = true;
} else {
ui.addNotification(null, E("p", _("Failed to install Tor. Code: ") + (res ? (res.error || res.code || "timeout") : "unknown")));
}
}).catch(function(err) {
ui.hideModal();
ui.addNotification(null, E("p", _("Command execution error: ") + err.message));
});
}
}, _("Install"))
])
]);
return _("The tor package is not installed.");
}
return super_validate ? super_validate.apply(this, [section_id, value]) : true;
};
-28
View File
@@ -2843,32 +2843,4 @@ msgstr "Закрыть"
msgid "Cannot save settings"
msgstr "Не удалось сохранить настройки"
msgid "Install Tor"
msgstr "Установить Tor"
msgid "The tor package is required to use the Darknet gateway. Do you want to install it automatically? (This will take about a minute)"
msgstr "Для работы шлюза Darknet необходим пакет tor. Хотите установить его автоматически? (Это займёт около минуты)"
msgid "Cancel"
msgstr "Отмена"
msgid "Installing Tor..."
msgstr "Установка Tor..."
msgid "Please wait. Installing via package manager..."
msgstr "Пожалуйста, подождите. Идёт установка через пакетный менеджер..."
msgid "Tor successfully installed! Please select the action again."
msgstr "Tor успешно установлен! Пожалуйста, выберите действие снова."
msgid "Failed to install Tor. Code: "
msgstr "Не удалось установить Tor. Код: "
msgid "Command execution error: "
msgstr "Ошибка выполнения команды: "
msgid "Install"
msgstr "Установить"
msgid "The tor package is not installed."
msgstr "Пакет tor не установлен."
+35
View File
@@ -3978,6 +3978,11 @@ msgstr ""
msgid "Destination IP or CIDR"
msgstr ""
msgid "Forced destination routing"
msgid "Destination IP or CIDR"
msgstr ""
msgid "Forced destination routing"
msgstr ""
@@ -3986,3 +3991,33 @@ msgstr ""
msgid "All Routes"
msgstr ""
msgid "Install Tor"
msgstr ""
msgid "The tor package is required to use the Darknet gateway. Do you want to install it automatically? (This will take about a minute)"
msgstr ""
msgid "Cancel"
msgstr ""
msgid "Installing Tor..."
msgstr ""
msgid "Please wait. Installing via package manager..."
msgstr ""
msgid "Tor successfully installed! Please select the action again."
msgstr ""
msgid "Failed to install Tor. Code: "
msgstr ""
msgid "Command execution error: "
msgstr ""
msgid "Install"
msgstr ""
msgid "The tor package is not installed."
msgstr ""
+2 -2
View File
@@ -813,13 +813,13 @@ function rule_action(section) {
function rule_action_supported(action) {
return contains([ "connection", "proxy", "outbound", "vpn", "awg", "warp",
"anytls", "snell", "mieru", "sudoku", "masque", "openvpn",
"bypass", "block", "dns", "zapret", "zapret2", "byedpi", "tor" ], as_string(action));
"bypass", "block", "dns", "zapret", "zapret2", "byedpi" ], as_string(action));
}
function server_routing_section_action_supported(action) {
return contains([ "connection", "proxy", "outbound", "vpn", "awg", "warp",
"anytls", "snell", "mieru", "sudoku", "masque", "openvpn",
"zapret", "zapret2", "byedpi", "tor" ], as_string(action));
"zapret", "zapret2", "byedpi" ], as_string(action));
}
function duration_to_seconds_value(value) {
+1 -14
View File
@@ -1095,7 +1095,6 @@ function build_system_info() {
zapret2_installed,
byedpi_version,
byedpi_installed,
tor_installed: command_exists("tor") ? 1 : 0,
openwrt_version: openwrt_release(),
device_model,
generated_at: int(clock()[0])
@@ -2578,19 +2577,7 @@ else if (mode == "check-zapret2-runtime")
else if (mode == "check-byedpi-runtime")
exit(module_passthrough(BYEDPI_RUNTIME_UC, [ "check" ]));
else if (mode == "check-tor-runtime") {
print(sprintf("%J", { success: true, data: { tor_installed: command_exists("tor") } }));
exit(0);
}
else if (mode == "install-tor") {
let code = 1;
if (command_exists("apk")) {
system("apk update >/dev/null 2>&1");
code = system("apk add tor >/dev/null 2>&1");
} else {
system("opkg update >/dev/null 2>&1");
code = system("opkg install tor >/dev/null 2>&1");
}
print(sprintf("%J", { success: command_exists("tor"), code: code }));
print(sprintf("%J", { success: true, data: { tor_installed: 0 } }));
exit(0);
}
else if (mode == "neutralize-zapret-defaults")
+3 -31
View File
@@ -493,27 +493,11 @@ function base_config(settings, service_address, runtime_context) {
for (let inbound in dns_config.inbounds)
push(inbounds, inbound);
let has_tor = false;
for (let sec in uci_core.section_objects(CONFIG_NAME, "section")) {
if (option(sec, "action", "") == "tor") {
has_tor = true;
break;
}
}
let default_outbounds = [
{ type: "direct", tag: runtime_constants.DIRECT_OUTBOUND_TAG },
{ type: "direct", tag: runtime_constants.BYPASS_OUTBOUND_TAG }
];
if (has_tor) {
push(default_outbounds, {
type: "tor",
tag: "tor-out",
executable_path: option(settings, "tor_executable_path", "/usr/sbin/tor")
});
}
runtime_context = object_or_empty(runtime_context);
runtime_context.dns_health_inbounds = dns_config.sniff_inbounds;
runtime_context.default_domain_resolver = runtime_dns.default_domain_resolver(settings);
@@ -1525,7 +1509,7 @@ function apply_section_detour_to_connection_outbounds(config, start_index, detou
function mixed_proxy_enabled_action(action) {
return action == "connection" || action == "proxy" || action == "outbound" || action == "vpn" ||
action == "awg" || action == "byedpi" || action == "zapret" || action == "zapret2" || action == "tor";
action == "awg" || action == "byedpi" || action == "zapret" || action == "zapret2";
}
function add_mixed_proxy_for_section(config, section, service_address) {
@@ -2560,16 +2544,6 @@ function add_byedpi_outbound(config, section, sections) {
});
}
function add_tor_outbound(config, section) {
push(config.outbounds, {
type: "socks",
tag: outbound_tag(section[".name"]),
server: "127.0.0.1",
server_port: 9050,
version: "5"
});
}
function ensure_community_ruleset(config, section_name, community) {
if (!runtime_rulesets.is_community(community))
runtime_generate_unsupported("unknown community list " + community);
@@ -3050,8 +3024,6 @@ function add_outbound_for_section(config, section, taken, sections) {
add_zapret2_outbound(config, section, sections);
else if (action == "byedpi")
add_byedpi_outbound(config, section, sections);
else if (action == "tor")
add_tor_outbound(config, section);
else if (action == "bypass") {
/* route-only action */
}
@@ -3072,7 +3044,7 @@ function reserve_section_outbound_tags(sections, taken) {
if (connections.is_connections_action(action) ||
action == "awg" || action == "warp" || action == "byedpi" || action == "zapret" || action == "zapret2" ||
action == "anytls" || action == "snell" || action == "mieru" || action == "sudoku" ||
action == "masque" || action == "openvpn" || action == "tor")
action == "masque" || action == "openvpn")
taken[outbound_tag(section[".name"])] = true;
if (!connections.is_connections_action(action))
@@ -3099,7 +3071,7 @@ function add_service_route_rules(config, sections) {
if (connections.is_connections_action(action) ||
action == "awg" || action == "warp" || action == "byedpi" || action == "zapret" || action == "zapret2" ||
action == "anytls" || action == "snell" || action == "mieru" || action == "sudoku" ||
action == "masque" || action == "openvpn" || action == "tor") {
action == "masque" || action == "openvpn") {
first = section;
break;
}
-2
View File
@@ -55,8 +55,6 @@ function target(section, outbound_tag_name) {
action == "masque" || action == "openvpn" ||
action == "byedpi" || action == "zapret" || action == "zapret2")
return { action: "route", outbound: outbound_tag_name };
if (action == "tor")
return { action: "route", outbound: "tor-out" };
if (action == "bypass")
return { action: "route", outbound: runtime_constants.BYPASS_OUTBOUND_TAG };
if (action == "block")