d4eec5dd08
edited 2023/11/24 by pedro
66 lines
3.9 KiB
Python
66 lines
3.9 KiB
Python
# Generated by Django 2.2.28 on 2023-08-17 09:45
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import orchestra.core.validators
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('orchestration', '__first__'),
|
|
('domains', '__first__'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
('webapps', '__first__'),
|
|
# ('webapps', '0004_auto_20230817_1108'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Content',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('path', models.CharField(blank=True, max_length=256, validators=[orchestra.core.validators.validate_url_path], verbose_name='path')),
|
|
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='webapps.WebApp', verbose_name='web application')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Website',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=128, validators=[orchestra.core.validators.validate_name], verbose_name='name')),
|
|
('protocol', models.CharField(choices=[('http', 'HTTP'), ('https', 'HTTPS'), ('http/https', 'HTTP and HTTPS'), ('https-only', 'HTTPS only')], default='http', help_text='Select the protocol(s) for this website<br><tt>HTTPS only</tt> performs a redirection from <tt>http</tt> to <tt>https</tt>.', max_length=16, verbose_name='protocol')),
|
|
('is_active', models.BooleanField(default=True, verbose_name='active')),
|
|
('comments', models.TextField(blank=True, default='')),
|
|
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='websites', to=settings.AUTH_USER_MODEL, verbose_name='Account')),
|
|
('contents', models.ManyToManyField(through='websites.Content', to='webapps.WebApp')),
|
|
('domains', models.ManyToManyField(blank=True, related_name='websites', to='domains.Domain', verbose_name='domains')),
|
|
('target_server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='websites', to='orchestration.Server', verbose_name='Target Server')),
|
|
],
|
|
options={
|
|
'unique_together': {('name', 'account')},
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='WebsiteDirective',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(choices=[(None, '-------'), ('HTTPD', [('redirect', 'Redirection'), ('proxy', 'Proxy'), ('error-document', 'ErrorDocumentRoot')]), ('SSL', [('ssl-ca', 'SSL CA'), ('ssl-cert', 'SSL cert'), ('ssl-key', 'SSL key')]), ('ModSecurity', [('sec-rule-remove', 'SecRuleRemoveById'), ('sec-engine', 'SecRuleEngine Off')]), ('SaaS', [('wordpress-saas', 'WordPress SaaS'), ('dokuwiki-saas', 'DokuWiki SaaS'), ('drupal-saas', 'Drupdal SaaS'), ('moodle-saas', 'Moodle SaaS')])], db_index=True, max_length=128, verbose_name='name')),
|
|
('value', models.CharField(blank=True, max_length=256, verbose_name='value')),
|
|
('website', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='directives', to='websites.Website', verbose_name='web site')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='content',
|
|
name='website',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='websites.Website', verbose_name='web site'),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name='content',
|
|
unique_together={('website', 'path')},
|
|
),
|
|
]
|