From 89a952bc94d1cf27762ab51ecc621e6150facc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Fri, 17 Sep 2021 10:44:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.ReverseProxy/CertService.cs | 8 ++++---- FastGithub/FastGithub.csproj | 1 + README.html | 18 +++++++++--------- README.md | 18 +++++++++--------- pack.sh | 14 +++++++------- publish.cmd | 6 +++--- 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/FastGithub.ReverseProxy/CertService.cs b/FastGithub.ReverseProxy/CertService.cs index ca367d0..67821f9 100644 --- a/FastGithub.ReverseProxy/CertService.cs +++ b/FastGithub.ReverseProxy/CertService.cs @@ -16,7 +16,7 @@ namespace FastGithub.ReverseProxy /// sealed class CertService { - private const string CAPATH = "CACert"; + private const string CACert_PATH = "cacert"; private const int KEY_SIZE_BITS = 2048; private readonly IMemoryCache serverCertCache; private readonly ILogger logger; @@ -25,12 +25,12 @@ namespace FastGithub.ReverseProxy /// /// 获取证书文件路径 /// - public string CaCerFilePath { get; } = $"{CAPATH}/{nameof(FastGithub)}.cer"; + public string CaCerFilePath { get; } = $"{CACert_PATH}/fastgithub.cer"; /// /// 获取私钥文件路径 /// - public string CaKeyFilePath { get; } = $"{CAPATH}/{nameof(FastGithub)}.key"; + public string CaKeyFilePath { get; } = $"{CACert_PATH}/fastgithub.key"; /// /// 证书服务 @@ -43,7 +43,7 @@ namespace FastGithub.ReverseProxy this.serverCertCache = serverCertCache; this.logger = logger; - Directory.CreateDirectory(CAPATH); + Directory.CreateDirectory(CACert_PATH); } /// diff --git a/FastGithub/FastGithub.csproj b/FastGithub/FastGithub.csproj index 2b920e8..a866968 100644 --- a/FastGithub/FastGithub.csproj +++ b/FastGithub/FastGithub.csproj @@ -1,6 +1,7 @@  + fastgithub Exe MIT true diff --git a/README.html b/README.html index a1a7806..afcec1a 100644 --- a/README.html +++ b/README.html @@ -372,20 +372,20 @@ code {

2 部署方式

2.1 windows本机

    -
  • 双击运行FastGithub.exe程序
  • -
  • FastGithub.exe start // 以windows服务安装并启动
  • -
  • FastGithub.exe stop // 以windows服务卸载并删除
  • +
  • 双击运行fastgithub.exe程序
  • +
  • fastgithub.exe start // 以windows服务安装并启动
  • +
  • fastgithub.exe stop // 以windows服务卸载并删除

2.2 linux本机

    -
  • 执行sudo ./FastGithub
  • -
  • 手工安装CACert/FastGithub.cer到受信任的根证书颁发机构
  • +
  • 执行sudo ./fastgithub
  • +
  • 手工安装cacert/fastgithub.cer到受信任的根证书颁发机构
  • 手工设置系统代理为http://127.0.0.1:38457或自动代理为http://127.0.0.1:38457/proxy.pac

2.3 macOS本机

    -
  • 双击运行FastGithub程序
  • -
  • 手工安装CACert/FastGithub.cer并设置信任
  • +
  • 双击运行fastgithub程序
  • +
  • 手工安装cacert/fastgithub.cer并设置信任
  • 手工设置系统代理为http://127.0.0.1:38457或自动代理为http://127.0.0.1:38457/proxy.pac

3 证书验证

@@ -394,9 +394,9 @@ code {

需要关闭git的证书验证:git config --global http.sslverify false

3.2 firefox

firefox提示连接有潜在的安全问题

-

设置->隐私与安全->证书->查看证书->证书颁发机构,导入FastGithub.cer,勾选信任由此证书颁发机构来标识网站

+

设置->隐私与安全->证书->查看证书->证书颁发机构,导入fastgithub.cer,勾选信任由此证书颁发机构来标识网站

4 安全性说明

-

FastGithub为每台不同的主机生成自颁发CA证书,保存在CACert文件夹下。客户端设备需要安装和无条件信任自颁发的CA证书,请不要将证书私钥泄露给他人,以免造成损失。

+

FastGithub为每台不同的主机生成自颁发CA证书,保存在cacert文件夹下。客户端设备需要安装和无条件信任自颁发的CA证书,请不要将证书私钥泄露给他人,以免造成损失。

5 合法性说明

《国际联网暂行规定》第六条规定:“计算机信息网络直接进行国际联网,必须使用邮电部国家公用电信网提供的国际出入口信道。任何单位和个人不得自行建立或者使用其他信道进行国际联网。” FastGithub本地代理使用的都是“公用电信网提供的国际出入口信道”,从国外Github服务器到国内用户电脑上FastGithub程序的流量,使用的是正常流量通道,其间未对流量进行任何额外加密(仅有网页原有的TLS加密,区别于VPN的流量加密),而FastGithub获取到网页数据之后发生的整个代理过程完全在国内,不再适用国际互联网相关之规定。

diff --git a/README.md b/README.md index 258be83..cefe4d6 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ github加速神器,解决github打不开、用户头像无法加载、releases ### 2 部署方式 #### 2.1 windows本机 -* 双击运行FastGithub.exe程序 -* `FastGithub.exe start` // 以windows服务安装并启动 -* `FastGithub.exe stop` // 以windows服务卸载并删除 +* 双击运行fastgithub.exe程序 +* `fastgithub.exe start` // 以windows服务安装并启动 +* `fastgithub.exe stop` // 以windows服务卸载并删除 #### 2.2 linux本机 -* 执行`sudo ./FastGithub` -* 手工安装CACert/FastGithub.cer到受信任的根证书颁发机构 +* 执行`sudo ./fastgithub` +* 手工安装cacert/fastgithub.cer到受信任的根证书颁发机构 * 手工设置系统代理为http://127.0.0.1:38457或自动代理为http://127.0.0.1:38457/proxy.pac #### 2.3 macOS本机 -* 双击运行FastGithub程序 -* 手工安装CACert/FastGithub.cer并设置信任 +* 双击运行fastgithub程序 +* 手工安装cacert/fastgithub.cer并设置信任 * 手工设置系统代理为http://127.0.0.1:38457或自动代理为http://127.0.0.1:38457/proxy.pac @@ -30,11 +30,11 @@ git操作提示`SSL certificate problem`
#### 3.2 firefox firefox提示`连接有潜在的安全问题`
-设置->隐私与安全->证书->查看证书->证书颁发机构,导入FastGithub.cer,勾选信任由此证书颁发机构来标识网站 +设置->隐私与安全->证书->查看证书->证书颁发机构,导入fastgithub.cer,勾选信任由此证书颁发机构来标识网站 ### 4 安全性说明 -FastGithub为每台不同的主机生成自颁发CA证书,保存在CACert文件夹下。客户端设备需要安装和无条件信任自颁发的CA证书,请不要将证书私钥泄露给他人,以免造成损失。 +FastGithub为每台不同的主机生成自颁发CA证书,保存在cacert文件夹下。客户端设备需要安装和无条件信任自颁发的CA证书,请不要将证书私钥泄露给他人,以免造成损失。 ### 5 合法性说明 《国际联网暂行规定》第六条规定:“计算机信息网络直接进行国际联网,必须使用邮电部国家公用电信网提供的国际出入口信道。任何单位和个人不得自行建立或者使用其他信道进行国际联网。” diff --git a/pack.sh b/pack.sh index 7e36ec6..ea9b511 100644 --- a/pack.sh +++ b/pack.sh @@ -2,14 +2,14 @@ cd ./FastGithub/bin/publish # win-x64 -zip -r FastGithub_win-x64.zip FastGithub_win-x64 -x "./FastGithub_win-x64/x86/*" -x "./FastGithub_win-x64/*.pdb" +zip -r fastgithub_win-x64.zip fastgithub_win-x64 -x "./fastgithub_win-x64/x86/*" -x "./fastgithub_win-x64/*.pdb" # linux-x64 -chmod 777 ./FastGithub_linux-x64/FastGithub -chmod 777 ./FastGithub_linux-x64/dnscryptproxy/dnscrypt-proxy -zip -r FastGithub_linux-x64.zip FastGithub_linux-x64 -x "./FastGithub_linux-x64/x64/*" -x "./FastGithub_linux-x64/x86/*" -x "./FastGithub_linux-x64/*.pdb" +chmod 777 ./fastgithub_linux-x64/fastgithub +chmod 777 ./fastgithub_linux-x64/dnscryptproxy/dnscrypt-proxy +zip -r fastgithub_linux-x64.zip fastgithub_linux-x64 -x "./fastgithub_linux-x64/x64/*" -x "./fastgithub_linux-x64/x86/*" -x "./fastgithub_linux-x64/*.pdb" # osx-x64 -chmod 777 ./FastGithub_osx-x64/FastGithub -chmod 777 ./FastGithub_osx-x64/dnscryptproxy/dnscrypt-proxy -zip -r FastGithub_osx-x64.zip FastGithub_osx-x64 -x "./FastGithub_osx-x64/x64/*" -x "./FastGithub_osx-x64/x86/*" -x "./FastGithub_osx-x64/*.pdb" +chmod 777 ./fastgithub_osx-x64/fastgithub +chmod 777 ./fastgithub_osx-x64/dnscryptproxy/dnscrypt-proxy +zip -r fastgithub_osx-x64.zip fastgithub_osx-x64 -x "./fastgithub_osx-x64/x64/*" -x "./fastgithub_osx-x64/x86/*" -x "./fastgithub_osx-x64/*.pdb" diff --git a/publish.cmd b/publish.cmd index 1980883..9ce72f5 100644 --- a/publish.cmd +++ b/publish.cmd @@ -1,6 +1,6 @@ cd ./FastGithub set output=./bin/publish if exist "%output%" rd /S /Q "%output%" -dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true --self-contained -r win-x64 -o "%output%/FastGithub_win-x64" -dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true --self-contained -r linux-x64 -o "%output%/FastGithub_linux-x64" -dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true --self-contained -r osx-x64 -o "%output%/FastGithub_osx-x64" \ No newline at end of file +dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true --self-contained -r win-x64 -o "%output%/fastgithub_win-x64" +dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true --self-contained -r linux-x64 -o "%output%/fastgithub_linux-x64" +dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true --self-contained -r osx-x64 -o "%output%/fastgithub_osx-x64" \ No newline at end of file