From f7f3e8bbdd0c1a543e10514917949a282983883d Mon Sep 17 00:00:00 2001 From: snltty <1069410172@qq.com> Date: Thu, 5 Sep 2024 09:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet.yml | 30 +++++++++---------- linker.libs/linker.libs.csproj | 6 ++-- linker.tun/linker.tun.csproj | 6 ++-- linker.tunnel/linker.tunnel.csproj | 6 ++-- linker/linker.csproj | 13 +++++--- linker/plugins/relay/RelayTransfer.cs | 31 ++++---------------- linker/plugins/relay/transport/ITransport.cs | 5 ++++ version.txt | 11 +++++-- 8 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a791c4e6..1ee4173d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -33,11 +33,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} with: - tag_name: v1.2.9 - release_name: v1.2.9.${{ steps.date.outputs.today }} + tag_name: v1.3.0 + release_name: v1.3.0.${{ steps.date.outputs.today }} draft: false prerelease: false - body: 1. 选择是否自动同步配置文件 + body: "1. 选择是否自动同步配置文件\r\n2. 优化中继\r\n3. 客户端配置文件加密\r\n4. 导出无管理权限的客户端节点配置文件\r\n5. 需要更新服务端\r\n6. 测试中,,请稍等再更新" - name: upload-win-x86-oss id: upload-win-x86-oss uses: tvrcgo/oss-action@v0.1.1 @@ -47,7 +47,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-win-x86.zip - target-path: /downloads/linker/v1.2.9/linker-win-x86.zip + target-path: /downloads/linker/v1.3.0/linker-win-x86.zip - name: upload-win-x86 id: upload-win-x86 uses: actions/upload-release-asset@master @@ -67,7 +67,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-win-x64.zip - target-path: /downloads/linker/v1.2.9/linker-win-x64.zip + target-path: /downloads/linker/v1.3.0/linker-win-x64.zip - name: upload-win-x64 id: upload-win-x64 uses: actions/upload-release-asset@master @@ -87,7 +87,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-win-arm64.zip - target-path: /downloads/linker/v1.2.9/linker-win-arm64.zip + target-path: /downloads/linker/v1.3.0/linker-win-arm64.zip - name: upload-win-arm64 id: upload-win-arm64 uses: actions/upload-release-asset@master @@ -107,7 +107,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-linux-x64.zip - target-path: /downloads/linker/v1.2.9/linker-linux-x64.zip + target-path: /downloads/linker/v1.3.0/linker-linux-x64.zip - name: upload-linux-x64 id: upload-linux-x64 uses: actions/upload-release-asset@master @@ -127,7 +127,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-linux-arm.zip - target-path: /downloads/linker/v1.2.9/linker-linux-arm.zip + target-path: /downloads/linker/v1.3.0/linker-linux-arm.zip - name: upload-linux-arm id: upload-linux-arm uses: actions/upload-release-asset@master @@ -147,7 +147,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-linux-arm64.zip - target-path: /downloads/linker/v1.2.9/linker-linux-arm64.zip + target-path: /downloads/linker/v1.3.0/linker-linux-arm64.zip - name: upload-linux-arm64 id: upload-linux-arm64 uses: actions/upload-release-asset@master @@ -167,7 +167,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-linux-musl-x64.zip - target-path: /downloads/linker/v1.2.9/linker-linux-musl-x64.zip + target-path: /downloads/linker/v1.3.0/linker-linux-musl-x64.zip - name: upload-linux-musl-x64 id: upload-linux-musl-x64 uses: actions/upload-release-asset@master @@ -187,7 +187,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-linux-musl-arm.zip - target-path: /downloads/linker/v1.2.9/linker-linux-musl-arm.zip + target-path: /downloads/linker/v1.3.0/linker-linux-musl-arm.zip - name: upload-linux-musl-arm id: upload-linux-musl-arm uses: actions/upload-release-asset@master @@ -207,7 +207,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-linux-musl-arm64.zip - target-path: /downloads/linker/v1.2.9/linker-linux-musl-arm64.zip + target-path: /downloads/linker/v1.3.0/linker-linux-musl-arm64.zip - name: upload-linux-musl-arm64 id: upload-linux-musl-arm64 uses: actions/upload-release-asset@master @@ -227,7 +227,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-osx-x64.zip - target-path: /downloads/linker/v1.2.9/linker-osx-x64.zip + target-path: /downloads/linker/v1.3.0/linker-osx-x64.zip - name: upload-osx-x64 id: upload-osx-x64 uses: actions/upload-release-asset@master @@ -247,7 +247,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-osx-arm64.zip - target-path: /downloads/linker/v1.2.9/linker-osx-arm64.zip + target-path: /downloads/linker/v1.3.0/linker-osx-arm64.zip - name: upload-osx-arm64 id: upload-osx-arm64 uses: actions/upload-release-asset@master @@ -277,7 +277,7 @@ jobs: key-secret: ${{ secrets.ALIYUN_OSS_SECRET }} bucket: ide-qbcode asset-path: ./public/publish-zip/linker-windows-route.zip - target-path: /downloads/linker/v1.2.9/linker-windows-route.zip + target-path: /downloads/linker/v1.3.0/linker-windows-route.zip - name: upload-windows-route id: upload-windows-route uses: actions/upload-release-asset@master diff --git a/linker.libs/linker.libs.csproj b/linker.libs/linker.libs.csproj index 60acffc9..ad60c08c 100644 --- a/linker.libs/linker.libs.csproj +++ b/linker.libs/linker.libs.csproj @@ -14,9 +14,9 @@ snltty https://github.com/snltty/linker https://github.com/snltty/linker - 1.2.9 - 1.2.9 - 1.2.9 + 1.3.0 + 1.3.0 + 1.3.0 full diff --git a/linker.tun/linker.tun.csproj b/linker.tun/linker.tun.csproj index 645cd17f..bd2691d6 100644 --- a/linker.tun/linker.tun.csproj +++ b/linker.tun/linker.tun.csproj @@ -9,7 +9,7 @@ true true linker tun - 1.2.9 + 1.3.0 snltty snltty linker tun @@ -17,8 +17,8 @@ https://github.com/snltty/linker https://github.com/snltty/linker linker tun - 1.2.9 - 1.2.9 + 1.3.0 + 1.3.0 diff --git a/linker.tunnel/linker.tunnel.csproj b/linker.tunnel/linker.tunnel.csproj index 98d4e90b..241e5cf7 100644 --- a/linker.tunnel/linker.tunnel.csproj +++ b/linker.tunnel/linker.tunnel.csproj @@ -9,7 +9,7 @@ true true linker tunnel - 1.2.9 + 1.3.0 snltty snltty linker tunnel @@ -17,8 +17,8 @@ https://github.com/snltty/linker https://github.com/snltty/linker linker tunnel - 1.2.9 - 1.2.9 + 1.3.0 + 1.3.0 diff --git a/linker/linker.csproj b/linker/linker.csproj index 0a2e81c1..c42ec1e8 100644 --- a/linker/linker.csproj +++ b/linker/linker.csproj @@ -17,16 +17,21 @@ true false linker - 1.2.9 + 1.3.0 snltty snltty - 1. 选择是否自动同步配置文件 + 1. 选择是否自动同步配置文件 +2. 优化中继 +3. 客户端配置文件加密 +4. 导出无管理权限的客户端节点配置文件 +5. 需要更新服务端 +6. 测试中,,请稍等再更新 snltty https://github.com/snltty/linker https://github.com/snltty/linker linker - 1.2.9 - 1.2.9 + 1.3.0 + 1.3.0 diff --git a/linker/plugins/relay/RelayTransfer.cs b/linker/plugins/relay/RelayTransfer.cs index a841eeee..310b2348 100644 --- a/linker/plugins/relay/RelayTransfer.cs +++ b/linker/plugins/relay/RelayTransfer.cs @@ -181,8 +181,9 @@ namespace linker.plugins.relay SecretKey = item.SecretKey, Server = server, TransactionId = transactionId, - TransportName = $"{transport.Name}|{item.Name}", - SSL = item.SSL + TransportName = transport.Name, + SSL = item.SSL, + ServerName = item.Name }; LoggerHelper.Instance.Info($"relay to {relayInfo.RemoteMachineId}->{relayInfo.RemoteMachineName} {relayInfo.ToJson()}"); @@ -224,7 +225,9 @@ namespace linker.plugins.relay try { - await TestServer(relayInfo); + RelayServerInfo server = running.Data.Relay.Servers.FirstOrDefault(c => c.Name == relayInfo.ServerName) ?? running.Data.Relay.Servers.FirstOrDefault(); + relayInfo.Server = NetworkHelper.GetEndPoint(server.Host, 3478); + ITransport _transports = transports.FirstOrDefault(c => c.Name == relayInfo.TransportName); if (_transports != null) { @@ -257,28 +260,6 @@ namespace linker.plugins.relay } return false; } - private async Task TestServer(RelayInfo relayInfo) - { - string[] arr = relayInfo.TransportName.Split('|'); - relayInfo.TransportName = arr[0]; - - try - { - Socket socket = new Socket(relayInfo.Server.AddressFamily, SocketType.Stream, ProtocolType.Tcp); - await socket.ConnectAsync(relayInfo.Server).WaitAsync(TimeSpan.FromMilliseconds(500)).ConfigureAwait(false); - socket.SafeClose(); - } - catch (Exception) - { - RelayServerInfo server = null; - if (arr.Length > 1) - { - server = running.Data.Relay.Servers.FirstOrDefault(c => c.Name == arr[1]); - } - server ??= running.Data.Relay.Servers.FirstOrDefault(); - relayInfo.Server = NetworkHelper.GetEndPoint(server.Host, 3478); - } - } /// /// 回调 diff --git a/linker/plugins/relay/transport/ITransport.cs b/linker/plugins/relay/transport/ITransport.cs index be11efb0..3222733d 100644 --- a/linker/plugins/relay/transport/ITransport.cs +++ b/linker/plugins/relay/transport/ITransport.cs @@ -117,5 +117,10 @@ namespace linker.plugins.relay.transport /// 是否ssl /// public bool SSL { get; set; } = true; + + /// + /// 服务器名 + /// + public string ServerName { get; set; } } } diff --git a/version.txt b/version.txt index 8f0c6b9f..dd73236f 100644 --- a/version.txt +++ b/version.txt @@ -1,3 +1,8 @@ -v1.2.9 -2024-09-04 17:41:53 -1. 选择是否自动同步配置文件 \ No newline at end of file +v1.3.0 +2024-09-05 09:20:19 +1. 选择是否自动同步配置文件 +2. 优化中继 +3. 客户端配置文件加密 +4. 导出无管理权限的客户端节点配置文件 +5. 需要更新服务端 +6. 测试中,,请稍等再更新 \ No newline at end of file