Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
97be319f
Commit
97be319f
authored
Jun 06, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reworking the configuration
parent
beed849d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
62 deletions
+42
-62
app/views/admin/application_settings/_elt_database_cron_job.html.haml
...min/application_settings/_elt_database_cron_job.html.haml
+0
-23
app/views/admin/application_settings/show.html.haml
app/views/admin/application_settings/show.html.haml
+4
-4
app/workers/pseudonymizer_worker.rb
app/workers/pseudonymizer_worker.rb
+2
-2
config/gitlab.yml.example
config/gitlab.yml.example
+10
-6
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
db/schema.rb
db/schema.rb
+2
-1
ee/app/helpers/ee/application_settings_helper.rb
ee/app/helpers/ee/application_settings_helper.rb
+6
-10
ee/app/models/ee/application_setting.rb
ee/app/models/ee/application_setting.rb
+7
-7
ee/app/models/license.rb
ee/app/models/license.rb
+2
-2
ee/db/migrate/20180531221734_add_elt_dump_enabled_to_application_settings.rb
...531221734_add_elt_dump_enabled_to_application_settings.rb
+1
-1
lib/tasks/gitlab/db.rake
lib/tasks/gitlab/db.rake
+7
-5
No files found.
app/views/admin/application_settings/_elt_database_cron_job.html.haml
deleted
100644 → 0
View file @
beed849d
=
form_for
@application_setting
,
url:
admin_application_settings_path
,
html:
{
class:
'fieldset-form'
}
do
|
f
|
=
form_errors
(
@application_setting
)
%fieldset
.form-group.row
.offset-sm-2.col-sm-10
-
is_enabled
=
@application_setting
.
elt_database_dump_enabled?
-
is_available
=
@application_setting
.
elt_database_dump_available?
.form-check
=
f
.
label
:elt_database_dump_enabled
do
=
f
.
check_box
:elt_database_dump_enabled
,
disabled:
!
is_available
Enable Meltano Database Cron Job
.form-text.text-muted
-
if
is_enabled
=
meltano_elt_description_text
-
else
-
if
is_available
=
meltano_elt_disabled_description_text
-
else
=
meltano_elt_unavailable_description_text
=
f
.
submit
'Save changes'
,
class:
"btn btn-success"
app/views/admin/application_settings/show.html.haml
View file @
97be319f
...
...
@@ -237,17 +237,17 @@
.settings-content
=
render
'usage'
-
if
meltano_elt_database_dump_enabled?
-
if
License
.
feature_available?
(
:pseudonymizer
)
%section
.settings.as-usage.no-animate
#js-elt-database-dump-settings
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
%h4
=
_
(
'
Meltano ELT Database
Cron Job'
)
=
_
(
'
Pseudonymizer
Cron Job'
)
%button
.btn.btn-default.js-settings-toggle
{
type:
'button'
}
=
expanded
?
_
(
'Collapse'
)
:
_
(
'Expand'
)
%p
=
_
(
'Enable or disable
Meltano ELT Database
Cron Job.'
)
=
_
(
'Enable or disable
the Pseudonymizer
Cron Job.'
)
.settings-content
=
render
'
elt_database_cron_job
'
=
render
'
pseudonymizer
'
%section
.settings.as-email.no-animate
#js-email-settings
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
...
...
app/workers/
gitlab_elt_data_dump
_worker.rb
→
app/workers/
pseudonymizer
_worker.rb
View file @
97be319f
class
GitlabEltDataDump
Worker
class
Pseudonymizer
Worker
include
ApplicationWorker
include
CronjobQueue
def
perform
return
unless
Gitlab
::
CurrentSettings
.
elt_database_dump_enabled
return
unless
Gitlab
::
CurrentSettings
.
pseudonymizer_enabled?
options
=
Pseudonymity
::
Options
.
new
(
config:
YAML
.
load_file
(
Rails
.
root
.
join
(
Gitlab
.
config
.
pseudonymizer
.
manifest
)),
...
...
config/gitlab.yml.example
View file @
97be319f
...
...
@@ -263,7 +263,7 @@ production: &base
# Remove outdated repository archives
repository_archive_cache_worker:
cron: "0 * * * *"
# Verify custom GitLab Pages domains
pages_domain_verification_cron_worker:
cron: "*/15 * * * *"
...
...
@@ -311,6 +311,9 @@ production: &base
geo_migrated_local_files_clean_up_worker:
cron: "15 */6 * * *"
pseudonymizer_worker:
cron: "0 * * * *"
registry:
# enabled: true
# host: registry.example.com
...
...
@@ -726,11 +729,12 @@ production: &base
# # Specifies Amazon S3 storage class to use for backups, this is optional
# # storage_class: 'STANDARD'
## Pseudonym exporter
## Pseudonym
izer
exporter
pseudonymizer:
enabled: false
# Tables manifest that specifies the fields to extract and pseudonymize.
# TODO: link to meltano configuration?
manifest: config/pseudonymizer.yml
# remote_directory: 'gitlab-elt'
upload:
# Fog storage connection settings, see http://fog.io/storage/ .
connection:
...
...
@@ -739,7 +743,6 @@ production: &base
# aws_access_key_id: AKIAKIAKI
# aws_secret_access_key: 'secret123'
# # The remote 'directory' to store the CSV files. For S3, this would be the bucket name.
# remote_directory: 'gitlab-elt'
## GitLab Shell settings
gitlab_shell:
...
...
@@ -892,6 +895,7 @@ test:
backup:
path: tmp/tests/backups
pseudonymizer:
enabled: false
manifest: config/pseudonymizer.test.yml
upload:
# The remote 'directory' to store the CSV files. For S3, this would be the bucket name.
...
...
@@ -900,8 +904,8 @@ test:
connection:
provider: AWS
region: us-east-1
aws_access_key_id:
AWS_ACCESS_KEY_ID
aws_secret_access_key:
AWS_SECRET_ACCESS_KEY
aws_access_key_id:
minio
aws_secret_access_key:
gdk-minio
gitlab_shell:
path: tmp/tests/gitlab-shell/
hooks_path: tmp/tests/gitlab-shell/hooks/
...
...
config/initializers/1_settings.rb
View file @
97be319f
...
...
@@ -162,7 +162,6 @@ Settings.gitlab['import_sources'] ||= Gitlab::ImportSources.values
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?
Settings
.
gitlab
[
'elt_database_dump_enabled'
]
=
false
if
Settings
.
gitlab
[
'elt_database_dump_enabled'
].
nil?
#
# Elasticseacrh
...
...
@@ -479,6 +478,7 @@ Settings.backup['upload']['storage_class'] ||= nil
# Pseudonymizer
#
Settings
[
'pseudonymizer'
]
||=
Settingslogic
.
new
({})
Settings
.
pseudonymizer
[
'enabled'
]
=
false
if
Settings
.
pseudonymizer
[
'enabled'
].
nil?
Settings
.
pseudonymizer
[
'manifest'
]
=
Settings
.
pseudonymizer
[
'manifest'
]
||
"lib/pseudonymity/manifest.yml"
Settings
.
pseudonymizer
[
'upload'
]
||=
Settingslogic
.
new
({
'remote_directory'
=>
nil
,
'connection'
=>
nil
})
# Settings.pseudonymizer['upload']['multipart_chunk_size'] ||= 104857600
...
...
db/schema.rb
View file @
97be319f
...
...
@@ -206,7 +206,7 @@ ActiveRecord::Schema.define(version: 20180612175636) do
t
.
string
"encrypted_external_auth_client_key_pass_iv"
t
.
string
"email_additional_text"
t
.
boolean
"enforce_terms"
,
default:
false
t
.
boolean
"
elt_database_dump
_enabled"
t
.
boolean
"
pseudonymizer
_enabled"
end
create_table
"approvals"
,
force: :cascade
do
|
t
|
...
...
@@ -2279,6 +2279,7 @@ ActiveRecord::Schema.define(version: 20180612175636) do
end
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path"
,
unique:
true
,
using: :btree
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path_text_pattern_ops"
,
using: :btree
,
opclasses:
{
"path"
=>
"varchar_pattern_ops"
}
add_index
"redirect_routes"
,
[
"source_type"
,
"source_id"
],
name:
"index_redirect_routes_on_source_type_and_source_id"
,
using: :btree
create_table
"releases"
,
force: :cascade
do
|
t
|
...
...
ee/app/helpers/ee/application_settings_helper.rb
View file @
97be319f
...
...
@@ -35,20 +35,16 @@ module EE
"and the value is encrypted at rest."
)
end
def
meltano_elt_database_dump_enabled?
return
License
.
feature_available?
:meltano_elt_database_dump
def
pseudonymizer_description_text
_
(
"GitLab will run the pseudonymizer cron job which will send pseudoanonymized data to be processed and analyzed."
)
end
def
meltano_elt
_description_text
_
(
"
GitLab will run the Meltano ELT cron job which
will send pseudoanonymized data to be processed and analyzed."
)
def
pseudonymizer_disabled
_description_text
_
(
"
The pseudonymizer database cron job is disabled. When enabled the cron job
will send pseudoanonymized data to be processed and analyzed."
)
end
def
meltano_elt_disabled_description_text
_
(
"The Meltano ELT database cron job is disabled. When enabled the cron job will send pseudoanonymized data to be processed and analyzed."
)
end
def
meltano_elt_unavailable_description_text
_
(
"The Meltano ELT database cron job is disabled. Once enabled, the cron job will send pseudoanonymized data to be processed and analyzed."
)
def
pseudonymizer_unavailable_description_text
_
(
"The pseudonymizer cron job is disabled. Once enabled, the cron job will send pseudoanonymized data to be processed and analyzed."
)
end
override
:visible_attributes
...
...
ee/app/models/ee/application_setting.rb
View file @
97be319f
...
...
@@ -101,21 +101,21 @@ module EE
slack_app_id:
nil
,
slack_app_secret:
nil
,
slack_app_verification_token:
nil
,
elt_database_dump_enabled:
Settings
.
gitlab
[
'elt_database_dump_
enabled'
],
pseudonymizer_enabled:
Settings
.
pseudonymizer
[
'
enabled'
],
)
end
end
def
elt_database_dump
_available?
License
.
feature_available?
:meltano_elt_database_dump
def
pseudonymizer
_available?
License
.
feature_available?
(
:pseudonymizer
)
end
def
elt_database_dump
_can_be_configured?
Settings
.
gitlab
.
elt_database_dump_enabled
&&
License
.
feature_available?
(
:meltano_elt_database_dump
)
def
pseudonymizer
_can_be_configured?
Settings
.
pseudonymizer
.
enabled
&&
pseudonymizer_available?
end
def
elt_database_dump
_enabled?
elt_database_dump
_can_be_configured?
&&
super
def
pseudonymizer
_enabled?
pseudonymizer
_can_be_configured?
&&
super
end
def
should_check_namespace_plan?
...
...
ee/app/models/license.rb
View file @
97be319f
...
...
@@ -30,8 +30,8 @@ class License < ActiveRecord::Base
related_issues
repository_mirrors
repository_size_limit
scoped_issue_board
,
meltano_elt_database_dump
scoped_issue_board
pseudonymizer
]
.
freeze
EEP_FEATURES
=
EES_FEATURES
+
%i[
...
...
ee/db/migrate/20180531221734_add_elt_dump_enabled_to_application_settings.rb
View file @
97be319f
...
...
@@ -26,6 +26,6 @@ class AddEltDumpEnabledToApplicationSettings < ActiveRecord::Migration
# disable_ddl_transaction!
def
change
add_column
:application_settings
,
:
elt_database_dump
_enabled
,
:boolean
add_column
:application_settings
,
:
pseudonymizer
_enabled
,
:boolean
end
end
lib/tasks/gitlab/db.rake
View file @
97be319f
...
...
@@ -46,10 +46,6 @@ namespace :gitlab do
desc
'Configures the database by running migrate, or by loading the schema and seeding if needed'
task
configure: :environment
do
unless
License
.
feature_available?
:meltano_elt_database_dump
raise
"The Meltano ELT extract is not available with this license."
end
if
ActiveRecord
::
Base
.
connection
.
tables
.
any?
Rake
::
Task
[
'db:migrate'
].
invoke
else
...
...
@@ -75,7 +71,13 @@ namespace :gitlab do
end
desc
'Output pseudonymity dump of selected tables'
task
pseudonymity_dump: :environment
do
task
pseudonymizer: :environment
do
unless
License
.
feature_available?
:pseudonymizer
raise
"The pseudonymizer is not available with this license."
end
abort
"Pseudonymizer disabled."
unless
Gitlab
::
CurrentSettings
.
pseudonymizer_enabled?
options
=
Pseudonymity
::
Options
.
new
(
config:
YAML
.
load_file
(
Rails
.
root
.
join
(
Gitlab
.
config
.
pseudonymizer
.
manifest
)),
start_at:
Time
.
now
.
utc
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment