Przeglądaj źródła

项目合并与重命名

xljiulang 4 lat temu
rodzic
commit
bb48f6b760

+ 1 - 1
Directory.Build.props

@@ -1,6 +1,6 @@
 <Project>
 	<PropertyGroup>
-		<Version>1.0.9</Version>
+		<Version>1.1.0</Version>
 		<Nullable>enable</Nullable>
 		<Description>github加速神器</Description>
 		<Copyright>https://github.com/xljiulang/FastGithub</Copyright>

+ 0 - 23
FastGithub.DnscryptProxy/DnscryptProxyServiceCollectionExtensions.cs

@@ -1,23 +0,0 @@
-using FastGithub.DnscryptProxy;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace FastGithub
-{
-    /// <summary>
-    ///  DnscryptProxy的服务注册扩展
-    /// </summary>
-    public static class DnscryptProxyServiceCollectionExtensions
-    {
-        /// <summary>
-        /// 添加DnscryptProxy
-        /// </summary>
-        /// <param name="services"></param> 
-        /// <returns></returns>
-        public static IServiceCollection AddDnscryptProxy(this IServiceCollection services)
-        {
-            return services
-                .AddSingleton<DnscryptProxyService>()
-                .AddHostedService<DnscryptProxyHostedService>();
-        }
-    }
-}

+ 1 - 1
FastGithub.DnscryptProxy/ControllState.cs → FastGithub.DomainResolve/ControllState.cs

@@ -1,4 +1,4 @@
-namespace FastGithub.DnscryptProxy
+namespace FastGithub.DomainResolve
 {
     /// <summary>
     /// 服务控制状态

+ 1 - 1
FastGithub.DnscryptProxy/DnscryptProxyHostedService.cs → FastGithub.DomainResolve/DnscryptProxyHostedService.cs

@@ -4,7 +4,7 @@ using System;
 using System.Threading;
 using System.Threading.Tasks;
 
-namespace FastGithub.DnscryptProxy
+namespace FastGithub.DomainResolve
 {
     /// <summary>
     /// DnscryptProxy后台服务

+ 1 - 1
FastGithub.DnscryptProxy/DnscryptProxyService.cs → FastGithub.DomainResolve/DnscryptProxyService.cs

@@ -4,7 +4,7 @@ using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
 
-namespace FastGithub.DnscryptProxy
+namespace FastGithub.DomainResolve
 {
     /// <summary>
     /// DnscryptProxy服务

+ 26 - 0
FastGithub.DomainResolve/DomainResolveServiceCollectionExtensions.cs

@@ -0,0 +1,26 @@
+using FastGithub.DomainResolve;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+
+namespace FastGithub
+{
+    /// <summary>
+    ///  域名解析相关服务注册扩展
+    /// </summary>
+    public static class DomainResolveServiceCollectionExtensions
+    {
+        /// <summary>
+        /// 注册域名解析相关服务
+        /// </summary>
+        /// <param name="services"></param> 
+        /// <returns></returns>
+        public static IServiceCollection AddDomainResolve(this IServiceCollection services)
+        {
+            services.AddMemoryCache();
+            services.TryAddSingleton<IDomainResolver, DomainResolver>();
+            services.AddSingleton<DnscryptProxyService>();
+            services.AddHostedService<DnscryptProxyHostedService>();
+            return services;
+        }
+    }
+}

+ 1 - 1
FastGithub.Http/DomainResolver.cs → FastGithub.DomainResolve/DomainResolver.cs

@@ -8,7 +8,7 @@ using System.Net;
 using System.Threading;
 using System.Threading.Tasks;
 
-namespace FastGithub.Http
+namespace FastGithub.DomainResolve
 {
     /// <summary>
     /// 域名解析器

+ 2 - 0
FastGithub.DnscryptProxy/FastGithub.DnscryptProxy.csproj → FastGithub.DomainResolve/FastGithub.DomainResolve.csproj

@@ -5,6 +5,8 @@
 	</PropertyGroup>
 
 	<ItemGroup>
+		<PackageReference Include="DNS" Version="6.1.0" />
+		<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
 		<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
 		<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
 	</ItemGroup>

+ 1 - 1
FastGithub.Http/IDomainResolver.cs → FastGithub.DomainResolve/IDomainResolver.cs

@@ -2,7 +2,7 @@
 using System.Threading;
 using System.Threading.Tasks;
 
-namespace FastGithub.Http
+namespace FastGithub.DomainResolve
 {
     /// <summary>
     /// 域名解析器

+ 1 - 1
FastGithub.DnscryptProxy/TomlUtil.cs → FastGithub.DomainResolve/TomlUtil.cs

@@ -5,7 +5,7 @@ using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
 
-namespace FastGithub.DnscryptProxy
+namespace FastGithub.DomainResolve
 {
     /// <summary>
     /// doml配置工具

+ 0 - 0
FastGithub.DnscryptProxy/dnscrypt-proxy → FastGithub.DomainResolve/dnscrypt-proxy


+ 0 - 0
FastGithub.DnscryptProxy/dnscrypt-proxy.exe → FastGithub.DomainResolve/dnscrypt-proxy.exe


+ 0 - 0
FastGithub.DnscryptProxy/dnscrypt-proxy.toml → FastGithub.DomainResolve/dnscrypt-proxy.toml


+ 1 - 2
FastGithub.Http/FastGithub.Http.csproj

@@ -5,10 +5,9 @@
 	</PropertyGroup>
 
 	<ItemGroup>
-		<PackageReference Include="DNS" Version="6.1.0" />
 		<PackageReference Include="Portable.BouncyCastle" Version="1.8.10" />
-		<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
 		<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
+		<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
 	</ItemGroup>
 
 </Project>

+ 2 - 1
FastGithub.Http/HttpClient.cs

@@ -1,4 +1,5 @@
-using System;
+using FastGithub.DomainResolve;
+using System;
 using System.Net.Http;
 using System.Threading;
 using System.Threading.Tasks;

+ 2 - 1
FastGithub.Http/HttpClientFactory.cs

@@ -1,4 +1,5 @@
-using Microsoft.Extensions.Options;
+using FastGithub.DomainResolve;
+using Microsoft.Extensions.Options;
 
 namespace FastGithub.Http
 {

+ 2 - 1
FastGithub.Http/HttpClientHandler.cs

@@ -1,4 +1,5 @@
-using System;
+using FastGithub.DomainResolve;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;

+ 0 - 2
FastGithub.Http/HttpClientServiceCollectionExtensions.cs

@@ -16,8 +16,6 @@ namespace FastGithub
         /// <returns></returns>
         public static IServiceCollection AddHttpClient(this IServiceCollection services)
         {
-            services.AddMemoryCache();
-            services.TryAddSingleton<IDomainResolver, DomainResolver>();
             services.TryAddSingleton<IHttpClientFactory, HttpClientFactory>();
             return services;
         }

+ 0 - 1
FastGithub.ReverseProxy/ReverseProxyServiceCollectionExtensions.cs

@@ -18,7 +18,6 @@ namespace FastGithub
             return services
                 .AddMemoryCache()
                 .AddHttpForwarder()
-                .AddHttpClient()
                 .AddSingleton<RequestLoggingMilldeware>()
                 .AddSingleton<ReverseProxyMiddleware>()
                 .AddHostedService<ReverseProxyHostedService>();

+ 2 - 1
FastGithub.Upgrade/UpgradeService.cs

@@ -1,4 +1,5 @@
-using FastGithub.Http;
+using FastGithub.DomainResolve;
+using FastGithub.Http;
 using Microsoft.Extensions.Logging;
 using System;
 using System.Linq;

+ 6 - 6
FastGithub.sln

@@ -13,10 +13,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Upgrade", "FastG
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.ReverseProxy", "FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj", "{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.DnscryptProxy", "FastGithub.DnscryptProxy\FastGithub.DnscryptProxy.csproj", "{26BB826F-4117-4746-9BD0-C6D8043E2808}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Http", "FastGithub.Http\FastGithub.Http.csproj", "{B5DCB3E4-5094-4170-B844-6F395002CA42}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.DomainResolve", "FastGithub.DomainResolve\FastGithub.DomainResolve.csproj", "{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -43,14 +43,14 @@ Global
 		{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}.Release|Any CPU.Build.0 = Release|Any CPU
-		{26BB826F-4117-4746-9BD0-C6D8043E2808}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{26BB826F-4117-4746-9BD0-C6D8043E2808}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{26BB826F-4117-4746-9BD0-C6D8043E2808}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{26BB826F-4117-4746-9BD0-C6D8043E2808}.Release|Any CPU.Build.0 = Release|Any CPU
 		{B5DCB3E4-5094-4170-B844-6F395002CA42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B5DCB3E4-5094-4170-B844-6F395002CA42}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{B5DCB3E4-5094-4170-B844-6F395002CA42}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{B5DCB3E4-5094-4170-B844-6F395002CA42}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 1 - 1
FastGithub/FastGithub.csproj

@@ -16,8 +16,8 @@
   <ItemGroup>
     <PackageReference Include="PInvoke.AdvApi32" Version="0.7.104" />
     <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
-    <ProjectReference Include="..\FastGithub.DnscryptProxy\FastGithub.DnscryptProxy.csproj" />
     <ProjectReference Include="..\FastGithub.Dns\FastGithub.Dns.csproj" />
+    <ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
     <ProjectReference Include="..\FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj" />
     <ProjectReference Include="..\FastGithub.Upgrade\FastGithub.Upgrade.csproj" />
   </ItemGroup>

+ 2 - 1
FastGithub/Program.cs

@@ -42,7 +42,8 @@ namespace FastGithub
                 .ConfigureServices((ctx, services) =>
                 {
                     services.AddDnsServer();
-                    services.AddDnscryptProxy();
+                    services.AddDomainResolve();
+                    services.AddHttpClient();
                     services.AddAppUpgrade();
                     services.AddReverseProxy();
                     services.AddSingleton<FastGithubConfig>();