Commit b012c0b3 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'disable-usage-ping' into 'master'

Usage ping updates

Closes #31741 and #31453

See merge request !11231
parents 2d83e4c5 f0b3ed91
......@@ -246,7 +246,7 @@ class ApplicationSetting < ActiveRecord::Base
two_factor_grace_period: 48,
user_default_external: false,
polling_interval_multiplier: 1,
usage_ping_enabled: true
usage_ping_enabled: Settings.gitlab['usage_ping_enabled']
}
end
......@@ -349,6 +349,14 @@ class ApplicationSetting < ActiveRecord::Base
sidekiq_throttling_enabled
end
def usage_ping_can_be_configured?
Settings.gitlab.usage_ping_enabled
end
def usage_ping_enabled
usage_ping_can_be_configured? && super
end
private
def ensure_uuid!
......
......@@ -502,17 +502,24 @@
Let GitLab inform you when an update is available.
.form-group
.col-sm-offset-2.col-sm-10
- can_be_configured = @application_setting.usage_ping_can_be_configured?
.checkbox
= f.label :usage_ping_enabled do
= f.check_box :usage_ping_enabled
= f.check_box :usage_ping_enabled, disabled: !can_be_configured
Usage ping enabled
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/usage_statistics", anchor: "usage-data")
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/usage_statistics", anchor: "usage-ping")
.help-block
Every week GitLab will report license usage back to GitLab, Inc.
Disable this option if you do not want this to occur. To see the
JSON payload that will be sent, visit the
= succeed '.' do
= link_to "Cohorts page", admin_cohorts_path(anchor: 'usage-ping')
- if can_be_configured
Every week GitLab will report license usage back to GitLab, Inc.
Disable this option if you do not want this to occur. To see the
JSON payload that will be sent, visit the
= succeed '.' do
= link_to "Cohorts page", admin_cohorts_path(anchor: 'usage-ping')
- else
The usage ping is disabled, and cannot be configured through this
form. For more information, see the documentation on
= succeed '.' do
= link_to 'deactivating the usage ping', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'deactivate-the-usage-ping')
%fieldset
%legend Email
......
---
title: Add hostname to usage ping
merge_request:
author:
---
title: Allow usage ping to be disabled completely in gitlab.yml
merge_request:
author:
......@@ -241,6 +241,7 @@ Settings.gitlab['domain_whitelist'] ||= []
Settings.gitlab['import_sources'] ||= %w[github bitbucket gitlab google_code fogbugz git gitlab_project gitea]
Settings.gitlab['trusted_proxies'] ||= []
Settings.gitlab['no_todos_messages'] ||= YAML.load_file(Rails.root.join('config', 'no_todos_messages.yml'))
Settings.gitlab['usage_ping_enabled'] = true if Settings.gitlab['usage_ping_enabled'].nil?
#
# CI
......
......@@ -28,60 +28,13 @@ for all signed in users.
[were added][ee-735] in GitLab Enterprise Edition
8.12. [Moved to GitLab Community Edition][ce-23361] in 9.1.
GitLab Inc. can collect non-sensitive information about how GitLab users
use their GitLab instance upon the activation of a ping feature
located in the admin panel (`/admin/application_settings`).
You can see the **exact** JSON payload that your instance sends to GitLab
in the "Usage statistics" section of the admin panel.
Nothing qualitative is collected. Only quantitative. That means no project
names, author names, comment bodies, names of labels, etc.
The usage ping is sent in order for GitLab Inc. to have a better understanding
of how our users use our product, and to be more data-driven when creating or
changing features.
The total number of the following is sent back to GitLab Inc.:
- Comments
- Groups
- Users
- Projects
- Issues
- Labels
- CI builds
- Snippets
- Milestones
- Todos
- Pushes
- Merge requests
- Environments
- Triggers
- Deploy keys
- Pages
- Project Services
- Projects using the Prometheus service
- Issue Boards
- CI Runners
- Deployments
- Geo Nodes
- LDAP Groups
- LDAP Keys
- LDAP Users
- LFS objects
- Protected branches
- Releases
- Remote mirrors
- Uploads
- Web hooks
Also, we track if you've installed Mattermost with GitLab.
For example: `"mattermost_enabled":true"`.
More data will be added over time. The goal of this ping is to be as light as
possible, so it won't have any performance impact on your installation when
the calculation is made.
GitLab sends a weekly payload containing usage data to GitLab Inc. The usage
ping uses high-level data to help our product, support, and sales teams. It does
not send any project names, usernames, or any other specific data. The
information from the usage ping is not anonymous, it is linked to the hostname
of the instance.
You can view the exact JSON payload in the administration panel.
### Deactivate the usage ping
......@@ -89,13 +42,23 @@ By default, usage ping is opt-out. If you want to deactivate this feature, go to
the Settings page of your administration panel and uncheck the Usage ping
checkbox.
## Privacy policy
To disable the usage ping and prevent it from being configured in future through
the administration panel, Omnibus installs can set the following in
[`gitlab.rb`](https://docs.gitlab.com/omnibus/settings/configuration.html#configuration-options):
```ruby
gitlab_rails['usage_ping_enabled'] = false
```
GitLab Inc. does **not** collect any sensitive information, like project names
or the content of the comments. GitLab Inc. does not disclose or otherwise make
available any of the data collected on a customer specific basis.
And source installs can set the following in `gitlab.yml`:
Read more about this in the [Privacy policy](https://about.gitlab.com/privacy).
```yaml
production: &base
# ...
gitlab:
# ...
usage_ping_enabled: false
```
[ee-557]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/557
[ee-735]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/735
......
......@@ -52,6 +52,7 @@ module Gitlab
def license_usage_data
usage_data = {
uuid: current_application_settings.uuid,
hostname: Gitlab.config.gitlab.host,
version: Gitlab::VERSION,
active_user_count: User.active.count,
recorded_at: Time.now,
......
......@@ -17,6 +17,7 @@ describe Gitlab::UsageData do
edition
version
uuid
hostname
))
end
......
......@@ -211,4 +211,66 @@ describe ApplicationSetting, models: true do
expect(setting.domain_blacklist).to contain_exactly('example.com', 'test.com', 'foo.bar')
end
end
describe 'usage ping settings' do
context 'when the usage ping is disabled in gitlab.yml' do
before do
allow(Settings.gitlab).to receive(:usage_ping_enabled).and_return(false)
end
it 'does not allow the usage ping to be configured' do
expect(setting.usage_ping_can_be_configured?).to be_falsey
end
context 'when the usage ping is disabled in the DB' do
before do
setting.usage_ping_enabled = false
end
it 'returns false for usage_ping_enabled' do
expect(setting.usage_ping_enabled).to be_falsey
end
end
context 'when the usage ping is enabled in the DB' do
before do
setting.usage_ping_enabled = true
end
it 'returns false for usage_ping_enabled' do
expect(setting.usage_ping_enabled).to be_falsey
end
end
end
context 'when the usage ping is enabled in gitlab.yml' do
before do
allow(Settings.gitlab).to receive(:usage_ping_enabled).and_return(true)
end
it 'allows the usage ping to be configured' do
expect(setting.usage_ping_can_be_configured?).to be_truthy
end
context 'when the usage ping is disabled in the DB' do
before do
setting.usage_ping_enabled = false
end
it 'returns false for usage_ping_enabled' do
expect(setting.usage_ping_enabled).to be_falsey
end
end
context 'when the usage ping is enabled in the DB' do
before do
setting.usage_ping_enabled = true
end
it 'returns true for usage_ping_enabled' do
expect(setting.usage_ping_enabled).to be_truthy
end
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment