This commit is contained in:
Iliyan Angelov
2025-11-26 22:32:20 +02:00
commit ed94dd22dd
150 changed files with 14058 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
# Generated by Django 5.2.8 on 2025-11-26 13:41
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='ScamTag',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True)),
('slug', models.SlugField(blank=True, max_length=100, unique=True)),
('description', models.TextField(blank=True)),
('color', models.CharField(default='#007bff', help_text='Hex color code for display', max_length=7)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'verbose_name': 'Scam Tag',
'verbose_name_plural': 'Scam Tags',
'db_table': 'reports_scamtag',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='ScamReport',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_anonymous', models.BooleanField(default=False, help_text='Report submitted anonymously')),
('title', models.CharField(max_length=200)),
('description', models.TextField()),
('scam_type', models.CharField(choices=[('phishing', 'Phishing'), ('fake_website', 'Fake Website'), ('romance_scam', 'Romance Scam'), ('investment_scam', 'Investment Scam'), ('tech_support_scam', 'Tech Support Scam'), ('identity_theft', 'Identity Theft'), ('fake_product', 'Fake Product'), ('advance_fee', 'Advance Fee Fraud'), ('other', 'Other')], default='other', max_length=50)),
('reported_url', models.URLField(blank=True, max_length=500, null=True)),
('reported_email', models.EmailField(blank=True, max_length=254, null=True)),
('reported_phone', models.CharField(blank=True, max_length=20, null=True)),
('reported_company', models.CharField(blank=True, max_length=200, null=True)),
('evidence_files', models.JSONField(blank=True, default=list, help_text='List of file paths for evidence')),
('status', models.CharField(choices=[('pending', 'Pending Review'), ('under_review', 'Under Review'), ('verified', 'Verified'), ('rejected', 'Rejected'), ('archived', 'Archived')], default='pending', max_length=20)),
('verification_score', models.IntegerField(default=0, help_text='OSINT verification confidence score (0-100)')),
('is_public', models.BooleanField(default=True, help_text='Visible in public database')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('verified_at', models.DateTimeField(blank=True, null=True)),
('reporter_ip', models.GenericIPAddressField(blank=True, null=True)),
('reporter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reports', to=settings.AUTH_USER_MODEL)),
('tags', models.ManyToManyField(blank=True, related_name='reports', to='reports.scamtag')),
],
options={
'verbose_name': 'Scam Report',
'verbose_name_plural': 'Scam Reports',
'db_table': 'reports_scamreport',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='ScamVerification',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('verification_method', models.CharField(choices=[('whois', 'WHOIS Lookup'), ('dns', 'DNS Records'), ('ssl', 'SSL Certificate'), ('archive', 'Wayback Machine'), ('email_check', 'Email Validation'), ('phone_check', 'Phone Validation'), ('business_registry', 'Business Registry'), ('social_media', 'Social Media'), ('manual', 'Manual Review')], max_length=50)),
('verification_data', models.JSONField(default=dict, help_text='Raw verification data')),
('confidence_score', models.IntegerField(default=0, help_text='Confidence score for this verification (0-100)')),
('notes', models.TextField(blank=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('report', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='verifications', to='reports.scamreport')),
('verified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='verifications', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Scam Verification',
'verbose_name_plural': 'Scam Verifications',
'db_table': 'reports_scamverification',
'ordering': ['-created_at'],
},
),
migrations.AddIndex(
model_name='scamreport',
index=models.Index(fields=['status', 'created_at'], name='reports_sca_status_91c8ad_idx'),
),
migrations.AddIndex(
model_name='scamreport',
index=models.Index(fields=['scam_type', 'status'], name='reports_sca_scam_ty_fd12f9_idx'),
),
migrations.AddIndex(
model_name='scamreport',
index=models.Index(fields=['reported_url'], name='reports_sca_reporte_ebc596_idx'),
),
migrations.AddIndex(
model_name='scamreport',
index=models.Index(fields=['reported_email'], name='reports_sca_reporte_c31241_idx'),
),
migrations.AddIndex(
model_name='scamreport',
index=models.Index(fields=['reported_phone'], name='reports_sca_reporte_33869d_idx'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.2.8 on 2025-11-26 18:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reports', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='scamreport',
name='is_auto_discovered',
field=models.BooleanField(default=False, help_text='Automatically discovered by OSINT system'),
),
]

View File

@@ -0,0 +1,29 @@
# Generated manually
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reports', '0002_scamreport_is_auto_discovered'),
]
operations = [
migrations.CreateModel(
name='SiteSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('contact_email', models.EmailField(default='support@fraudplatform.bg', help_text='Основен имейл за контакти и поддръжка', max_length=254)),
('contact_phone', models.CharField(default='+359 2 XXX XXXX', help_text='Телефонен номер за контакти', max_length=50)),
('contact_address', models.CharField(blank=True, default='София, България', help_text='Адрес за контакти', max_length=200)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Настройки на Сайта',
'verbose_name_plural': 'Настройки на Сайта',
'db_table': 'reports_sitesettings',
},
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.2.8 on 2025-11-26 19:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reports', '0003_sitesettings'),
]
operations = [
migrations.AlterField(
model_name='sitesettings',
name='contact_address',
field=models.CharField(blank=True, default='', help_text='Адрес за контакти (незадължително)', max_length=200),
),
migrations.AlterField(
model_name='sitesettings',
name='contact_phone',
field=models.CharField(blank=True, default='', help_text='Телефонен номер за контакти (незадължително)', max_length=50),
),
]

View File

@@ -0,0 +1,43 @@
# Generated by Django 5.2.8 on 2025-11-26 19:46
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reports', '0004_alter_sitesettings_contact_address_and_more'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='TakedownRequest',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('requester_name', models.CharField(help_text='Име на заявителя', max_length=200)),
('requester_email', models.EmailField(help_text='Имейл на заявителя', max_length=254)),
('requester_phone', models.CharField(blank=True, help_text='Телефон на заявителя (незадължително)', max_length=50)),
('reason', models.TextField(help_text='Причина за заявката за премахване')),
('evidence', models.TextField(blank=True, help_text='Доказателства или допълнителна информация')),
('status', models.CharField(choices=[('pending', 'Pending Review'), ('under_review', 'Under Review'), ('approved', 'Approved'), ('rejected', 'Rejected')], default='pending', max_length=20)),
('review_notes', models.TextField(blank=True, help_text='Бележки от модератора')),
('ip_address', models.GenericIPAddressField(blank=True, null=True)),
('user_agent', models.TextField(blank=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('reviewed_at', models.DateTimeField(blank=True, null=True)),
('report', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='takedown_requests', to='reports.scamreport')),
('reviewed_by', models.ForeignKey(blank=True, limit_choices_to={'role__in': ['moderator', 'admin']}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reviewed_takedown_requests', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Заявка за Премахване',
'verbose_name_plural': 'Заявки за Премахване',
'db_table': 'reports_takedownrequest',
'ordering': ['-created_at'],
'indexes': [models.Index(fields=['report', 'status'], name='reports_tak_report__a40ed0_idx'), models.Index(fields=['status', 'created_at'], name='reports_tak_status_049c16_idx')],
},
),
]

View File

@@ -0,0 +1,58 @@
# Generated by Django 5.2.8 on 2025-11-26 19:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reports', '0005_takedownrequest'),
]
operations = [
migrations.AddField(
model_name='sitesettings',
name='default_from_email',
field=models.EmailField(default='noreply@fraudplatform.bg', help_text='Имейл адрес по подразбиране за изпращане', max_length=254),
),
migrations.AddField(
model_name='sitesettings',
name='email_backend',
field=models.CharField(choices=[('django.core.mail.backends.smtp.EmailBackend', 'SMTP'), ('django.core.mail.backends.console.EmailBackend', 'Console (Development)'), ('django.core.mail.backends.filebased.EmailBackend', 'File Based')], default='django.core.mail.backends.smtp.EmailBackend', help_text='Тип на имейл сървъра', max_length=100),
),
migrations.AddField(
model_name='sitesettings',
name='email_host',
field=models.CharField(blank=True, default='', help_text='SMTP сървър (напр. smtp.gmail.com)', max_length=255),
),
migrations.AddField(
model_name='sitesettings',
name='email_host_password',
field=models.CharField(blank=True, default='', help_text='SMTP парола (ще бъде криптирана)', max_length=255),
),
migrations.AddField(
model_name='sitesettings',
name='email_host_user',
field=models.CharField(blank=True, default='', help_text='SMTP потребителско име / имейл', max_length=255),
),
migrations.AddField(
model_name='sitesettings',
name='email_port',
field=models.IntegerField(default=587, help_text='SMTP порт (обикновено 587 за TLS или 465 за SSL)'),
),
migrations.AddField(
model_name='sitesettings',
name='email_timeout',
field=models.IntegerField(default=10, help_text='Таймаут за имейл връзка (секунди)'),
),
migrations.AddField(
model_name='sitesettings',
name='email_use_ssl',
field=models.BooleanField(default=False, help_text='Използване на SSL (за порт 465)'),
),
migrations.AddField(
model_name='sitesettings',
name='email_use_tls',
field=models.BooleanField(default=True, help_text='Използване на TLS (за порт 587)'),
),
]

View File