diff --git a/ProxySuper.Core/Models/Projects/NaiveProxySettings.cs b/ProxySuper.Core/Models/Projects/NaiveProxySettings.cs index 4c17338..f6c457f 100644 --- a/ProxySuper.Core/Models/Projects/NaiveProxySettings.cs +++ b/ProxySuper.Core/Models/Projects/NaiveProxySettings.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System.Collections.Generic; +using System.Linq; namespace ProxySuper.Core.Models.Projects { @@ -10,7 +11,13 @@ namespace ProxySuper.Core.Models.Projects Port = 443; } - public List FreePorts => new List(); + public List FreePorts + { + get + { + return new List { 80, 443, Port }.Distinct().ToList(); + } + } public ProjectType Type { get; set; } = ProjectType.NaiveProxy; diff --git a/ProxySuper.Core/Models/Projects/TrojanGoSettings.cs b/ProxySuper.Core/Models/Projects/TrojanGoSettings.cs index 427dd86..17055fa 100644 --- a/ProxySuper.Core/Models/Projects/TrojanGoSettings.cs +++ b/ProxySuper.Core/Models/Projects/TrojanGoSettings.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.Linq; namespace ProxySuper.Core.Models.Projects { @@ -17,7 +18,7 @@ namespace ProxySuper.Core.Models.Projects { get { - return new List(); + return new List { 80, 443, Port }.Distinct().ToList(); } } diff --git a/ProxySuper.Core/Models/Projects/XraySettings.cs b/ProxySuper.Core/Models/Projects/XraySettings.cs index a0a14eb..0c068d5 100644 --- a/ProxySuper.Core/Models/Projects/XraySettings.cs +++ b/ProxySuper.Core/Models/Projects/XraySettings.cs @@ -2,6 +2,7 @@ using ProxySuper.Core.Services; using System; using System.Collections.Generic; +using System.Linq; namespace ProxySuper.Core.Models.Projects { @@ -35,11 +36,46 @@ namespace ProxySuper.Core.Models.Projects ShadowSocksMethod = "aes-128-gcm"; } + [JsonIgnore] + public bool WithTLS + { + get + { + var withOutTLSList = new List { + XrayType.ShadowsocksAEAD, + XrayType.VLESS_KCP, + XrayType.VMESS_KCP + }; + + return Types.Except(withOutTLSList).Count() > 0; + } + } + + [JsonIgnore] + public bool IsFullbackMode + { + get + { + var withoutFullback = new List { + XrayType.ShadowsocksAEAD, + XrayType.VLESS_KCP, + XrayType.VMESS_KCP, + XrayType.VLESS_gRPC, + }; + + return Types.Except(withoutFullback).Count() > 0; + } + } + + [JsonIgnore] public List FreePorts { get { var list = new List(); + list.Add(80); + list.Add(443); + if (Types.Contains(XrayType.VLESS_KCP)) { list.Add(VLESS_KCP_Port); @@ -60,7 +96,7 @@ namespace ProxySuper.Core.Models.Projects list.Add(VLESS_gRPC_Port); } - return list; + return list.Distinct().ToList(); } } diff --git a/ProxySuper.Core/Services/BrookProject.cs b/ProxySuper.Core/Services/BrookProject.cs index 42aaf5e..7b15c96 100644 --- a/ProxySuper.Core/Services/BrookProject.cs +++ b/ProxySuper.Core/Services/BrookProject.cs @@ -7,17 +7,17 @@ namespace ProxySuper.Core.Services public class BrookProject : ProjectBase { private string brookServiceTemp = @" - [Unit] - Description=brook service - After=network.target syslog.target - Wants=network.target + [Unit] + Description=brook service + After=network.target syslog.target + Wants=network.target - [Service] - Type=simple - ExecStart=##run_cmd## + [Service] + Type=simple + ExecStart=##run_cmd## - [Install] - WantedBy=multi-user.target"; + [Install] + WantedBy=multi-user.target"; public BrookProject(SshClient sshClient, BrookSettings parameters, Action writeOutput) : base(sshClient, parameters, writeOutput) { @@ -31,11 +31,7 @@ namespace ProxySuper.Core.Services WriteOutput("检测安装系统环境完成"); WriteOutput("配置服务器端口..."); - OpenPort(Parameters.FreePorts.ToArray()); - Parameters.FreePorts.ForEach(port => - { - SetPortFree(port); - }); + ConfigFirewalld(); WriteOutput("端口配置完成"); WriteOutput("安装必要的系统工具..."); @@ -120,7 +116,7 @@ namespace ProxySuper.Core.Services RunCmd("rm -rf /usr/bin/brook"); Console.WriteLine("关闭端口"); - ClosePort(Parameters.FreePorts.ToArray()); + ResetFirewalld(); WriteOutput("******卸载完成******"); } diff --git a/ProxySuper.Core/Services/NaiveProxyProject.cs b/ProxySuper.Core/Services/NaiveProxyProject.cs index 0e53a52..a3f166f 100644 --- a/ProxySuper.Core/Services/NaiveProxyProject.cs +++ b/ProxySuper.Core/Services/NaiveProxyProject.cs @@ -49,16 +49,12 @@ namespace ProxySuper.Core.Services EnsureSystemEnv(); WriteOutput("检测安装系统环境完成"); - WriteOutput("配置服务器端口..."); - ConfigurePort(); - WriteOutput("端口配置完成"); - WriteOutput("安装必要的系统工具..."); ConfigureSoftware(); WriteOutput("系统工具安装完成"); WriteOutput("配置防火墙..."); - ConfigureFirewall(); + ConfigFirewalld(); WriteOutput("防火墙配置完成"); WriteOutput("同步系统和本地时间..."); diff --git a/ProxySuper.Core/Services/ProjectBase.cs b/ProxySuper.Core/Services/ProjectBase.cs index 8986d42..4437360 100644 --- a/ProxySuper.Core/Services/ProjectBase.cs +++ b/ProxySuper.Core/Services/ProjectBase.cs @@ -259,103 +259,30 @@ namespace ProxySuper.Core.Services } } - /// - /// 关闭端口 - /// - /// - protected void ClosePort(params int[] portList) - { - string cmd; - - cmd = RunCmd("command -v firewall-cmd"); - if (!string.IsNullOrEmpty(cmd)) - { - //有很奇怪的vps主机,在firewalld未运行时,端口是关闭的,无法访问。所以要先启动firewalld - //用于保证acme.sh申请证书成功 - cmd = RunCmd("firewall-cmd --state"); - if (cmd.Trim() != "running") - { - RunCmd("systemctl restart firewalld"); - } - - foreach (var port in portList) - { - RunCmd($"firewall-cmd --zone=public --remove-port={port}/tcp --permanent"); - RunCmd($"firewall-cmd --zone=public --remove-port={port}/udp --permanent"); - } - RunCmd("yes | firewall-cmd --reload"); - } - else - { - cmd = RunCmd("command -v ufw"); - if (!string.IsNullOrEmpty(cmd)) - { - foreach (var port in portList) - { - RunCmd($"ufw delete allow {port}/tcp"); - RunCmd($"ufw delete allow {port}/udp"); - } - RunCmd("yes | ufw reload"); - } - } - } - - /// - /// 开放端口 - /// - /// - protected void OpenPort(params int[] portList) - { - string cmd; - - cmd = RunCmd("command -v firewall-cmd"); - if (!string.IsNullOrEmpty(cmd)) - { - //有很奇怪的vps主机,在firewalld未运行时,端口是关闭的,无法访问。所以要先启动firewalld - //用于保证acme.sh申请证书成功 - cmd = RunCmd("firewall-cmd --state"); - if (cmd.Trim() != "running") - { - RunCmd("systemctl restart firewalld"); - } - - foreach (var port in portList) - { - RunCmd($"firewall-cmd --zone=public --add-port={port}/tcp --permanent"); - RunCmd($"firewall-cmd --zone=public --add-port={port}/udp --permanent"); - } - RunCmd("yes | firewall-cmd --reload"); - } - else - { - cmd = RunCmd("command -v ufw"); - if (string.IsNullOrEmpty(cmd)) - { - RunCmd(GetInstallCmd("ufw")); - RunCmd("echo y | ufw enable"); - } - - foreach (var port in portList) - { - RunCmd($"ufw allow {port}/tcp"); - RunCmd($"ufw allow {port}/udp"); - } - RunCmd("yes | ufw reload"); - - } - } - /// /// 配置防火墙 /// - protected void ConfigureFirewall() + protected void ConfigFirewalld() { - var portList = new List(); - portList.Add(80); - portList.Add(Parameters.Port); - portList.AddRange(Parameters.FreePorts); + Parameters.FreePorts.ForEach(port => + { + SetPortFree(port); + }); - OpenPort(portList.ToArray()); + OpenPort(_sshClient.ConnectionInfo.Port); + OpenPort(Parameters.FreePorts.ToArray()); + } + + /// + /// 重置防火墙 + /// + protected void ResetFirewalld() + { + Parameters.FreePorts.ForEach(port => + { + SetPortFree(port); + }); + ClosePort(Parameters.FreePorts.ToArray()); } /// @@ -448,7 +375,7 @@ namespace ProxySuper.Core.Services RunCmd($"wget -O caddy.tar.gz {url}"); RunCmd("mkdir /etc/caddy"); - RunCmd("tar -zxvf caddy.tar.gz caddy -C /etc/caddy"); + RunCmd("tar -zxvf caddy.tar.gz -C /etc/caddy"); RunCmd("cp -rf /etc/caddy/caddy /usr/bin"); WriteToFile(Caddy.DefaultCaddyFile, "/etc/caddy/Caddyfile"); WriteToFile(Caddy.Service, "/etc/systemd/system/caddy.service"); @@ -456,6 +383,11 @@ namespace ProxySuper.Core.Services RunCmd("systemctl enable caddy"); RunCmd("mkdir /usr/share/caddy"); + + if (!FileExists("/usr/bin/caddy")) + { + throw new Exception("Caddy服务器安装失败,请联系开发者!"); + } #endregion #region 官方安装步骤 @@ -527,55 +459,6 @@ namespace ProxySuper.Core.Services return OnlyIpv6; } - protected bool SetPortFree(int port, bool force = true) - { - string result = RunCmd($"lsof -n -P -i :{port} | grep LISTEN"); - - if (!string.IsNullOrEmpty(result)) - { - if (force) - { - var btnResult = MessageBox.Show($"{port}端口被占用,将强制停止占用{port}端口的程序?", "提示", MessageBoxButton.YesNo); - if (btnResult == MessageBoxResult.No) - { - throw new Exception($"{port}端口被占用,安装停止!"); - } - - string[] process = result.Split(' '); - RunCmd($"systemctl stop {process[0]}"); - RunCmd($"systemctl disable {process[0]}"); - RunCmd($"pkill {process[0]}"); - return SetPortFree(port, force: false); - } - else - { - return false; - } - } - - return true; - } - - public void ConfigurePort() - { - if (Parameters.Port == 80 || Parameters.Port == 443) - { - SetPortFree(80); - SetPortFree(443); - } - else - { - SetPortFree(80); - SetPortFree(443); - SetPortFree(Parameters.Port); - - Parameters.FreePorts.ForEach(port => - { - SetPortFree(port); - }); - } - } - protected void SetNat64() { var dns64List = FilterFastestIP(); @@ -638,6 +521,121 @@ namespace ProxySuper.Core.Services return dns64List.Keys.ToList(); } + private bool SetPortFree(int port, bool force = true) + { + string result = RunCmd($"lsof -n -P -i :{port} | grep LISTEN"); + + if (!string.IsNullOrEmpty(result)) + { + if (force) + { + var btnResult = MessageBox.Show($"{port}端口被占用,将强制停止占用{port}端口的程序?", "提示", MessageBoxButton.YesNo); + if (btnResult == MessageBoxResult.No) + { + throw new Exception($"{port}端口被占用,安装停止!"); + } + + string[] process = result.Split(' '); + RunCmd($"systemctl stop {process[0]}"); + RunCmd($"systemctl disable {process[0]}"); + RunCmd($"pkill {process[0]}"); + return SetPortFree(port, force: false); + } + else + { + return false; + } + } + + return true; + } + + /// + /// 关闭端口 + /// + /// + private void ClosePort(params int[] portList) + { + string cmd; + + cmd = RunCmd("command -v firewall-cmd"); + if (!string.IsNullOrEmpty(cmd)) + { + //有很奇怪的vps主机,在firewalld未运行时,端口是关闭的,无法访问。所以要先启动firewalld + //用于保证acme.sh申请证书成功 + cmd = RunCmd("firewall-cmd --state"); + if (cmd.Trim() != "running") + { + RunCmd("systemctl restart firewalld"); + } + + foreach (var port in portList) + { + RunCmd($"firewall-cmd --zone=public --remove-port={port}/tcp --permanent"); + RunCmd($"firewall-cmd --zone=public --remove-port={port}/udp --permanent"); + } + RunCmd("yes | firewall-cmd --reload"); + } + else + { + cmd = RunCmd("command -v ufw"); + if (!string.IsNullOrEmpty(cmd)) + { + foreach (var port in portList) + { + RunCmd($"ufw delete allow {port}/tcp"); + RunCmd($"ufw delete allow {port}/udp"); + } + RunCmd("yes | ufw reload"); + } + } + } + + /// + /// 开放端口 + /// + /// + private void OpenPort(params int[] portList) + { + string cmd; + + cmd = RunCmd("command -v firewall-cmd"); + if (!string.IsNullOrEmpty(cmd)) + { + //有很奇怪的vps主机,在firewalld未运行时,端口是关闭的,无法访问。所以要先启动firewalld + //用于保证acme.sh申请证书成功 + cmd = RunCmd("firewall-cmd --state"); + if (cmd.Trim() != "running") + { + RunCmd("systemctl restart firewalld"); + } + + foreach (var port in portList) + { + RunCmd($"firewall-cmd --zone=public --add-port={port}/tcp --permanent"); + RunCmd($"firewall-cmd --zone=public --add-port={port}/udp --permanent"); + } + RunCmd("yes | firewall-cmd --reload"); + } + else + { + cmd = RunCmd("command -v ufw"); + if (string.IsNullOrEmpty(cmd)) + { + RunCmd(GetInstallCmd("ufw")); + RunCmd("echo y | ufw enable"); + } + + foreach (var port in portList) + { + RunCmd($"ufw allow {port}/tcp"); + RunCmd($"ufw allow {port}/udp"); + } + RunCmd("yes | ufw reload"); + + } + } + #endregion @@ -776,11 +774,15 @@ namespace ProxySuper.Core.Services { using (var sftp = new SftpClient(_sshClient.ConnectionInfo)) { - sftp.Connect(); try { + sftp.Connect(); sftp.UploadFile(stream, path, true); } + catch (Exception ex) + { + throw ex; + } finally { sftp.Disconnect(); diff --git a/ProxySuper.Core/Services/ShareLink.cs b/ProxySuper.Core/Services/ShareLink.cs index f659f41..00992e1 100644 --- a/ProxySuper.Core/Services/ShareLink.cs +++ b/ProxySuper.Core/Services/ShareLink.cs @@ -21,13 +21,13 @@ namespace ProxySuper.Core.Services if (settings.BrookType == BrookType.wsserver) { var address = HttpUtility.UrlEncode($"ws://{settings.IP}:{settings.Port}"); - return $"brook://wsserver?password={password}&ws={address}"; + return $"brook://wsserver?password={password}&wsserver={address}"; } if (settings.BrookType == BrookType.wssserver) { var address = HttpUtility.UrlEncode($"wss://{settings.Domain}:{settings.Port}"); - return $"brook://wssserver?password={password}&wss={address}"; + return $"brook://wssserver?password={password}&wssserver={address}"; } if (settings.BrookType == BrookType.socks5) diff --git a/ProxySuper.Core/Services/TrojanGoProject.cs b/ProxySuper.Core/Services/TrojanGoProject.cs index 8903df6..7c6e8f6 100644 --- a/ProxySuper.Core/Services/TrojanGoProject.cs +++ b/ProxySuper.Core/Services/TrojanGoProject.cs @@ -77,18 +77,14 @@ namespace ProxySuper.Core.Services WriteOutput("检测安装系统环境..."); EnsureSystemEnv(); - WriteOutput("检测安装系统环境完成"); - - WriteOutput("配置服务器端口..."); - ConfigurePort(); - WriteOutput("端口配置完成"); + WriteOutput("检测安装系统环境完成"); WriteOutput("安装必要的系统工具..."); ConfigureSoftware(); WriteOutput("系统工具安装完成"); WriteOutput("配置防火墙..."); - ConfigureFirewall(); + ConfigFirewalld(); WriteOutput("防火墙配置完成"); WriteOutput("同步系统和本地时间..."); diff --git a/ProxySuper.Core/Services/XrayConfigBuilder.cs b/ProxySuper.Core/Services/XrayConfigBuilder.cs index 0e7beb6..b07b990 100644 --- a/ProxySuper.Core/Services/XrayConfigBuilder.cs +++ b/ProxySuper.Core/Services/XrayConfigBuilder.cs @@ -117,28 +117,78 @@ namespace ProxySuper.Core.Services uuidList.Insert(0, parameters.UUID); var xrayConfig = LoadXrayConfig(); - var baseBound = GetBound("VLESS_TCP_XTLS.json"); - baseBound.port = parameters.Port; - baseBound.settings.fallbacks.Add(JToken.FromObject(new - { - dest = FullbackPort - })); - xrayConfig.inbounds.Add(baseBound); - SetClients(baseBound, uuidList, withXtls: true); - if (parameters.Types.Contains(XrayType.VLESS_WS)) + if (parameters.IsFullbackMode) { - var wsInbound = GetBound("VLESS_WS.json"); - wsInbound.port = VLESS_WS_Port; - SetClients(wsInbound, uuidList); - wsInbound.streamSettings.wsSettings.path = parameters.VLESS_WS_Path; + #region Fullbacks + var baseBound = GetBound("VLESS_TCP_XTLS.json"); + baseBound.port = parameters.Port; baseBound.settings.fallbacks.Add(JToken.FromObject(new { - dest = VLESS_WS_Port, - path = parameters.VLESS_WS_Path, - xver = 1, + dest = FullbackPort })); - xrayConfig.inbounds.Add(JToken.FromObject(wsInbound)); + xrayConfig.inbounds.Add(baseBound); + SetClients(baseBound, uuidList, withXtls: true); + + if (parameters.Types.Contains(XrayType.VLESS_WS)) + { + var wsInbound = GetBound("VLESS_WS.json"); + wsInbound.port = VLESS_WS_Port; + SetClients(wsInbound, uuidList); + wsInbound.streamSettings.wsSettings.path = parameters.VLESS_WS_Path; + baseBound.settings.fallbacks.Add(JToken.FromObject(new + { + dest = VLESS_WS_Port, + path = parameters.VLESS_WS_Path, + xver = 1, + })); + xrayConfig.inbounds.Add(JToken.FromObject(wsInbound)); + } + + if (parameters.Types.Contains(XrayType.VMESS_TCP)) + { + var mtcpBound = GetBound("VMESS_TCP.json"); + mtcpBound.port = VMESS_TCP_Port; + SetClients(mtcpBound, uuidList); + mtcpBound.streamSettings.tcpSettings.header.request.path = parameters.VMESS_TCP_Path; + baseBound.settings.fallbacks.Add(JToken.FromObject(new + { + dest = VMESS_TCP_Port, + path = parameters.VMESS_TCP_Path, + xver = 1, + })); + xrayConfig.inbounds.Add(JToken.FromObject(mtcpBound)); + } + + if (parameters.Types.Contains(XrayType.VMESS_WS)) + { + var mwsBound = GetBound("VMESS_WS.json"); + mwsBound.port = VMESS_WS_Port; + SetClients(mwsBound, uuidList); + mwsBound.streamSettings.wsSettings.path = parameters.VMESS_WS_Path; + baseBound.settings.fallbacks.Add(JToken.FromObject(new + { + dest = VMESS_WS_Port, + path = parameters.VMESS_WS_Path, + xver = 1, + })); + xrayConfig.inbounds.Add(JToken.FromObject(mwsBound)); + } + + if (parameters.Types.Contains(XrayType.Trojan_TCP)) + { + var trojanTcpBound = GetBound("Trojan_TCP.json"); + trojanTcpBound.port = Trojan_TCP_Port; + trojanTcpBound.settings.clients[0].password = parameters.TrojanPassword; + trojanTcpBound.settings.fallbacks[0].dest = FullbackPort; + baseBound.settings.fallbacks[0] = JToken.FromObject(new + { + dest = Trojan_TCP_Port, + xver = 1, + }); + xrayConfig.inbounds.Add(JToken.FromObject(trojanTcpBound)); + } + #endregion } if (parameters.Types.Contains(XrayType.VLESS_gRPC)) @@ -161,35 +211,7 @@ namespace ProxySuper.Core.Services xrayConfig.inbounds.Add(JToken.FromObject(kcpBound)); } - if (parameters.Types.Contains(XrayType.VMESS_TCP)) - { - var mtcpBound = GetBound("VMESS_TCP.json"); - mtcpBound.port = VMESS_TCP_Port; - SetClients(mtcpBound, uuidList); - mtcpBound.streamSettings.tcpSettings.header.request.path = parameters.VMESS_TCP_Path; - baseBound.settings.fallbacks.Add(JToken.FromObject(new - { - dest = VMESS_TCP_Port, - path = parameters.VMESS_TCP_Path, - xver = 1, - })); - xrayConfig.inbounds.Add(JToken.FromObject(mtcpBound)); - } - if (parameters.Types.Contains(XrayType.VMESS_WS)) - { - var mwsBound = GetBound("VMESS_WS.json"); - mwsBound.port = VMESS_WS_Port; - SetClients(mwsBound, uuidList); - mwsBound.streamSettings.wsSettings.path = parameters.VMESS_WS_Path; - baseBound.settings.fallbacks.Add(JToken.FromObject(new - { - dest = VMESS_WS_Port, - path = parameters.VMESS_WS_Path, - xver = 1, - })); - xrayConfig.inbounds.Add(JToken.FromObject(mwsBound)); - } if (parameters.Types.Contains(XrayType.VMESS_KCP)) { @@ -201,20 +223,6 @@ namespace ProxySuper.Core.Services xrayConfig.inbounds.Add(JToken.FromObject(kcpBound)); } - if (parameters.Types.Contains(XrayType.Trojan_TCP)) - { - var trojanTcpBound = GetBound("Trojan_TCP.json"); - trojanTcpBound.port = Trojan_TCP_Port; - trojanTcpBound.settings.clients[0].password = parameters.TrojanPassword; - trojanTcpBound.settings.fallbacks[0].dest = FullbackPort; - baseBound.settings.fallbacks[0] = JToken.FromObject(new - { - dest = Trojan_TCP_Port, - xver = 1, - }); - xrayConfig.inbounds.Add(JToken.FromObject(trojanTcpBound)); - } - if (parameters.Types.Contains(XrayType.ShadowsocksAEAD)) { diff --git a/ProxySuper.Core/Services/XrayProject.cs b/ProxySuper.Core/Services/XrayProject.cs index 8c4e4bf..3c11eb1 100644 --- a/ProxySuper.Core/Services/XrayProject.cs +++ b/ProxySuper.Core/Services/XrayProject.cs @@ -3,6 +3,8 @@ using ProxySuper.Core.Models.Projects; using Renci.SshNet; using System; using System.IO; +using System.Linq; +using System.Net; using System.Text; using System.Windows; @@ -50,25 +52,24 @@ namespace ProxySuper.Core.Services EnsureSystemEnv(); WriteOutput("检测安装系统环境完成"); - WriteOutput("配置服务器端口..."); - ConfigurePort(); - WriteOutput("端口配置完成"); - WriteOutput("安装必要的系统工具..."); ConfigureSoftware(); WriteOutput("系统工具安装完成"); WriteOutput("配置防火墙..."); - ConfigureFirewall(); + ConfigFirewalld(); WriteOutput("防火墙配置完成"); WriteOutput("同步系统和本地时间..."); SyncTimeDiff(); WriteOutput("时间同步完成"); - WriteOutput("检测域名是否绑定本机IP..."); - ValidateDomain(); - WriteOutput("域名检测完成"); + if (Parameters.WithTLS) + { + WriteOutput("检测域名是否绑定本机IP..."); + ValidateDomain(); + WriteOutput("域名检测完成"); + } WriteOutput("安装Caddy..."); InstallCaddy(); @@ -105,7 +106,7 @@ namespace ProxySuper.Core.Services WriteOutput("卸载证书"); UninstallAcme(); WriteOutput("关闭端口"); - ClosePort(Parameters.FreePorts.ToArray()); + ResetFirewalld(); WriteOutput("************ 卸载完成 ************"); } @@ -129,8 +130,11 @@ namespace ProxySuper.Core.Services { EnsureRootAuth(); EnsureSystemEnv(); - ConfigurePort(); - ConfigureFirewall(); + + RunCmd("systemctl stop caddy"); + RunCmd("systemctl stop xray"); + + ConfigFirewalld(); var configJson = XrayConfigBuilder.BuildXrayConfig(Parameters); var stream = new MemoryStream(Encoding.UTF8.GetBytes(configJson)); RunCmd("rm -rf /usr/local/etc/xray/config.json"); @@ -288,10 +292,12 @@ namespace ProxySuper.Core.Services RunCmd(@"mv /usr/local/etc/xray/config.json /usr/local/etc/xray/config.json.1"); } - WriteOutput("安装TLS证书"); - InstallCertToXray(); - WriteOutput("TLS证书安装完成"); - + if (Parameters.WithTLS) + { + WriteOutput("安装TLS证书"); + InstallCertToXray(); + WriteOutput("TLS证书安装完成"); + } var configJson = XrayConfigBuilder.BuildXrayConfig(Parameters); WriteToFile(configJson, "/usr/local/etc/xray/config.json"); diff --git a/ProxySuper.WPF/Properties/AssemblyInfo.cs b/ProxySuper.WPF/Properties/AssemblyInfo.cs index 508d2fa..b463edc 100644 --- a/ProxySuper.WPF/Properties/AssemblyInfo.cs +++ b/ProxySuper.WPF/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.0.3.0")] -[assembly: AssemblyFileVersion("4.0.3.0")] +[assembly: AssemblyVersion("4.0.4.0")] +[assembly: AssemblyFileVersion("4.0.4.0")] diff --git a/ProxySuper.WPF/Resources/Languages/en.xaml b/ProxySuper.WPF/Resources/Languages/en.xaml index 6e66ce3..87d9958 100644 --- a/ProxySuper.WPF/Resources/Languages/en.xaml +++ b/ProxySuper.WPF/Resources/Languages/en.xaml @@ -67,13 +67,13 @@ VLESS over TCP With XTLS Preferred VLESS over TCP with TLS XTLS is Preferred VLESS over WS with TLS Support CDN - VLESS mKCP low delay + VLESS mKCP low delay,without Domain VMESS over WS with TLS Support CDN - VMESS mKCP low delay - ShadowSocks Support CDN + VMESS mKCP low delay,without Domian + ShadowSocks Support UDP,without Domain Trojan over TCP with TLS Trojan - Address + Domain/IP GuiseHost UUID Multi User diff --git a/ProxySuper.WPF/Resources/Languages/tw_cn.xaml b/ProxySuper.WPF/Resources/Languages/tw_cn.xaml index fec016f..53ff51e 100644 --- a/ProxySuper.WPF/Resources/Languages/tw_cn.xaml +++ b/ProxySuper.WPF/Resources/Languages/tw_cn.xaml @@ -65,14 +65,14 @@ VLESS Over TCP With XTLS 性能數倍,首選方式。 VLESS over TCP with TLS 仍推薦XTLS。 VLESS over WS with TLS 推薦,支持CDN。 - VLESS mKCP 遊戲推薦,延遲低。 + VLESS mKCP 遊戲推薦,延遲低,免域名。 VMESS over WS with TLS 推薦,支持CDN。 - VMESS mKCP 遊戲推薦,延遲低。 - ShadowSocks SS,支持udp。 + VMESS mKCP 遊戲推薦,延遲低,免域名。 + ShadowSocks SS,支持udp,免域名。 Trojan over TCP with TLS Trojan。 - 域名 + 域名/IP 偽裝域名 UUID 多用戶 diff --git a/ProxySuper.WPF/Resources/Languages/zh_cn.xaml b/ProxySuper.WPF/Resources/Languages/zh_cn.xaml index 8db8c0a..dbe87b5 100644 --- a/ProxySuper.WPF/Resources/Languages/zh_cn.xaml +++ b/ProxySuper.WPF/Resources/Languages/zh_cn.xaml @@ -66,14 +66,14 @@ VLESS Over TCP With XTLS 性能数倍,首选方式。 VLESS over TCP with TLS 仍推荐XTLS。 VLESS over WS with TLS 推荐,支持CDN。 - VLESS mKCP 游戏推荐,延迟低。 + VLESS mKCP 游戏推荐,延迟低,免域名。 VMESS over WS with TLS 推荐,支持CDN。 - VMESS mKCP 游戏推荐,延迟低。 - ShadowSocks SS,支持udp。 + VMESS mKCP 游戏推荐,延迟低,免域名。 + ShadowSocks SS,支持udp,免域名。 Trojan over TCP with TLS Trojan。 - 域名 + 域名/IP 伪装域名 UUID 多用户