Add IP origin enrichment with DB-IP and world map
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
536aee1f31
commit
3671019e60
47 files changed
+1389
-12
No files matched your search
@@ -6,6 +6,7 @@ namespace Flypaper.Storage;
|
||||
public sealed class FlypaperDbContext(DbContextOptions<FlypaperDbContext> options) : DbContext(options)
|
||||
{
|
||||
internal const int MaxTextLength = 2048;
|
||||
internal const int MaxNameLength = 256;
|
||||
|
||||
public DbSet<TrapEventEntity> TrapEvents => Set<TrapEventEntity>();
|
||||
|
||||
@@ -24,7 +25,13 @@ public sealed class FlypaperDbContext(DbContextOptions<FlypaperDbContext> option
|
||||
trapEvent.Property(e => e.Target).HasMaxLength(MaxTextLength);
|
||||
trapEvent.Property(e => e.ClientInfo).HasMaxLength(MaxTextLength);
|
||||
trapEvent.HasIndex(e => e.StartedAt);
|
||||
trapEvent.Property(e => e.CountryCode).HasMaxLength(2);
|
||||
trapEvent.Property(e => e.Country).HasMaxLength(MaxNameLength);
|
||||
trapEvent.Property(e => e.City).HasMaxLength(MaxNameLength);
|
||||
trapEvent.Property(e => e.Provider).HasMaxLength(MaxNameLength);
|
||||
trapEvent.HasIndex(e => e.RemoteIp);
|
||||
trapEvent.HasIndex(e => e.CountryCode);
|
||||
trapEvent.HasIndex(e => e.Asn);
|
||||
|
||||
var setting = modelBuilder.Entity<SettingEntity>();
|
||||
setting.HasKey(e => e.Key);
|
||||
|
||||
Reference in new issue
Block a user