mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
configs: add ACME section
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -38,17 +38,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
certAutoReload bool
|
||||
pemCRLPrefix = []byte("-----BEGIN X509 CRL")
|
||||
pemCRLPrefix = []byte("-----BEGIN X509 CRL")
|
||||
)
|
||||
|
||||
// SetCertAutoReloadMode sets if the certificate must be monitored for changes and
|
||||
// automatically reloaded
|
||||
func SetCertAutoReloadMode(val bool) {
|
||||
certAutoReload = val
|
||||
logger.Debug(logSender, "", "is certificate monitoring enabled? %t", certAutoReload)
|
||||
}
|
||||
|
||||
// TLSKeyPair defines the paths and the unique identifier for a TLS key pair
|
||||
type TLSKeyPair struct {
|
||||
Cert string
|
||||
@@ -302,11 +294,11 @@ func NewCertManager(keyPairs []TLSKeyPair, configDir, logSender string) (*CertMa
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if certAutoReload {
|
||||
randSecs := rand.Intn(59)
|
||||
manager.monitor()
|
||||
_, err := eventScheduler.AddFunc(fmt.Sprintf("@every 8h0m%ds", randSecs), manager.monitor)
|
||||
util.PanicOnError(err)
|
||||
randSecs := rand.Intn(59)
|
||||
manager.monitor()
|
||||
if eventScheduler != nil {
|
||||
logger.Debug(manager.logSender, "", "starting certificates monitoring tasks")
|
||||
_, err = eventScheduler.AddFunc(fmt.Sprintf("@every 8h0m%ds", randSecs), manager.monitor)
|
||||
}
|
||||
return manager, nil
|
||||
return manager, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user