mirror of
https://github.com/AmanTahiliani/cloudflare-dns-updater.git
synced 2026-08-07 11:53:08 -04:00
27 lines
541 B
Go
27 lines
541 B
Go
|
|
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
|
||
|
|
}
|