Revert "FakeIP кэш перенесён в персистентное хранилище /etc/sing-box/"

This reverts commit 4e6b1d776c.
This commit is contained in:
Dushnilin
2026-07-19 12:04:33 +03:00
parent 4e6b1d776c
commit af41f6ddba
4 changed files with 9 additions and 9 deletions
@@ -880,9 +880,12 @@ function createSettingsContent(section, capabilities) {
"Select or enter path for sing-box cache file. Change this ONLY if you know what you are doing",
),
);
o.value("/etc/sing-box/cache.db", _("Persistent (/etc/sing-box/cache.db)"));
o.value("/tmp/sing-box/cache.db", _("RAM — lost on reboot (/tmp/sing-box/cache.db)"));
o.default = "/etc/sing-box/cache.db";
o.value("/tmp/sing-box/cache.db", "RAM (/tmp/sing-box/cache.db)");
o.value(
"/usr/share/sing-box/cache.db",
"Flash (/usr/share/sing-box/cache.db)",
);
o.default = "/tmp/sing-box/cache.db";
o.rmempty = false;
o.validate = function (section_id, value) {
if (!value) {
+1 -4
View File
@@ -725,9 +725,6 @@ function start_main() {
module_success(BYEDPI_UC, [ "start-runtime" ]);
// Ensure persistent cache directory exists before sing-box starts
ensure_dir("/etc/sing-box");
if (!command_success_from_args([ "/etc/init.d/sing-box", "start" ])) {
log_message("Failed to start sing-box. Aborted.", "fatal");
return 1;
@@ -847,7 +844,7 @@ function stop_main() {
if (module_success(NFT_UC, [ "tproxy-route6-present", RT_TABLE_NAME ]))
command_success_from_args([ "ip", "-6", "route", "flush", "table", RT_TABLE_NAME ]);
let cache_path = uci_core.get(CONFIG_NAME + ".settings.cache_path") || "/etc/sing-box/cache.db";
let cache_path = uci_core.get(CONFIG_NAME + ".settings.cache_path") || "/tmp/sing-box/cache.db";
remove_file(cache_path);
let sing_box_status = command_status_from_args([ "/etc/init.d/sing-box", "stop" ]);
+1 -1
View File
@@ -1400,7 +1400,7 @@ function sing_box_signature_body(settings, sections, servers, mwan3_active) {
body = signature_add_value(body, "settings.disable_quic", bool_option_value(settings, "disable_quic", false));
if (sing_box_signature_has_remote_ruleset_sources(sections))
body = signature_add_value(body, "settings.update_interval", settings_update_interval(settings));
body = signature_add_value(body, "settings.cache_path", option(settings, "cache_path", "/etc/sing-box/cache.db"));
body = signature_add_value(body, "settings.cache_path", option(settings, "cache_path", "/tmp/sing-box/cache.db"));
body = signature_add_value(body, "settings.config_path", option(settings, "config_path", ""));
body = signature_add_value(body, "settings.log_level", option(settings, "log_level", "warn"));
body = signature_add_value(body, "settings.service_listen_address", option(settings, "service_listen_address", ""));
+1 -1
View File
@@ -425,7 +425,7 @@ function tproxy_inbound_matcher() {
function base_config(settings, service_address, runtime_context) {
let log_level = option(settings, "log_level", "warn");
let rewrite_ttl = int_option(settings, "dns_rewrite_ttl", "60");
let cache_path = option(settings, "cache_path", "/etc/sing-box/cache.db");
let cache_path = option(settings, "cache_path", "/tmp/sing-box/cache.db");
let dns_config = runtime_dns.config(settings);
if (dns_config.unsupported)
runtime_generate_unsupported(dns_config.unsupported);