debian-mirror-gitlab/lib/tasks/gitlab/uploads/sanitize.rake

23 lines
811 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2019-04-03 18:18:56 +05:30
namespace :gitlab do
namespace :uploads do
namespace :sanitize do
desc 'GitLab | Uploads | Remove EXIF from images.'
2019-09-04 21:01:54 +05:30
task :remove_exif, [:start_id, :stop_id, :dry_run, :sleep_time, :uploader, :since] => :environment do |task, args|
2019-04-03 18:18:56 +05:30
args.with_defaults(dry_run: 'true')
args.with_defaults(sleep_time: 0.3)
2021-09-04 01:27:46 +05:30
logger = Logger.new($stdout)
2019-04-03 18:18:56 +05:30
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',
2019-09-04 21:01:54 +05:30
sleep_time: args.sleep_time.to_f,
uploader: args.uploader,
since: args.since)
2019-04-03 18:18:56 +05:30
end
end
end
end