75 lines
1.8 KiB
Go
75 lines
1.8 KiB
Go
package acmedns
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type Account struct {
|
|
Username string
|
|
Password string
|
|
Subdomain string
|
|
}
|
|
|
|
// AcmeDnsConfig holds the config structure
|
|
type AcmeDnsConfig struct {
|
|
General general
|
|
Database dbsettings
|
|
API httpapi
|
|
Logconfig logconfig
|
|
}
|
|
|
|
// Config file general section
|
|
type general struct {
|
|
Listen string
|
|
Proto string `toml:"protocol"`
|
|
Domain string
|
|
Nsname string
|
|
Nsadmin string
|
|
Debug bool
|
|
StaticRecords []string `toml:"records"`
|
|
Serialpath string
|
|
SlaveHosts []string `toml:"slaves"`
|
|
}
|
|
|
|
type dbsettings struct {
|
|
Engine string
|
|
Connection string
|
|
}
|
|
|
|
// API config
|
|
type httpapi struct {
|
|
Domain string `toml:"api_domain"`
|
|
IP string
|
|
DisableRegistration bool `toml:"disable_registration"`
|
|
AutocertPort string `toml:"autocert_port"`
|
|
Port string `toml:"port"`
|
|
TLS string
|
|
TLSCertPrivkey string `toml:"tls_cert_privkey"`
|
|
TLSCertFullchain string `toml:"tls_cert_fullchain"`
|
|
ACMECacheDir string `toml:"acme_cache_dir"`
|
|
NotificationEmail string `toml:"notification_email"`
|
|
CorsOrigins []string
|
|
UseHeader bool `toml:"use_header"`
|
|
HeaderName string `toml:"header_name"`
|
|
}
|
|
|
|
// Logging config
|
|
type logconfig struct {
|
|
Level string `toml:"loglevel"`
|
|
Logtype string `toml:"logtype"`
|
|
File string `toml:"logfile"`
|
|
Format string `toml:"logformat"`
|
|
}
|
|
|
|
// ACMETxt is the default structure for the user controlled record
|
|
type ACMETxt struct {
|
|
Username uuid.UUID
|
|
Password string
|
|
ACMETxtPost
|
|
AllowFrom Cidrslice
|
|
}
|
|
|
|
// ACMETxtPost holds the DNS part of the ACMETxt struct
|
|
type ACMETxtPost struct {
|
|
Subdomain string `json:"subdomain"`
|
|
Value string `json:"txt"`
|
|
}
|