mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
feat: add support for https certs
This commit is contained in:
@@ -25,6 +25,7 @@ const (
|
||||
var (
|
||||
keepAliveInterval = defaultKeepAliveInterval
|
||||
magicDNSSuffix = defaultMagicDNSSuffix
|
||||
certDNSSuffix = ""
|
||||
)
|
||||
|
||||
func KeepAliveInterval() time.Duration {
|
||||
@@ -35,6 +36,10 @@ func MagicDNSSuffix() string {
|
||||
return magicDNSSuffix
|
||||
}
|
||||
|
||||
func CertDNSSuffix() string {
|
||||
return certDNSSuffix
|
||||
}
|
||||
|
||||
func LoadConfig(path string) (*Config, error) {
|
||||
cfg := defaultConfig()
|
||||
|
||||
@@ -72,6 +77,14 @@ func LoadConfig(path string) (*Config, error) {
|
||||
keepAliveInterval = cfg.PollNet.KeepAliveInterval
|
||||
magicDNSSuffix = cfg.DNS.MagicDNSSuffix
|
||||
|
||||
if cfg.DNS.Provider.Zone != "" {
|
||||
if cfg.DNS.Provider.Subdomain == "" {
|
||||
certDNSSuffix = cfg.DNS.Provider.Zone
|
||||
} else {
|
||||
certDNSSuffix = fmt.Sprintf("%s.%s", cfg.DNS.Provider.Subdomain, cfg.DNS.Provider.Zone)
|
||||
}
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
@@ -165,13 +178,21 @@ type AuthProvider struct {
|
||||
}
|
||||
|
||||
type DNS struct {
|
||||
MagicDNSSuffix string `yaml:"magic_dns_suffix"`
|
||||
MagicDNSSuffix string `yaml:"magic_dns_suffix"`
|
||||
Provider DNSProvider `yaml:"provider,omitempty"`
|
||||
}
|
||||
|
||||
type DNSProvider struct {
|
||||
Name string `yaml:"name"`
|
||||
Zone string `yaml:"zone"`
|
||||
Subdomain string `yaml:"subdomain"`
|
||||
Configuration map[string]string `yaml:"config"`
|
||||
}
|
||||
|
||||
type SystemAdminPolicy struct {
|
||||
Subs []string `json:"subs,omitempty"`
|
||||
Emails []string `json:"emails,omitempty"`
|
||||
Filters []string `json:"filters,omitempty"`
|
||||
Subs []string `yaml:"subs,omitempty"`
|
||||
Emails []string `yaml:"emails,omitempty"`
|
||||
Filters []string `yaml:"filters,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Config) CreateUrl(format string, a ...interface{}) string {
|
||||
|
||||
Reference in New Issue
Block a user