<reponame>sweetchipsw/Sweetmon_legacy
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-16 14:26
from __future__ import unicode_literals

import datetime
from django.conf import settings
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
import monitor.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Crash',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=1000)),
                ('crash_hash', models.CharField(max_length=100)),
                ('crashlog', models.CharField(max_length=6553500)),
                ('dup_crash', models.IntegerField(default=0)),
                ('crash_file', models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/Users/sweetchip/Desktop/Code_Repository/dev_sweetmon/sweetmon/files/crashes/'), upload_to=monitor.models.getUploadPath)),
                ('reg_date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('latest_date', models.DateTimeField(auto_now=True)),
                ('comment', models.CharField(blank=True, max_length=100000, null=True)),
                ('is_encrypted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='DupCrash',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('crash_hash', models.CharField(max_length=100)),
                ('dup_crash', models.IntegerField(default=0)),
                ('crash_file', models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/Users/sweetchip/Desktop/Code_Repository/dev_sweetmon/sweetmon/files/crashes/'), upload_to=monitor.models.getUploadPath)),
                ('reg_date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
            ],
        ),
        migrations.CreateModel(
            name='EmailBot',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email_id', models.CharField(max_length=512)),
                ('email_pw', models.CharField(blank=True, help_text='Use only if you want to change password', max_length=512, null=True)),
                ('email_pw_enc', models.CharField(default='', max_length=512)),
                ('smtp_server', models.CharField(help_text='Check https://www.google.com/settings/security/lesssecureapps if use Gmail', max_length=512)),
                ('smtp_port', models.CharField(max_length=5)),
                ('is_public', models.BooleanField(default=False, help_text='Check true if you want to share this email')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Machine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fuzzer_name', models.CharField(max_length=50)),
                ('target', models.CharField(max_length=200)),
                ('crash_count', models.IntegerField(default=0)),
                ('testcase', models.IntegerField(default=0)),
                ('ping', models.DateTimeField(auto_now=True)),
                ('reg_date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('pub_ip', models.CharField(max_length=16)),
                ('pri_ip', models.CharField(max_length=16)),
                ('token', models.CharField(max_length=100)),
                ('owner', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OnetimeToken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.CharField(max_length=512)),
                ('real_path', models.CharField(max_length=5120)),
                ('is_expired', models.BooleanField(default=False)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_name', models.CharField(max_length=512)),
                ('first_name', models.CharField(max_length=512)),
                ('email', models.EmailField(blank=True, max_length=512, null=True)),
                ('profile_image', models.FileField(blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(location='/Users/sweetchip/Desktop/Code_Repository/dev_sweetmon/sweetmon/files/userimage/'), upload_to=monitor.models.getimageUploadPath)),
                ('telegram_chatid', models.CharField(blank=True, help_text="To get your chat_id, Add '@get_id_bot' and send '/my_id'", max_length=12, null=True)),
                ('alert_message', models.TextField(blank=True, default='[SWEETMON] New crash detected : __title__ / __description__', help_text='__title__ => Crash title, __description__ => Crash log', max_length=10000, null=True)),
                ('use_telegram_alert', models.BooleanField(default=False, help_text='You should fill out telegram_chatid to use this feature.')),
                ('use_email_alert', models.BooleanField(default=False, help_text='You should fill out email of your profile to use this feature.')),
                ('userkey', models.TextField(blank=True, help_text='Use this key when you regist the new fuzzer.', null=True)),
                ('emailbot', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='monitor.EmailBot')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TelegramBot',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('telegram_bot_name', models.CharField(max_length=512)),
                ('telegram_bot_key', models.CharField(max_length=512)),
                ('is_activated', models.BooleanField(default=False)),
                ('is_public', models.BooleanField(default=False, help_text='Note That, other user can modify/delete this configuration.')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Testcase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=200, null=True)),
                ('fuzzerName', models.CharField(blank=True, max_length=200, null=True)),
                ('target', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(blank=True, max_length=1024, null=True)),
                ('testcase_url', models.CharField(blank=True, max_length=1024, null=True)),
                ('fuzzer_url', models.CharField(blank=True, max_length=1024, null=True)),
                ('fuzzerFile', models.FileField(blank=True, storage=django.core.files.storage.FileSystemStorage(location='/Users/sweetchip/Desktop/Code_Repository/dev_sweetmon/sweetmon/files/fuzzer/'), upload_to=monitor.models.getFuzzUploadPath)),
                ('testcaseFile', models.FileField(blank=True, storage=django.core.files.storage.FileSystemStorage(location='/Users/sweetchip/Desktop/Code_Repository/dev_sweetmon/sweetmon/files/testcase/'), upload_to=monitor.models.getFuzzUploadPath)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='profile',
            name='telegram',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='monitor.TelegramBot'),
        ),
        migrations.AddField(
            model_name='dupcrash',
            name='fuzzer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='monitor.Machine'),
        ),
        migrations.AddField(
            model_name='dupcrash',
            name='original_crash',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='monitor.Crash'),
        ),
        migrations.AddField(
            model_name='dupcrash',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='crash',
            name='fuzzer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='monitor.Machine'),
        ),
        migrations.AddField(
            model_name='crash',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
