mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-11-21 04:23:15 +01:00
Each application host now selects how its TLS certificate is issued: self-signed, ACME HTTP challenge, or ACME DNS challenge using a stored DNS credential. ACME modes fall back to the internal CA when issuance fails, so hosts stay reachable with a browser warning instead of a TLS error. - Add DnsChallengeCredential model and provider registry (Cloudflare) - Add certificate_type and dns_credential to ApplicationHost - Sync WireGuard WebAdmin hosts from .env into the reserved application - Export per-host TLS settings to tls.json, read only by Caddy - Group hosts by certificate settings into separate Caddy site blocks - Build Caddy with the Cloudflare DNS module using xcaddy - Regenerate the Caddyfile without DNS challenge if validation fails
45 lines
1.9 KiB
Python
45 lines
1.9 KiB
Python
# Generated by Django 5.2.19 on 2026-11-17 18:30
|
|
|
|
import uuid
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('app_gateway', '0008_accesspolicy_display_name_applicationroute_display_name'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='DnsChallengeCredential',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.SlugField(max_length=64, unique=True)),
|
|
('display_name', models.CharField(blank=True, max_length=128)),
|
|
('provider', models.CharField(choices=[('cloudflare', 'Cloudflare')], max_length=32)),
|
|
('credentials', models.JSONField(default=dict)),
|
|
('created', models.DateTimeField(auto_now_add=True)),
|
|
('updated', models.DateTimeField(auto_now=True)),
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
|
],
|
|
options={
|
|
'verbose_name': 'DNS Challenge Credential',
|
|
'verbose_name_plural': 'DNS Challenge Credentials',
|
|
'ordering': ['name'],
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='applicationhost',
|
|
name='certificate_type',
|
|
field=models.CharField(choices=[('self_signed', 'Self-signed'), ('http_challenge', 'HTTP challenge'), ('dns_challenge', 'DNS challenge')], default='http_challenge', max_length=16),
|
|
),
|
|
migrations.AddField(
|
|
model_name='applicationhost',
|
|
name='dns_credential',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='hosts', to='app_gateway.dnschallengecredential'),
|
|
),
|
|
]
|