Files
cloudflare-dns-updater/config.go

27 lines
541 B
Go
Raw Normal View History

2025-10-03 01:01:07 -04:00
package main
import (
"os"
"strings"
)
// Email, Auth Key, Zone ID, Record Names
type Config struct {
Email string
AuthKey string
ZoneID string
RecordNames []string
ForceIP string
}
func LoadConfig() (*Config, error) {
return &Config{
Email: os.Getenv("CLOUDFLARE_EMAIL"),
AuthKey: os.Getenv("CLOUDFLARE_AUTH_KEY"),
ZoneID: os.Getenv("CLOUDFLARE_ZONE_ID"),
RecordNames: strings.Split(os.Getenv("CLOUDFLARE_RECORD_NAMES"), ","),
ForceIP: os.Getenv("CLOUDFLARE_FORCE_IP"),
}, nil
}