diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4445011c..0a51e727 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,9 +57,9 @@ jobs: docker tag snltty/linker-musl-x64:latest snltty/linker-musl:amd64 && \ docker push snltty/linker-musl:amd64 && \ docker manifest create snltty/linker-musl:latest snltty/linker-musl:amd64 snltty/linker-musl:arm64 snltty/linker-musl:arm && \ - docker manifest create snltty/linker-musl:v1.6.1 snltty/linker-musl:amd64 snltty/linker-musl:arm64 snltty/linker-musl:arm && \ + docker manifest create snltty/linker-musl:v1.6.2 snltty/linker-musl:amd64 snltty/linker-musl:arm64 snltty/linker-musl:arm && \ docker manifest push snltty/linker-musl:latest && \ - docker manifest push snltty/linker-musl:v1.6.1 && \ + docker manifest push snltty/linker-musl:v1.6.2 && \ docker pull --platform linux/arm/v7 snltty/linker-debian-arm:latest && \ docker tag snltty/linker-debian-arm:latest snltty/linker-debian:arm && \ docker push snltty/linker-debian:arm && \ @@ -70,6 +70,6 @@ jobs: docker tag snltty/linker-debian-x64:latest snltty/linker-debian:amd64 && \ docker push snltty/linker-debian:amd64 && \ docker manifest create snltty/linker-debian:latest snltty/linker-debian:amd64 snltty/linker-debian:arm64 snltty/linker-debian:arm && \ - docker manifest create snltty/linker-debian:v1.6.1 snltty/linker-debian:amd64 snltty/linker-debian:arm64 snltty/linker-debian:arm && \ + docker manifest create snltty/linker-debian:v1.6.2 snltty/linker-debian:amd64 snltty/linker-debian:arm64 snltty/linker-debian:arm && \ docker manifest push snltty/linker-debian:latest && \ - docker manifest push snltty/linker-debian:v1.6.1 \ No newline at end of file + docker manifest push snltty/linker-debian:v1.6.2 \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 00bd1e79..cde750f7 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.6.1 - release_name: v1.6.1.${{ steps.date.outputs.today }} + tag_name: v1.6.2 + release_name: v1.6.2.${{ steps.date.outputs.today }} draft: false prerelease: false - body: "1. 优化中继节点\r\n2. 优化虚拟网卡的端口转发,仅有变化时重建列表\r\n3. 优化网点对网和网对网,目标下线后,更新路由\r\n4. 优化端口转发,端口监听失败多尝试几次" + body: "1. 修复UI\r\n2. 修复服务端重启无法关闭内网穿透的问题\r\n3. 修复网络掩码计算错误" - 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.6.1/linker-win-x86.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-win-x64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-win-arm64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-linux-x64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-linux-arm.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-linux-arm64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-linux-musl-x64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-linux-musl-arm.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-linux-musl-arm64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-osx-x64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-osx-arm64.zip + target-path: /downloads/linker/v1.6.2/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.6.1/linker-windows-route.zip + target-path: /downloads/linker/v1.6.2/linker-windows-route.zip - name: upload-version-oss id: upload-version-oss uses: tvrcgo/oss-action@v0.1.1 diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index ef3a1ec4..febe1d8b 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -38,6 +38,6 @@ jobs: - name: Push run: | - nuget push ./linker.tunnel/bin/release/linker.tunnel.1.6.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol - nuget push ./linker.libs/bin/release/linker.libs.1.6.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol - nuget push ./linker.tun/bin/release/linker.tun.1.6.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol + nuget push ./linker.tunnel/bin/release/linker.tunnel.1.6.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol + nuget push ./linker.libs/bin/release/linker.libs.1.6.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol + nuget push ./linker.tun/bin/release/linker.tun.1.6.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol diff --git a/linker.libs/NetworkHelper.cs b/linker.libs/NetworkHelper.cs index c1d70494..d650496b 100644 --- a/linker.libs/NetworkHelper.cs +++ b/linker.libs/NetworkHelper.cs @@ -96,7 +96,6 @@ namespace linker.libs } - static List starts = new() { "10.", "100.", "192.168.", "172." }; public static ushort GetRouteLevel(string server, out List result) { @@ -163,7 +162,6 @@ namespace linker.libs } - private static byte[] ipv6LocalBytes = new byte[] { 254, 128, 0, 0, 0, 0, 0, 0 }; public static IPAddress[] GetIPV6() { @@ -194,19 +192,17 @@ namespace linker.libs return Array.Empty(); } - public static byte PrefixValue2Length(uint ip) { - byte maskLength = 32; - for (int i = 0; i < sizeof(uint); i++) + int maskLength = 32, i; + for (i = 0; i < sizeof(uint) * 8; i++) { - if (((ip >> (i * 8)) & 0x000000ff) != 0) + if (((ip >> i) & 0x01) != 0) { break; } - maskLength -= 8; } - return maskLength; + return (byte)(maskLength - i); } public static uint PrefixLength2Value(byte prefixLength) { @@ -219,7 +215,6 @@ namespace linker.libs return new IPAddress(BitConverter.GetBytes(BinaryPrimitives.ReverseEndianness(prefixIP))); } - public static uint IP2Value(IPAddress ip) { return BinaryPrimitives.ReadUInt32BigEndian(ip.GetAddressBytes()); @@ -229,7 +224,6 @@ namespace linker.libs return new IPAddress(BitConverter.GetBytes(BinaryPrimitives.ReverseEndianness(value))); } - public static IPAddress NetworkIP2IP(IPAddress ip, uint prefixIP) { return NetworkValue2Ip(BinaryPrimitives.ReadUInt32BigEndian(ip.GetAddressBytes()), prefixIP); diff --git a/linker.libs/linker.libs.csproj b/linker.libs/linker.libs.csproj index 91757809..243a212e 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.6.1 - 1.6.1 - 1.6.1 + 1.6.2 + 1.6.2 + 1.6.2 full diff --git a/linker.tray.win/dist/linker.tray.win.exe b/linker.tray.win/dist/linker.tray.win.exe index fa69d938..d805d618 100644 Binary files a/linker.tray.win/dist/linker.tray.win.exe and b/linker.tray.win/dist/linker.tray.win.exe differ diff --git a/linker.tun/linker.tun.csproj b/linker.tun/linker.tun.csproj index a582a4ba..ea532587 100644 --- a/linker.tun/linker.tun.csproj +++ b/linker.tun/linker.tun.csproj @@ -16,9 +16,9 @@ https://github.com/snltty/linker https://github.com/snltty/linker linker tun - 1.6.1 - 1.6.1 - 1.6.1 + 1.6.2 + 1.6.2 + 1.6.2 diff --git a/linker.tunnel/linker.tunnel.csproj b/linker.tunnel/linker.tunnel.csproj index 7383d609..63596790 100644 --- a/linker.tunnel/linker.tunnel.csproj +++ b/linker.tunnel/linker.tunnel.csproj @@ -16,9 +16,9 @@ https://github.com/snltty/linker https://github.com/snltty/linker linker tunnel - 1.6.1 - 1.6.1 - 1.6.1 + 1.6.2 + 1.6.2 + 1.6.2 diff --git a/linker/linker.csproj b/linker/linker.csproj index e2f6d4c8..b9013763 100644 --- a/linker/linker.csproj +++ b/linker/linker.csproj @@ -21,17 +21,16 @@ linker snltty snltty - 1. 优化中继节点 -2. 优化虚拟网卡的端口转发,仅有变化时重建列表 -3. 优化网点对网和网对网,目标下线后,更新路由 -4. 优化端口转发,端口监听失败多尝试几次 + 1. 修复UI +2. 修复服务端重启无法关闭内网穿透的问题 +3. 修复网络掩码计算错误 snltty https://github.com/snltty/linker https://github.com/snltty/linker linker - 1.6.1 - 1.6.1 - 1.6.1 + 1.6.2 + 1.6.2 + 1.6.2 diff --git a/linker/plugins/tuntap/lease/LeaseClientTreansfer.cs b/linker/plugins/tuntap/lease/LeaseClientTreansfer.cs index 14242633..c1608d88 100644 --- a/linker/plugins/tuntap/lease/LeaseClientTreansfer.cs +++ b/linker/plugins/tuntap/lease/LeaseClientTreansfer.cs @@ -4,6 +4,7 @@ using linker.plugins.client; using linker.plugins.messenger; using linker.plugins.tuntap.messenger; using linker.libs; +using linker.libs.extends; namespace linker.plugins.tuntap.lease { @@ -39,7 +40,8 @@ namespace linker.plugins.tuntap.lease }); if (resp.Code == MessageResponeCodes.OK) { - return MemoryPackSerializer.Deserialize(resp.Data.Span); + LeaseInfo info = MemoryPackSerializer.Deserialize(resp.Data.Span); + return info; } return new LeaseInfo { IP = IPAddress.Any, PrefixLength = 24 }; } diff --git a/linker/plugins/tuntap/lease/LeaseServerTreansfer.cs b/linker/plugins/tuntap/lease/LeaseServerTreansfer.cs index ff0cc54d..069493c6 100644 --- a/linker/plugins/tuntap/lease/LeaseServerTreansfer.cs +++ b/linker/plugins/tuntap/lease/LeaseServerTreansfer.cs @@ -4,6 +4,7 @@ using System.Net; using linker.libs; using MemoryPack; using System.Collections.Concurrent; +using linker.libs.extends; namespace linker.plugins.tuntap.lease { diff --git a/publish-docker.sh b/publish-docker.sh index b77ea863..4a996034 100644 --- a/publish-docker.sh +++ b/publish-docker.sh @@ -33,16 +33,16 @@ do fi done cd public/publish/docker/linux-${p}-x64/${f} - docker buildx build -f ${target}/public/publish/docker/linux-${p}-x64/${f}/Dockerfile-${p} --platform="linux/x86_64" --force-rm -t "${image}-${p}-x64:latest" -t "${image}-${p}-x64:v1.6.1" . --push + docker buildx build -f ${target}/public/publish/docker/linux-${p}-x64/${f}/Dockerfile-${p} --platform="linux/x86_64" --force-rm -t "${image}-${p}-x64:latest" -t "${image}-${p}-x64:v1.6.2" . --push cd ../../../../../ cd public/publish/docker/linux-${p}-arm64/${f} - docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm64/${f}/Dockerfile-${p} --platform="linux/arm64" --force-rm -t "${image}-${p}-arm64:latest" -t "${image}-${p}-arm64:v1.6.1" . --push + docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm64/${f}/Dockerfile-${p} --platform="linux/arm64" --force-rm -t "${image}-${p}-arm64:latest" -t "${image}-${p}-arm64:v1.6.2" . --push cd ../../../../../ cd public/publish/docker/linux-${p}-arm/${f} - docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm/${f}/Dockerfile-${p} --platform="linux/arm/v7" --force-rm -t "${image}-${p}-arm:latest" -t "${image}-${p}-arm:v1.6.1" . --push + docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm/${f}/Dockerfile-${p} --platform="linux/arm/v7" --force-rm -t "${image}-${p}-arm:latest" -t "${image}-${p}-arm:v1.6.2" . --push cd ../../../../../ done done \ No newline at end of file diff --git a/version.txt b/version.txt index 6fa386a8..5df6c2e2 100644 --- a/version.txt +++ b/version.txt @@ -1,6 +1,5 @@ -v1.6.1 -2024-12-07 01:21:43 -1. 优化中继节点 -2. 优化虚拟网卡的端口转发,仅有变化时重建列表 -3. 优化网点对网和网对网,目标下线后,更新路由 -4. 优化端口转发,端口监听失败多尝试几次 \ No newline at end of file +v1.6.2 +2024-12-07 13:37:13 +1. 修复UI +2. 修复服务端重启无法关闭内网穿透的问题 +3. 修复网络掩码计算错误 \ No newline at end of file