From cf616b33a875c8bcfe47580fc65288da2cc13a26 Mon Sep 17 00:00:00 2001 From: Space Time Date: Thu, 26 Dec 2024 12:51:48 +0800 Subject: [PATCH] =?UTF-8?q?1.1.4=20->=201.1.5=20=E7=AC=AC6=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Consts/MainConst.cs | 2 ++ Proces/ComihomoProc.cs | 9 +++++++++ Proces/ConginxProc.cs | 13 +++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 Proces/ComihomoProc.cs create mode 100644 Proces/ConginxProc.cs diff --git a/Consts/MainConst.cs b/Consts/MainConst.cs index e65dfe8..e08cb25 100644 --- a/Consts/MainConst.cs +++ b/Consts/MainConst.cs @@ -26,6 +26,7 @@ internal abstract partial class MainConst : MainMultilangConst internal static string HostsConfStartMarker => $"# Cealing Nginx Start{Environment.NewLine}"; internal static string HostsConfEndMarker => "# Cealing Nginx End"; + internal static string ConginxPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Conginx.exe"); internal static string NginxPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Nginx.exe"); internal static string NginxConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "nginx.conf"); internal static string NginxLogsPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "logs"); @@ -36,6 +37,7 @@ internal abstract partial class MainConst : MainMultilangConst internal static string NginxRootCertSubjectName => "CN=Cealing Cert Root"; internal static string NginxChildCertSubjectName => "CN=Cealing Cert Child"; + internal static string ComihomoPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Comihomo.exe"); internal static string MihomoPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Mihomo.exe"); internal static string MihomoConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "config.yaml"); internal static string[] MihomoNameServers => ["https://doh.apad.pro/dns-query", "https://ns.net.kg/dns-query"]; diff --git a/Proces/ComihomoProc.cs b/Proces/ComihomoProc.cs new file mode 100644 index 0000000..b2865ac --- /dev/null +++ b/Proces/ComihomoProc.cs @@ -0,0 +1,9 @@ +using Sheas_Cealer.Consts; +using Sheas_Core; + +namespace Sheas_Cealer.Proces; + +internal class ComihomoProc : Proc +{ + internal ComihomoProc() : base(MainConst.ComihomoPath) { } +} \ No newline at end of file diff --git a/Proces/ConginxProc.cs b/Proces/ConginxProc.cs new file mode 100644 index 0000000..2d32816 --- /dev/null +++ b/Proces/ConginxProc.cs @@ -0,0 +1,13 @@ +using Sheas_Cealer.Consts; +using Sheas_Cealer.Utils; +using Sheas_Core; +using System; + +namespace Sheas_Cealer.Proces; + +internal class ConginxProc : Proc +{ + internal ConginxProc() : base(MainConst.ConginxPath) { } + + protected override async void Process_Exited(object? sender, EventArgs e) => await NginxCleaner.Clean(); +} \ No newline at end of file