mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-28 13:58:09 +02:00
Add peer expiration
This commit is contained in:
parent
2d67540e13
commit
2ecb92eef6
94 changed files with 43258 additions and 49 deletions
|
@ -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>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue