Revert "FEATURE: Support backup uploads/downloads directly to/from S3."

This reverts commit c29a4dddc1.

We're doing a beta bump soon so un-revert this after that is done.
This commit is contained in:
Guo Xiang Tan
2018-10-11 11:08:12 +08:00
parent c92bda95e1
commit 3c59106bac
52 changed files with 419 additions and 1078 deletions

View File

@@ -51,7 +51,7 @@ class S3Helper
# make sure we have a cors config for assets
# otherwise we will have no fonts
def ensure_cors!(rules = nil)
def ensure_cors!
rule = nil
begin
@@ -63,17 +63,17 @@ class S3Helper
end
unless rule
rules = [{
allowed_headers: ["Authorization"],
allowed_methods: ["GET", "HEAD"],
allowed_origins: ["*"],
max_age_seconds: 3000
}] if rules.nil?
puts "installing CORS rule"
s3_resource.client.put_bucket_cors(
bucket: @s3_bucket_name,
cors_configuration: {
cors_rules: rules
cors_rules: [{
allowed_headers: ["Authorization"],
allowed_methods: ["GET", "HEAD"],
allowed_origins: ["*"],
max_age_seconds: 3000
}]
}
)
end
@@ -137,7 +137,10 @@ class S3Helper
end
def list(prefix = "")
prefix = get_path_for_s3_upload(prefix)
if @s3_bucket_folder_path.present?
prefix = File.join(@s3_bucket_folder_path, prefix)
end
s3_bucket.objects(prefix: prefix)
end
@@ -156,11 +159,6 @@ class S3Helper
)
end
def object(path)
path = get_path_for_s3_upload(path)
s3_bucket.object(path)
end
def self.s3_options(obj)
opts = { region: obj.s3_region,
endpoint: SiteSetting.s3_endpoint,