diff --git a/quesma/quesma/config/config_v2.go b/quesma/quesma/config/config_v2.go index 0ebe1c720..12528be8b 100644 --- a/quesma/quesma/config/config_v2.go +++ b/quesma/quesma/config/config_v2.go @@ -503,10 +503,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { if conf.Elasticsearch, err = c.getElasticsearchConfig(); err != nil { errAcc = multierror.Append(errAcc, err) } - if !c.DisableTelemetry { - conf.QuesmaInternalTelemetryUrl = telemetryUrl - conf.Logging.RemoteLogDrainUrl = telemetryUrl - } // This is perhaps a little oversimplification, **but** in case any of the FE connectors has auth disabled, we disable auth for the whole incomming traffic // After all, the "duality" of frontend connectors is still an architectural choice we tend to question for _, fConn := range c.FrontendConnectors { @@ -520,6 +516,14 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { conf.Logging.Level = &DefaultLogLevel } + if !c.DisableTelemetry { + conf.QuesmaInternalTelemetryUrl = telemetryUrl + conf.Logging.RemoteLogDrainUrl = telemetryUrl + } else { + conf.QuesmaInternalTelemetryUrl = nil + conf.Logging.RemoteLogDrainUrl = nil + } + conf.InstallationId = c.InstallationId conf.LicenseKey = c.LicenseKey diff --git a/quesma/quesma/ui/dashboard.go b/quesma/quesma/ui/dashboard.go index 0068f5b50..510757768 100644 --- a/quesma/quesma/ui/dashboard.go +++ b/quesma/quesma/ui/dashboard.go @@ -183,7 +183,7 @@ func (qmc *QuesmaManagementConsole) generateDashboardPanel() []byte { buffer.Html(`
`) buffer.Html(`

Quesma

`) - buffer = maybePrintUpgradeAvailableBanner(buffer) + buffer.Write(qmc.maybePrintUpgradeAvailableBanner()) buffer.Html(`
Version: `) buffer.Text(buildinfo.Version) @@ -244,13 +244,17 @@ type latestVersionCheckResult struct { // maybePrintUpgradeAvailableBanner has time cap of 500ms to check for the latest version, if it takes longer than that, // it will log an error message and don't render anything -func maybePrintUpgradeAvailableBanner(buffer builder.HtmlBuffer) builder.HtmlBuffer { +func (qmc *QuesmaManagementConsole) maybePrintUpgradeAvailableBanner() []byte { + if qmc.cfg.Logging.RemoteLogDrainUrl == nil { + return nil + } resultChan := make(chan latestVersionCheckResult, 1) go func() { upgradeAvailable, message := buildinfo.CheckForTheLatestVersion() resultChan <- latestVersionCheckResult{upgradeAvailable, message} }() + buffer := builder.HtmlBuffer{} select { case result := <-resultChan: if result.upgradeAvailable { @@ -261,5 +265,5 @@ func maybePrintUpgradeAvailableBanner(buffer builder.HtmlBuffer) builder.HtmlBuf case <-time.After(500 * time.Millisecond): logger.Error().Msg("Timeout while checking for the latest version.") } - return buffer + return buffer.Bytes() }