all: sync with master

This commit is contained in:
Ainar Garipov
2022-12-07 16:46:59 +03:00
parent 03d9803238
commit fde9ea5cb1
61 changed files with 1523 additions and 295 deletions

View File

@@ -514,7 +514,8 @@ func run(opts options, clientBuildFS fs.FS) {
Context.tls, err = newTLSManager(config.TLS)
if err != nil {
log.Fatalf("initializing tls: %s", err)
log.Error("initializing tls: %s", err)
onConfigModified()
}
Context.web, err = initWeb(opts, clientBuildFS)

View File

@@ -40,7 +40,9 @@ type tlsManager struct {
conf tlsConfigSettings
}
// newTLSManager initializes the TLS configuration.
// newTLSManager initializes the manager of TLS configuration. m is always
// non-nil while any returned error indicates that the TLS configuration isn't
// valid. Thus TLS may be initialized later, e.g. via the web UI.
func newTLSManager(conf tlsConfigSettings) (m *tlsManager, err error) {
m = &tlsManager{
status: &tlsConfigStatus{},
@@ -50,7 +52,9 @@ func newTLSManager(conf tlsConfigSettings) (m *tlsManager, err error) {
if m.conf.Enabled {
err = m.load()
if err != nil {
return nil, err
m.conf.Enabled = false
return m, err
}
m.setCertFileTime()