Files
Auto-ssl/backend/config/certificate.go
T
cnbugs bdb3ca856f feat: add DNS credential management with Web UI
- New config/credential_store.go: persistent credential storage (credentials.json)
- New API: CRUD for DNS credentials + credential-types endpoint
- Certificate model now supports credential_id reference
- Create certificate auto-resolves credential_id to DNS config
- New Vue page: Credentials.vue for managing saved DNS keys
- CertCreate.vue: select existing credential or manual input + save as new
- Secrets masked in API responses, never exposed in list
2026-07-24 18:56:03 +08:00

27 lines
1.1 KiB
Go

package config
import "time"
type Certificate struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Domain string `json:"domain"`
Email string `json:"email"`
Provider string `json:"provider"` // letsencrypt, zerossl
ChallengeType string `json:"challenge_type"` // http, dns
DNSProvider string `json:"dns_provider,omitempty"` // alidns, cloudflare, etc.
DNSConfig string `json:"dns_config,omitempty"` // JSON config for DNS provider
CredentialID *uint `json:"credential_id,omitempty"` // references saved credential
Status string `json:"status"` // pending, active, expired, error
CertURL string `json:"cert_url,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
LastRenewedAt *time.Time `json:"last_renewed_at,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
AutoRenew bool `json:"auto_renew"`
RenewDays int `json:"renew_days"` // Renew when expires within this many days
}