Add renew to acme

This commit is contained in:
Pablu23
2025-07-20 22:08:32 +02:00
parent 77a880cee1
commit 21e28fb60b
4 changed files with 94 additions and 23 deletions

View File

@@ -70,12 +70,15 @@ func main() {
}
if config.Server.Ssl.Acme.Enabled {
err := acme.SetupAcme(config)
acmeRenewer, err := acme.SetupAcme(config)
if err != nil {
log.Fatal().Err(err).Msg("unable to setup acme")
}
}
go func() {
acmeRenewer.RegisterTicker()
}()
}
log.Info().Int("port", config.Server.Port).Str("cert", config.Server.Ssl.CertFile).Str("key", config.Server.Ssl.KeyFile).Msg("Starting server")
err := server.ListenAndServeTLS("", "")
log.Fatal().Err(err).Str("cert", config.Server.Ssl.CertFile).Str("key", config.Server.Ssl.KeyFile).Int("port", config.Server.Port).Msg("Could not start server")