Documentation
¶
Index ¶
- func CheckMissingDNSRecords(cloudflareDNSRecords []cloudflare.DNSRecord, ...) []cloudflare.DNSRecord
- func CheckOrphanedDNSRecords(cloudflareDNSRecords []cloudflare.DNSRecord, ...) []cloudflare.DNSRecord
- func CreateCloudflareDNSRecord(record cloudflare.DNSRecord)
- func DeleteCloudflareDNSRecord(record cloudflare.DNSRecord)
- func GetAdditionalRecords(userRecords []cloudflare.DNSRecord) []cloudflare.DNSRecord
- func GetCloudflareDNSRecords() []cloudflare.DNSRecord
- func GetCloudflareZoneID()
- func GetConfig(configFilePath string)
- func GetCurrentIP()
- func GetTraefikRules(userRecords []cloudflare.DNSRecord) []cloudflare.DNSRecord
- func ParseFlags() (string, bool, bool)
- func SendSlackMessage()
- func SetupCloudflareClient()
- func UpdateCloudflareDNSRecords(cloudflareDNSRecords []cloudflare.DNSRecord, ...)
- type Configuration
- type TraefikRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMissingDNSRecords ¶
func CheckMissingDNSRecords(cloudflareDNSRecords []cloudflare.DNSRecord, userRecords []cloudflare.DNSRecord) []cloudflare.DNSRecord
CheckMissingDNSRecords compares Cloudflare DNS records with Traefik rules and additionalRecords
func CheckOrphanedDNSRecords ¶
func CheckOrphanedDNSRecords(cloudflareDNSRecords []cloudflare.DNSRecord, userRecords []cloudflare.DNSRecord) []cloudflare.DNSRecord
CheckOrphanedDNSRecords compares Cloudflare DNS records with Traefik rules and additionalRecords
func CreateCloudflareDNSRecord ¶
func CreateCloudflareDNSRecord(record cloudflare.DNSRecord)
CreateCloudflareDNSRecord is a wrapper function to create a DNS record
func DeleteCloudflareDNSRecord ¶
func DeleteCloudflareDNSRecord(record cloudflare.DNSRecord)
DeleteCloudflareDNSRecord is a wrapper function to delete a DNS record
func GetAdditionalRecords ¶
func GetAdditionalRecords(userRecords []cloudflare.DNSRecord) []cloudflare.DNSRecord
GetAdditionalRecords gathers and checks configured additionalRecords
func GetCloudflareDNSRecords ¶
func GetCloudflareDNSRecords() []cloudflare.DNSRecord
GetCloudflareDNSRecords gathers all DNS records in a given zone
func GetCloudflareZoneID ¶
func GetCloudflareZoneID()
GetCloudflareZoneID creates a global var containing the zone id
func GetConfig ¶
func GetConfig(configFilePath string)
GetConfig creates a global var holding the configuration
func GetTraefikRules ¶
func GetTraefikRules(userRecords []cloudflare.DNSRecord) []cloudflare.DNSRecord
GetTraefikRules gathers and formats all Traefik http routers
func SendSlackMessage ¶
func SendSlackMessage()
SendSlackMessage sends a Slack message if configured
func SetupCloudflareClient ¶
func SetupCloudflareClient()
SetupCloudflareClient creates a global var with a Cloudflare client instance
func UpdateCloudflareDNSRecords ¶
func UpdateCloudflareDNSRecords(cloudflareDNSRecords []cloudflare.DNSRecord, userRecords []cloudflare.DNSRecord)
UpdateCloudflareDNSRecords updates the public IP and additionalRecords
Types ¶
type Configuration ¶
type Configuration struct {
RootDomain string `yaml:"rootDomain"`
IPProviders []string `yaml:"ipProviders"`
Notifications struct {
Slack struct {
WebhookURL string `yaml:"webhookURL"`
Username string `yaml:"username"`
Channel string `yaml:"channel"`
IconURL string `yaml:"iconURL"`
} `yaml:"slack"`
} `yaml:"notifications"`
Traefik struct {
URL string `yaml:"url"`
Username string `yaml:"username"`
Password string `yaml:"password"`
IgnoredRules []string `yaml:"ignoredRules"`
} `yaml:"traefik"`
AdditionalRecords []cloudflare.DNSRecord `yaml:"additionalRecords"`
Cloudflare struct {
Email string `yaml:"email"`
APIKey string `yaml:"apiKey"`
Defaults struct {
Type string `yaml:"type"`
Proxied bool `yaml:"proxied"`
TTL int `yaml:"ttl"`
} `yaml:"defaults"`
} `yaml:"cloudflare"`
}
Configuration is a struct to store the script's configuration
type TraefikRouter ¶
type TraefikRouter struct {
EntryPoints []string `json:"entryPoints"`
Middlewares []string `json:"middlewares,omitempty"`
Service string `json:"service"`
Rule string `json:"rule"`
TLS struct {
CertResolver string `json:"certResolver"`
Domains []struct {
Main string `json:"main"`
Sans []string `json:"sans"`
} `json:"domains"`
} `json:"tls,omitempty"`
Status string `json:"status"`
Using []string `json:"using"`
Name string `json:"name"`
Provider string `json:"provider"`
Priority int64 `json:"priority,omitempty"`
}
TraefikRouter is a struct to store a router object of Traefik