Commit 3735e9fa authored by Micaël Bergeron's avatar Micaël Bergeron

apply feedback

parent e7415e3e
...@@ -22,7 +22,9 @@ To configure the pseudonymizer, you need to: ...@@ -22,7 +22,9 @@ To configure the pseudonymizer, you need to:
- Provide a manifest file that describes which fields should be included or - Provide a manifest file that describes which fields should be included or
pseudonymized ([example `manifest.yml` file](https://gitlab.com/gitlab-org/gitlab-ee/tree/master/config/pseudonymizer.yml)). pseudonymized ([example `manifest.yml` file](https://gitlab.com/gitlab-org/gitlab-ee/tree/master/config/pseudonymizer.yml)).
- Use an object storage A default manifest is provided with the GitLab installation. Using a relative file path will be resolved from the Rails root.
Alternatively, you can use an absolute file path.
- Use an object storage and specify the connection parameters in the `pseudonymizer.upload.connection` configuration option.
**For Omnibus installations:** **For Omnibus installations:**
......
...@@ -3,8 +3,15 @@ class PseudonymizerWorker ...@@ -3,8 +3,15 @@ class PseudonymizerWorker
include CronjobQueue include CronjobQueue
def perform def perform
abort "The pseudonymizer is not available with this license." unless License.feature_available?(:pseudonymizer) unless License.feature_available?(:pseudonymizer)
abort "The pseudonymizer is disabled." unless Gitlab::CurrentSettings.pseudonymizer_enabled? Rails.logger.warn("The pseudonymizer is not available with this license.")
return
end
unless unless Gitlab::CurrentSettings.pseudonymizer_enabled?
Rails.logger.info("The pseudonymizer is disabled.")
return
end
options = Pseudonymizer::Options.new( options = Pseudonymizer::Options.new(
config: YAML.load_file(Gitlab.config.pseudonymizer.manifest), config: YAML.load_file(Gitlab.config.pseudonymizer.manifest),
...@@ -14,7 +21,10 @@ class PseudonymizerWorker ...@@ -14,7 +21,10 @@ class PseudonymizerWorker
dumper = Pseudonymizer::Dumper.new(options) dumper = Pseudonymizer::Dumper.new(options)
uploader = Pseudonymizer::Uploader.new(options, progress_output: File.open(File::NULL, "w")) uploader = Pseudonymizer::Uploader.new(options, progress_output: File.open(File::NULL, "w"))
abort "The pseudonymizer object storage must be configured." unless uploader.available? unless uploader.available?
Rails.logger.error("The pseudonymizer object storage must be configured.")
return
end
begin begin
dumper.tables_to_csv dumper.tables_to_csv
......
...@@ -24,6 +24,7 @@ module Pseudonymizer ...@@ -24,6 +24,7 @@ module Pseudonymizer
@output_files = tables.map do |k, v| @output_files = tables.map do |k, v|
table_to_csv(k, v[:whitelist], v[:pseudo]) table_to_csv(k, v[:whitelist], v[:pseudo])
end.compact end.compact
schema_to_yml schema_to_yml
file_list_to_json file_list_to_json
......
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