diff --git a/conf/defaults.ini b/conf/defaults.ini index 3f0a03de907..d0ab0c1a16c 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -193,12 +193,19 @@ reporting_enabled = true reporting_distributor = grafana-labs # Set to false to disable all checks to https://grafana.com -# for new versions (grafana itself and plugins), check is used -# in some UI views to notify that grafana or plugin update exists +# for new versions of grafana. The check is used +# in some UI views to notify that a grafana update exists. # This option does not cause any auto updates, nor send any information -# only a GET request to https://grafana.com to get latest versions +# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version. check_for_updates = true +# Set to false to disable all checks to https://grafana.com +# for new versions of plugins. The check is used +# in some UI views to notify that a plugin update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://grafana.com to get the latest versions. +check_for_plugin_updates = true + # Google Analytics universal tracking code, only enabled if you specify an id here google_analytics_ua_id = diff --git a/conf/sample.ini b/conf/sample.ini index d56075fd037..f20d03f7461 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -198,13 +198,20 @@ # The name of the distributor of the Grafana instance. Ex hosted-grafana, grafana-labs ;reporting_distributor = grafana-labs -# Set to false to disable all checks to https://grafana.net -# for new versions (grafana itself and plugins), check is used -# in some UI views to notify that grafana or plugin update exists +# Set to false to disable all checks to https://grafana.com +# for new versions of grafana. The check is used +# in some UI views to notify that a grafana update exists. # This option does not cause any auto updates, nor send any information -# only a GET request to http://grafana.com to get latest versions +# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version. ;check_for_updates = true +# Set to false to disable all checks to https://grafana.com +# for new versions of plugins. The check is used +# in some UI views to notify that a plugin update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://grafana.com to get the latest versions. +;check_for_plugin_updates = true + # Google Analytics universal tracking code, only enabled if you specify an id here ;google_analytics_ua_id = diff --git a/docs/sources/administration/configuration.md b/docs/sources/administration/configuration.md index c44ce31b24a..58cdcc98e3b 100644 --- a/docs/sources/administration/configuration.md +++ b/docs/sources/administration/configuration.md @@ -461,7 +461,13 @@ value is `true`. ### check_for_updates -Set to false to disable all checks to https://grafana.com for new versions of installed plugins and to the Grafana GitHub repository to check for a newer version of Grafana. The version information is used in some UI views to notify that a new Grafana update or a plugin update exists. This option does not cause any auto updates, nor send any sensitive information. The check is run every 10 minutes. +Set to false, disables checking for new versions of Grafana from Grafana's GitHub repository. When enabled, the check for a new version runs every 10 minutes. It will notify, via the UI, when a new version is available. The check itself will not prompt any auto-updates of the Grafana software, nor will it send any sensitive information. + +### check_for_plugin_updates + +> **Note**: Available in Grafana v8.5.0 and later versions. + +Set to false disables checking for new versions of installed plugins from https://grafana.com. When enabled, the check for a new plugin runs every 10 minutes. It will notify, via the UI, when a new plugin update exists. The check itself will not prompt any auto-updates of the plugin, nor will it send any sensitive information. ### google_analytics_ua_id diff --git a/pkg/services/updatechecker/grafana.go b/pkg/services/updatechecker/grafana.go index 777fcd07a19..f66fb76e9d6 100644 --- a/pkg/services/updatechecker/grafana.go +++ b/pkg/services/updatechecker/grafana.go @@ -28,7 +28,7 @@ type GrafanaService struct { func ProvideGrafanaService(cfg *setting.Cfg) *GrafanaService { return &GrafanaService{ - enabled: cfg.CheckForUpdates, + enabled: cfg.CheckForGrafanaUpdates, grafanaVersion: cfg.BuildVersion, httpClient: http.Client{Timeout: 10 * time.Second}, log: log.New("grafana.update.checker"), diff --git a/pkg/services/updatechecker/plugins.go b/pkg/services/updatechecker/plugins.go index 618597acda6..967fdb9fdcb 100644 --- a/pkg/services/updatechecker/plugins.go +++ b/pkg/services/updatechecker/plugins.go @@ -29,7 +29,7 @@ type PluginsService struct { func ProvidePluginsService(cfg *setting.Cfg, pluginStore plugins.Store) *PluginsService { return &PluginsService{ - enabled: cfg.CheckForUpdates, + enabled: cfg.CheckForPluginUpdates, grafanaVersion: cfg.BuildVersion, httpClient: &http.Client{Timeout: 10 * time.Second}, log: log.New("plugins.update.checker"), diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 6d5729b731c..10834bf4556 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -387,7 +387,8 @@ type Cfg struct { Env string // Analytics - CheckForUpdates bool + CheckForGrafanaUpdates bool + CheckForPluginUpdates bool ReportingDistributor string ReportingEnabled bool ApplicationInsightsConnectionString string @@ -929,7 +930,8 @@ func (cfg *Cfg) Load(args CommandLineArgs) error { cfg.MetricsEndpointDisableTotalStats = iniFile.Section("metrics").Key("disable_total_stats").MustBool(false) analytics := iniFile.Section("analytics") - cfg.CheckForUpdates = analytics.Key("check_for_updates").MustBool(true) + cfg.CheckForGrafanaUpdates = analytics.Key("check_for_updates").MustBool(true) + cfg.CheckForPluginUpdates = analytics.Key("check_for_plugin_updates").MustBool(true) GoogleAnalyticsId = analytics.Key("google_analytics_ua_id").String() GoogleTagManagerId = analytics.Key("google_tag_manager_id").String() RudderstackWriteKey = analytics.Key("rudderstack_write_key").String()