From 628d11bd5ac4ad292bd2d03951b2c6612e1d8039 Mon Sep 17 00:00:00 2001 From: next-autumn Date: Thu, 18 Mar 2021 15:17:07 +0800 Subject: [PATCH 01/12] publish v 3.0.1 --- ProxySU_Core/Models/XraySettings.cs | 5 +- .../ViewModels/XraySettingsViewModel.cs | 72 +++++++++++++++++++ ProxySU_Core/Views/MainWindow.xaml | 1 + 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/ProxySU_Core/Models/XraySettings.cs b/ProxySU_Core/Models/XraySettings.cs index 56dbda9..d045e2c 100644 --- a/ProxySU_Core/Models/XraySettings.cs +++ b/ProxySU_Core/Models/XraySettings.cs @@ -21,9 +21,12 @@ namespace ProxySU_Core.Models Types = new List(); VLESS_WS_Path = "/vlessws"; VLESS_TCP_Path = "/vlesstcp"; + VLESS_H2_Path = "/vlessh2"; VMESS_WS_Path = "/vmessws"; VMESS_TCP_Path = "/vmesstcp"; + VMESS_H2_Path = "/vmessh2"; TrojanPassword = guid; + Trojan_WS_Path = "/trojanws"; } /// @@ -69,7 +72,7 @@ namespace ProxySU_Core.Models /// /// vmess http2 path /// - public string VMESS_HTTP2_Path { get; set; } + public string VMESS_H2_Path { get; set; } /// /// vmess mKcp seed diff --git a/ProxySU_Core/ViewModels/XraySettingsViewModel.cs b/ProxySU_Core/ViewModels/XraySettingsViewModel.cs index 54d1435..f11d618 100644 --- a/ProxySU_Core/ViewModels/XraySettingsViewModel.cs +++ b/ProxySU_Core/ViewModels/XraySettingsViewModel.cs @@ -50,6 +50,12 @@ namespace ProxySU_Core.ViewModels set => settings.VLESS_WS_Path = value; } + public string VLESS_H2_Path + { + get => settings.VLESS_H2_Path; + set => settings.VLESS_H2_Path = value; + } + public string VMESS_TCP_Path { get => settings.VMESS_TCP_Path; @@ -62,6 +68,12 @@ namespace ProxySU_Core.ViewModels set => settings.VMESS_WS_Path = value; } + public string VMESS_H2_Path + { + get => settings.VMESS_H2_Path; + set => settings.VMESS_H2_Path = value; + } + public string TrojanPassword { get => settings.TrojanPassword; @@ -134,6 +146,25 @@ namespace ProxySU_Core.ViewModels } } + public bool Checked_VLESS_H2 + { + get => settings.Types.Contains(XrayType.VLESS_H2_TLS); + set + { + if (value == true) + { + if (!settings.Types.Contains(XrayType.VLESS_H2_TLS)) + settings.Types.Add(XrayType.VLESS_H2_TLS); + } + else + { + settings.Types.Remove(XrayType.VLESS_H2_TLS); + } + Notify("Checked_VLESS_H2"); + Notify("VLESS_H2_Path_Visibility"); + } + } + public bool Checked_VMESS_TCP { get @@ -178,6 +209,24 @@ namespace ProxySU_Core.ViewModels } } + public bool Checked_VMESS_H2 + { + get => settings.Types.Contains(XrayType.VMESS_H2_TLS); + set + { + if (value == true) + { + if (!settings.Types.Contains(XrayType.VMESS_H2_TLS)) + settings.Types.Add(XrayType.VMESS_H2_TLS); + } + else + { + settings.Types.Remove(XrayType.VMESS_H2_TLS); + } + Notify("Checked_VMESS_H2"); + Notify("VMESS_H2_Path_Visibility"); + } + } public bool Checked_Trojan_TCP { get @@ -214,6 +263,14 @@ namespace ProxySU_Core.ViewModels return Checked_VLESS_WS ? Visibility.Visible : Visibility.Hidden; } } + public Visibility VLESS_H2_Path_Visibility + { + get + { + return Checked_VLESS_H2 ? Visibility.Visible : Visibility.Hidden; + } + } + public Visibility VMESS_TCP_Path_Visibility { get @@ -228,6 +285,13 @@ namespace ProxySU_Core.ViewModels return Checked_VMESS_WS ? Visibility.Visible : Visibility.Hidden; } } + public Visibility VMESS_H2_Path_Visibility + { + get + { + return Checked_VMESS_H2 ? Visibility.Visible : Visibility.Hidden; + } + } public Visibility Trojan_TCP_Pwd_Visibility { get @@ -248,6 +312,10 @@ namespace ProxySU_Core.ViewModels { get => ShareLink.Build(XrayType.VLESS_WS_TLS, settings); } + public string VLESS_H2_TLS_ShareLink + { + get => ShareLink.Build(XrayType.VLESS_H2_TLS, settings); + } public string VMESS_TCP_TLS_ShareLink { get => ShareLink.Build(XrayType.VMESS_TCP_TLS, settings); @@ -256,6 +324,10 @@ namespace ProxySU_Core.ViewModels { get => ShareLink.Build(XrayType.VMESS_WS_TLS, settings); } + public string VMESS_H2_TLS_ShareLink + { + get => ShareLink.Build(XrayType.VMESS_H2_TLS, settings); + } public string Trojan_TCP_TLS_ShareLink { get => ShareLink.Build(XrayType.Trojan_TCP_TLS, settings); diff --git a/ProxySU_Core/Views/MainWindow.xaml b/ProxySU_Core/Views/MainWindow.xaml index 2649b91..af4e8e0 100644 --- a/ProxySU_Core/Views/MainWindow.xaml +++ b/ProxySU_Core/Views/MainWindow.xaml @@ -26,6 +26,7 @@ From 6427f8de3d6ab8790716e60ebfa541b7e0553741 Mon Sep 17 00:00:00 2001 From: next-autumn Date: Thu, 18 Mar 2021 15:21:56 +0800 Subject: [PATCH 02/12] merge icon --- ProxySU_Core/ProxySU.ico | Bin 0 -> 16958 bytes ProxySU_Core/ProxySU_Core.csproj | 9 +++++++++ ProxySU_Core/Resources/ProxySU.ico | Bin 0 -> 16958 bytes 3 files changed, 9 insertions(+) create mode 100644 ProxySU_Core/ProxySU.ico create mode 100644 ProxySU_Core/Resources/ProxySU.ico diff --git a/ProxySU_Core/ProxySU.ico b/ProxySU_Core/ProxySU.ico new file mode 100644 index 0000000000000000000000000000000000000000..9d7a128c59c121d3e72c9d81575b05bde4971b2c GIT binary patch literal 16958 zcmeI3cZd{87r^H@@cug$Gw6C4PZ87;b6Nu!K~#*$f&u+QF=1A8F<`=+bIxMUaTRk~ z^O@J2vl!M?SHCw~{q^+pj2mWFclUcsZB18Kzk2z-s+sn9e$#)Ekskg3FVEjKJ)WE% zkLPdQ^pGc7H^v1by;Wo^0Om?CjyuFCOSI;zUM)K6XFQ zOq1i%a-2`9-r&{BjrudWGNVCvV*{G;*l;rc{rh)C`}XZyIG0H(?pXNO4^h*G4dUbD zRoAXv)zYO)Rj*#X)WU@e)uKg3I0?p<1zGg**#R+W!6f z)u&IN5{*MoH1&K^o=NgtXfyEj>sNL7@L`e1k|j&jh7B9k+qZ9(;b-Q|nd;uXduF;{ z|LWB%HDksMwQ18P_5S^P>pu2%?bp<;xefY}qn(>JrXh7}GSIwU$ebLLFI7>JDU z4Fkvty&8bW&6_uyOX;6Hd7{>=S>rQiF0h}ICr^qU1c|$5|85@pDLu9^efo4u{}6$` z?fkD=waUlenM3?=+5_VN&*KN@&Ye?7j~?|7`u~5Shx`rFe_q%|@aajDCP^HyF9Q7w z7A&xaun)!z@EM;E20V}M?eW(!|EKXzd`73}*iDD0PMz|Jf#}-Fzg<2KzT|S(u3eH# z>~`cfFSW*?|Hh3Q5~GQ4FJHcNU7B2IkB3Zh@=wkT({Rr8?!%a$D10T$?=mXPxgynW^H&y zF4R8M2yV1G^-p}KjtB-yw(Vi+|Geh~~-uU_pVzkU1mDe`vi;Puji=s@7%d#N9+0-zd3#Sw7PKN zg6sWo4^r1U*TyDq-@YAiX*c^PChpuxx#orA$B(PamoJ;kfIYeI>C>lvwNt%nsQP0=`UWtRq7C9J*jg1xG zz(3sDty{Ou)SuEne*9SN*s(+GnfQ#)lc&rWc1_Fz$cy+3@jp;IaNvN*^`|fs=0!Q< zLGLtdqgAU`a`r+LsgF+Jwz8= zvv=6GZJX2wpshkj$mWd+1OKo0tJ+FAMSi^!h{Jjm-&1S1f19B z&YfH3&!1nlZQEAG*=jR#9OK|HXBzN@Z6Q~DoN@Ls$cQoK!tch78`Y>$qvV=#YKfEr zaRgj6&Y^+<^*ww+54p&$Kl2=8b?ep@eAGTsQBkUB(V{+Qe((VfY?(F5>0I06IyE3V zVZ3kOzN%TXW-5F3?5cnN{xZh6y+$_cC$)#(3Kc2{&XFTW27R2l(8$^};-M3mQ?6V& zl{s@}In$@MAzpLtX@EK1yLT5H$fjn^nqm{=76a^ejqV2w7$CByHq4nbr_Z>VpOSvi zpg}@Q_3G7Kb!x{=-Ddc&Ql*ODcTe!vxN&2lkvhi6qd|iPKDap}D^;qLg=_5CvG!$D zoc0;RKXC^D7j=+XziHE^J~(|4B;kT{ID@lVwQ8zgzkYH?<#t{{jZO|U^Xu2IFLf)l z(b#VdA3j{}6Ym+TRH>3QKHGu4vB86l+wb$;pW(kojT+WHVrZd4h2*)?rAu4mcDzab z44=doXn_vw0pDXCY%fmh!q7(Fu3bBYt)NpwW66>w#m~__`*q?(!-frI?}LpG9z58O zte!o4%9@dpk^JqElh1(z2g-c>DimjZ@I?NDfBX`_K8Fn(rgG)VCH~vH zcW>Flakj>OjqkUqPpL_wqoWn~*|VDO{P_L~8D`6tO=LmdvY+7+yOB|uGG!!A6e&_f z6)afLsx6_ZR;^k>6S6h(hc@_P_u58I0KFLA$Gmb!O zL$hgd+J>N;eK7mfV#SK75+zDlIc)FVy&@}Y#^@B=gQnWGYx~dyPHYC*hU$Fd{{8#1 z7VDAc?0_#;tXNU*bKa5?AZJkL5X-4?48Rj-9IQWj^l0IieIGt(KMOPSiLLCBLj|l~ zzI=IEpZ$OnsA-@rCAGg3r}G*bIL9L|@ZCTdARe697rsrbYT2@-_%dfurncn##R;6V zz(3zxgd31U7y#b+4%n(8;m56E>%=s4fsGLxsFCW`tCuLh4+HI?Knd^i`v-iuMT-^^ zpH2R9lY<#!PW$%lef%{P1f?<#c;9K(#Kzd~T)cQu&KtXQ>7tr6X(Bm?*h=o9=Ee@p zxw?5ajrQ>Vzal&U6UfE108`THFuX^lRpLWHH@ruL08d&)A@2%l;=}s;*I!gP^843> z-@tkc{9lyNFp*{d{d0!?{duZQZe+uD@CV6z*lcy zU2f|Muf5lqZ+rVcOdsRD{@wJ^-s|6-y?6Nk{}U?#r~J%yj2D3=@7vz%KTL1*Wb|hA MX!L67IYICL0XR=#Gynhq literal 0 HcmV?d00001 diff --git a/ProxySU_Core/ProxySU_Core.csproj b/ProxySU_Core/ProxySU_Core.csproj index 8de2020..c4f6a22 100644 --- a/ProxySU_Core/ProxySU_Core.csproj +++ b/ProxySU_Core/ProxySU_Core.csproj @@ -64,6 +64,9 @@ false + + ProxySU.ico + ..\packages\ControlzEx.5.0.0\lib\net452\ControlzEx.dll @@ -333,6 +336,12 @@ false + + + + + + diff --git a/ProxySU_Core/Resources/ProxySU.ico b/ProxySU_Core/Resources/ProxySU.ico new file mode 100644 index 0000000000000000000000000000000000000000..9d7a128c59c121d3e72c9d81575b05bde4971b2c GIT binary patch literal 16958 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 MX!L67IYICL0XR=#Gynhq literal 0 HcmV?d00001 From 34f4addd917a68f03f67e98c7d006f6ba9b6f02c Mon Sep 17 00:00:00 2001 From: next-autumn Date: Thu, 18 Mar 2021 15:54:45 +0800 Subject: [PATCH 03/12] fix vless ws config issue --- .../Models/Developers/ConfigBuilder.cs | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/ProxySU_Core/Models/Developers/ConfigBuilder.cs b/ProxySU_Core/Models/Developers/ConfigBuilder.cs index 78bb2d8..0d0e502 100644 --- a/ProxySU_Core/Models/Developers/ConfigBuilder.cs +++ b/ProxySU_Core/Models/Developers/ConfigBuilder.cs @@ -113,29 +113,28 @@ namespace ProxySU_Core.Models.Developers baseBound.settings.fallbacks.Add(JToken.FromObject(new { dest = VLESS_WS_Port, - path = parameters.VLESS_WS_Path + path = parameters.VLESS_WS_Path, + xver = 1, })); xrayConfig.inbounds.Add(JToken.FromObject(wsInbound)); } - if (parameters.Types.Contains(XrayType.VLESS_H2_TLS)) - { - var h2Inbound = LoadJsonObj(Path.Combine(ServerInboundsDir, "VLESS_HTTP2_TLS.json")); - h2Inbound.port = VLESS_H2_Port; - h2Inbound.settings.clients[0].id = parameters.UUID; - h2Inbound.streamSettings.httpSettings.path = parameters.VLESS_H2_Path; - baseBound.settings.fallbacks.Add(JToken.FromObject(new - { - dest = VLESS_H2_Port, - path = parameters.VLESS_H2_Path - })); - xrayConfig.inbounds.Add(JToken.FromObject(h2Inbound)); - } + //if (parameters.Types.Contains(XrayType.VLESS_H2_TLS)) + //{ + // var h2Inbound = LoadJsonObj(Path.Combine(ServerInboundsDir, "VLESS_HTTP2_TLS.json")); + // h2Inbound.port = VLESS_H2_Port; + // h2Inbound.settings.clients[0].id = parameters.UUID; + // h2Inbound.streamSettings.httpSettings.path = parameters.VLESS_H2_Path; + // baseBound.settings.fallbacks.Add(JToken.FromObject(new + // { + // dest = VLESS_H2_Port, + // path = parameters.VLESS_H2_Path, + // xver = 1, + // })); + // xrayConfig.inbounds.Add(JToken.FromObject(h2Inbound)); + //} + - if (parameters.Types.Contains(XrayType.VLESS_mKCP_Speed)) - { - var kcpInbound = LoadJsonObj(Path.Combine(ServerInboundsDir, "VLESS_mKCP")); - } if (parameters.Types.Contains(XrayType.VMESS_TCP_TLS)) { @@ -167,10 +166,6 @@ namespace ProxySU_Core.Models.Developers xrayConfig.inbounds.Add(JToken.FromObject(mwsBound)); } - if (parameters.Types.Contains(XrayType.VMESS_H2_TLS)) { } - - if (parameters.Types.Contains(XrayType.VMESS_mKCP_Speed)) { } - if (parameters.Types.Contains(XrayType.Trojan_TCP_TLS)) { var trojanTcpBound = LoadJsonObj(Path.Combine(ServerInboundsDir, "Trojan_TCP_TLS.json")); From 0c146f176d27329ecb587b9632cb370f7e3011b9 Mon Sep 17 00:00:00 2001 From: next-autumn Date: Fri, 26 Mar 2021 11:28:41 +0800 Subject: [PATCH 04/12] add uninstall xray fix text issue --- ProxySU_Core/Models/Developers/Project.cs | 31 +++------- ProxySU_Core/Models/Developers/XrayProject.cs | 34 ++++++++++- .../server/05_inbounds/VLESS_TCP_XTLS.json | 6 +- .../ViewModels/XraySettingsViewModel.cs | 6 +- ProxySU_Core/Views/ClientInfoWindow.xaml | 2 +- ProxySU_Core/Views/MainWindow.xaml | 6 +- ProxySU_Core/Views/RecordEditorWindow.xaml | 58 +++++++++++-------- ProxySU_Core/Views/RecordEditorWindow.xaml.cs | 5 ++ ProxySU_Core/Views/TerminalWindow.xaml | 9 ++- ProxySU_Core/Views/TerminalWindow.xaml.cs | 22 ++++++- 10 files changed, 121 insertions(+), 58 deletions(-) diff --git a/ProxySU_Core/Models/Developers/Project.cs b/ProxySU_Core/Models/Developers/Project.cs index c0bc53a..414f3ad 100644 --- a/ProxySU_Core/Models/Developers/Project.cs +++ b/ProxySU_Core/Models/Developers/Project.cs @@ -357,29 +357,16 @@ namespace ProxySU_Core.Models.Developers RunCmd("rm -rf caddy_install.sh"); RunCmd("curl -o caddy_install.sh https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh"); RunCmd("yes | bash caddy_install.sh"); + RunCmd("rm -rf caddy_install.sh"); + } - //if (CmdType == CmdType.Apt) - //{ - // RunCmd("sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https"); - // RunCmd("curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo apt-key add -"); - // RunCmd("curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list"); - // RunCmd(GetUpdateCmd()); - // RunCmd("sudo apt install caddy"); - //} - //else if (CmdType == CmdType.Dnf) - //{ - // RunCmd("echo y | dnf install 'dnf-command(copr)'"); - // RunCmd("echo y | dnf copr enable @caddy/caddy"); - // RunCmd(GetUpdateCmd()); - // RunCmd("dnf install caddy"); - //} - //else if (CmdType == CmdType.Yum) - //{ - // RunCmd("echo y | echo y | yum install yum-plugin-copr"); - // RunCmd("echo y | echo y | yum copr enable @caddy/caddy"); - // RunCmd(GetUpdateCmd()); - // RunCmd("yum install caddy"); - //} + protected void UninstallCaddy() + { + RunCmd("rm -rf caddy_install.sh"); + RunCmd("curl -o caddy_install.sh https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh"); + RunCmd("yes | bash caddy_install.sh uninstall"); + RunCmd("rm -rf caddy_install.sh"); + RunCmd("rm -rf /usr/share/caddy"); } diff --git a/ProxySU_Core/Models/Developers/XrayProject.cs b/ProxySU_Core/Models/Developers/XrayProject.cs index 4c65360..309f5fe 100644 --- a/ProxySU_Core/Models/Developers/XrayProject.cs +++ b/ProxySU_Core/Models/Developers/XrayProject.cs @@ -69,7 +69,7 @@ namespace ProxySU_Core.Models.Developers ConfigureFirewall(); WriteOutput("防火墙配置完成"); - WriteOutput("同步系统和本地世间..."); + WriteOutput("同步系统和本地时间..."); SyncTimeDiff(); WriteOutput("时间同步完成"); @@ -96,10 +96,25 @@ namespace ProxySU_Core.Models.Developers } catch (Exception ex) { - MessageBox.Show("安装终止," + ex.Message); + var errorLog = "安装终止," + ex.Message; + WriteOutput(errorLog); + MessageBox.Show(errorLog); } } + public void Uninstall() + { + EnsureRootAuth(); + WriteOutput("卸载Caddy"); + UninstallCaddy(); + WriteOutput("卸载Xray"); + UninstallXray(); + WriteOutput("卸载证书"); + UninstallAcme(); + + WriteOutput("************ 卸载完成 ************"); + } + /// /// 更新xray内核 /// @@ -286,12 +301,24 @@ namespace ProxySU_Core.Models.Developers } + private void UninstallXray() + { + RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ remove"); + } + + private void UninstallAcme() + { + RunCmd("acme.sh --uninstall"); + RunCmd("rm -r ~/.acme.sh"); + } + private void InstallXrayWithCert() { RunCmd("bash -c \"$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)\" @ install"); if (!FileExists("/usr/local/bin/xray")) { + WriteOutput("Xray-Core安装失败,请联系开发者"); throw new Exception("Xray-Core安装失败,请联系开发者"); } @@ -333,6 +360,7 @@ namespace ProxySU_Core.Models.Developers } else { + WriteOutput("安装 acme.sh 失败,请联系开发者!"); throw new Exception("安装 acme.sh 失败,请联系开发者!"); } @@ -357,6 +385,7 @@ namespace ProxySU_Core.Models.Developers } else { + WriteOutput("申请证书失败,请联系开发者!"); throw new Exception("申请证书失败,请联系开发者!"); } @@ -370,6 +399,7 @@ namespace ProxySU_Core.Models.Developers } else { + WriteOutput("安装证书失败,请联系开发者!"); throw new Exception("安装证书失败,请联系开发者!"); } diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_TCP_XTLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_TCP_XTLS.json index d8cddd9..eab8363 100644 --- a/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_TCP_XTLS.json +++ b/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_TCP_XTLS.json @@ -15,7 +15,11 @@ "network": "tcp", "security": "xtls", "xtlsSettings": { - "alpn": [ "h2", "http/1.1" ], + "allowInsecure": false, + "minVersion": "1.2", + "alpn": [ + "http/1.1" + ], "certificates": [ { "certificateFile": "/usr/local/etc/xray/ssl/xray_ssl.crt", diff --git a/ProxySU_Core/ViewModels/XraySettingsViewModel.cs b/ProxySU_Core/ViewModels/XraySettingsViewModel.cs index f11d618..3f81ca1 100644 --- a/ProxySU_Core/ViewModels/XraySettingsViewModel.cs +++ b/ProxySU_Core/ViewModels/XraySettingsViewModel.cs @@ -23,7 +23,11 @@ namespace ProxySU_Core.ViewModels public string UUID { get => settings.UUID; - set => settings.UUID = value; + set + { + settings.UUID = value; + Notify("UUID"); + } } public string Domain diff --git a/ProxySU_Core/Views/ClientInfoWindow.xaml b/ProxySU_Core/Views/ClientInfoWindow.xaml index 3380bc7..a20fb09 100644 --- a/ProxySU_Core/Views/ClientInfoWindow.xaml +++ b/ProxySU_Core/Views/ClientInfoWindow.xaml @@ -254,7 +254,7 @@ + Header="VMESS-WebSocket-TLS"> public string Trojan_WS_Path { get; set; } + #endregion + + #region ShadowsocksAEAD + /// + /// ss password + /// + public string ShadowsocksPassword { get; set; } + + /// + /// ss method + /// + public string ShadowsocksMethod { get; set; } + #endregion + /// /// 域名 @@ -109,26 +130,24 @@ namespace ProxySU_Core.Models { switch (type) { - case XrayType.VLESS_TCP_TLS: - return VLESS_TCP_Path; - case XrayType.VLESS_TCP_XTLS: - return VLESS_TCP_Path; - case XrayType.VLESS_WS_TLS: + case XrayType.VLESS_WS: return VLESS_WS_Path; - case XrayType.VLESS_H2_TLS: + case XrayType.VLESS_H2: return VLESS_H2_Path; - case XrayType.VMESS_TCP_TLS: + case XrayType.VMESS_TCP: return VMESS_TCP_Path; - case XrayType.VMESS_WS_TLS: + case XrayType.VMESS_WS: return VMESS_WS_Path; - case XrayType.Trojan_WS_TLS: + case XrayType.Trojan_WS: return Trojan_WS_Path; // no path - case XrayType.VLESS_mKCP_Speed: - case XrayType.Trojan_TCP_TLS: - case XrayType.VMESS_mKCP_Speed: + case XrayType.VLESS_TCP_XTLS: + case XrayType.VLESS_TCP: + case XrayType.VLESS_KCP: + case XrayType.VMESS_KCP: + case XrayType.Trojan_TCP: return string.Empty; default: return string.Empty; @@ -144,19 +163,22 @@ namespace ProxySU_Core.Models VLESS_TCP_XTLS = 100, // vless 101开头 - VLESS_TCP_TLS = 101, - VLESS_WS_TLS = 102, - VLESS_H2_TLS = 103, - VLESS_mKCP_Speed = 104, + VLESS_TCP = 101, + VLESS_WS = 102, + VLESS_H2 = 103, + VLESS_KCP = 104, // vmess 201开头 - VMESS_TCP_TLS = 201, - VMESS_WS_TLS = 202, - VMESS_H2_TLS = 203, - VMESS_mKCP_Speed = 204, + VMESS_TCP = 201, + VMESS_WS = 202, + VMESS_H2 = 203, + VMESS_KCP = 204, // trojan 301开头 - Trojan_TCP_TLS = 301, - Trojan_WS_TLS = 302, + Trojan_TCP = 301, + Trojan_WS = 302, + + // ss + ShadowsocksAEAD = 401 } } diff --git a/ProxySU_Core/ProxySU_Core.csproj b/ProxySU_Core/ProxySU_Core.csproj index c4f6a22..45af54e 100644 --- a/ProxySU_Core/ProxySU_Core.csproj +++ b/ProxySU_Core/ProxySU_Core.csproj @@ -122,6 +122,7 @@ + @@ -138,6 +139,7 @@ + @@ -241,34 +243,35 @@ PreserveNewest - + + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json b/ProxySU_Core/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json new file mode 100644 index 0000000..5b18d5c --- /dev/null +++ b/ProxySU_Core/Templates/xray/server/05_inbounds/Shadowsocks-AEAD.json @@ -0,0 +1,13 @@ +{ + "port": 12345, + "protocol": "shadowsocks", + "settings": { + "clients": [ + { + "password": "example_user_1", + "method": "aes-128-gcm" + } + ], + "network": "tcp,udp" + } +} \ No newline at end of file diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_TCP_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_TCP.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_TCP_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_TCP.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_WS_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_WS.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_WS_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/Trojan_WS.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_HTTP2_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_HTTP2.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_HTTP2_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_HTTP2.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_mKCP.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_KCP.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_mKCP.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_KCP.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_WS_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_WS.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_WS_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VLESS_WS.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_HTTP2_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_HTTP2.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_HTTP2_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_HTTP2.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_mKCP.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_KCP.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_mKCP.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_KCP.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_TCP_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_TCP.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_TCP_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_TCP.json diff --git a/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_WS_TLS.json b/ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_WS.json similarity index 100% rename from ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_WS_TLS.json rename to ProxySU_Core/Templates/xray/server/05_inbounds/VMESS_WS.json diff --git a/ProxySU_Core/ViewModels/IdValueViewModel.cs b/ProxySU_Core/ViewModels/IdValueViewModel.cs new file mode 100644 index 0000000..d7b8fbf --- /dev/null +++ b/ProxySU_Core/ViewModels/IdValueViewModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySU_Core.ViewModels +{ + public class IdValueViewModel + { + public IdValueViewModel(int id, string value) + { + Id = id; + Value = value; + } + + public int Id { get; set; } + + public string Value { get; set; } + } +} diff --git a/ProxySU_Core/ViewModels/XraySettingsViewModel.cs b/ProxySU_Core/ViewModels/XraySettingsViewModel.cs index 3f81ca1..8525b34 100644 --- a/ProxySU_Core/ViewModels/XraySettingsViewModel.cs +++ b/ProxySU_Core/ViewModels/XraySettingsViewModel.cs @@ -3,21 +3,24 @@ using ProxySU_Core.Common; using ProxySU_Core.Models; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web; using System.Windows; +using System.Windows.Controls; namespace ProxySU_Core.ViewModels { - public class XraySettingsViewModel : BaseViewModel + public partial class XraySettingsViewModel : BaseViewModel { public XraySettings settings; public XraySettingsViewModel(XraySettings parameters) { this.settings = parameters; + Notify("VMESS_KCP_Type"); } public string UUID @@ -42,299 +45,225 @@ namespace ProxySU_Core.ViewModels set => settings.MaskDomain = value; } - public string VLESS_TCP_Path - { - get => settings.VLESS_TCP_Path; - set => settings.VLESS_TCP_Path = value; - } - - public string VLESS_WS_Path - { - get => settings.VLESS_WS_Path; - set => settings.VLESS_WS_Path = value; - } - - public string VLESS_H2_Path - { - get => settings.VLESS_H2_Path; - set => settings.VLESS_H2_Path = value; - } - - public string VMESS_TCP_Path - { - get => settings.VMESS_TCP_Path; - set => settings.VMESS_TCP_Path = value; - } - - public string VMESS_WS_Path - { - get => settings.VMESS_WS_Path; - set => settings.VMESS_WS_Path = value; - } - - public string VMESS_H2_Path - { - get => settings.VMESS_H2_Path; - set => settings.VMESS_H2_Path = value; - } public string TrojanPassword { get => settings.TrojanPassword; set => settings.TrojanPassword = value; } - - public bool Checked_VLESS_TCP - { - get - { - return settings.Types.Contains(XrayType.VLESS_TCP_TLS); - } - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VLESS_TCP_TLS)) - settings.Types.Add(XrayType.VLESS_TCP_TLS); - - } - else - { - settings.Types.Remove(XrayType.VLESS_TCP_TLS); - } - Notify("Checked_VLESS_TCP"); - Notify("VLESS_TCP_Path_Visibility"); - } - } - - public bool Checked_VLESS_XTLS - { - get - { - return settings.Types.Contains(XrayType.VLESS_TCP_XTLS); - } - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VLESS_TCP_XTLS)) - settings.Types.Add(XrayType.VLESS_TCP_XTLS); - } - else - { - settings.Types.Remove(XrayType.VLESS_TCP_XTLS); - } - Notify("Checked_VLESS_XTLS"); - } - } - - public bool Checked_VLESS_WS - { - get - { - return settings.Types.Contains(XrayType.VLESS_WS_TLS); - } - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VLESS_WS_TLS)) - settings.Types.Add(XrayType.VLESS_WS_TLS); - } - else - { - settings.Types.Remove(XrayType.VLESS_WS_TLS); - } - Notify("Checked_VLESS_WS"); - Notify("VLESS_WS_Path_Visibility"); - } - } - - public bool Checked_VLESS_H2 - { - get => settings.Types.Contains(XrayType.VLESS_H2_TLS); - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VLESS_H2_TLS)) - settings.Types.Add(XrayType.VLESS_H2_TLS); - } - else - { - settings.Types.Remove(XrayType.VLESS_H2_TLS); - } - Notify("Checked_VLESS_H2"); - Notify("VLESS_H2_Path_Visibility"); - } - } - - public bool Checked_VMESS_TCP - { - get - { - return settings.Types.Contains(XrayType.VMESS_TCP_TLS); - } - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VMESS_TCP_TLS)) - settings.Types.Add(XrayType.VMESS_TCP_TLS); - } - else - { - settings.Types.Remove(XrayType.VMESS_TCP_TLS); - } - Notify("Checked_VMESS_TCP"); - Notify("VMESS_TCP_Path_Visibility"); - } - } - - public bool Checked_VMESS_WS - { - get - { - return settings.Types.Contains(XrayType.VMESS_WS_TLS); - } - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VMESS_WS_TLS)) - settings.Types.Add(XrayType.VMESS_WS_TLS); - } - else - { - settings.Types.Remove(XrayType.VMESS_WS_TLS); - } - Notify("Checked_VMESS_WS"); - Notify("VMESS_WS_Path_Visibility"); - } - } - - public bool Checked_VMESS_H2 - { - get => settings.Types.Contains(XrayType.VMESS_H2_TLS); - set - { - if (value == true) - { - if (!settings.Types.Contains(XrayType.VMESS_H2_TLS)) - settings.Types.Add(XrayType.VMESS_H2_TLS); - } - else - { - settings.Types.Remove(XrayType.VMESS_H2_TLS); - } - Notify("Checked_VMESS_H2"); - Notify("VMESS_H2_Path_Visibility"); - } - } public bool Checked_Trojan_TCP { get { - return settings.Types.Contains(XrayType.Trojan_TCP_TLS); + return settings.Types.Contains(XrayType.Trojan_TCP); } set { if (value == true) { - if (!settings.Types.Contains(XrayType.Trojan_TCP_TLS)) - settings.Types.Add(XrayType.Trojan_TCP_TLS); + if (!settings.Types.Contains(XrayType.Trojan_TCP)) + settings.Types.Add(XrayType.Trojan_TCP); } else { - settings.Types.Remove(XrayType.Trojan_TCP_TLS); + settings.Types.Remove(XrayType.Trojan_TCP); } Notify("Checked_Trojan_TCP"); - Notify("Trojan_TCP_Pwd_Visibility"); + } + } + public string Trojan_TCP_ShareLink + { + get => ShareLink.Build(XrayType.Trojan_TCP, settings); + } + + private List _ssMethods = new List { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305" }; + public List ShadowSocksMethods => _ssMethods; + public bool CheckedShadowSocks + { + + get => settings.Types.Contains(XrayType.ShadowsocksAEAD); + set + { + CheckBoxChanged(value, XrayType.ShadowsocksAEAD); + Notify("CheckedShadowSocks"); + } + } + public string ShadowSocksPassword + { + get => settings.ShadowsocksPassword; + set => settings.ShadowsocksPassword = value; + } + public string ShadowSocksMethod + { + get => settings.ShadowsocksMethod; + set + { + var namespaceStr = typeof(ComboBoxItem).FullName + ":"; + var trimValue = value.Replace(namespaceStr, ""); + trimValue = trimValue.Trim(); + settings.ShadowsocksMethod = trimValue; + Notify("ShadowSocksMethod"); + } + } + public string ShadowSocksShareLink + { + get => ShareLink.Build(XrayType.ShadowsocksAEAD, settings); + } + + + private void CheckBoxChanged(bool value, XrayType type) + { + if (value == true) + { + if (!settings.Types.Contains(type)) + { + settings.Types.Add(type); + } + } + else + { + settings.Types.RemoveAll(x => x == type); } } - public Visibility VLESS_TCP_Path_Visibility + } + + public partial class XraySettingsViewModel + { + // vmess tcp + public bool Checked_VMESS_TCP { - get + get => settings.Types.Contains(XrayType.VMESS_TCP); + set { - return Checked_VLESS_TCP ? Visibility.Visible : Visibility.Hidden; + CheckBoxChanged(value, XrayType.VMESS_TCP); + Notify("Checked_VMESS_TCP"); } } - public Visibility VLESS_WS_Path_Visibility + public string VMESS_TCP_Path { - get - { - return Checked_VLESS_WS ? Visibility.Visible : Visibility.Hidden; - } + get => settings.VMESS_TCP_Path; + set => settings.VMESS_TCP_Path = value; } - public Visibility VLESS_H2_Path_Visibility + public string VMESS_TCP_ShareLink { - get - { - return Checked_VLESS_H2 ? Visibility.Visible : Visibility.Hidden; - } + get => ShareLink.Build(XrayType.VMESS_TCP, settings); } - public Visibility VMESS_TCP_Path_Visibility + // vmess ws + public bool Checked_VMESS_WS { - get + get => settings.Types.Contains(XrayType.VMESS_WS); + set { - return Checked_VMESS_TCP ? Visibility.Visible : Visibility.Hidden; + CheckBoxChanged(value, XrayType.VMESS_WS); + Notify("Checked_VMESS_WS"); } } - public Visibility VMESS_WS_Path_Visibility + public string VMESS_WS_Path { - get - { - return Checked_VMESS_WS ? Visibility.Visible : Visibility.Hidden; - } + get => settings.VMESS_WS_Path; + set => settings.VMESS_WS_Path = value; } - public Visibility VMESS_H2_Path_Visibility + public string VMESS_WS_TLS_ShareLink { - get - { - return Checked_VMESS_H2 ? Visibility.Visible : Visibility.Hidden; - } - } - public Visibility Trojan_TCP_Pwd_Visibility - { - get - { - return Checked_Trojan_TCP ? Visibility.Visible : Visibility.Hidden; - } + get => ShareLink.Build(XrayType.VMESS_WS, settings); } + // vmess kcp + public string VMESS_KCP_Seed + { + get => settings.VMESS_KCP_Seed; + set => settings.VMESS_KCP_Seed = value; + } + public string VMESS_KCP_Type + { + get => settings.VMESS_KCP_Type; + set + { + var namespaceStr = typeof(ComboBoxItem).FullName + ":"; + var trimValue = value.Replace(namespaceStr, ""); + trimValue = trimValue.Trim(); + settings.VMESS_KCP_Type = trimValue; + Notify("VMESS_KCP_Type"); + } + } + public bool Checked_VMESS_KCP + { + get => settings.Types.Contains(XrayType.VMESS_KCP); + set + { + CheckBoxChanged(value, XrayType.VMESS_KCP); + Notify("Checked_VMESS_KCP"); + } + } + public string VMESS_KCP_ShareLink + { + get => ShareLink.Build(XrayType.VMESS_KCP, settings); + } + + + private List _kcpTypes = new List { "none", "srtp", "utp", "wechat-video", "dtls", "wireguard", }; + public List KcpTypes => _kcpTypes; + } + + + public partial class XraySettingsViewModel + { + + // vless xtls + public bool Checked_VLESS_TCP_XTLS + { + get => settings.Types.Contains(XrayType.VLESS_TCP_XTLS); + set + { + CheckBoxChanged(value, XrayType.VLESS_TCP_XTLS); + Notify("Checked_VLESS_XTLS"); + } + } public string VLESS_TCP_XTLS_ShareLink { get => ShareLink.Build(XrayType.VLESS_TCP_XTLS, settings); } - public string VLESS_TCP_TLS_ShareLink + + + // vless tcp + public bool Checked_VLESS_TCP { - get => ShareLink.Build(XrayType.VLESS_TCP_TLS, settings); + get => settings.Types.Contains(XrayType.VLESS_TCP); + set + { + CheckBoxChanged(value, XrayType.VLESS_TCP); + Notify("Checked_VLESS_TCP"); + } } - public string VLESS_WS_TLS_ShareLink + public string VLESS_TCP_ShareLink { - get => ShareLink.Build(XrayType.VLESS_WS_TLS, settings); + get => ShareLink.Build(XrayType.VLESS_TCP, settings); } - public string VLESS_H2_TLS_ShareLink + + + // vless ws + public string VLESS_WS_Path { - get => ShareLink.Build(XrayType.VLESS_H2_TLS, settings); + get => settings.VLESS_WS_Path; + set => settings.VLESS_WS_Path = value; } - public string VMESS_TCP_TLS_ShareLink + public bool Checked_VLESS_WS { - get => ShareLink.Build(XrayType.VMESS_TCP_TLS, settings); + get + { + return settings.Types.Contains(XrayType.VLESS_WS); + } + set + { + CheckBoxChanged(value, XrayType.VLESS_WS); + Notify("Checked_VLESS_WS"); + } } - public string VMESS_WS_TLS_ShareLink + public string VLESS_WS_ShareLink { - get => ShareLink.Build(XrayType.VMESS_WS_TLS, settings); - } - public string VMESS_H2_TLS_ShareLink - { - get => ShareLink.Build(XrayType.VMESS_H2_TLS, settings); - } - public string Trojan_TCP_TLS_ShareLink - { - get => ShareLink.Build(XrayType.Trojan_TCP_TLS, settings); + get => ShareLink.Build(XrayType.VLESS_WS, settings); } } diff --git a/ProxySU_Core/Views/ClientInfoWindow.xaml b/ProxySU_Core/Views/ClientInfoWindow.xaml index a20fb09..251b01f 100644 --- a/ProxySU_Core/Views/ClientInfoWindow.xaml +++ b/ProxySU_Core/Views/ClientInfoWindow.xaml @@ -34,7 +34,7 @@ @@ -69,7 +69,7 @@ @@ -130,7 +130,7 @@ diff --git a/ProxySU_Core/Views/RecordEditorWindow.xaml b/ProxySU_Core/Views/RecordEditorWindow.xaml index 988ea11..ce79ebb 100644 --- a/ProxySU_Core/Views/RecordEditorWindow.xaml +++ b/ProxySU_Core/Views/RecordEditorWindow.xaml @@ -13,6 +13,7 @@ + @@ -98,7 +99,7 @@ Content="{DynamicResource KeyLogin}" /> - + @@ -278,39 +292,97 @@ - - - - - @@ -191,7 +194,7 @@ @@ -247,7 +250,7 @@ @@ -303,7 +306,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -329,11 +388,41 @@ + + + + + + + + + + + + + + + + + From f81f79367f3a45320e3b552361389be9a74419e1 Mon Sep 17 00:00:00 2001 From: next-autumn <73510229+next-autumn@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:19:41 +0800 Subject: [PATCH 07/12] Create version.json --- version.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 version.json diff --git a/version.json b/version.json new file mode 100644 index 0000000..8871097 --- /dev/null +++ b/version.json @@ -0,0 +1,14 @@ +{ + "version":"3.1.0", + "url":"http://rbsoft.org/downloads/AutoUpdaterTest.zip", + "changelog":"https://github.com/ravibpatel/AutoUpdater.NET/releases", + "mandatory":{ + "value":true, + "minVersion": "3.1.0", + "mode":1 + }, + "checksum":{ + "value":"E5F59E50FC91A9E52634FFCB11F32BD37FE0E2F1", + "hashingAlgorithm":"SHA1" + } +} From f84dc13ec7695ee524bae427f5e21defaafe49e7 Mon Sep 17 00:00:00 2001 From: next-autumn <73510229+next-autumn@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:27:06 +0800 Subject: [PATCH 08/12] Update version.json --- version.json | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/version.json b/version.json index 8871097..4c57362 100644 --- a/version.json +++ b/version.json @@ -1,14 +1,7 @@ -{ - "version":"3.1.0", - "url":"http://rbsoft.org/downloads/AutoUpdaterTest.zip", - "changelog":"https://github.com/ravibpatel/AutoUpdater.NET/releases", - "mandatory":{ - "value":true, - "minVersion": "3.1.0", - "mode":1 - }, - "checksum":{ - "value":"E5F59E50FC91A9E52634FFCB11F32BD37FE0E2F1", - "hashingAlgorithm":"SHA1" - } -} + + + 3.1.0 + http://rbsoft.org/downloads/AutoUpdaterTest.zip + https://github.com/ravibpatel/AutoUpdater.NET/releases + false + From f4f9eceb6a4477d305079b53d19c6157d1991c2f Mon Sep 17 00:00:00 2001 From: next-autumn <73510229+next-autumn@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:32:11 +0800 Subject: [PATCH 09/12] Update version.json --- version.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.json b/version.json index 4c57362..d69ed1b 100644 --- a/version.json +++ b/version.json @@ -1,7 +1,7 @@ 3.1.0 - http://rbsoft.org/downloads/AutoUpdaterTest.zip - https://github.com/ravibpatel/AutoUpdater.NET/releases + https://github.com/proxysu/ProxySU/releases/download/v3.0.1/ProySU-Core.zip + https://github.com/proxysu/ProxySU/releases/tag/v3.0.1 false From aadd003fbce5a85c81bc65839d21af6d0d3fbacf Mon Sep 17 00:00:00 2001 From: next-autumn <73510229+next-autumn@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:16:22 +0800 Subject: [PATCH 10/12] Delete version.json --- version.json | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 version.json diff --git a/version.json b/version.json deleted file mode 100644 index d69ed1b..0000000 --- a/version.json +++ /dev/null @@ -1,7 +0,0 @@ - - - 3.1.0 - https://github.com/proxysu/ProxySU/releases/download/v3.0.1/ProySU-Core.zip - https://github.com/proxysu/ProxySU/releases/tag/v3.0.1 - false - From 83d6d045780d6eedf1f009450de75dce85a855b4 Mon Sep 17 00:00:00 2001 From: nuxt-autumn Date: Sat, 27 Mar 2021 22:18:56 +0800 Subject: [PATCH 11/12] fix issue --- ProxySU_Core/Models/Developers/IParameters.cs | 2 + ProxySU_Core/Models/Developers/Project.cs | 96 +++++++++++++------ ProxySU_Core/Models/Developers/XrayProject.cs | 3 + ProxySU_Core/Views/TerminalWindow.xaml.cs | 2 + 4 files changed, 76 insertions(+), 27 deletions(-) diff --git a/ProxySU_Core/Models/Developers/IParameters.cs b/ProxySU_Core/Models/Developers/IParameters.cs index 11554c0..e532214 100644 --- a/ProxySU_Core/Models/Developers/IParameters.cs +++ b/ProxySU_Core/Models/Developers/IParameters.cs @@ -9,5 +9,7 @@ namespace ProxySU_Core.Models.Developers int Port { get; set; } string Domain { get; set; } + + List Types { get; set; } } } diff --git a/ProxySU_Core/Models/Developers/Project.cs b/ProxySU_Core/Models/Developers/Project.cs index 414f3ad..7f23b83 100644 --- a/ProxySU_Core/Models/Developers/Project.cs +++ b/ProxySU_Core/Models/Developers/Project.cs @@ -222,10 +222,7 @@ namespace ProxySU_Core.Models.Developers } } - /// - /// 配置防火墙 - /// - protected void ConfigureFirewall() + protected void ClosePort(params int[] portList) { string cmd; @@ -240,43 +237,88 @@ namespace ProxySU_Core.Models.Developers RunCmd("systemctl restart firewalld"); } - if (Parameters.Port == 443) + foreach (var port in portList) { - RunCmd("firewall-cmd --zone=public --add-port=80/tcp --permanent"); - RunCmd("firewall-cmd --zone=public --add-port=443/tcp --permanent"); - RunCmd("firewall-cmd --zone=public --add-port=80/udp --permanent"); - RunCmd("firewall-cmd --zone=public --add-port=443/udp --permanent"); - RunCmd("yes | firewall-cmd --reload"); + RunCmd($"firewall-cmd --zone=public --remove-port={port}/tcp --permanent"); + RunCmd($"firewall-cmd --zone=public --remove-port={port}/udp --permanent"); } - else - { - RunCmd($"firewall-cmd --zone=public --add-port={Parameters.Port}/tcp --permanent"); - RunCmd($"firewall-cmd --zone=public --add-port={Parameters.Port}/udp --permanent"); - RunCmd("yes | firewall-cmd --reload"); - } - return; + 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"); + } + } + } - cmd = RunCmd("command -v ufw"); + protected void OpenPort(params int[] portList) + { + + string cmd; + + cmd = RunCmd("command -v firewall-cmd"); if (!string.IsNullOrEmpty(cmd)) { - if (Parameters.Port == 443) + //有很奇怪的vps主机,在firewalld未运行时,端口是关闭的,无法访问。所以要先启动firewalld + //用于保证acme.sh申请证书成功 + cmd = RunCmd("firewall-cmd --state"); + if (cmd.Trim() != "running") { - RunCmd("ufw allow 80/tcp"); - RunCmd("ufw allow 443/tcp"); - RunCmd("ufw allow 80/udp"); - RunCmd("ufw allow 443/udp"); - RunCmd("yes | ufw reload"); + RunCmd("systemctl restart firewalld"); } - else + + foreach (var port in portList) { - RunCmd($"ufw allow {Parameters.Port}/tcp"); - RunCmd($"ufw allow {Parameters.Port}/udp"); + 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)) + { + foreach (var port in portList) + { + RunCmd($"ufw allow {port}/tcp"); + RunCmd($"ufw allow {port}/udp"); + } RunCmd("yes | ufw reload"); } } } + /// + /// 配置防火墙 + /// + protected void ConfigureFirewall() + { + var portList = new List(); + portList.Add(80); + portList.Add(Parameters.Port); + + if (Parameters.Types.Contains(XrayType.ShadowsocksAEAD)) + { + portList.Add(ConfigBuilder.ShadowSocksPort); + } + + if (Parameters.Types.Contains(XrayType.VMESS_KCP)) + { + portList.Add(ConfigBuilder.VMESS_mKCP_Port); + } + + OpenPort(portList.ToArray()); + } + /// /// 配置同步时间差 /// diff --git a/ProxySU_Core/Models/Developers/XrayProject.cs b/ProxySU_Core/Models/Developers/XrayProject.cs index 309f5fe..98a550e 100644 --- a/ProxySU_Core/Models/Developers/XrayProject.cs +++ b/ProxySU_Core/Models/Developers/XrayProject.cs @@ -111,6 +111,8 @@ namespace ProxySU_Core.Models.Developers UninstallXray(); WriteOutput("卸载证书"); UninstallAcme(); + WriteOutput("关闭端口"); + ClosePort(ConfigBuilder.ShadowSocksPort, ConfigBuilder.VLESS_mKCP_Port, ConfigBuilder.VMESS_mKCP_Port); WriteOutput("************ 卸载完成 ************"); } @@ -134,6 +136,7 @@ namespace ProxySU_Core.Models.Developers { EnsureRootAuth(); EnsureSystemEnv(); + ConfigureFirewall(); var configJson = ConfigBuilder.BuildXrayConfig(Parameters); var stream = new MemoryStream(Encoding.UTF8.GetBytes(configJson)); RunCmd("rm -rf /usr/local/etc/xray/config.json"); diff --git a/ProxySU_Core/Views/TerminalWindow.xaml.cs b/ProxySU_Core/Views/TerminalWindow.xaml.cs index a9f4b07..b191556 100644 --- a/ProxySU_Core/Views/TerminalWindow.xaml.cs +++ b/ProxySU_Core/Views/TerminalWindow.xaml.cs @@ -114,7 +114,9 @@ namespace ProxySU_Core } catch (Exception ex) { + WriteOutput("登陆失败!"); WriteOutput(ex.Message); + return; } WriteOutput("登陆服务器成功!"); From f27ae4d70cf91da2d561412c3ca375672a01660b Mon Sep 17 00:00:00 2001 From: nuxt-autumn Date: Sun, 28 Mar 2021 09:11:10 +0800 Subject: [PATCH 12/12] v3.1.0 --- ProxySU_Core/Properties/AssemblyInfo.cs | 4 ++-- ProxySU_Core/Views/MainWindow.xaml.cs | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ProxySU_Core/Properties/AssemblyInfo.cs b/ProxySU_Core/Properties/AssemblyInfo.cs index 82eaa44..52079d5 100644 --- a/ProxySU_Core/Properties/AssemblyInfo.cs +++ b/ProxySU_Core/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("3.1.0.0")] +[assembly: AssemblyFileVersion("3.1.0.0")] diff --git a/ProxySU_Core/Views/MainWindow.xaml.cs b/ProxySU_Core/Views/MainWindow.xaml.cs index 5e6fcc4..b33c227 100644 --- a/ProxySU_Core/Views/MainWindow.xaml.cs +++ b/ProxySU_Core/Views/MainWindow.xaml.cs @@ -5,24 +5,14 @@ using ProxySU_Core.Common; using ProxySU_Core.Models; using ProxySU_Core.ViewModels; using ProxySU_Core.Views; -using Renci.SshNet; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Text; -using System.Threading; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace ProxySU_Core