fix(config): ложное предупреждение про AWG, сироты section_interface, дубль cron
- has_outbound_section: туннельные секции (awg/warp/vpn/openvpn/masque/ anytls/snell/mieru/sudoku) теперь считаются исходящей конфигурацией - одинокая AWG-секция больше не получает вводящее в заблуждение «No proxy outbound sections found» (жалобы пользователей #39/#42) - новая миграция orphan_section_interface_cleanup: удаление секции маршрутизации раньше оставляло после себя дочерние section_interface, ссылающиеся на несуществующего родителя (у пользователя - запись на секцию '2' при живой только '1'); сироты удаляются через новую операцию delete_section; функция объявлена до массива MIGRATIONS - ucode не поднимает объявления - strip_unmarked_tachyon_cron_lines: старые версии писали cron-строки без маркер-комментария, они переживали фильтрацию по маркерам, копились при обновлениях и crond запускал component_updates_if_due дважды за тик; немаркированные строки с нашими командами теперь вычищаются при каждом refresh и remove
This commit is contained in:
@@ -175,7 +175,7 @@ assert(JSON.stringify(config.settings.dns_server) === JSON.stringify(['9.9.9.9']
|
||||
assert(JSON.stringify(config.settings.bootstrap_dns_server) === JSON.stringify(['1.1.1.1']), 'legacy Bootstrap DNS scalar migrated to ordered list');
|
||||
assert(config.settings.config_version === '1.0.5', 'legacy config should be marked at the current schema version');
|
||||
assert(config.settings.component_update_check_enabled === '1', 'component update checks should be enabled during migration');
|
||||
assert(JSON.stringify(config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section']), 'legacy config should record named migrations');
|
||||
assert(JSON.stringify(config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section', 'orphan_section_interface_cleanup']), 'legacy config should record named migrations');
|
||||
|
||||
function assert(condition, message) {
|
||||
if (!condition) {
|
||||
@@ -394,7 +394,7 @@ function assert(condition, message) {
|
||||
assert(out.changed === true, '1.0.1 config should require migration');
|
||||
assert(out.config.settings.config_version === '1.0.5', 'config schema version should advance to 1.0.5');
|
||||
assert(out.config.settings.component_update_check_enabled === '1', 'updates from 1.0.1 and below should enable component update checks');
|
||||
assert(JSON.stringify(out.config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section']), 'named migrations should be recorded');
|
||||
assert(JSON.stringify(out.config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section', 'orphan_section_interface_cleanup']), 'named migrations should be recorded');
|
||||
assert(!Object.prototype.hasOwnProperty.call(section, 'interfaces'), 'parent interface list should be removed');
|
||||
assert(JSON.stringify(interfaces.map(item => item.name)) === JSON.stringify(['awg0', 'tun0']), 'interfaces should keep their order');
|
||||
for (const item of interfaces) {
|
||||
@@ -432,7 +432,7 @@ function assert(condition, message) {
|
||||
|
||||
assert(out.config.settings.component_update_check_enabled === '0', '1.0.2 config must preserve an explicitly disabled component check');
|
||||
assert(out.config.settings.config_version === '1.0.5', '1.0.2 config should advance through the HTTP URL migration schema');
|
||||
assert(JSON.stringify(out.config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section']), 'newer configs should mark skipped migrations');
|
||||
assert(JSON.stringify(out.config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section', 'orphan_section_interface_cleanup']), 'newer configs should mark skipped migrations');
|
||||
NODE
|
||||
|
||||
cat >"$WORK_DIR/forkop-1.0.4-http.json" <<'JSON'
|
||||
@@ -498,7 +498,7 @@ assert(JSON.stringify(jsonOutbounds[1]) === JSON.stringify({
|
||||
server_port: 8080,
|
||||
}), 'unnamed HTTP URL should receive a unique http tag');
|
||||
assert(jsonOutbounds[2].type === 'direct' && jsonOutbounds[2].tag === 'http', 'existing JSON outbounds should remain unchanged');
|
||||
assert(JSON.stringify(out.config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section']), 'HTTP URL migration should be recorded');
|
||||
assert(JSON.stringify(out.config.settings.applied_migrations) === JSON.stringify(['interface_sections', 'enable_component_checks', 'http_connection_urls', 'dns_hosts_to_option', 'global_hosts_to_section', 'orphan_section_interface_cleanup']), 'HTTP URL migration should be recorded');
|
||||
NODE
|
||||
|
||||
cat >"$WORK_DIR/forkop-1.0.5-http.json" <<'JSON'
|
||||
|
||||
Reference in New Issue
Block a user