VPN Invite first commit

This commit is contained in:
Eduardo Silva
2025-02-27 10:51:07 -03:00
parent 4c038b97c0
commit 4e7005893d
9 changed files with 148 additions and 1 deletions

View File

@@ -0,0 +1,71 @@
# Generated by Django 5.1.5 on 2025-02-27 13:49
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('wireguard', '0027_alter_wireguardinstance_peer_list_refresh_interval'),
]
operations = [
migrations.CreateModel(
name='InviteSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(default='default_settings', max_length=16, unique=True)),
('default_password', models.CharField(blank=True, default='', max_length=32, null=True)),
('enforce_random_password', models.BooleanField(default=True)),
('random_password_length', models.IntegerField(default=6)),
('random_password_complexity', models.CharField(choices=[('letters_digits_special', 'Letters, Digits, Special Characters'), ('letters_digits', 'Letters, Digits'), ('letters', 'Letters'), ('digits', 'Digits')], default='letters_digits', max_length=22)),
('invite_expiration', models.IntegerField(default=30)),
('download_1_label', models.CharField(blank=True, default='iPhone', max_length=32, null=True)),
('download_2_label', models.CharField(blank=True, default='Android', max_length=32, null=True)),
('download_3_label', models.CharField(blank=True, default='Windows', max_length=32, null=True)),
('download_4_label', models.CharField(blank=True, default='macOS', max_length=32, null=True)),
('download_5_label', models.CharField(blank=True, default='Desktop', max_length=32, null=True)),
('download_1_icon', models.CharField(blank=True, default='fab fa-app-store-ios', max_length=32, null=True)),
('download_2_icon', models.CharField(blank=True, default='fab fa-google-play', max_length=32, null=True)),
('download_3_icon', models.CharField(blank=True, default='fab fa-windows', max_length=32, null=True)),
('download_4_icon', models.CharField(blank=True, default='fab fa-apple', max_length=32, null=True)),
('download_5_icon', models.CharField(blank=True, default='fas fa-desktop', max_length=32, null=True)),
('download_1_url', models.URLField(blank=True, default='https://apps.apple.com/us/app/wireguard/id1441195209', null=True)),
('download_2_url', models.URLField(blank=True, default='https://play.google.com/store/apps/details?id=com.wireguard.android', null=True)),
('download_3_url', models.URLField(blank=True, default='https://download.wireguard.com/windows-client/wireguard-installer.exe', null=True)),
('download_4_url', models.URLField(blank=True, default='https://apps.apple.com/us/app/wireguard/id1451685025', null=True)),
('download_5_url', models.URLField(blank=True, default='https://www.wireguard.com/install/', null=True)),
('download_1_enabled', models.BooleanField(default=True)),
('download_2_enabled', models.BooleanField(default=True)),
('download_3_enabled', models.BooleanField(default=True)),
('download_4_enabled', models.BooleanField(default=True)),
('download_5_enabled', models.BooleanField(default=True)),
('download_instructions', models.TextField(default='Download the WireGuard app for your device using one of the links below. After installation, you can scan the QR code or download the configuration file to import on your device.')),
('invite_url', models.URLField(default='')),
('invite_email_subject', models.CharField(blank=True, default='WireGuard VPN Invite', max_length=64, null=True)),
('invite_email_body', models.TextField(blank=True, default='Here is your WireGuard VPN invite link: {invite_url}', null=True)),
('invite_email_enabled', models.BooleanField(default=True)),
('invite_whatsapp_body', models.TextField(blank=True, default='Here is your WireGuard VPN invite link: {invite_url}', null=True)),
('invite_whatsapp_enabled', models.BooleanField(default=True)),
('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='PeerInvite',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('invite_password', models.CharField(default='', max_length=32)),
('invite_expiration', models.DateTimeField()),
('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('peer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wireguard.peer')),
],
),
]