# Generated by Django 5.2.9 on 2025-12-16 17:07

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="SiteConfiguration",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(default="default", max_length=64, unique=True),
                ),
                ("enabled", models.BooleanField(default=True)),
                (
                    "mode",
                    models.CharField(
                        choices=[("internal", "Internal"), ("public", "Public")],
                        default="internal",
                        max_length=16,
                    ),
                ),
                ("role", models.CharField(default="Terminal", max_length=64)),
                (
                    "port",
                    models.PositiveIntegerField(
                        default=8888,
                        validators=[
                            django.core.validators.MinValueValidator(1),
                            django.core.validators.MaxValueValidator(65535),
                        ],
                    ),
                ),
                ("include_ipv6", models.BooleanField(default=False)),
                (
                    "expected_path",
                    models.CharField(
                        default="/etc/nginx/sites-enabled/arthexis.conf",
                        help_text="Filesystem path where the managed nginx configuration is applied.",
                        max_length=255,
                    ),
                ),
                (
                    "site_entries_path",
                    models.CharField(
                        default="scripts/generated/nginx-sites.json",
                        help_text="Staged site definitions to include when rendering managed servers.",
                        max_length=255,
                    ),
                ),
                (
                    "site_destination",
                    models.CharField(
                        default="/etc/nginx/sites-enabled/arthexis-sites.conf",
                        help_text="Destination for the rendered managed site server blocks.",
                        max_length=255,
                    ),
                ),
                ("last_applied_at", models.DateTimeField(blank=True, null=True)),
                ("last_validated_at", models.DateTimeField(blank=True, null=True)),
                ("last_message", models.TextField(blank=True, default="")),
            ],
            options={
                "verbose_name": "Site configuration",
                "verbose_name_plural": "Site Server Configs",
            },
        ),
    ]
