Initial commit: DDNS service with NIC V2 protocol support
Features: - Token-based subdomain claiming - NIC V2 (DynDNS2) protocol implementation - Technitium DNS integration - Rate limiting (10 req/min IP, 1 req/min token) - Web UI for space claiming - Docker/Docker Compose support - Compatible with UniFi, pfSense, EdgeRouter Module: git.dws.rip/DWS/dyn
This commit is contained in:
35
internal/models/space.go
Normal file
35
internal/models/space.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Space struct {
|
||||
Token string `json:"token" db:"token"`
|
||||
Subdomain string `json:"subdomain" db:"subdomain"`
|
||||
LastIP string `json:"last_ip" db:"last_ip"`
|
||||
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
type CreateSpaceRequest struct {
|
||||
Subdomain string `json:"subdomain" binding:"required,alphanumdash,min=3,max=63"`
|
||||
}
|
||||
|
||||
type CreateSpaceResponse struct {
|
||||
Token string `json:"token"`
|
||||
Subdomain string `json:"subdomain"`
|
||||
FQDN string `json:"fqdn"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type SpaceInfo struct {
|
||||
Subdomain string `json:"subdomain"`
|
||||
LastIP string `json:"last_ip"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
func (s *Space) GetFQDN(zone string) string {
|
||||
return s.Subdomain + "." + zone
|
||||
}
|
||||
Reference in New Issue
Block a user