Add peer expiration

This commit is contained in:
Tech Garage 2023-06-23 17:00:49 +03:30
parent 2d67540e13
commit 2ecb92eef6
94 changed files with 43258 additions and 49 deletions

View file

@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using MTWireGuard;
using Hangfire;
using Hangfire.Storage.SQLite;
using Microsoft.Extensions.DependencyInjection;
using MTWireGuard.Application.Mapper;
using MTWireGuard.Application.Repositories;
using MTWireGuard.Application.Services;
@ -14,6 +15,13 @@ namespace MTWireGuard.Application
// Add DBContext
services.AddDbContext<DBContext>(ServiceLifetime.Singleton);
// Add HangFire
services.AddHangfire(config =>
{
config.UseSQLiteStorage(Path.Join(AppDomain.CurrentDomain.BaseDirectory, "MikrotikWireguard.db"));
});
services.AddHangfireServer();
// Auto Mapper Configurations
services.AddSingleton<PeerMapping>();
services.AddSingleton<ServerMapping>();
@ -28,6 +36,7 @@ namespace MTWireGuard.Application
// Add Mikrotik API Service
services.AddSingleton<IMikrotikRepository, MTAPI>();
}
}
}