Enable to override certificates in key-value store when using storeconfig
This commit is contained in:
parent
68cc826519
commit
4a3b1f3847
3 changed files with 26 additions and 13 deletions
|
@ -52,6 +52,7 @@ type ACME struct {
|
||||||
DNSProvider string `description:"(Deprecated) Activate DNS-01 Challenge"` // Deprecated
|
DNSProvider string `description:"(Deprecated) Activate DNS-01 Challenge"` // Deprecated
|
||||||
DelayDontCheckDNS flaeg.Duration `description:"(Deprecated) Assume DNS propagates after a delay in seconds rather than finding and querying nameservers."` // Deprecated
|
DelayDontCheckDNS flaeg.Duration `description:"(Deprecated) Assume DNS propagates after a delay in seconds rather than finding and querying nameservers."` // Deprecated
|
||||||
ACMELogging bool `description:"Enable debug logging of ACME actions."`
|
ACMELogging bool `description:"Enable debug logging of ACME actions."`
|
||||||
|
OverrideCertificates bool `description:"Enable to override certificates in key-value store when using storeconfig"`
|
||||||
client *acme.Client
|
client *acme.Client
|
||||||
defaultCertificate *tls.Certificate
|
defaultCertificate *tls.Certificate
|
||||||
store cluster.Store
|
store cluster.Store
|
||||||
|
|
|
@ -85,21 +85,26 @@ func Run(kv *staert.KvSource, traefikConfiguration *cmd.TraefikConfiguration) fu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the ACME Account into the KV Store
|
// Check to see if ACME account object is already in kv store
|
||||||
meta := cluster.NewMetadata(account)
|
if traefikConfiguration.GlobalConfiguration.ACME.OverrideCertificates {
|
||||||
err = meta.Marshall()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
source := staert.KvSource{
|
// Store the ACME Account into the KV Store
|
||||||
Store: kv,
|
// Certificates in KV Store will be overridden
|
||||||
Prefix: traefikConfiguration.GlobalConfiguration.ACME.Storage,
|
meta := cluster.NewMetadata(account)
|
||||||
}
|
err = meta.Marshall()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = source.StoreConfig(meta)
|
source := staert.KvSource{
|
||||||
if err != nil {
|
Store: kv,
|
||||||
return err
|
Prefix: traefikConfiguration.GlobalConfiguration.ACME.Storage,
|
||||||
|
}
|
||||||
|
|
||||||
|
err = source.StoreConfig(meta)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force to delete storagefile
|
// Force to delete storagefile
|
||||||
|
|
|
@ -63,6 +63,13 @@ entryPoint = "https"
|
||||||
#
|
#
|
||||||
# acmeLogging = true
|
# acmeLogging = true
|
||||||
|
|
||||||
|
# If true, override certificates in key-value store when using storeconfig.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: false
|
||||||
|
#
|
||||||
|
# overrideCertificates = true
|
||||||
|
|
||||||
# Enable on demand certificate generation.
|
# Enable on demand certificate generation.
|
||||||
#
|
#
|
||||||
# Optional (Deprecated)
|
# Optional (Deprecated)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue