-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow trailing "_" in hostname attribute. (#354)
Needed e.g. for domains like "_acme-challenge.example.com"
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
serveradmin/serverdb/migrations/0018_alter_server_hostname.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 3.2.23 on 2024-01-04 08:23 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('serverdb', '0017_inet_family_choice'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='server', | ||
name='hostname', | ||
field=models.CharField(max_length=254, unique=True, validators=[django.core.validators.RegexValidator('\\A(\\*\\.)?([a-z0-9_]+(\\.|-+))*[a-z0-9]+\\Z', 'Invalid hostname')]), | ||
), | ||
migrations.RunSQL( | ||
sql=( | ||
"ALTER TABLE server " | ||
"DROP CONSTRAINT server_hostname_check, " | ||
"ADD CONSTRAINT server_hostname_check " | ||
"CHECK (hostname::text ~ '\A(\*\.)?([a-z0-9_]+(\.|-+))*[a-z0-9]+\Z'::text);" | ||
), | ||
reverse_sql=( | ||
"ALTER TABLE server " | ||
"DROP CONSTRAINT server_hostname_check, " | ||
"ADD CONSTRAINT server_hostname_check " | ||
"CHECK (hostname::text ~ '\A(\*\.)?([a-z0-9]+(\.|-+))*[a-z0-9]+\Z'::text);" | ||
) | ||
), | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters