Compare commits

...

7 commits

Author SHA1 Message Date
2dust
06500e0218 When testing, start the core and then delay 1s before starting the test
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
https://github.com/2dust/v2rayN/issues/7391
2025-06-15 17:33:11 +08:00
DHR60
9ddf0b42e7
Fix Observatory (#7437)
* Enables concurrency for observatory

* Adds burst observatory for least load balancer
2025-06-15 14:41:47 +08:00
2dust
2056377f55 up 7.12.6 2025-06-15 14:39:02 +08:00
2dust
7065dabc94 If it is not in China area, no update is required
https://github.com/2dust/v2rayN/issues/7417
2025-06-15 14:35:59 +08:00
2dust
9e2336a71e The notification pop-up position is changed to the top right
https://github.com/2dust/v2rayN/issues/7421
2025-06-15 14:16:30 +08:00
2dust
d239c627f3 Use File.SetUnixFileMode to set the execute permission first. If that fails, use chmod to set the execute permission.
https://github.com/2dust/v2rayN/issues/7416
2025-06-15 12:33:21 +08:00
2dust
984b36d34e Update Directory.Packages.props 2025-06-15 12:33:02 +08:00
8 changed files with 77 additions and 21 deletions

View file

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<Version>7.12.5</Version>
<Version>7.12.6</Version>
</PropertyGroup>
<PropertyGroup>

View file

@ -5,21 +5,21 @@
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.0" />
<PackageVersion Include="Avalonia.Desktop" Version="11.3.0" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.0" />
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.0" />
<PackageVersion Include="CliWrap" Version="3.8.2" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.1" />
<PackageVersion Include="Avalonia.Desktop" Version="11.3.1" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.1" />
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.1" />
<PackageVersion Include="CliWrap" Version="3.9.0" />
<PackageVersion Include="Downloader" Version="3.3.4" />
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
<PackageVersion Include="MaterialDesignThemes" Version="5.2.1" />
<PackageVersion Include="MessageBox.Avalonia" Version="3.2.0" />
<PackageVersion Include="QRCoder" Version="1.6.0" />
<PackageVersion Include="ReactiveUI" Version="20.2.45" />
<PackageVersion Include="ReactiveUI" Version="20.3.1" />
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageVersion Include="ReactiveUI.WPF" Version="20.2.45" />
<PackageVersion Include="Semi.Avalonia" Version="11.2.1.7" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.7" />
<PackageVersion Include="ReactiveUI.WPF" Version="20.3.1" />
<PackageVersion Include="Semi.Avalonia" Version="11.2.1.8" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.8" />
<PackageVersion Include="Splat.NLog" Version="15.3.1" />
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
<PackageVersion Include="TaskScheduler" Version="2.12.1" />

View file

@ -582,7 +582,7 @@ public class Utils
var result = await cmd.ExecuteBufferedAsync();
if (result.IsSuccess)
{
return result.StandardOutput.ToString();
return result.StandardOutput ?? "";
}
Logging.SaveLog(result.ToString() ?? "");
@ -839,14 +839,46 @@ public class Utils
public static async Task<string?> SetLinuxChmod(string? fileName)
{
if (fileName.IsNullOrEmpty())
{
return null;
}
if (SetUnixFileMode(fileName))
{
Logging.SaveLog($"Successfully set the file execution permission, {fileName}");
return "";
}
if (fileName.Contains(' '))
{
fileName = fileName.AppendQuotes();
//File.SetUnixFileMode(fileName, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
}
var arg = new List<string>() { "-c", $"chmod +x {fileName}" };
return await GetCliWrapOutput(Global.LinuxBash, arg);
}
public static bool SetUnixFileMode(string? fileName)
{
try
{
if (fileName.IsNullOrEmpty())
{
return false;
}
if (File.Exists(fileName))
{
var currentMode = File.GetUnixFileMode(fileName);
File.SetUnixFileMode(fileName, currentMode | UnixFileMode.UserExecute | UnixFileMode.GroupExecute | UnixFileMode.OtherExecute);
return true;
}
}
catch (Exception ex)
{
Logging.SaveLog("SetUnixFileMode", ex);
}
return false;
}
public static async Task<string?> GetLinuxFontFamily(string lang)
{
// var arg = new List<string>() { "-c", $"fc-list :lang={lang} family" };

View file

@ -1366,16 +1366,32 @@ public class CoreConfigV2rayService
private async Task<int> GenBalancer(V2rayConfig v2rayConfig, EMultipleLoad multipleLoad)
{
if (multipleLoad is EMultipleLoad.LeastLoad or EMultipleLoad.LeastPing)
if (multipleLoad == EMultipleLoad.LeastPing)
{
var observatory = new Observatory4Ray
{
subjectSelector = [Global.ProxyTag],
probeUrl = AppHandler.Instance.Config.SpeedTestItem.SpeedPingTestUrl,
probeInterval = "3m"
probeInterval = "3m",
enableConcurrency = true,
};
v2rayConfig.observatory = observatory;
}
else if (multipleLoad == EMultipleLoad.LeastLoad)
{
var burstObservatory = new BurstObservatory4Ray
{
subjectSelector = [Global.ProxyTag],
pingConfig = new()
{
destination = AppHandler.Instance.Config.SpeedTestItem.SpeedPingTestUrl,
interval = "5m",
timeout = "30s",
sampling = 2,
}
};
v2rayConfig.burstObservatory = burstObservatory;
}
var strategyType = multipleLoad switch
{
EMultipleLoad.Random => "random",

View file

@ -196,6 +196,7 @@ public class SpeedtestService
{
return false;
}
await Task.Delay(1000);
var downloadHandle = new DownloadService();
@ -255,9 +256,13 @@ public class SpeedtestService
try
{
pid = await CoreHandler.Instance.LoadCoreConfigSpeedtest(it);
if (pid > 0)
if (pid < 0)
{
await Task.Delay(500);
UpdateFunc(it.IndexId, "", ResUI.FailedToRunCore);
}
else
{
await Task.Delay(1000);
var delay = await DoRealPing(downloadHandle, it);
if (blSpeedTest)
{
@ -271,10 +276,6 @@ public class SpeedtestService
}
}
}
else
{
UpdateFunc(it.IndexId, "", ResUI.FailedToRunCore);
}
}
catch (Exception ex)
{

View file

@ -485,6 +485,12 @@ public class UpdateService
private async Task UpdateOtherFiles(Config config, Action<bool, string> updateFunc)
{
//If it is not in China area, no update is required
if (config.ConstItem.GeoSourceUrl.IsNotEmpty())
{
return;
}
_updateFunc = updateFunc;
foreach (var url in Global.OtherGeoUrls)

View file

@ -552,6 +552,7 @@ public class MainWindowViewModel : MyReactiveObject
{
await LoadCore();
await SysProxyHandler.UpdateSysProxy(_config, false);
await Task.Delay(1000);
});
Locator.Current.GetService<StatusBarViewModel>()?.TestServerAvailability();

View file

@ -29,7 +29,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
InitializeComponent();
_config = AppHandler.Instance.Config;
_manager = new WindowNotificationManager(TopLevel.GetTopLevel(this)) { MaxItems = 3, Position = NotificationPosition.BottomRight };
_manager = new WindowNotificationManager(TopLevel.GetTopLevel(this)) { MaxItems = 3, Position = NotificationPosition.TopRight };
this.KeyDown += MainWindow_KeyDown;
menuSettingsSetUWP.Click += menuSettingsSetUWP_Click;