mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-02-21 08:53:17 +03:00
优化caddy.service
This commit is contained in:
parent
b404c3e6c9
commit
df98787e6c
@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:ProxySU"
|
xmlns:local="clr-namespace:ProxySU"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="ProxySU - v2.4.19-beta1" Height="675" Width="650">
|
Title="ProxySU - v2.4.19-beta2" Height="675" Width="650">
|
||||||
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
|
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
|
||||||
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
|
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
|
@ -1116,7 +1116,7 @@ namespace ProxySU
|
|||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测系统是否符合安装要求 11--30
|
//检测系统是否符合安装要求 11--30
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -2422,7 +2422,7 @@ namespace ProxySU
|
|||||||
functionResult = SoftInstalledIsNoYes(client, "trojan-go", @"/usr/local/bin/trojan-go");
|
functionResult = SoftInstalledIsNoYes(client, "trojan-go", @"/usr/local/bin/trojan-go");
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -3049,7 +3049,7 @@ namespace ProxySU
|
|||||||
functionResult = SoftInstalledIsNoYes(client, "trojan", @"/usr/local/bin/trojan");
|
functionResult = SoftInstalledIsNoYes(client, "trojan", @"/usr/local/bin/trojan");
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -3614,7 +3614,7 @@ namespace ProxySU
|
|||||||
functionResult = SoftInstalledIsNoYes(client, "caddy", @"/usr/bin/caddy");
|
functionResult = SoftInstalledIsNoYes(client, "caddy", @"/usr/bin/caddy");
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -4005,7 +4005,7 @@ namespace ProxySU
|
|||||||
functionResult = SoftInstalledIsNoYes(client, "server.py", @"/usr/local/shadowsocks/server.py");
|
functionResult = SoftInstalledIsNoYes(client, "server.py", @"/usr/local/shadowsocks/server.py");
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -4387,7 +4387,7 @@ namespace ProxySU
|
|||||||
functionResult = SoftInstalledIsNoYes(client, "ss-server", @"/usr/local/bin/ss-server");
|
functionResult = SoftInstalledIsNoYes(client, "ss-server", @"/usr/local/bin/ss-server");
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -4964,7 +4964,7 @@ namespace ProxySU
|
|||||||
functionResult = SoftInstalledIsNoYes(client, "mtg", @"/usr/local/bin/mtg");
|
functionResult = SoftInstalledIsNoYes(client, "mtg", @"/usr/local/bin/mtg");
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口
|
//安装依赖软件,检测端口,防火墙开启端口
|
||||||
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
@ -5634,7 +5634,7 @@ namespace ProxySU
|
|||||||
functionResult = RootAuthorityDetect(client);
|
functionResult = RootAuthorityDetect(client);
|
||||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
|
|
||||||
sshShellCommand = @"command -v apt";
|
sshShellCommand = @"command -v apt-get";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
getApt = !String.IsNullOrEmpty(currentShellCommandResult);
|
getApt = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||||
|
|
||||||
@ -5649,8 +5649,8 @@ namespace ProxySU
|
|||||||
//设置安装软件所用的命令格式
|
//设置安装软件所用的命令格式
|
||||||
if (getApt == true)
|
if (getApt == true)
|
||||||
{
|
{
|
||||||
sshCmdUpdate = @"apt update";
|
sshCmdUpdate = @"apt-get update";
|
||||||
//sshCmdInstall = @"apt -y install ";
|
//sshCmdInstall = @"apt-get -y install ";
|
||||||
}
|
}
|
||||||
else if (getDnf == true)
|
else if (getDnf == true)
|
||||||
{
|
{
|
||||||
@ -6227,10 +6227,10 @@ namespace ProxySU
|
|||||||
sshShellCommand = @"systemctl disable caddy";
|
sshShellCommand = @"systemctl disable caddy";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
//检测系统是否支持yum 或 apt或zypper
|
//检测系统是否支持yum 或 apt-get或zypper
|
||||||
//如果不存在组件,则命令结果为空,string.IsNullOrEmpty值为真,
|
//如果不存在组件,则命令结果为空,string.IsNullOrEmpty值为真,
|
||||||
|
|
||||||
sshShellCommand = @"command -v apt";
|
sshShellCommand = @"command -v apt-get";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
bool getApt = ! String.IsNullOrEmpty(currentShellCommandResult);
|
bool getApt = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||||
|
|
||||||
@ -6254,8 +6254,8 @@ namespace ProxySU
|
|||||||
//设置安装软件所用的命令格式
|
//设置安装软件所用的命令格式
|
||||||
if (getApt == true)
|
if (getApt == true)
|
||||||
{
|
{
|
||||||
//sshCmdUpdate = @"apt update";
|
//sshCmdUpdate = @"apt-get update";
|
||||||
sshCmdRemove = @"apt -y autoremove --purge ";
|
sshCmdRemove = @"apt-get -y autoremove --purge ";
|
||||||
}
|
}
|
||||||
else if (getDnf == true)
|
else if (getDnf == true)
|
||||||
{
|
{
|
||||||
@ -7645,14 +7645,14 @@ namespace ProxySU
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
|
//检测关闭Selinux及系统组件是否齐全(apt-get/yum/dnf/systemctl)11--30
|
||||||
//安装依赖软件,检测端口,防火墙开启端口,检测是否为纯ipv6主机,若是则设置Nat64网关
|
//安装依赖软件,检测端口,防火墙开启端口,检测是否为纯ipv6主机,若是则设置Nat64网关
|
||||||
//functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
//functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
|
||||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||||
private bool ShutDownSelinuxAndSysComponentsDetect(SshClient client)
|
private bool ShutDownSelinuxAndSysComponentsDetect(SshClient client)
|
||||||
{
|
{
|
||||||
|
|
||||||
//检测系统是否支持yum 或 apt或zypper,且支持Systemd
|
//检测系统是否支持yum 或 apt-get或zypper,且支持Systemd
|
||||||
//如果不存在组件,则命令结果为空,String.IsNullOrEmpty值为真
|
//如果不存在组件,则命令结果为空,String.IsNullOrEmpty值为真
|
||||||
//取反则getApt,getDnf,getYum,getSystem,getGetenforce为假
|
//取反则getApt,getDnf,getYum,getSystem,getGetenforce为假
|
||||||
//不存在组件,则为假
|
//不存在组件,则为假
|
||||||
@ -7662,7 +7662,7 @@ namespace ProxySU
|
|||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_CheckSystemRequirements").ToString();
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_CheckSystemRequirements").ToString();
|
||||||
MainWindowsShowInfo(currentStatus);
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
|
||||||
sshShellCommand = @"command -v apt";
|
sshShellCommand = @"command -v apt-get";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
getApt = ! String.IsNullOrEmpty(currentShellCommandResult);
|
getApt = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||||
|
|
||||||
@ -7689,11 +7689,11 @@ namespace ProxySU
|
|||||||
bool getGetenforce = ! String.IsNullOrEmpty(currentShellCommandResult);
|
bool getGetenforce = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||||
|
|
||||||
|
|
||||||
//没有安装apt,也没有安装dnf\yum,也没有安装zypper,或者没有安装systemd的,不满足安装条件
|
//没有安装apt-get,也没有安装dnf\yum,也没有安装zypper,或者没有安装systemd的,不满足安装条件
|
||||||
//也就是apt ,dnf\yum, zypper必须安装其中之一,且必须安装Systemd的系统才能安装。
|
//也就是apt-get ,dnf\yum, zypper必须安装其中之一,且必须安装Systemd的系统才能安装。
|
||||||
if ((getApt == false && getDnf == false && getYum == false) || getSystemd == false)
|
if ((getApt == false && getDnf == false && getYum == false) || getSystemd == false)
|
||||||
{
|
{
|
||||||
//******"系统缺乏必要的安装组件如:apt||dnf||yum||zypper||Syetemd,主机系统推荐使用:CentOS 7/8,Debian 8/9/10,Ubuntu 16.04及以上版本"******
|
//******"系统缺乏必要的安装组件如:apt-get||dnf||yum||zypper||Syetemd,主机系统推荐使用:CentOS 7/8,Debian 8/9/10,Ubuntu 16.04及以上版本"******
|
||||||
MessageBox.Show(Application.Current.FindResource("MessageBoxShow_MissingSystemComponents").ToString());
|
MessageBox.Show(Application.Current.FindResource("MessageBoxShow_MissingSystemComponents").ToString());
|
||||||
|
|
||||||
//******"系统环境不满足要求,安装失败!!"******
|
//******"系统环境不满足要求,安装失败!!"******
|
||||||
@ -7716,8 +7716,8 @@ namespace ProxySU
|
|||||||
//设置安装软件所用的命令格式
|
//设置安装软件所用的命令格式
|
||||||
if (getApt == true)
|
if (getApt == true)
|
||||||
{
|
{
|
||||||
sshCmdUpdate = @"apt update";
|
sshCmdUpdate = @"apt-get update";
|
||||||
sshCmdInstall = @"apt -y install dnsutils";
|
sshCmdInstall = @"apt-get -y install dnsutils";
|
||||||
}
|
}
|
||||||
else if (getDnf == true)
|
else if (getDnf == true)
|
||||||
{
|
{
|
||||||
@ -7740,8 +7740,8 @@ namespace ProxySU
|
|||||||
//设置安装软件所用的命令格式
|
//设置安装软件所用的命令格式
|
||||||
if (getApt == true)
|
if (getApt == true)
|
||||||
{
|
{
|
||||||
sshCmdUpdate = @"apt update";
|
sshCmdUpdate = @"apt-get update";
|
||||||
sshCmdInstall = @"apt -y install ";
|
sshCmdInstall = @"apt-get -y install ";
|
||||||
}
|
}
|
||||||
else if (getDnf == true)
|
else if (getDnf == true)
|
||||||
{
|
{
|
||||||
@ -7882,7 +7882,7 @@ namespace ProxySU
|
|||||||
sshShellCommand = $"systemctl disable {cmdResultArry443[0]}";
|
sshShellCommand = $"systemctl disable {cmdResultArry443[0]}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = $"kill -9 {cmdResultArry443[3]}";
|
sshShellCommand = $"pkill {cmdResultArry443[0]}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7896,9 +7896,29 @@ namespace ProxySU
|
|||||||
sshShellCommand = $"systemctl disable {cmdResultArry80[0]}";
|
sshShellCommand = $"systemctl disable {cmdResultArry80[0]}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = $"kill -9 {cmdResultArry80[3]}";
|
sshShellCommand = $"pkill {cmdResultArry80[0]}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
}
|
}
|
||||||
|
testPort80 = string.Empty;
|
||||||
|
testPort443 = string.Empty;
|
||||||
|
|
||||||
|
sshShellCommand = @"lsof -n -P -i :80 | grep LISTEN";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
testPort80 = currentShellCommandResult;
|
||||||
|
|
||||||
|
sshShellCommand = @"lsof -n -P -i :443 | grep LISTEN";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
testPort443 = currentShellCommandResult;
|
||||||
|
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(testPort80) == false || String.IsNullOrEmpty(testPort443) == false)
|
||||||
|
{
|
||||||
|
//****** "端口被占用,安装失败......" ******
|
||||||
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ErrorPortUsedFail").ToString();
|
||||||
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
//client.Disconnect();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//****** "80/443端口释放完毕!" ******
|
//****** "80/443端口释放完毕!" ******
|
||||||
SetUpProgressBarProcessing(26);
|
SetUpProgressBarProcessing(26);
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ReleasePortOK").ToString();
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ReleasePortOK").ToString();
|
||||||
@ -7946,9 +7966,24 @@ namespace ProxySU
|
|||||||
sshShellCommand = $"systemctl disable {cmdResultArry[0]}";
|
sshShellCommand = $"systemctl disable {cmdResultArry[0]}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = $"kill -9 {cmdResultArry[3]}";
|
sshShellCommand = $"pkill {cmdResultArry[0]}";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
|
testPort = string.Empty;
|
||||||
|
|
||||||
|
sshShellCommand = $"lsof -n -P -i :{ReceiveConfigurationParameters[1]} | grep LISTEN";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
testPort = currentShellCommandResult;
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(testPort) == false)
|
||||||
|
{
|
||||||
|
//****** "端口被占用,安装失败......" ******
|
||||||
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ErrorPortUsedFail").ToString();
|
||||||
|
MainWindowsShowInfo(currentStatus);
|
||||||
|
//client.Disconnect();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//****** "端口释放完毕!" ******
|
//****** "端口释放完毕!" ******
|
||||||
SetUpProgressBarProcessing(26);
|
SetUpProgressBarProcessing(26);
|
||||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ReleasePortOKOther").ToString();
|
currentStatus = Application.Current.FindResource("DisplayInstallInfo_ReleasePortOKOther").ToString();
|
||||||
@ -8376,13 +8411,13 @@ namespace ProxySU
|
|||||||
sshShellCommand = @"echo ""deb [trusted=yes] https://apt.fury.io/caddy/ /"" | tee -a /etc/apt/sources.list.d/caddy-fury.list";
|
sshShellCommand = @"echo ""deb [trusted=yes] https://apt.fury.io/caddy/ /"" | tee -a /etc/apt/sources.list.d/caddy-fury.list";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = @"apt install -y apt-transport-https";
|
sshShellCommand = @"apt-get install -y apt-transport-https";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = @"apt update";
|
sshShellCommand = @"apt-get update";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = @"apt -y install caddy";
|
sshShellCommand = @"apt-get -y install caddy";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -8417,17 +8452,25 @@ namespace ProxySU
|
|||||||
sshShellCommand = @"yum -y install caddy";
|
sshShellCommand = @"yum -y install caddy";
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
sshShellCommand = @"sed -i 's/AmbientCapabilities/#AmbientCapabilities/g' /usr/lib/systemd/system/caddy.service";
|
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
|
||||||
|
|
||||||
sshShellCommand = @"sed -i 's/=caddy/=root/g' /usr/lib/systemd/system/caddy.service";
|
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
|
||||||
|
|
||||||
sshShellCommand = @"systemctl daemon-reload";
|
|
||||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string caddyService = @"/lib/systemd/system/caddy.service";
|
||||||
|
functionResult = FileCheckExists(client, $"{caddyService}");
|
||||||
|
if (functionResult == false)
|
||||||
|
{
|
||||||
|
caddyService = @"/usr/lib/systemd/system/caddy.service";
|
||||||
|
}
|
||||||
|
sshShellCommand = $"sed -i 's/AmbientCapabilities/#AmbientCapabilities/g' {caddyService}";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
|
sshShellCommand = $"sed -i 's/=caddy/=root/g' {caddyService}";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
|
sshShellCommand = @"systemctl daemon-reload";
|
||||||
|
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
|
||||||
//sshShellCommand = @"find / -name caddy";
|
//sshShellCommand = @"find / -name caddy";
|
||||||
//sshShellCommand = @"if [[ -f /usr/bin/caddy ]];then echo '1';else echo '0'; fi";
|
//sshShellCommand = @"if [[ -f /usr/bin/caddy ]];then echo '1';else echo '0'; fi";
|
||||||
//currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
//currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<RowDefinition Height="0.12*"></RowDefinition>
|
<RowDefinition Height="0.12*"></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<!-- V2Ray客户端配置参数 -->
|
<!-- V2Ray客户端配置参数 -->
|
||||||
<GroupBox Header="{DynamicResource GroupBoxHeaderClientParameter}" x:Name="GroupBoxV2rayClient" Visibility="Collapsed" Grid.Row="0">
|
<GroupBox Header="{DynamicResource GroupBoxHeaderClientParameter}" x:Name="GroupBoxV2rayClient" Visibility="Visible" Grid.Row="0">
|
||||||
<Grid >
|
<Grid >
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<!-- Trojan-Go客户端配置参数 -->
|
<!-- Trojan-Go客户端配置参数 -->
|
||||||
<GroupBox Header="{DynamicResource GroupBoxHeaderClientParameter}" x:Name="GroupBoxTrojanGoClient" Visibility="Visible" Grid.Row="0">
|
<GroupBox Header="{DynamicResource GroupBoxHeaderClientParameter}" x:Name="GroupBoxTrojanGoClient" Visibility="Collapsed" Grid.Row="0">
|
||||||
<Grid >
|
<Grid >
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||||
|
@ -105,6 +105,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -113,6 +115,8 @@ namespace ProxySU
|
|||||||
{
|
{
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -123,6 +127,8 @@ namespace ProxySU
|
|||||||
|
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTLS.Text = "xtls";
|
TextBoxTLS.Text = "xtls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
@ -136,6 +142,8 @@ namespace ProxySU
|
|||||||
|
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
@ -149,6 +157,8 @@ namespace ProxySU
|
|||||||
|
|
||||||
TextBoxTransmission.Text = "ws";
|
TextBoxTransmission.Text = "ws";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
@ -162,6 +172,8 @@ namespace ProxySU
|
|||||||
|
|
||||||
TextBoxTransmission.Text = "h2";
|
TextBoxTransmission.Text = "h2";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
@ -182,6 +194,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "ws";
|
TextBoxTransmission.Text = "ws";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -191,6 +205,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "ws";
|
TextBoxTransmission.Text = "ws";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -199,6 +215,8 @@ namespace ProxySU
|
|||||||
{
|
{
|
||||||
TextBoxTransmission.Text = "ws";
|
TextBoxTransmission.Text = "ws";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -208,6 +226,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "h2";
|
TextBoxTransmission.Text = "h2";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -226,6 +246,8 @@ namespace ProxySU
|
|||||||
{
|
{
|
||||||
TextBoxTransmission.Text = "h2";
|
TextBoxTransmission.Text = "h2";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
ShowPathV2ray();
|
ShowPathV2ray();
|
||||||
@ -674,6 +696,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "xtls";
|
TextBoxTLS.Text = "xtls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
@ -693,6 +717,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
@ -711,6 +737,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "ws";
|
TextBoxTransmission.Text = "ws";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
HideAlterId();
|
HideAlterId();
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
@ -725,6 +753,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "tcp";
|
TextBoxTransmission.Text = "tcp";
|
||||||
TextBoxCamouflageType.Text = "http";
|
TextBoxCamouflageType.Text = "http";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowAlterId();
|
ShowAlterId();
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
@ -742,6 +772,8 @@ namespace ProxySU
|
|||||||
TextBoxEncryption.Text = "none";
|
TextBoxEncryption.Text = "none";
|
||||||
TextBoxTransmission.Text = "ws";
|
TextBoxTransmission.Text = "ws";
|
||||||
TextBoxCamouflageType.Text = "none";
|
TextBoxCamouflageType.Text = "none";
|
||||||
|
//TLS的Host /Quic 加密方式
|
||||||
|
TextBoxHostQuicEncryption.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||||
TextBoxTLS.Text = "tls";
|
TextBoxTLS.Text = "tls";
|
||||||
ShowAlterId();
|
ShowAlterId();
|
||||||
ShowHostName();
|
ShowHostName();
|
||||||
@ -965,10 +997,11 @@ namespace ProxySU
|
|||||||
v2rayNjsonObject["aid"] = TextBoxUUIDextra.Text; //设置额外ID
|
v2rayNjsonObject["aid"] = TextBoxUUIDextra.Text; //设置额外ID
|
||||||
v2rayNjsonObject["net"] = TextBoxTransmission.Text; //设置传输模式
|
v2rayNjsonObject["net"] = TextBoxTransmission.Text; //设置传输模式
|
||||||
v2rayNjsonObject["type"] = TextBoxCamouflageType.Text; //设置伪装类型
|
v2rayNjsonObject["type"] = TextBoxCamouflageType.Text; //设置伪装类型
|
||||||
|
|
||||||
if (TextBoxTransmission.Text.Contains("kcp") == true)
|
if (TextBoxTransmission.Text.Contains("kcp") == true)
|
||||||
{
|
{
|
||||||
v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text;//设置mKCP Seed
|
v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text;//设置mKCP Seed
|
||||||
|
v2rayNjsonObject["host"] = "";//设置Host
|
||||||
}
|
}
|
||||||
else if (TextBoxTransmission.Text.Contains("quic")==true)
|
else if (TextBoxTransmission.Text.Contains("quic")==true)
|
||||||
{
|
{
|
||||||
@ -1649,6 +1682,7 @@ namespace ProxySU
|
|||||||
if (TextBoxTransmission.Text.Contains("kcp") == true)
|
if (TextBoxTransmission.Text.Contains("kcp") == true)
|
||||||
{
|
{
|
||||||
v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text;//设置mKCP Seed
|
v2rayNjsonObject["path"] = TextBoxQuicKeyMkcpSeedPath.Text;//设置mKCP Seed
|
||||||
|
v2rayNjsonObject["host"] = "";//设置Host
|
||||||
}
|
}
|
||||||
else if (TextBoxTransmission.Text.Contains("quic") == true)
|
else if (TextBoxTransmission.Text.Contains("quic") == true)
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user