Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-01-30 10:32:45 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2019-03-25 16:53:33 +0300
commit2c5b492f317d536fe8d0188131dd235466d2bf57 (patch)
tree8aaf5864de278634c82d28f1dbec53ee52fc1c69 /lib/tasks
parentb1268e93775a992c990a8d378491b19c59463545 (diff)
Rake task for removing exif from uploads
Adds a rake task which can be used for removing EXIF data from existing uploads.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/uploads/sanitize.rake18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/uploads/sanitize.rake b/lib/tasks/gitlab/uploads/sanitize.rake
new file mode 100644
index 00000000000..12cf5302555
--- /dev/null
+++ b/lib/tasks/gitlab/uploads/sanitize.rake
@@ -0,0 +1,18 @@
+namespace :gitlab do
+ namespace :uploads do
+ namespace :sanitize do
+ desc 'GitLab | Uploads | Remove EXIF from images.'
+ task :remove_exif, [:start_id, :stop_id, :dry_run, :sleep_time] => :environment do |task, args|
+ args.with_defaults(dry_run: 'true')
+ args.with_defaults(sleep_time: 0.3)
+
+ logger = Logger.new(STDOUT)
+
+ sanitizer = Gitlab::Sanitizers::Exif.new(logger: logger)
+ sanitizer.batch_clean(start_id: args.start_id, stop_id: args.stop_id,
+ dry_run: args.dry_run != 'false',
+ sleep_time: args.sleep_time.to_f)
+ end
+ end
+ end
+end