grpc fixes

This commit is contained in:
2025-05-26 12:34:03 -04:00
parent d76e126d35
commit c40b6f0fa3
6 changed files with 16 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ pub const HOST: &'static str = "http://localhost:5164";
#[cfg(debug_assertions)]
pub const RPC_HOST: &'static str = "http://localhost:5164";
#[cfg(not(debug_assertions))]
pub const RPC_HOST: &'static str = "https://grpc.aoba.app";
pub const RPC_HOST: &'static str = "https://grpc.aoba.app:8443";
#[cfg(not(debug_assertions))]
pub const HOST: &'static str = "https://aoba.app";

View File

@@ -26,6 +26,7 @@ public static class Extensions
services.AddSingleton(dbClient);
services.AddSingleton<IMongoDatabase>(db);
services.AddSingleton<AobaService>();
services.AddSingleton<ThumbnailService>();
services.AddSingleton<AccountsService>();
services.AddHostedService<AobaIndexCreationService>();
return services;

View File

@@ -18,7 +18,7 @@ internal class ThumbnailService(IMongoDatabase db, AobaService aobaService)
public async Task<MemoryStream> GetThumbnailAsync(ObjectId id)
{
throw new NotImplementedException();
}
public async Task GenerateThumbnailAsync(ObjectId id)

View File

@@ -11,6 +11,18 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.IdentityModel.Tokens;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(o =>
{
o.ListenAnyIP(8081, lo =>
{
lo.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;
});
o.ListenAnyIP(8080, lo =>
{
lo.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2;
});
});
var config = builder.Configuration;
// Add services to the container.
builder.Services.AddControllers(opt => opt.ModelBinderProviders.Add(new BsonIdModelBinderProvider()));

View File

@@ -9,8 +9,6 @@ using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using Microsoft.AspNetCore.Mvc;
using MongoDB.Bson.IO;
using System.Text.Json;

View File

@@ -1,7 +1,7 @@
{
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http1AndHttp2",
"Protocols": "Http1AndHttp2"
},
"Logging": {
"LogLevel": {