mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
chore: update to .net 8
This commit is contained in:
parent
9716922ab5
commit
2d564535af
26 changed files with 1453 additions and 4487 deletions
4
.github/workflows/dotnetcore.yml
vendored
4
.github/workflows/dotnetcore.yml
vendored
|
|
@ -24,7 +24,7 @@ jobs:
|
|||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Build with dotnet
|
||||
run: dotnet build --configuration Release
|
||||
test:
|
||||
|
|
@ -36,6 +36,6 @@ jobs:
|
|||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Run automated tests
|
||||
run: dotnet test --configuration Release
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ COPY . /app
|
|||
RUN dotnet build -c Release -o bin
|
||||
|
||||
# Build runtime stage (doesn't include SDK)
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
LABEL org.opencontainers.image.source = "https://github.com/PluralKit/PluralKit"
|
||||
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
|
@ -21,17 +21,17 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.13.0"/>
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.32.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Polly" Version="7.2.1"/>
|
||||
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1"/>
|
||||
<PackageReference Include="Serilog" Version="2.10.0"/>
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
<PackageReference Include="System.Linq.Async" Version="5.0.0"/>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.29.1" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.67.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.68.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Polly" Version="8.5.0" />
|
||||
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
|
||||
<PackageReference Include="Serilog" Version="4.2.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.8.22" />
|
||||
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="../proto/discord_cache.proto" GrpcServices="Client" Link="Protos/discord_cache.proto"/>
|
||||
<Protobuf Include="../proto/discord_cache.proto" GrpcServices="Client" Link="Protos/discord_cache.proto" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,38 +1,37 @@
|
|||
{
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net6.0": {
|
||||
"net8.0": {
|
||||
"Google.Protobuf": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.13.0, )",
|
||||
"resolved": "3.13.0",
|
||||
"contentHash": "/6VgKCh0P59x/rYsBkCvkUanF0TeUYzwV9hzLIWgt23QRBaKHoxaaMkidEWhKibLR88c3PVCXyyrx9Xlb+Ne6w==",
|
||||
"dependencies": {
|
||||
"System.Memory": "4.5.2",
|
||||
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
|
||||
}
|
||||
"requested": "[3.29.1, )",
|
||||
"resolved": "3.29.1",
|
||||
"contentHash": "kDFLP72bPu4GwquVN7HtFnfqxhQs4CLbUEyOc/0yV48HB0Pxf7tDK7zIx6ifaQwGp+RSoLY1sz1CXqoAEAu+AQ=="
|
||||
},
|
||||
"Grpc.Net.ClientFactory": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.32.0, )",
|
||||
"resolved": "2.32.0",
|
||||
"contentHash": "ixqSWxPK49P+5z6M2dDBHca0k+sXFe2KHHTJK3P+YXp6QOTHv5CHxNdaW8GrFF34Eh1FJ56Q2ADe383+FEAp6Q==",
|
||||
"requested": "[2.67.0, )",
|
||||
"resolved": "2.67.0",
|
||||
"contentHash": "owkRL6j8ZXvLnn8SsFGCRiWoe/2wGv+u+TASAylzUtGbHLnw7IiFRoeTs0IgpCNTETvlMLVb0gHDiLGo+mJZ6g==",
|
||||
"dependencies": {
|
||||
"Grpc.Net.Client": "2.32.0",
|
||||
"Microsoft.Extensions.Http": "3.0.3"
|
||||
"Grpc.Net.Client": "2.67.0",
|
||||
"Microsoft.Extensions.Http": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Grpc.Tools": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.47.0, )",
|
||||
"resolved": "2.47.0",
|
||||
"contentHash": "nInNoLfT/zR7+0VNIC4Lu5nF8azjTz3KwHB1ckwsYUxvof4uSxIt/LlCKb/NH7GPfXfdvqDDinguPpP5t55nuA=="
|
||||
"requested": "[2.68.1, )",
|
||||
"resolved": "2.68.1",
|
||||
"contentHash": "BZ96s7ijKAhJoRpIK+pqCeLaGaSwyc5/CAZFwgCcBuAnkU2naYvH0P6qnYCkl0pWDY/JBOnE2RvX9IvRX1Yc5Q=="
|
||||
},
|
||||
"Polly": {
|
||||
"type": "Direct",
|
||||
"requested": "[7.2.1, )",
|
||||
"resolved": "7.2.1",
|
||||
"contentHash": "Od8SnPlpQr+PuAS0YzY3jgtzaDNknlIuAaldN2VEIyTvm/wCg22C5nUkUV1BEG8rIsub5RFMoV/NEQ0tM/+7Uw=="
|
||||
"requested": "[8.5.0, )",
|
||||
"resolved": "8.5.0",
|
||||
"contentHash": "GBNZPy7i7OpkaIruWPRJ0+AWzdGDQDnKY91b7Ic2aAch4lKhPjUc5KSffpH9krIWe0MoyghqaRxwRC0Uwz2PkA==",
|
||||
"dependencies": {
|
||||
"Polly.Core": "8.5.0"
|
||||
}
|
||||
},
|
||||
"Polly.Contrib.WaitAndRetry": {
|
||||
"type": "Direct",
|
||||
|
|
@ -42,242 +41,145 @@
|
|||
},
|
||||
"Serilog": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.10.0, )",
|
||||
"resolved": "2.10.0",
|
||||
"contentHash": "+QX0hmf37a0/OZLxM3wL7V6/ADvC1XihXN4Kq/p6d8lCPfgkRdiuhbWlMaFjR9Av0dy5F0+MBeDmDdRZN/YwQA=="
|
||||
"requested": "[4.2.0, )",
|
||||
"resolved": "4.2.0",
|
||||
"contentHash": "gmoWVOvKgbME8TYR+gwMf7osROiWAURterc6Rt2dQyX7wtjZYpqFiA/pY6ztjGQKKV62GGCyOcmtP1UKMHgSmA=="
|
||||
},
|
||||
"StackExchange.Redis": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.2.88, )",
|
||||
"resolved": "2.2.88",
|
||||
"contentHash": "JJi1jcO3/ZiamBhlsC/TR8aZmYf+nqpGzMi0HRRCy5wJkUPmMnRp0kBA6V84uhU8b531FHSdTDaFCAyCUJomjA==",
|
||||
"requested": "[2.8.22, )",
|
||||
"resolved": "2.8.22",
|
||||
"contentHash": "GRA97f4cHYxBI/fKOfgs3GyKklc5is6YKM2yWbkiCZGR/JKsXIo0sRJSSeJabriJAZkKFthM0rXnULFfSbs0KA==",
|
||||
"dependencies": {
|
||||
"Pipelines.Sockets.Unofficial": "2.2.0",
|
||||
"System.Diagnostics.PerformanceCounter": "5.0.0"
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
|
||||
"Pipelines.Sockets.Unofficial": "2.2.8"
|
||||
}
|
||||
},
|
||||
"System.Linq.Async": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "cPtIuuH8TIjVHSi2ewwReWGW1PfChPE0LxPIDlfwVcLuTM9GANFTXiMB7k3aC4sk3f0cQU25LNKzx+jZMxijqw=="
|
||||
"requested": "[6.0.1, )",
|
||||
"resolved": "6.0.1",
|
||||
"contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Bcl.AsyncInterfaces": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Grpc.Core.Api": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.32.0",
|
||||
"contentHash": "t9H6P/oYA4ZQI4fWq4eEwq2GmMNqmOSRfz5+YIat7pQuFmz1hRC2Vq/fL9ZVV1mjd5kHqBlhupMdlsBOsaxeEw==",
|
||||
"dependencies": {
|
||||
"System.Memory": "4.5.3"
|
||||
}
|
||||
"resolved": "2.67.0",
|
||||
"contentHash": "cL1/2f8kc8lsAGNdfCU25deedXVehhLA6GXKLLN4hAWx16XN7BmjYn3gFU+FBpir5yJynvDTHEypr3Tl0j7x/Q=="
|
||||
},
|
||||
"Grpc.Net.Client": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.32.0",
|
||||
"contentHash": "T4lKl51ahaSprLcgoZvgn8zYwh834DpaPnrDs6jBRdipL2NHIAC0rPeE7UyzDp/lzv4Xll2tw1u65Fg9ckvErg==",
|
||||
"resolved": "2.67.0",
|
||||
"contentHash": "ofTjJQfegWkVlk5R4k/LlwpcucpsBzntygd4iAeuKd/eLMkmBWoXN+xcjYJ5IibAahRpIJU461jABZvT6E9dwA==",
|
||||
"dependencies": {
|
||||
"Grpc.Net.Common": "2.32.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "3.0.3",
|
||||
"System.Diagnostics.DiagnosticSource": "4.5.1"
|
||||
"Grpc.Net.Common": "2.67.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Grpc.Net.Common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.32.0",
|
||||
"contentHash": "vDsgy6fs+DlsylppjK9FBGTMMUe8vfAmaURV7ZTurM27itr8qBwymgqmwnVB2hcP1q35NqKx2NvPGe5S2IEnDw==",
|
||||
"resolved": "2.67.0",
|
||||
"contentHash": "gazn1cD2Eol0/W5ZJRV4PYbNrxJ9oMs8pGYux5S9E4MymClvl7aqYSmpqgmWAUWvziRqK9K+yt3cjCMfQ3x/5A==",
|
||||
"dependencies": {
|
||||
"Grpc.Core.Api": "2.32.0"
|
||||
"Grpc.Core.Api": "2.67.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration": {
|
||||
"Microsoft.Bcl.AsyncInterfaces": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "0F/MLd7yOSjhswQSFO6tkTREHxBffE/AS9gnvtx1jVFaKNdJPEj+2KOdREmYZ4Orpvf4nwXGwbRpX5SLlwIPEw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "3.0.3"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "ND+ka7njp3HgVJCVn0YgpuxbFWBOCkcQaK+UBGJNseDhjz6I/qpXmCqLK+nXSzxU7cdscFWnUJS6wjEEEkMvSQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "3.0.3"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Binder": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "hRmuReZgWqWqko4RXaGd/DP9L7380+HafHgbR5CMc7AZYmoLpUmeV8O8sgZqJONCbzg1q0Sz8U8Gy99eETpGPA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "3.0.3"
|
||||
}
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "Vu59TuHl3zoRI8vwK6gQL2EbWI2Qf/uBHFkSJXb4pgNvW7g8yK6Gn3v1bXDIKbMKEneTApriHfCVde0O314K+g==",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.0.3"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "Wb1ejBzHhCvp7VMr+M7vlHoXb68mJ89IHj4L+TzL8yA+X7Iz2UTAEkl8aIbhRloroYJw5zvlIPtKF5uA4wFlxw=="
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg=="
|
||||
},
|
||||
"Microsoft.Extensions.Http": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "dcyB8szIcSynjVZRuFgqkZpPgTc5zeRSj1HMXSmNqWbHYKiPYJl8ZQgBHz6wmZNSUUNGpCs5uxUg8DZHHDC1Ew==",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "15+pa2G0bAMHbHewaQIdr/y6ag2H3yh4rd9hTXavtWDzQBkvpe2RMqFg8BxDpcQWssmjmBApGPcw93QRz6YcMg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.0.3",
|
||||
"Microsoft.Extensions.Logging": "3.0.3",
|
||||
"Microsoft.Extensions.Options": "3.0.3"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Logging": "6.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Options": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "uAZppu6kWIgS+VtVjqmhh+k3bMztwWQR5HYxI++Cn5Kz5m099g0KJ+krUrckaZP9NqIplQu63tPR5YpNWnjLuw==",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Binder": "3.0.3",
|
||||
"Microsoft.Extensions.DependencyInjection": "3.0.3",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "3.0.3",
|
||||
"Microsoft.Extensions.Options": "3.0.3"
|
||||
"Microsoft.Extensions.DependencyInjection": "6.0.0",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Options": "6.0.0",
|
||||
"System.Diagnostics.DiagnosticSource": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "m2Jyi/MEn043WMI1I6J1ALuCThktZ93rd7eqzYeLmMcA0bdZC+TBVl0LuEbEWM01dWeeBjOoagjNwQTzOi2r6A=="
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA=="
|
||||
},
|
||||
"Microsoft.Extensions.Options": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "cvP/w0kyT9TmrDPMY2ZHJBWx+gRH0jHKaJPkzN47UBpLLC4KbqVU5AoCMK47+ZChlINhqJX2WTflbLe5KufD/A==",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.0.3",
|
||||
"Microsoft.Extensions.Primitives": "3.0.3"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Primitives": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.3",
|
||||
"contentHash": "eJuAFVIH9zUZ7j7tCSbJD+tS0dueENIerwoGxFL8RYqCmbEqQ7wVOG+mt2mZAbEpnMPsGl1Fc/HIhWpB9ftwhg=="
|
||||
},
|
||||
"Microsoft.NETCore.Platforms": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ=="
|
||||
},
|
||||
"Microsoft.Win32.Registry": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==",
|
||||
"dependencies": {
|
||||
"System.Security.AccessControl": "5.0.0",
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Win32.SystemEvents": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "Bh6blKG8VAKvXiLe2L+sEsn62nc1Ij34MrNxepD2OCrS5cpCwQa9MeLyhVQPQ/R4Wlzwuy6wMK8hLb11QPDRsQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "5.0.0"
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Pipelines.Sockets.Unofficial": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.2.0",
|
||||
"contentHash": "7hzHplEIVOGBl5zOQZGX/DiJDHjq+RVRVrYgDiqXb6RriqWAdacXxp+XO9WSrATCEXyNOUOQg9aqQArsjase/A==",
|
||||
"resolved": "2.2.8",
|
||||
"contentHash": "zG2FApP5zxSx6OcdJQLbZDk2AVlN2BNQD6MorwIfV6gVj0RRxWPEp2LXAxqDGZqeNV1Zp0BNPcNaey/GXmTdvQ==",
|
||||
"dependencies": {
|
||||
"System.IO.Pipelines": "5.0.0"
|
||||
"System.IO.Pipelines": "5.0.1"
|
||||
}
|
||||
},
|
||||
"System.Configuration.ConfigurationManager": {
|
||||
"Polly.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "aM7cbfEfVNlEEOj3DsZP+2g9NRwbkyiAv2isQEzw7pnkDg9ekCU2m1cdJLM02Uq691OaCS91tooaxcEn8d0q5w==",
|
||||
"dependencies": {
|
||||
"System.Security.Cryptography.ProtectedData": "5.0.0",
|
||||
"System.Security.Permissions": "5.0.0"
|
||||
}
|
||||
"resolved": "8.5.0",
|
||||
"contentHash": "VYYMZNitZ85UEhwOKkTQI63WEMvzUqwQc74I2mm8h/DBVAMcBBxqYPni4DmuRtbCwngmuONuK2yBJfWNRKzI+A=="
|
||||
},
|
||||
"System.Diagnostics.DiagnosticSource": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.5.1",
|
||||
"contentHash": "zCno/m44ymWhgLFh7tELDG9587q0l/EynPM0m4KgLaWQbz/TEKvNRX2YT5ip2qXW/uayifQ2ZqbnErsKJ4lYrQ=="
|
||||
},
|
||||
"System.Diagnostics.PerformanceCounter": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "kcQWWtGVC3MWMNXdMDWfrmIlFZZ2OdoeT6pSNVRtk9+Sa7jwdPiMlNwb0ZQcS7NRlT92pCfmjRtkSWUW3RAKwg==",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "5.0.0",
|
||||
"Microsoft.Win32.Registry": "5.0.0",
|
||||
"System.Configuration.ConfigurationManager": "5.0.0",
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
}
|
||||
},
|
||||
"System.Drawing.Common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "SztFwAnpfKC8+sEKXAFxCBWhKQaEd97EiOL7oZJZP56zbqnLpmxACWA8aGseaUExciuEAUuR9dY8f7HkTRAdnw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Win32.SystemEvents": "5.0.0"
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "irMYm3vhVgRsYvHTU5b2gsT2CwT/SMM6LZFzuJjpIvT5Z4CshxNsaoBC1X/LltwuR3Opp8d6jOS/60WwOb7Q2Q=="
|
||||
},
|
||||
"System.Memory": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.5.3",
|
||||
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA=="
|
||||
"resolved": "5.0.1",
|
||||
"contentHash": "qEePWsaq9LoEEIqhbGe6D5J8c9IqQOUuTzzV6wn1POlfdLkJliZY3OlB0j0f17uMWlqZYjH7txj+2YbyrIA8Yg=="
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.5.2",
|
||||
"contentHash": "wprSFgext8cwqymChhrBLu62LMg/1u92bU+VOwyfBimSPVFXtsNqEWC92Pf9ofzJFlk4IHmJA75EDJn1b2goAQ=="
|
||||
},
|
||||
"System.Security.AccessControl": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "5.0.0",
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
}
|
||||
},
|
||||
"System.Security.Cryptography.ProtectedData": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "HGxMSAFAPLNoxBvSfW08vHde0F9uh7BjASwu6JF9JnXuEPhCY3YUqURn0+bQV/4UWeaqymmrHWV+Aw9riQCtCA=="
|
||||
},
|
||||
"System.Security.Permissions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "uE8juAhEkp7KDBCdjDIE3H9R1HJuEHqeqX8nLX9gmYKWwsqk3T5qZlPx8qle5DPKimC/Fy3AFTdV7HamgCh9qQ==",
|
||||
"dependencies": {
|
||||
"System.Security.AccessControl": "5.0.0",
|
||||
"System.Windows.Extensions": "5.0.0"
|
||||
}
|
||||
},
|
||||
"System.Security.Principal.Windows": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
|
||||
},
|
||||
"System.Windows.Extensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "c1ho9WU9ZxMZawML+ssPKZfdnrg/OjR3pe0m9v8230z3acqphwvPJqzAkH54xRYm5ntZHGG1EPP3sux9H3qSPg==",
|
||||
"dependencies": {
|
||||
"System.Drawing.Common": "5.0.0"
|
||||
}
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public static class APIJsonExt
|
|||
public static async Task WriteJSON(this HttpResponse resp, int statusCode, string jsonText)
|
||||
{
|
||||
resp.StatusCode = statusCode;
|
||||
resp.Headers.Add("content-type", "application/json");
|
||||
resp.Headers.Append("content-type", "application/json");
|
||||
await resp.WriteAsync(jsonText);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>annotations</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
|
@ -28,12 +28,12 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.2.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.29.1" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.68.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class Startup
|
|||
// add X-PluralKit-Version header
|
||||
app.Use((ctx, next) =>
|
||||
{
|
||||
ctx.Response.Headers.Add("X-PluralKit-Version", BuildInfoService.FullVersion);
|
||||
ctx.Response.Headers.Append("X-PluralKit-Version", BuildInfoService.FullVersion);
|
||||
return next();
|
||||
});
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -74,8 +74,6 @@ public class Bot
|
|||
}
|
||||
};
|
||||
|
||||
_services.Resolve<RedisGatewayService>().OnEventReceived += (e) => OnEventReceived(e.Item1, e.Item2);
|
||||
|
||||
// Init the shard stuff
|
||||
_services.Resolve<ShardInfoService>().Init();
|
||||
|
||||
|
|
@ -269,7 +267,7 @@ public class Bot
|
|||
_logger.Debug("Running once-per-minute scheduled tasks");
|
||||
|
||||
// Check from a new custom status from Redis and update Discord accordingly
|
||||
if (_redis.Connection != null && _config.RedisGatewayUrl == null)
|
||||
if (true)
|
||||
{
|
||||
var newStatus = await _redis.Connection.GetDatabase().StringGetAsync("pluralkit:botstatus");
|
||||
if (newStatus != CustomStatusMessage)
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ public class BotConfig
|
|||
public string? HttpCacheUrl { get; set; }
|
||||
public bool HttpUseInnerCache { get; set; } = false;
|
||||
|
||||
public string? RedisGatewayUrl { get; set; }
|
||||
|
||||
public string? DiscordBaseUrl { get; set; }
|
||||
public string? AvatarServiceUrl { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -184,15 +184,7 @@ public class Init
|
|||
var shardMin = (int)Math.Round(totalShards * (float)nodeIndex / totalNodes);
|
||||
var shardMax = (int)Math.Round(totalShards * (float)(nodeIndex + 1) / totalNodes) - 1;
|
||||
|
||||
if (config.RedisGatewayUrl != null)
|
||||
{
|
||||
var shardService = services.Resolve<RedisGatewayService>();
|
||||
|
||||
for (var i = shardMin; i <= shardMax; i++)
|
||||
await shardService.Start(i);
|
||||
}
|
||||
else
|
||||
await cluster.Start(info.Url, shardMin, shardMax, totalShards, info.SessionStartLimit.MaxConcurrency, redis.Connection);
|
||||
await cluster.Start(info.Url, shardMin, shardMax, totalShards, info.SessionStartLimit.MaxConcurrency, redis.Connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ public class BotModule: Module
|
|||
};
|
||||
}).AsSelf().SingleInstance();
|
||||
builder.RegisterType<Cluster>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<RedisGatewayService>().AsSelf().SingleInstance();
|
||||
builder.Register<IDiscordCache>(c =>
|
||||
{
|
||||
var botConfig = c.Resolve<BotConfig>();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>annotations</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.32.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
|
||||
<PackageReference Include="Sentry" Version="4.12.1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.29.1" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.67.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.68.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
|
||||
<PackageReference Include="Sentry" Version="4.13.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
using System.Text.Json;
|
||||
|
||||
using Serilog;
|
||||
|
||||
using StackExchange.Redis;
|
||||
|
||||
using Myriad.Gateway;
|
||||
using Myriad.Serialization;
|
||||
|
||||
namespace PluralKit.Bot;
|
||||
|
||||
public class RedisGatewayService
|
||||
{
|
||||
private readonly BotConfig _config;
|
||||
private readonly JsonSerializerOptions _jsonSerializerOptions;
|
||||
private ConnectionMultiplexer _redis;
|
||||
private ILogger _logger;
|
||||
|
||||
public RedisGatewayService(BotConfig config, ILogger logger)
|
||||
{
|
||||
_jsonSerializerOptions = new JsonSerializerOptions().ConfigureForMyriad();
|
||||
_config = config;
|
||||
_logger = logger.ForContext<RedisGatewayService>();
|
||||
}
|
||||
|
||||
public event Func<(int, IGatewayEvent), Task>? OnEventReceived;
|
||||
|
||||
public async Task Start(int shardId)
|
||||
{
|
||||
if (_redis == null)
|
||||
_redis = await ConnectionMultiplexer.ConnectAsync(_config.RedisGatewayUrl);
|
||||
|
||||
_logger.Debug("Subscribing to shard {ShardId} on redis", shardId);
|
||||
|
||||
var channel = await _redis.GetSubscriber().SubscribeAsync($"evt-{shardId}");
|
||||
channel.OnMessage((evt) => Handle(shardId, evt));
|
||||
}
|
||||
|
||||
public async Task Handle(int shardId, ChannelMessage message)
|
||||
{
|
||||
var packet = JsonSerializer.Deserialize<GatewayPacket>(message.Message, _jsonSerializerOptions);
|
||||
if (packet.Opcode != GatewayOpcode.Dispatch) return;
|
||||
var evt = DeserializeEvent(packet.EventType, (JsonElement)packet.Payload);
|
||||
if (evt == null) return;
|
||||
await OnEventReceived((shardId, evt));
|
||||
}
|
||||
|
||||
private IGatewayEvent? DeserializeEvent(string eventType, JsonElement payload)
|
||||
{
|
||||
if (!IGatewayEvent.EventTypes.TryGetValue(eventType, out var clrType))
|
||||
{
|
||||
_logger.Debug("Received unknown event type {EventType}", eventType);
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_logger.Verbose("Deserializing {EventType} to {ClrType}", eventType, clrType);
|
||||
return JsonSerializer.Deserialize(payload.GetRawText(), clrType, _jsonSerializerOptions) as IGatewayEvent;
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
_logger.Error(e, "Error deserializing event {EventType} to {ClrType}", eventType, clrType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -24,8 +24,9 @@ internal partial class Database: IDatabase
|
|||
private readonly IMetrics _metrics;
|
||||
private readonly DbConnectionCountHolder _countHolder;
|
||||
private readonly DatabaseMigrator _migrator;
|
||||
private readonly string _connectionString;
|
||||
private readonly string _messagesConnectionString;
|
||||
|
||||
private readonly NpgsqlDataSource _dataSource;
|
||||
private readonly NpgsqlDataSource _dataSourceMessages;
|
||||
|
||||
public Database(CoreConfig config, DbConnectionCountHolder countHolder, ILogger logger,
|
||||
IMetrics metrics, DatabaseMigrator migrator)
|
||||
|
|
@ -54,14 +55,31 @@ internal partial class Database: IDatabase
|
|||
return builder.ConnectionString;
|
||||
}
|
||||
|
||||
_connectionString = connectionString(_config.Database);
|
||||
_messagesConnectionString = connectionString(_config.MessagesDatabase ?? _config.Database);
|
||||
NpgsqlDataSource createDataSource(string connectionString)
|
||||
{
|
||||
var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString);
|
||||
|
||||
dataSourceBuilder.UseNodaTime();
|
||||
|
||||
// Register our custom types to Npgsql
|
||||
// Without these it'll still *work* but break at the first launch + probably cause other small issues
|
||||
dataSourceBuilder.MapComposite<ProxyTag>("proxy_tag");
|
||||
dataSourceBuilder.MapEnum<PrivacyLevel>("privacy_level");
|
||||
|
||||
return dataSourceBuilder.Build();
|
||||
}
|
||||
|
||||
_dataSource = createDataSource(connectionString(_config.Database));
|
||||
_dataSourceMessages = createDataSource(connectionString(_config.MessagesDatabase ?? _config.Database));
|
||||
}
|
||||
|
||||
private static readonly PostgresCompiler _compiler = new();
|
||||
|
||||
public static void InitStatic()
|
||||
{
|
||||
// map postgres `timestamp` to NodaTime.Instant instead of NodaTime.LocalDateTime
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
|
||||
DefaultTypeMap.MatchNamesWithUnderscores = true;
|
||||
|
||||
// Dapper by default tries to pass ulongs to Npgsql, which rejects them since PostgreSQL technically
|
||||
|
|
@ -71,8 +89,7 @@ internal partial class Database: IDatabase
|
|||
SqlMapper.AddTypeHandler(new UlongEncodeAsLongHandler());
|
||||
SqlMapper.AddTypeHandler(new UlongArrayHandler());
|
||||
|
||||
NpgsqlConnection.GlobalTypeMapper.UseNodaTime();
|
||||
// With the thing we add above, Npgsql already handles NodaTime integration
|
||||
// With the thing we add above (in `createDataSource`), Npgsql already handles NodaTime integration
|
||||
// This makes Dapper confused since it thinks it has to convert it anyway and doesn't understand the types
|
||||
// So we add a custom type handler that literally just passes the type through to Npgsql
|
||||
SqlMapper.AddTypeHandler(new PassthroughTypeHandler<Instant>());
|
||||
|
|
@ -89,11 +106,6 @@ internal partial class Database: IDatabase
|
|||
SqlMapper.AddTypeHandler(new NumericIdArrayHandler<SwitchId, int>(i => new SwitchId(i)));
|
||||
SqlMapper.AddTypeHandler(new NumericIdArrayHandler<GroupId, int>(i => new GroupId(i)));
|
||||
SqlMapper.AddTypeHandler(new NumericIdArrayHandler<AbuseLogId, int>(i => new AbuseLogId(i)));
|
||||
|
||||
// Register our custom types to Npgsql
|
||||
// Without these it'll still *work* but break at the first launch + probably cause other small issues
|
||||
NpgsqlConnection.GlobalTypeMapper.MapComposite<ProxyTag>("proxy_tag");
|
||||
NpgsqlConnection.GlobalTypeMapper.MapEnum<PrivacyLevel>("privacy_level");
|
||||
}
|
||||
|
||||
// TODO: make sure every SQL query is behind a logged query method
|
||||
|
|
@ -104,7 +116,7 @@ internal partial class Database: IDatabase
|
|||
|
||||
// Create a connection and open it
|
||||
// We wrap it in PKConnection for tracing purposes
|
||||
var conn = new PKConnection(new NpgsqlConnection(messages ? _messagesConnectionString : _connectionString), _countHolder, _logger, _metrics);
|
||||
var conn = new PKConnection((messages ? _dataSourceMessages : _dataSource).CreateConnection(), _countHolder, _logger, _metrics);
|
||||
await conn.OpenAsync();
|
||||
return conn;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,12 +99,12 @@ internal partial class Database: IDatabase
|
|||
public async Task<T> QuerySingleProcedure<T>(string queryName, object param)
|
||||
{
|
||||
using var conn = await Obtain();
|
||||
return await conn.QueryFirstAsync<T>(queryName, param, commandType: CommandType.StoredProcedure);
|
||||
return await conn.QueryFirstAsync<T>(queryName, param, commandType: CommandType.Text);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<T>> QueryProcedure<T>(string queryName, object param)
|
||||
{
|
||||
using var conn = await Obtain();
|
||||
return await conn.QueryAsync<T>(queryName, param, commandType: CommandType.StoredProcedure);
|
||||
return await conn.QueryAsync<T>(queryName, param);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,31 +9,33 @@ namespace PluralKit.Core;
|
|||
/// </summary>
|
||||
public class MessageContext
|
||||
{
|
||||
public SystemId? SystemId { get; }
|
||||
public bool AllowAutoproxy { get; }
|
||||
|
||||
public SystemId? SystemId { get; }
|
||||
public string? SystemTag { get; }
|
||||
public string? SystemAvatar { get; }
|
||||
|
||||
public int? LatchTimeout { get; }
|
||||
public bool CaseSensitiveProxyTags { get; }
|
||||
public bool ProxyErrorMessageEnabled { get; }
|
||||
public SystemConfig.ProxySwitchAction ProxySwitch { get; }
|
||||
public string? NameFormat { get; }
|
||||
|
||||
public bool TagEnabled { get; }
|
||||
public bool ProxyEnabled { get; }
|
||||
public string? SystemGuildTag { get; }
|
||||
public string? SystemGuildAvatar { get; }
|
||||
public string? GuildNameFormat { get; }
|
||||
|
||||
public SwitchId? LastSwitch { get; }
|
||||
public MemberId[] LastSwitchMembers { get; } = new MemberId[0];
|
||||
public Instant? LastSwitchTimestamp { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether a system is being deleted (no actions should be taken, or commands ran)
|
||||
/// </summary>
|
||||
public ulong? LogChannel { get; }
|
||||
public bool InBlacklist { get; }
|
||||
public bool InLogBlacklist { get; }
|
||||
public bool LogCleanupEnabled { get; }
|
||||
public bool RequireSystemTag { get; }
|
||||
public bool ProxyEnabled { get; }
|
||||
public SwitchId? LastSwitch { get; }
|
||||
public MemberId[] LastSwitchMembers { get; } = new MemberId[0];
|
||||
public Instant? LastSwitchTimestamp { get; }
|
||||
public string? SystemTag { get; }
|
||||
public string? SystemGuildTag { get; }
|
||||
public bool TagEnabled { get; }
|
||||
public string? NameFormat { get; }
|
||||
public string? GuildNameFormat { get; }
|
||||
public string? SystemAvatar { get; }
|
||||
public string? SystemGuildAvatar { get; }
|
||||
public bool AllowAutoproxy { get; }
|
||||
public int? LatchTimeout { get; }
|
||||
public bool CaseSensitiveProxyTags { get; }
|
||||
public bool ProxyErrorMessageEnabled { get; }
|
||||
public SystemConfig.ProxySwitchAction ProxySwitch { get; }
|
||||
|
||||
public bool DenyBotUsage { get; }
|
||||
}
|
||||
|
|
@ -28,9 +28,10 @@ public class ProxyMember
|
|||
public string? WebhookAvatar { get; }
|
||||
public string? Avatar { get; }
|
||||
|
||||
public bool AllowAutoproxy { get; }
|
||||
public string? Color { get; }
|
||||
|
||||
public bool AllowAutoproxy { get; }
|
||||
|
||||
// If not set, this formatting will be applied to the proxy name
|
||||
public static string DefaultFormat = "{name} {tag}";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ namespace PluralKit.Core;
|
|||
public partial class ModelRepository
|
||||
{
|
||||
public Task<MessageContext> GetMessageContext(ulong account, ulong guild, ulong channel, ulong thread)
|
||||
=> _db.QuerySingleProcedure<MessageContext>("message_context",
|
||||
new { account_id = account, guild_id = guild, channel_id = channel, thread_id = thread });
|
||||
=> _db.QuerySingleProcedure<MessageContext>("select * from message_context(@account, @guild, @channel, @thread)",
|
||||
new { account, guild, channel, thread });
|
||||
|
||||
public Task<IEnumerable<ProxyMember>> GetProxyMembers(ulong account, ulong guild)
|
||||
=> _db.QueryProcedure<ProxyMember>("proxy_members", new { account_id = account, guild_id = guild });
|
||||
=> _db.QueryProcedure<ProxyMember>("select * from proxy_members(@account, @guild)", new { account, guild });
|
||||
}
|
||||
|
|
@ -69,8 +69,8 @@ public static class DispatchExt
|
|||
|
||||
private static List<IPNetwork> _privateNetworks = new()
|
||||
{
|
||||
IPNetwork.IANA_ABLK_RESERVED1, // 10/8
|
||||
IPNetwork.IANA_CBLK_RESERVED1, // 192.168/16
|
||||
IPNetwork.Parse("10.0.0.0/8"), // 10/8
|
||||
IPNetwork.Parse("192.168.0.0/16"), // 192.168/16
|
||||
IPNetwork.Parse("127.0.0.0/8"),
|
||||
IPNetwork.Parse("169.254.0.0/16"),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>annotations</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
|
@ -16,41 +16,41 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="App.Metrics" Version="4.1.0" />
|
||||
<PackageReference Include="App.Metrics.Reporting.InfluxDB" Version="4.1.0" />
|
||||
<PackageReference Include="App.Metrics" Version="4.3.0" />
|
||||
<PackageReference Include="App.Metrics.Reporting.InfluxDB" Version="4.3.0" />
|
||||
<PackageReference Include="AppFact.SerilogOpenSearchSink" Version="0.0.8" />
|
||||
<PackageReference Include="Autofac" Version="6.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
|
||||
<PackageReference Include="Dapper" Version="2.0.35" />
|
||||
<PackageReference Include="Dapper.Contrib" Version="2.0.35" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
|
||||
<PackageReference Include="ipnetwork2" Version="2.5.381" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.10" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NodaTime" Version="3.0.3" />
|
||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
|
||||
<PackageReference Include="Npgsql" Version="4.1.13" />
|
||||
<PackageReference Include="Npgsql.NodaTime" Version="4.1.5" />
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
|
||||
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
|
||||
<PackageReference Include="Autofac" Version="8.1.1" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.29.1" />
|
||||
<PackageReference Include="ipnetwork2" Version="3.0.667" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NodaTime" Version="3.2.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.1.0" />
|
||||
<PackageReference Include="Npgsql" Version="9.0.2" />
|
||||
<PackageReference Include="Npgsql.NodaTime" Version="9.0.2" />
|
||||
<PackageReference Include="Serilog" Version="4.2.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
|
||||
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
|
||||
<PackageReference Include="Serilog.NodaTime" Version="3.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.1-dev-00071" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
||||
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.4.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="5.2.2" />
|
||||
<PackageReference Include="SqlKata" Version="2.3.7" />
|
||||
<PackageReference Include="SqlKata.Execution" Version="2.3.7" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
|
||||
<PackageReference Include="System.Interactive.Async" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="10.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="8.0.0" />
|
||||
<PackageReference Include="SqlKata" Version="2.4.0" />
|
||||
<PackageReference Include="SqlKata.Execution" Version="2.4.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.8.22" />
|
||||
<PackageReference Include="System.Interactive.Async" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -62,7 +62,25 @@
|
|||
</Exec>
|
||||
</Target>
|
||||
|
||||
<Target Name="SetSourceRevisionTimestamp" BeforeTargets="InitializeSourceControlInformation">
|
||||
<Exec Command="git show --no-patch --format=%at $(git rev-parse HEAD) > ../.versionts" IgnoreExitCode="False">
|
||||
</Exec>
|
||||
</Target>
|
||||
|
||||
<Target Name="SetSourceIsDev" BeforeTargets="InitializeSourceControlInformation">
|
||||
<Exec Command="(git diff-index --quiet HEAD -- && echo 1) > ../.versiondev" IgnoreExitCode="True">
|
||||
</Exec>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\.version" LogicalName="version" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\.versionts" LogicalName="versionts" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\.versiondev" LogicalName="versiondev" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
|
@ -12,10 +12,13 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0"/>
|
||||
<PackageReference Include="xunit" Version="2.4.1"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0"/>
|
||||
<PackageReference Include="coverlet.collector" Version="1.3.0">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
@ -26,13 +29,13 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PluralKit.API\PluralKit.API.csproj"/>
|
||||
<ProjectReference Include="..\PluralKit.Bot\PluralKit.Bot.csproj"/>
|
||||
<ProjectReference Include="..\PluralKit.Core\PluralKit.Core.csproj"/>
|
||||
<ProjectReference Include="..\PluralKit.API\PluralKit.API.csproj" />
|
||||
<ProjectReference Include="..\PluralKit.Bot\PluralKit.Bot.csproj" />
|
||||
<ProjectReference Include="..\PluralKit.Core\PluralKit.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="API"/>
|
||||
<Folder Include="API" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,7 @@ pkgs.mkShellNoCC {
|
|||
cargo rust-analyzer rustfmt
|
||||
gcc
|
||||
protobuf
|
||||
dotnet-sdk_6
|
||||
dotnet-sdk_8
|
||||
omnisharp-roslyn
|
||||
go
|
||||
nodejs yarn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue