mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-03 13:53:36 +03:00
修改bug
This commit is contained in:
parent
02b6b478ac
commit
b42959034b
4 changed files with 26 additions and 18 deletions
|
@ -525,7 +525,22 @@ namespace ProxySU
|
|||
client.RunCommand("sed -i 's/##mkcpHeaderType##/" + ReceiveConfigurationParameters[5] + "/' " + upLoadPath);
|
||||
client.RunCommand("systemctl restart v2ray");
|
||||
|
||||
//如果是WebSocket + TLS + Web模式,需要安装Caddy
|
||||
//打开防火墙端口
|
||||
string openFireWallPort = ReceiveConfigurationParameters[1];
|
||||
if (String.Equals(openFireWallPort, "443"))
|
||||
{
|
||||
client.RunCommand("firewall-cmd --zone=public --add-port=80/tcp --permanent");
|
||||
client.RunCommand("firewall-cmd --zone=public --add-port=443/tcp --permanent");
|
||||
client.RunCommand("firewall-cmd --reload");
|
||||
}
|
||||
else
|
||||
{
|
||||
client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/tcp --permanent");
|
||||
client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/udp --permanent");
|
||||
client.RunCommand("firewall-cmd --reload");
|
||||
}
|
||||
|
||||
//如果是WebSocket + TLS + Web模式,需要安装Caddy
|
||||
if (appConfig.Contains("WebSocketTLSWeb")==true)
|
||||
{
|
||||
currentStatus = "使用WebSocket + TLS + Web模式,正在安装Caddy......";
|
||||
|
@ -563,20 +578,7 @@ namespace ProxySU
|
|||
sshCmd = "caddy -service install -agree -conf /etc/caddy/Caddyfile -email " + email;
|
||||
//MessageBox.Show(sshCmd);
|
||||
client.RunCommand(sshCmd);
|
||||
//打开防火墙端口
|
||||
string openFireWallPort = ReceiveConfigurationParameters[1];
|
||||
if (String.Equals(openFireWallPort, "443"))
|
||||
{
|
||||
client.RunCommand("firewall-cmd --zone=public --add-port=80/tcp --permanent");
|
||||
client.RunCommand("firewall-cmd --zone=public --add-port=443/tcp --permanent");
|
||||
client.RunCommand("firewall-cmd --reload");
|
||||
}
|
||||
else
|
||||
{
|
||||
client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/tcp --permanent");
|
||||
client.RunCommand($"firewall-cmd --zone=public --add-port={openFireWallPort}/udp --permanent");
|
||||
client.RunCommand("firewall-cmd --reload");
|
||||
}
|
||||
|
||||
|
||||
//启动Caddy服务
|
||||
client.RunCommand("caddy -service start");
|
||||
|
|
|
@ -182,6 +182,12 @@ namespace ProxySU
|
|||
//MessageBox.Show(v2rayNjsonObject["v"].ToString());
|
||||
|
||||
saveFileFolder = v2rayNjsonObject["ps"].ToString();
|
||||
int num = 1;
|
||||
while(Directory.Exists(@"config\" + saveFileFolder))
|
||||
{
|
||||
saveFileFolder = saveFileFolder + "_copy_" + num.ToString();
|
||||
num++;
|
||||
}
|
||||
CheckDir(@"config\" + saveFileFolder);
|
||||
//MessageBox.Show(v2rayNjsonObject.ToString());
|
||||
string vmessUrl = "vmess://" + ToBase64Encode(v2rayNjsonObject.ToString());
|
||||
|
@ -249,11 +255,11 @@ namespace ProxySU
|
|||
//ImageShareQRcode.Source = @"config\v2rayN.bmp";
|
||||
}
|
||||
//判断目录是否存在,不存在则创建
|
||||
public static bool CheckDir(string folder)
|
||||
private static bool CheckDir(string folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(folder))//如果不存在就创建file文件夹
|
||||
if (!Directory.Exists(folder))//如果不存在就创建file文件夹
|
||||
Directory.CreateDirectory(folder);//创建该文件夹
|
||||
return true;
|
||||
}
|
||||
|
@ -265,7 +271,7 @@ namespace ProxySU
|
|||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string openFolderPath = @"config";
|
||||
string openFolderPath = @"config\" + saveFileFolder;
|
||||
System.Diagnostics.Process.Start("explorer.exe", openFolderPath);
|
||||
this.Close();
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue