diff --git a/FastGithub/Program.cs b/FastGithub/Program.cs index 13d7b83..45124fc 100644 --- a/FastGithub/Program.cs +++ b/FastGithub/Program.cs @@ -1,9 +1,6 @@ using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using System; -using System.IO; namespace FastGithub { @@ -33,13 +30,6 @@ namespace FastGithub { c.ValidateOnBuild = false; }) - .ConfigureAppConfiguration(c => - { - foreach (var jsonFile in Directory.GetFiles(".", "appsettings.*.json")) - { - c.AddJsonFile(jsonFile, optional: true, reloadOnChange: true); - } - }) .ConfigureServices((ctx, services) => { services.AddAppUpgrade(); diff --git a/FastGithub/appsettings.github.json b/FastGithub/appsettings.github.json deleted file mode 100644 index 3b1d9db..0000000 --- a/FastGithub/appsettings.github.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "FastGithub": { - "DomainConfigs": { // 域名的*表示0到多个任意字符 - "github.com": { - "TlsSni": false, // 指示tls握手时是否发送SNI - "Timeout": null, // 请求超时时长,格式为"00:02:00",默认为null - "Destination": null // 请求目的地,格式为绝对或相对Uri,默认null - }, - "githubstatus.com": { - "TlsSni": false - }, - "*.github.com": { - "TlsSni": false - }, - "*.github.io": { - "TlsSni": false - }, - "*.githubapp.com": { - "TlsSni": false - }, - "*.githubassets.com": { - "TlsSni": false - }, - "*.githubusercontent.com": { - "TlsSni": false - }, - "*github*.s3.amazonaws.com": { - "TlsSni": false - } - } - } -} diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json index bb26872..03c8323 100644 --- a/FastGithub/appsettings.json +++ b/FastGithub/appsettings.json @@ -7,6 +7,65 @@ "FastDns": { // 用于解析不在DomainConfigs的域名 "IPAddress": "114.114.114.114", "Port": 53 + }, + "DomainConfigs": { // 域名的*表示0到多个任意字符 + "github.com": { + "TlsSni": false, // 指示tls握手时是否发送SNI + "Timeout": null, // 请求超时时长,格式为"00:02:00",默认为null + "Destination": null // 请求目的地,格式为绝对或相对Uri,默认null + }, + "githubstatus.com": { + "TlsSni": false + }, + "*.github.com": { + "TlsSni": false + }, + "*.github.io": { + "TlsSni": false + }, + "*.githubapp.com": { + "TlsSni": false + }, + "*.githubassets.com": { + "TlsSni": false + }, + "*.githubusercontent.com": { + "TlsSni": false + }, + "*github*.s3.amazonaws.com": { + "TlsSni": false + }, + "ajax.googleapis.com": { + "TlsSni": true, + "Destination": "https://gapis.geekzu.org/ajax/" + }, + "fonts.googleapis.com": { + "TlsSni": true, + "Destination": "https://fonts.geekzu.org/" + }, + "themes.googleusercontent.com": { + "TlsSni": true, + "Destination": "https://gapis.geekzu.org/g-themes/" + }, + "fonts.gstatic.com": { + "TlsSni": true, + "Destination": "https://gapis.geekzu.org/g-fonts/" + }, + "secure.gravatar.com": { + "TlsSni": true, + "Destination": "https://sdn.geekzu.org/" + }, + "*.gravatar.com": { + "TlsSni": true, + "Destination": "https://fdn.geekzu.org/" + }, + "i.stack.imgur.com": { + "Response": { // 直接响应 + "StatusCode": 404, + "ContentType": "text/plain;charset=utf-8", + "ContentValue": "阻断的请求" + } + } } }, "Logging": { diff --git a/FastGithub/appsettings.stackoverflow.json b/FastGithub/appsettings.stackoverflow.json deleted file mode 100644 index 941ff2f..0000000 --- a/FastGithub/appsettings.stackoverflow.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "FastGithub": { - "DomainConfigs": { // 域名的*表示0到多个任意字符 - "ajax.googleapis.com": { - "TlsSni": true, - "Destination": "https://gapis.geekzu.org/ajax/" - }, - "fonts.googleapis.com": { - "TlsSni": true, - "Destination": "https://fonts.geekzu.org/" - }, - "themes.googleusercontent.com": { - "TlsSni": true, - "Destination": "https://gapis.geekzu.org/g-themes/" - }, - "fonts.gstatic.com": { - "TlsSni": true, - "Destination": "https://gapis.geekzu.org/g-fonts/" - }, - "secure.gravatar.com": { - "TlsSni": true, - "Destination": "https://sdn.geekzu.org/" - }, - "*.gravatar.com": { - "TlsSni": true, - "Destination": "https://fdn.geekzu.org/" - }, - "i.stack.imgur.com": { - "Response": { // 直接响应 - "StatusCode": 404, - "ContentType": "text/plain;charset=utf-8", - "ContentValue": "阻断的请求" - } - } - } - } -}