diff --git a/ProxySuper.Core/Models/Record.cs b/ProxySuper.Core/Models/Record.cs index 4faf1c9..6d3fed3 100644 --- a/ProxySuper.Core/Models/Record.cs +++ b/ProxySuper.Core/Models/Record.cs @@ -84,7 +84,7 @@ namespace ProxySuper.Core.Models if (Type == ProjectType.V2ray) { StringBuilder strBuilder = new StringBuilder(); - XraySettings.Types.ForEach(type => + V2raySettings.Types.ForEach(type => { var link = ShareLink.Build(type, V2raySettings); strBuilder.AppendLine(link); diff --git a/ProxySuper.Core/Services/NaiveProxyService.cs b/ProxySuper.Core/Services/NaiveProxyService.cs index 939bf83..a74f9be 100644 --- a/ProxySuper.Core/Services/NaiveProxyService.cs +++ b/ProxySuper.Core/Services/NaiveProxyService.cs @@ -179,8 +179,11 @@ namespace ProxySuper.Core.Services } Progress.Desc = "上传Caddy配置文件"; - UploadCaddySettings(); + UploadCaddySettings(useCustomWeb: true); + Progress.Percentage = 90; + Progress.Desc = "重启caddy服务"; + RunCmd("systemctl restart caddy"); Progress.Percentage = 100; Progress.Desc = "上传静态网站成功"; } diff --git a/ProxySuper.Core/Services/ServiceBase.cs b/ProxySuper.Core/Services/ServiceBase.cs index 3ac9721..f28d268 100644 --- a/ProxySuper.Core/Services/ServiceBase.cs +++ b/ProxySuper.Core/Services/ServiceBase.cs @@ -766,7 +766,7 @@ namespace ProxySuper.Core.Services { return new ConnectionInfo( host: _host.Address, - username: _host.Password, + username: _host.UserName, authenticationMethods: authMethods.ToArray()); } diff --git a/ProxySuper.Core/Services/TrojanGoService.cs b/ProxySuper.Core/Services/TrojanGoService.cs index 5ac29ad..46058e4 100644 --- a/ProxySuper.Core/Services/TrojanGoService.cs +++ b/ProxySuper.Core/Services/TrojanGoService.cs @@ -75,6 +75,9 @@ namespace ProxySuper.Core.Services Progress.Step = $"{index++}. 启动BBR"; EnableBBR(); + Progress.Step = $"{index++}. 重启caddy服务"; + RunCmd("systemctl restart caddy"); + Progress.Desc = "启用Trojan-Go开机启动"; RunCmd("systemctl enable trojan-go"); RunCmd("systemctl restart trojan-go"); @@ -156,6 +159,11 @@ namespace ProxySuper.Core.Services Progress.Desc = "更新配置文件"; UploadTrojanGoSettings(); + Progress.Percentage = 70; + + Progress.Desc = "重启caddy服务"; + RunCmd("systemctl restart caddy"); + Progress.Percentage = 80; Progress.Desc = "重启Trojan-Go服务器"; RunCmd("systemctl restart trojan-go"); @@ -313,8 +321,11 @@ namespace ProxySuper.Core.Services } Progress.Desc = "上传Caddy配置文件"; - UploadCaddySettings(); + UploadCaddySettings(useCustomWeb: true); + Progress.Percentage = 90; + Progress.Desc = "重启caddy服务"; + RunCmd("systemctl restart caddy"); Progress.Percentage = 100; Progress.Desc = "上传静态网站成功"; } @@ -334,7 +345,6 @@ namespace ProxySuper.Core.Services RunCmd("mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.back"); } UploadFile(stream, "/etc/caddy/Caddyfile"); - RunCmd("systemctl restart caddy"); } private void InstallTrojanGo() @@ -356,7 +366,7 @@ namespace ProxySuper.Core.Services { Progress.Desc = "安装TLS证书"; InstallCert( - dirPath: "/usr/local/etc/trojan-go", + dirPath: "/usr/local/etc/trojan-go/ssl", certName: "trojan-go.crt", keyName: "trojan-go.key"); } diff --git a/ProxySuper.Core/Services/V2rayConfigBuilder.cs b/ProxySuper.Core/Services/V2rayConfigBuilder.cs index 9adb136..585ca44 100644 --- a/ProxySuper.Core/Services/V2rayConfigBuilder.cs +++ b/ProxySuper.Core/Services/V2rayConfigBuilder.cs @@ -220,8 +220,8 @@ namespace ProxySuper.Core.Services { var ssBound = GetBound("Shadowsocks-AEAD.json"); ssBound.port = parameters.ShadowSocksPort; - ssBound.settings.clients[0].password = parameters.ShadowSocksPassword; - ssBound.settings.clients[0].method = parameters.ShadowSocksMethod; + ssBound.settings.password = parameters.ShadowSocksPassword; + ssBound.settings.method = parameters.ShadowSocksMethod; xrayConfig.inbounds.Add(JToken.FromObject(ssBound)); } diff --git a/ProxySuper.Core/Services/V2rayService.cs b/ProxySuper.Core/Services/V2rayService.cs index 5f5135f..c6d5236 100644 --- a/ProxySuper.Core/Services/V2rayService.cs +++ b/ProxySuper.Core/Services/V2rayService.cs @@ -78,7 +78,7 @@ namespace ProxySuper.Core.Services Progress.Desc = "重启V2ray服务"; RunCmd("systemctl restart caddy"); - RunCmd("systemctl restart V2ray"); + RunCmd("systemctl restart v2ray"); Progress.Percentage = 100; Progress.Step = "安装成功"; @@ -348,6 +348,10 @@ namespace ProxySuper.Core.Services Progress.Desc = "上传Web配置文件"; UploadCaddyFile(useCustomWeb: true); + Progress.Percentage = 90; + + Progress.Desc = "重启caddy服务"; + RunCmd("systemctl restart caddy"); Progress.Percentage = 100; Progress.Desc = "上传静态网站成功"; diff --git a/ProxySuper.Core/Services/XrayConfigBuilder.cs b/ProxySuper.Core/Services/XrayConfigBuilder.cs index 04ee9a3..d93a1ba 100644 --- a/ProxySuper.Core/Services/XrayConfigBuilder.cs +++ b/ProxySuper.Core/Services/XrayConfigBuilder.cs @@ -223,8 +223,8 @@ namespace ProxySuper.Core.Services { var ssBound = GetBound("Shadowsocks-AEAD.json"); ssBound.port = parameters.ShadowSocksPort; - ssBound.settings.clients[0].password = parameters.ShadowSocksPassword; - ssBound.settings.clients[0].method = parameters.ShadowSocksMethod; + ssBound.settings.password = parameters.ShadowSocksPassword; + ssBound.settings.method = parameters.ShadowSocksMethod; xrayConfig.inbounds.Add(JToken.FromObject(ssBound)); } diff --git a/ProxySuper.Core/Services/XrayService.cs b/ProxySuper.Core/Services/XrayService.cs index 7df4d7b..7dae882 100644 --- a/ProxySuper.Core/Services/XrayService.cs +++ b/ProxySuper.Core/Services/XrayService.cs @@ -350,6 +350,10 @@ namespace ProxySuper.Core.Services Progress.Desc = "上传Web配置文件"; UploadCaddyFile(useCustomWeb: true); + Progress.Percentage = 90; + + Progress.Desc = "重启caddy服务"; + RunCmd("systemctl restart caddy"); Progress.Percentage = 100; Progress.Desc = "上传静态网站成功"; diff --git a/ProxySuper.WPF/Templates/trojan-go/trojan-go.json b/ProxySuper.WPF/Templates/trojan-go/trojan-go.json index f9057a9..7e624a9 100644 --- a/ProxySuper.WPF/Templates/trojan-go/trojan-go.json +++ b/ProxySuper.WPF/Templates/trojan-go/trojan-go.json @@ -8,8 +8,8 @@ "" ], "ssl": { - "cert": "/usr/local/etc/trojan-go/trojan-go.crt", - "key": "/usr/local/etc/trojan-go/trojan-go.key", + "cert": "/usr/local/etc/trojan-go/ssl/trojan-go.crt", + "key": "/usr/local/etc/trojan-go/ssl/trojan-go.key", "sni": "example.com" }, "websocket": { diff --git a/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/Shadowsocks-AEAD.json b/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/Shadowsocks-AEAD.json index e7179e5..71b16ba 100644 --- a/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/Shadowsocks-AEAD.json +++ b/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/Shadowsocks-AEAD.json @@ -2,12 +2,8 @@ "port": 12345, "protocol": "shadowsocks", "settings": { - "clients": [ - { - "password": "", - "method": "aes-128-gcm" - } - ], + "password": "", + "method": "aes-128-gcm", "network": "tcp,udp" } } \ No newline at end of file diff --git a/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_TCP_TLS.json b/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_TCP_TLS.json index 40a4149..d007d6f 100644 --- a/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_TCP_TLS.json +++ b/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_TCP_TLS.json @@ -16,13 +16,12 @@ "security": "tls", "tlsSettings": { "alpn": [ - "h2", "http/1.1" ], "certificates": [ { - "certificateFile": "/usr/local/etc/v2ray/ssl/xray_ssl.crt", - "keyFile": "/usr/local/etc/v2ray/ssl/xray_ssl.key" + "certificateFile": "/usr/local/etc/v2ray/ssl/v2ray_ssl.crt", + "keyFile": "/usr/local/etc/v2ray/ssl/v2ray_ssl.key" } ] } diff --git a/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_gRPC.json b/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_gRPC.json index bab4d21..541a72f 100644 --- a/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_gRPC.json +++ b/ProxySuper.WPF/Templates/v2ray/server/05_inbounds/VLESS_gRPC.json @@ -20,8 +20,8 @@ ], "certificates": [ { - "certificateFile": "/usr/local/etc/xray/ssl/xray_ssl.crt", - "keyFile": "/usr/local/etc/xray/ssl/xray_ssl.key" + "certificateFile": "/usr/local/etc/v2ray/ssl/v2ray_ssl.crt", + "keyFile": "/usr/local/etc/v2ray/ssl/v2ray_ssl.key" } ] }, diff --git a/ProxySuper.WPF/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json b/ProxySuper.WPF/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json index e7179e5..71b16ba 100644 --- a/ProxySuper.WPF/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json +++ b/ProxySuper.WPF/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json @@ -2,12 +2,8 @@ "port": 12345, "protocol": "shadowsocks", "settings": { - "clients": [ - { - "password": "", - "method": "aes-128-gcm" - } - ], + "password": "", + "method": "aes-128-gcm", "network": "tcp,udp" } } \ No newline at end of file