anti-brigading system - detection engine, phantom voting, ALTCHA adaptive difficulty, honeypot fields, admin security dashboard, auto-learning

This commit is contained in:
2026-03-22 08:35:26 +02:00
parent a530ce67b0
commit 14a605b3de
23 changed files with 3104 additions and 86 deletions

View File

@@ -34,6 +34,10 @@ model Board {
rssFeedCount Int @default(50)
staleDays Int @default(0)
position Int @default(0)
sensitivityLevel String @default("normal")
velocityThreshold Int?
quarantined Boolean @default(false)
requireVoteVerification Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -43,6 +47,8 @@ model Board {
statusConfig BoardStatus[]
templates BoardTemplate[]
changelogEntries ChangelogEntry[]
baseline BoardBaseline?
brigadePatterns BrigadePattern[]
}
model BoardStatus {
@@ -69,6 +75,12 @@ model User {
displayName String?
avatarPath String?
darkMode String @default("system")
firstActionType String?
firstActionAt DateTime?
actionDiversityScore Float @default(0)
voteTimingStdDev Float?
boardInteractionCount Int @default(0)
flagCount Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -128,6 +140,8 @@ model Post {
isEditLocked Boolean @default(false)
isThreadLocked Boolean @default(false)
isVotingLocked Boolean @default(false)
frozenAt DateTime?
votesVisibleAfter DateTime?
onBehalfOf String?
boardId String
authorId String
@@ -148,6 +162,7 @@ model Post {
tags PostTag[]
attachments Attachment[]
editHistory EditHistory[]
voteSnapshots PostVoteSnapshot[]
@@index([boardId, status])
}
@@ -206,6 +221,9 @@ model Vote {
id String @id @default(cuid())
weight Int @default(1)
importance String?
phantom Boolean @default(false)
voterIp String?
referrer String?
postId String
voterId String
budgetPeriod String
@@ -493,3 +511,60 @@ model PluginData {
@@unique([pluginId, key])
@@index([pluginId])
}
model AnomalyEvent {
id String @id @default(cuid())
type String
severity String
targetType String
targetId String
boardId String?
metadata Json @default("{}")
status String @default("pending")
createdAt DateTime @default(now())
@@index([status, createdAt])
@@index([targetType, targetId])
@@index([boardId, createdAt])
}
model BoardBaseline {
id String @id @default(cuid())
boardId String @unique
avgVotesPerHour Float @default(0)
avgPostsPerDay Float @default(0)
avgReactionsPerHour Float @default(0)
peakHourOfDay Int @default(12)
peakDayOfWeek Int @default(2)
updatedAt DateTime @updatedAt
board Board @relation(fields: [boardId], references: [id], onDelete: Cascade)
}
model PostVoteSnapshot {
id String @id @default(cuid())
postId String
voteCount Int
snapshotAt DateTime @default(now())
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
@@index([postId, snapshotAt])
}
model BrigadePattern {
id String @id @default(cuid())
boardId String?
features Json
matchCount Int @default(0)
createdAt DateTime @default(now())
board Board? @relation(fields: [boardId], references: [id], onDelete: Cascade)
}
model AdminWebhookConfig {
id String @id @default(cuid())
url String
events String[]
active Boolean @default(true)
}