3fa77d9bc0
- Remove GORM and SQLite, use simple JSON file (data/certs.json) for persistence - CertStore with sync.RWMutex for thread-safe in-memory cache - All handlers updated to use config.Store instead of config.DB - Cron job and stats updated accordingly - go mod tidy removes unused gorm/sqlite dependencies
26 lines
991 B
Go
26 lines
991 B
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
|
|
|
|
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
|
|
}
|