diff --git a/ProxySuper.Core/Models/Record.cs b/ProxySuper.Core/Models/Record.cs index 0363a9b..b48001e 100644 --- a/ProxySuper.Core/Models/Record.cs +++ b/ProxySuper.Core/Models/Record.cs @@ -42,7 +42,7 @@ namespace ProxySuper.Core.Models [JsonProperty("trojanGoSettings")] public TrojanGoSettings TrojanGoSettings { get; set; } - [JsonProperty("naiveProtoSettings")] + [JsonProperty("naiveProxySettings")] public NaiveProxySettings NaiveProxySettings { get; set; } [JsonProperty("brook")] diff --git a/ProxySuper.Core/Services/ServiceBase.cs b/ProxySuper.Core/Services/ServiceBase.cs index 7558a60..d3dbd80 100644 --- a/ProxySuper.Core/Services/ServiceBase.cs +++ b/ProxySuper.Core/Services/ServiceBase.cs @@ -327,7 +327,7 @@ namespace ProxySuper.Core.Services var result = RunCmd("id -u"); if (!result.Equals("0\n")) { - throw new Exception("ProxySU需要使用Root用户进行安装!"); + throw new Exception("请使用Root权限账户登录!"); } } @@ -365,6 +365,9 @@ namespace ProxySuper.Core.Services public void InstallSystemTools() { + Progress.Desc = ("更新安装包"); + RunUpdateCmd(); + Progress.Desc = ("安装sudo工具"); InstallSoftware("sudo"); @@ -768,6 +771,22 @@ namespace ProxySuper.Core.Services } } + private void RunUpdateCmd() + { + if (CmdType == CmdType.Apt) + { + RunCmd($"apt update -y"); + } + else if (CmdType == CmdType.Yum) + { + RunCmd($"yum update -y"); + } + else + { + RunCmd($"dnf update -y"); + } + } + private ConnectionInfo CreateConnectionInfo() { @@ -799,6 +818,7 @@ namespace ProxySuper.Core.Services return new ConnectionInfo( host: _host.Address, username: _host.UserName, + port: _host.Port, authenticationMethods: authMethods.ToArray()); } diff --git a/ProxySuper.Core/Services/XrayService.cs b/ProxySuper.Core/Services/XrayService.cs index dce2df3..4c62dc9 100644 --- a/ProxySuper.Core/Services/XrayService.cs +++ b/ProxySuper.Core/Services/XrayService.cs @@ -268,7 +268,7 @@ namespace ProxySuper.Core.Services } - #region 似有方法 + #region 私有方法 private void DoUploadCert(object sender, CancelEventArgs e) { @@ -424,7 +424,6 @@ namespace ProxySuper.Core.Services WriteToFile(configJson, "/etc/caddy/Caddyfile"); } - private void UninstallXray() { Progress.Desc = "关闭Xray服务"; diff --git a/ProxySuper.WPF/ProxySuper.WPF.csproj b/ProxySuper.WPF/ProxySuper.WPF.csproj index d10a899..bc4d57b 100644 --- a/ProxySuper.WPF/ProxySuper.WPF.csproj +++ b/ProxySuper.WPF/ProxySuper.WPF.csproj @@ -144,14 +144,14 @@ MTProxyGoInstallView.xaml - - NaiveProtoConfigView.xaml + + NaiveProxyConfigView.xaml - - NaiveProtoEditorView.xaml + + NaiveProxyEditorView.xaml - - NaiveProtoInstallView.xaml + + NaiveProxyInstallView.xaml ShareLinkView.xaml @@ -299,15 +299,15 @@ Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile diff --git a/ProxySuper.WPF/Templates/trojan-go/trojan-go.json b/ProxySuper.WPF/Templates/trojan-go/trojan-go.json index 7e624a9..cfe6b10 100644 --- a/ProxySuper.WPF/Templates/trojan-go/trojan-go.json +++ b/ProxySuper.WPF/Templates/trojan-go/trojan-go.json @@ -1,4 +1,5 @@ { + "log_level": 5, "run_type": "server", "local_addr": "0.0.0.0", "local_port": 443, diff --git a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoConfigView.xaml b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyConfigView.xaml similarity index 93% rename from ProxySuper.WPF/Views/NaiveProto/NaiveProtoConfigView.xaml rename to ProxySuper.WPF/Views/NaiveProxy/NaiveProxyConfigView.xaml index ab48e08..3603b25 100644 --- a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoConfigView.xaml +++ b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyConfigView.xaml @@ -1,4 +1,4 @@ - + Title="NaiveProxy配置" Height="450" Width="800"> diff --git a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoConfigView.xaml.cs b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyConfigView.xaml.cs similarity index 70% rename from ProxySuper.WPF/Views/NaiveProto/NaiveProtoConfigView.xaml.cs rename to ProxySuper.WPF/Views/NaiveProxy/NaiveProxyConfigView.xaml.cs index bf2ece3..bcd9f4d 100644 --- a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoConfigView.xaml.cs +++ b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyConfigView.xaml.cs @@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views /// /// NaiveProxyConfigView.xaml 的交互逻辑 /// - public partial class NaiveProtoConfigView : MvxWindow + public partial class NaiveProxyConfigView : MvxWindow { - public NaiveProtoConfigView() + public NaiveProxyConfigView() { InitializeComponent(); } diff --git a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoEditorView.xaml b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyEditorView.xaml similarity index 96% rename from ProxySuper.WPF/Views/NaiveProto/NaiveProtoEditorView.xaml rename to ProxySuper.WPF/Views/NaiveProxy/NaiveProxyEditorView.xaml index cbd2b58..b764166 100644 --- a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoEditorView.xaml +++ b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyEditorView.xaml @@ -1,4 +1,4 @@ - + Title="NaiveProxy编辑配置" Height="600" Width="1000"> diff --git a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoEditorView.xaml.cs b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyEditorView.xaml.cs similarity index 70% rename from ProxySuper.WPF/Views/NaiveProto/NaiveProtoEditorView.xaml.cs rename to ProxySuper.WPF/Views/NaiveProxy/NaiveProxyEditorView.xaml.cs index a4c4ae0..4a948bd 100644 --- a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoEditorView.xaml.cs +++ b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyEditorView.xaml.cs @@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views /// /// NaiveProxyEditorView.xaml 的交互逻辑 /// - public partial class NaiveProtoEditorView : MvxWindow + public partial class NaiveProxyEditorView : MvxWindow { - public NaiveProtoEditorView() + public NaiveProxyEditorView() { InitializeComponent(); } diff --git a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoInstallView.xaml b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyInstallView.xaml similarity index 96% rename from ProxySuper.WPF/Views/NaiveProto/NaiveProtoInstallView.xaml rename to ProxySuper.WPF/Views/NaiveProxy/NaiveProxyInstallView.xaml index 0798cd3..a2dfd4e 100644 --- a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoInstallView.xaml +++ b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyInstallView.xaml @@ -1,4 +1,4 @@ - + Title="TrojanGo安装" Height="600" Width="1000"> diff --git a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoInstallView.xaml.cs b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyInstallView.xaml.cs similarity index 85% rename from ProxySuper.WPF/Views/NaiveProto/NaiveProtoInstallView.xaml.cs rename to ProxySuper.WPF/Views/NaiveProxy/NaiveProxyInstallView.xaml.cs index 62da6f2..da77f21 100644 --- a/ProxySuper.WPF/Views/NaiveProto/NaiveProtoInstallView.xaml.cs +++ b/ProxySuper.WPF/Views/NaiveProxy/NaiveProxyInstallView.xaml.cs @@ -18,9 +18,9 @@ namespace ProxySuper.WPF.Views.NaiveProxy /// /// NaiveProxyInstallViewModel.xaml 的交互逻辑 /// - public partial class NaiveProtoInstallView : MvxWindow + public partial class NaiveProxyInstallView : MvxWindow { - public NaiveProtoInstallView() + public NaiveProxyInstallView() { InitializeComponent(); } diff --git a/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml b/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml index 1bd3a07..728e2ab 100644 --- a/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml +++ b/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml @@ -22,6 +22,7 @@ BorderThickness="1,0,1,0" BorderBrush="#DDD" TabStripPlacement="Left" + x:Name="TabCtrl" SelectionChanged="BuildQrCode">