37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
//using Minio;
|
|
using Minio.AspNetCore;
|
|
|
|
namespace Modules.Media.Api;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
//public static IServiceCollection AddMediaStorage(this IServiceCollection services, IConfigurationManager configuration, string jwtSettingsSection)
|
|
public static IServiceCollection AddMediaStorage(this IServiceCollection services)
|
|
{
|
|
//Configuration
|
|
//services.AddOptions<JwtSettings>().Bind(configuration.GetSection(jwtSettingsSection));
|
|
|
|
//var endpoint = "play.min.io";
|
|
//var endpoint = "quay.io";
|
|
var endpoint = "192.168.0.3:9000";
|
|
//var accessKey = "ROOTUSER";
|
|
//var secretKey = "CHANGEME123";
|
|
var accessKey = "4aA6tfkVpJIZtmzvtf5r";
|
|
var secretKey = "ZoJanpZZLcgl9CPKF0Hum3pWYNjZ1nTxjCO3GzIf";
|
|
|
|
|
|
services.AddMinio(options =>
|
|
{
|
|
options.Endpoint = endpoint;
|
|
options.AccessKey = accessKey;
|
|
options.SecretKey = secretKey;
|
|
//.WithSSL()
|
|
//.Build()
|
|
});
|
|
|
|
services.AddMediatR(q => q.RegisterServicesFromAssemblies(AppDomain.CurrentDomain.GetAssemblies()));
|
|
|
|
return services;
|
|
}
|
|
} |