拆分配置文件
This commit is contained in:
parent
f45b880232
commit
b1f3a79122
@ -5,7 +5,7 @@ namespace FastGithub.Scanner
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 域名
|
/// 域名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Lookup")]
|
[Options("Lookup")]
|
||||||
sealed class GithubLookupFactoryOptions
|
sealed class GithubLookupFactoryOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace FastGithub.Scanner
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 扫描选项
|
/// 扫描选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Scan")]
|
[Options("Scan")]
|
||||||
sealed class GithubScanOptions
|
sealed class GithubScanOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace FastGithub.Scanner.LookupProviders
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Github公开的域名与ip关系提供者选项
|
/// Github公开的域名与ip关系提供者选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Lookup:GithubMetaProvider")]
|
[Options("Lookup:GithubMetaProvider")]
|
||||||
sealed class GithubMetaProviderOptions
|
sealed class GithubMetaProviderOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// ipaddress.com的域名与ip关系提供者选项
|
/// ipaddress.com的域名与ip关系提供者选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Lookup:IPAddressComProvider")]
|
[Options("Lookup:IPAddressComProvider")]
|
||||||
sealed class IPAddressComProviderOptions
|
sealed class IPAddressComProviderOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace FastGithub.Scanner.LookupProviders
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 公共dns的域名与ip关系提供者选项
|
/// 公共dns的域名与ip关系提供者选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Lookup:PublicDnsProvider")]
|
[Options("Lookup:PublicDnsProvider")]
|
||||||
sealed class PublicDnsProviderOptions
|
sealed class PublicDnsProviderOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace FastGithub.Scanner.ScanMiddlewares
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// https扫描选项
|
/// https扫描选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Scan:HttpsScan")]
|
[Options("Scan:HttpsScan")]
|
||||||
sealed class HttpsScanOptions
|
sealed class HttpsScanOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace FastGithub.Scanner.ScanMiddlewares
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// tcp扫描选项
|
/// tcp扫描选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Options("Github:Scan:TcpScan")]
|
[Options("Scan:TcpScan")]
|
||||||
sealed class TcpScanOptions
|
sealed class TcpScanOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -23,6 +23,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Update="appsettings.github.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="appsettings.json">
|
<None Update="appsettings.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace FastGithub
|
namespace FastGithub
|
||||||
{
|
{
|
||||||
@ -24,6 +26,13 @@ namespace FastGithub
|
|||||||
.CreateDefaultBuilder(args)
|
.CreateDefaultBuilder(args)
|
||||||
.UseWindowsService()
|
.UseWindowsService()
|
||||||
.UseBinaryPathContentRoot()
|
.UseBinaryPathContentRoot()
|
||||||
|
.ConfigureAppConfiguration(c =>
|
||||||
|
{
|
||||||
|
foreach (var jsonFile in Directory.GetFiles(".", "appsettings.*.json"))
|
||||||
|
{
|
||||||
|
c.AddJsonFile(jsonFile, optional: true);
|
||||||
|
}
|
||||||
|
})
|
||||||
.ConfigureServices((ctx, services) =>
|
.ConfigureServices((ctx, services) =>
|
||||||
{
|
{
|
||||||
services.AddAppUpgrade();
|
services.AddAppUpgrade();
|
||||||
|
|||||||
@ -12,4 +12,4 @@ github定制版的dns服务,解析github最优的ip
|
|||||||
### 以windows服务运行
|
### 以windows服务运行
|
||||||
以管理员身份运行cmd,键入如下命令,其中D:\Softs为软件实际目录
|
以管理员身份运行cmd,键入如下命令,其中D:\Softs为软件实际目录
|
||||||
* D:\Softs\FastGithub.exe start // 安装并启动服务
|
* D:\Softs\FastGithub.exe start // 安装并启动服务
|
||||||
* D:\Softs\FastGithub.exe stop // 卸载并删除服务
|
* D:\Softs\FastGithub.exe stop // 卸载并删除服务
|
||||||
39
FastGithub/appsettings.github.json
Normal file
39
FastGithub/appsettings.github.json
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"Lookup": { // ip查找
|
||||||
|
"Domains": [ // 查找的域名,下面是github最主要的域名
|
||||||
|
"github.com",
|
||||||
|
"api.github.com",
|
||||||
|
"collector.githubapp.com",
|
||||||
|
"github.githubassets.com",
|
||||||
|
"raw.githubusercontent.com",
|
||||||
|
"avatars.githubusercontent.com",
|
||||||
|
"favicons.githubusercontent.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Scan": {
|
||||||
|
"HttpsScan": {
|
||||||
|
"Rules": { // 域名扫描规则,缺失的域名,将默认HEAD请求到域名的根路径
|
||||||
|
"github.com": {
|
||||||
|
"Method": "HEAD",
|
||||||
|
"Path": "/xljiulang/FastGithub"
|
||||||
|
},
|
||||||
|
"github.githubassets.com": {
|
||||||
|
"Method": "HEAD",
|
||||||
|
"Path": "/favicons/favicon.png"
|
||||||
|
},
|
||||||
|
"raw.githubusercontent.com": {
|
||||||
|
"Method": "HEAD",
|
||||||
|
"Path": "/xljiulang/FastGithub/master/README.md"
|
||||||
|
},
|
||||||
|
"avatars.githubusercontent.com": {
|
||||||
|
"Method": "HEAD",
|
||||||
|
"Path": "/u/8308014?s=40&v=4"
|
||||||
|
},
|
||||||
|
"favicons.githubusercontent.com": {
|
||||||
|
"Method": "HEAD",
|
||||||
|
"Path": "/github.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,72 +4,39 @@
|
|||||||
"GithubTTL": "00:10:00", // github相关域名解析结果的存活时长
|
"GithubTTL": "00:10:00", // github相关域名解析结果的存活时长
|
||||||
"SetToLocalMachine": true // 是否设置本机使用此dns(仅支持windows)
|
"SetToLocalMachine": true // 是否设置本机使用此dns(仅支持windows)
|
||||||
},
|
},
|
||||||
"Github": {
|
"Lookup": { // ip查找
|
||||||
"Lookup": { // ip查找
|
"IPAddressComProvider": {
|
||||||
"Domains": [ // 查找的域名,下面是github最主要的域名
|
"Enable": true // 是从启用从address.com查找ip
|
||||||
"github.com",
|
|
||||||
"api.github.com",
|
|
||||||
"collector.githubapp.com",
|
|
||||||
"github.githubassets.com",
|
|
||||||
"raw.githubusercontent.com",
|
|
||||||
"avatars.githubusercontent.com",
|
|
||||||
"favicons.githubusercontent.com"
|
|
||||||
],
|
|
||||||
"IPAddressComProvider": {
|
|
||||||
"Enable": true // 是从启用从address.com查找ip
|
|
||||||
},
|
|
||||||
"GithubMetaProvider": {
|
|
||||||
"Enable": true, // 是否从github获取ip列表
|
|
||||||
"MetaUri": "https://gitee.com/jiulang/fast-github/raw/master/FastGithub/meta.json"
|
|
||||||
},
|
|
||||||
"PublicDnsProvider": {
|
|
||||||
"Enable": true, // 是否需要从dns服务器查找ip
|
|
||||||
"Timeout": "00:00:00.100", // dns查询超时时长
|
|
||||||
"Dnss": [ // dns服务器列表
|
|
||||||
"1.2.4.8",
|
|
||||||
"8.8.8.8",
|
|
||||||
"223.5.5.5",
|
|
||||||
"123.125.81.6",
|
|
||||||
"180.76.76.76",
|
|
||||||
"119.29.29.29",
|
|
||||||
"208.67.220.220",
|
|
||||||
"114.114.114.114"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"Scan": {
|
"GithubMetaProvider": {
|
||||||
"FullScanInterval": "02:00:00", // 完整扫描时间间隔
|
"Enable": true, // 是否从github获取ip列表
|
||||||
"ResultScanInterval": "00:01:00", // 结果扫描时间间隔
|
"MetaUri": "https://gitee.com/jiulang/fast-github/raw/master/FastGithub/meta.json"
|
||||||
"TcpScan": {
|
},
|
||||||
"Timeout": "00:00:01", // tcp扫描超时时间
|
"PublicDnsProvider": {
|
||||||
"CacheExpiration": "00:30:00" // 扫描结果缓存时长
|
"Enable": true, // 是否需要从dns服务器查找ip
|
||||||
},
|
"Timeout": "00:00:00.100", // dns查询超时时长
|
||||||
"HttpsScan": {
|
"Dnss": [ // dns服务器列表
|
||||||
"Timeout": "00:00:05", // https扫描超时时间
|
"1.2.4.8",
|
||||||
"ConnectionClose": false, // 是否使用https短连接
|
"8.8.8.8",
|
||||||
"Rules": { // 域名扫描规则,缺失的域名,将默认HEAD请求到域名的根路径
|
"223.5.5.5",
|
||||||
"github.com": {
|
"123.125.81.6",
|
||||||
"Method": "HEAD",
|
"180.76.76.76",
|
||||||
"Path": "/xljiulang/FastGithub"
|
"119.29.29.29",
|
||||||
},
|
"208.67.220.220",
|
||||||
"github.githubassets.com": {
|
"114.114.114.114"
|
||||||
"Method": "HEAD",
|
]
|
||||||
"Path": "/favicons/favicon.png"
|
}
|
||||||
},
|
},
|
||||||
"raw.githubusercontent.com": {
|
"Scan": {
|
||||||
"Method": "HEAD",
|
"FullScanInterval": "02:00:00", // 完整扫描时间间隔
|
||||||
"Path": "/xljiulang/FastGithub/master/README.md"
|
"ResultScanInterval": "00:01:00", // 结果扫描时间间隔
|
||||||
},
|
"TcpScan": {
|
||||||
"avatars.githubusercontent.com": {
|
"Timeout": "00:00:01", // tcp扫描超时时间
|
||||||
"Method": "HEAD",
|
"CacheExpiration": "00:30:00" // 扫描结果缓存时长
|
||||||
"Path": "/u/8308014?s=40&v=4"
|
},
|
||||||
},
|
"HttpsScan": {
|
||||||
"favicons.githubusercontent.com": {
|
"Timeout": "00:00:05", // https扫描超时时间
|
||||||
"Method": "HEAD",
|
"ConnectionClose": false // 是否使用https短连接
|
||||||
"Path": "/github.com"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user