Commit e6562d3a authored by jan.koester's avatar jan.koester
Browse files

Merge config reload loading the DB connections (fix/reload-db-sources)

parents 201edab9 df77238a
Loading
Loading
Loading
Loading
+15 −0
Changes for src/blogi.cpp: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -612,6 +612,21 @@ bool blogi::Blogi::reloadConfig()
                std::cerr << "[blogi] Reload: DB init failed for '" << dcfg.names[0] << "': " << e.what() << std::endl;
            }

            // As at startup: the domain's DB holds the authoritative auth/media
            // connection lists (Settings > Connections); the YAML only seeds
            // them. Without this a reload ran Auth and the plugins on the YAML
            // values, e.g. with TLS verification back on (AUTH_TLS_VERIFY
            // defaults to true) for an authdb/mediadb with a self-signed cert.
            // Must run before Auth and the plugins are constructed below.
            try
            {
                ctx->config->loadSourcesFromDB(*initdb);
            }
            catch (std::exception &e)
            {
                std::cerr << "[blogi] Reload: loading connections failed for '" << dcfg.names[0] << "': " << e.what() << std::endl;
            }

            ctx->plgArgs->smtp = std::make_unique<SmtpSettings>();
            try
            {