Merge pull request #46 from benjaminbear/fix_domain_validation

Use fqdn validator for domain name
This commit is contained in:
benjaminbear 2024-05-28 00:01:19 +02:00 committed by GitHub
commit 6cc20a66e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@ import (
type Host struct {
gorm.Model
Hostname string `gorm:"unique_index:idx_host_domain;not null" form:"hostname" validate:"required,hostname"`
Domain string `gorm:"unique_index:idx_host_domain;not null" form:"domain" validate:"required,hostname"`
Domain string `gorm:"unique_index:idx_host_domain;not null" form:"domain" validate:"required,fqdn"`
Ip string `form:"ip" validate:"omitempty,ipv4|ipv6"`
Ttl int `form:"ttl" validate:"required,min=20,max=86400"`
LastUpdate time.Time `form:"lastupdate"`