From 0c16b363a1c2c668784dbeeb005cb7c07212c84b Mon Sep 17 00:00:00 2001 From: Bruce Wayne Date: Fri, 16 Jun 2023 12:12:26 +0800 Subject: [PATCH] dep: Update deps --- .github/dependabot.yml | 25 ------------------- .github/renovate.json | 18 +++++++++++++ .github/workflows/CI.yml | 11 +++----- Benchmark/Benchmark.csproj | 2 +- HttpProxy/HttpProxy.csproj | 2 +- .../Pipelines.Extensions.csproj | 4 +-- Shadowsocks.Crypto/Shadowsocks.Crypto.csproj | 2 +- .../ListenServices/TcpListenService.cs | 7 +----- .../LocalUdpServices/Socks5UdpService.cs | 5 +++- .../Shadowsocks.Protocol.csproj | 6 ++--- TestConsoleApp/TestConsoleApp.csproj | 10 ++++---- UnitTest/UnitTest.csproj | 8 +++--- common.props | 2 +- 13 files changed, 44 insertions(+), 58 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/renovate.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index d94811c..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,25 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - time: "07:00" - timezone: "Asia/Shanghai" - labels: - - "Automatic" - open-pull-requests-limit: 99 - - package-ecosystem: "nuget" - directory: "/" - schedule: - interval: "daily" - time: "07:15" - timezone: "Asia/Shanghai" - labels: - - "Automatic" - open-pull-requests-limit: 99 diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..1471bba --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "assignees": [ + "HMBSbige" + ], + "commitMessagePrefix": "dep:", + "dependencyDashboard": false, + "extends": [ + "config:base", + ":automergeBranch", + ":automergeDigest", + ":automergeMinor", + ":disableRateLimiting" + ], + "labels": [ + "Automatic" + ] +} \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fbfc435..12e05f0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x @@ -65,7 +65,7 @@ jobs: uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x @@ -85,14 +85,9 @@ jobs: runs-on: ubuntu-latest steps: - - name: Changelog - uses: glennawatson/ChangeLog@v1 - id: changelog - - name: Create Release uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - body: ${{ steps.changelog.outputs.commitLog }} draft: false prerelease: false diff --git a/Benchmark/Benchmark.csproj b/Benchmark/Benchmark.csproj index 2123a6c..8268d9e 100644 --- a/Benchmark/Benchmark.csproj +++ b/Benchmark/Benchmark.csproj @@ -3,7 +3,7 @@ - + diff --git a/HttpProxy/HttpProxy.csproj b/HttpProxy/HttpProxy.csproj index adf5cc7..4150a56 100644 --- a/HttpProxy/HttpProxy.csproj +++ b/HttpProxy/HttpProxy.csproj @@ -11,7 +11,7 @@ - + diff --git a/Pipelines.Extensions/Pipelines.Extensions.csproj b/Pipelines.Extensions/Pipelines.Extensions.csproj index 8d9d475..e403d3e 100644 --- a/Pipelines.Extensions/Pipelines.Extensions.csproj +++ b/Pipelines.Extensions/Pipelines.Extensions.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Shadowsocks.Crypto/Shadowsocks.Crypto.csproj b/Shadowsocks.Crypto/Shadowsocks.Crypto.csproj index ebf5305..f3aefd4 100644 --- a/Shadowsocks.Crypto/Shadowsocks.Crypto.csproj +++ b/Shadowsocks.Crypto/Shadowsocks.Crypto.csproj @@ -11,7 +11,7 @@ - + diff --git a/Shadowsocks.Protocol/ListenServices/TcpListenService.cs b/Shadowsocks.Protocol/ListenServices/TcpListenService.cs index dce6b71..0173bee 100644 --- a/Shadowsocks.Protocol/ListenServices/TcpListenService.cs +++ b/Shadowsocks.Protocol/ListenServices/TcpListenService.cs @@ -60,12 +60,7 @@ private async Task HandleAsync(Socket socket, CancellationToken token) ReadResult result = await pipe.Input.ReadAsync(token); ReadOnlySequence buffer = result.Buffer; - ILocalTcpService? service = _services.FirstOrDefault(tcpService => tcpService.IsHandle(buffer)); - - if (service is null) - { - throw new InvalidDataException(@"Cannot handle incoming pipe."); - } + ILocalTcpService service = _services.FirstOrDefault(tcpService => tcpService.IsHandle(buffer)) ?? throw new InvalidDataException(@"Cannot handle incoming pipe."); pipe.Input.AdvanceTo(buffer.Start, buffer.End); pipe.Input.CancelPendingRead(); diff --git a/Shadowsocks.Protocol/LocalUdpServices/Socks5UdpService.cs b/Shadowsocks.Protocol/LocalUdpServices/Socks5UdpService.cs index 0a62295..9dd04d5 100644 --- a/Shadowsocks.Protocol/LocalUdpServices/Socks5UdpService.cs +++ b/Shadowsocks.Protocol/LocalUdpServices/Socks5UdpService.cs @@ -1,3 +1,4 @@ +using Microsoft; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Logging; using Shadowsocks.Protocol.ServersControllers; @@ -69,7 +70,7 @@ public async ValueTask HandleAsync(UdpReceiveResult receiveResult, UdpClient inc _ => socks5UdpPacket.Address!.ToString() }; - if (!_cache.TryGetValue(receiveResult.RemoteEndPoint, out IUdpClient client)) + if (!_cache.TryGetValue(receiveResult.RemoteEndPoint, out IUdpClient? client)) { client = await _serversController.GetServerUdpAsync(target, socks5UdpPacket.Port); if (client is ConnectionRefusedUdpClient) @@ -83,6 +84,8 @@ public async ValueTask HandleAsync(UdpReceiveResult receiveResult, UdpClient inc _logger.LogInformation(@"Udp Send to {Target} via {Client}", target, client); Memory sendBuffer = receiveResult.Buffer.AsMemory(3); //TODO Only support ss now + + Assumes.NotNull(client); await client.SendAsync(sendBuffer, cancellationToken); byte[] receiveBuffer = ArrayPool.Shared.Rent(0x10000); diff --git a/Shadowsocks.Protocol/Shadowsocks.Protocol.csproj b/Shadowsocks.Protocol/Shadowsocks.Protocol.csproj index 271e23b..362d2a2 100644 --- a/Shadowsocks.Protocol/Shadowsocks.Protocol.csproj +++ b/Shadowsocks.Protocol/Shadowsocks.Protocol.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/TestConsoleApp/TestConsoleApp.csproj b/TestConsoleApp/TestConsoleApp.csproj index 4eb9c57..ecd83f0 100644 --- a/TestConsoleApp/TestConsoleApp.csproj +++ b/TestConsoleApp/TestConsoleApp.csproj @@ -7,12 +7,12 @@ - - - - + + + + - + diff --git a/UnitTest/UnitTest.csproj b/UnitTest/UnitTest.csproj index 3760f80..81838ef 100644 --- a/UnitTest/UnitTest.csproj +++ b/UnitTest/UnitTest.csproj @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/common.props b/common.props index be3f93c..317df97 100644 --- a/common.props +++ b/common.props @@ -5,7 +5,7 @@ enable enable HMBSbige - Copyright © 2021-2022 HMBSbige + Copyright © 2021-2023 HMBSbige MIT https://github.com/HMBSbige/Shadowsocks.Net https://github.com/HMBSbige/Shadowsocks.Net