mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not show backups stored in subfolder of bucket
This commit is contained in:
@@ -59,7 +59,7 @@ module BackupRestore
|
||||
objects = []
|
||||
|
||||
@s3_helper.list.each do |obj|
|
||||
if obj.key.match?(/\.t?gz$/i)
|
||||
if obj.key.match?(file_regex)
|
||||
objects << create_file_from_object(obj)
|
||||
end
|
||||
end
|
||||
@@ -106,6 +106,19 @@ module BackupRestore
|
||||
end
|
||||
end
|
||||
|
||||
def file_regex
|
||||
@file_regex ||= begin
|
||||
path = @s3_helper.s3_bucket_folder_path || ""
|
||||
|
||||
if path.present?
|
||||
path = "#{path}/" unless path.end_with?("/")
|
||||
path = Regexp.quote(path)
|
||||
end
|
||||
|
||||
/^#{path}[^\/]*\.t?gz$/i
|
||||
end
|
||||
end
|
||||
|
||||
def free_bytes
|
||||
nil
|
||||
end
|
||||
|
Reference in New Issue
Block a user