mirror of
https://github.com/juanfont/headscale.git
synced 2025-09-06 17:54:31 +02:00
fix: Missing config type deserialization
This commit is contained in:
parent
018fdd7a2b
commit
16a76c9b96
@ -113,7 +113,7 @@ type DNSConfig struct {
|
||||
|
||||
type TlsCertConfig struct {
|
||||
// Type sets the tls cert type, one of "hetzner", ...
|
||||
Type string
|
||||
Type string `mapstructure:"type"`
|
||||
Hetzner HetznerTlsCertConfig `mapstructure:"hetzner"`
|
||||
}
|
||||
|
||||
@ -654,12 +654,15 @@ func dns() (DNSConfig, error) {
|
||||
dns.ExtraRecordsPath = viper.GetString("dns.extra_records_path")
|
||||
|
||||
if viper.IsSet("dns.tls_cert") {
|
||||
certType := viper.GetString("dns.tls_cert.type")
|
||||
if certType == TlsCertHetzner {
|
||||
zoneName := dns.BaseDomain
|
||||
if viper.IsSet("dns.tls_cert.hetzner.zone_name") {
|
||||
zoneName = viper.GetString("dns.tls_cert.hetzner.zone_name")
|
||||
}
|
||||
|
||||
dns.TlsCert = TlsCertConfig{
|
||||
Type: certType,
|
||||
Hetzner: HetznerTlsCertConfig{
|
||||
ApiToken: viper.GetString("dns.tls_cert.hetzner.api_token"),
|
||||
ZoneId: viper.GetString("dns.tls_cert.hetzner.zone_id"),
|
||||
@ -668,6 +671,7 @@ func dns() (DNSConfig, error) {
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if viper.IsSet("dns.extra_records") {
|
||||
var extraRecords []tailcfg.DNSRecord
|
||||
|
Loading…
Reference in New Issue
Block a user