拆分配置文件
This commit is contained in:
parent
aec3ce2f4f
commit
8312886db7
@ -1,6 +1,8 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.IO;
|
||||
|
||||
namespace FastGithub
|
||||
{
|
||||
@ -30,6 +32,13 @@ namespace FastGithub
|
||||
{
|
||||
c.ValidateOnBuild = false;
|
||||
})
|
||||
.ConfigureAppConfiguration(c =>
|
||||
{
|
||||
foreach (var jsonFile in Directory.GetFiles(".", "appsettings.*.json"))
|
||||
{
|
||||
c.AddJsonFile(jsonFile, optional: true);
|
||||
}
|
||||
})
|
||||
.ConfigureServices((ctx, services) =>
|
||||
{
|
||||
services.AddAppUpgrade();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# FastGithub
|
||||
# FastGithub
|
||||
github加速神器
|
||||
|
||||
### 本机使用[推荐]
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
32
FastGithub/appsettings.github.json
Normal file
32
FastGithub/appsettings.github.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"FastGithub": {
|
||||
"PureDns": { // 用于解析DomainConfigs的域名
|
||||
"IPAddress": "127.0.0.1",
|
||||
@ -7,65 +7,6 @@
|
||||
"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": {
|
||||
|
||||
37
FastGithub/appsettings.stackoverflow.json
Normal file
37
FastGithub/appsettings.stackoverflow.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"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": "阻断的请求"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user