Open mzch opened 5 years ago
Hi @mzch thanks for posting this and contacting us on support.helpy.io. Do you know of any easy way to stand up a test instance of Minio?
OK, please access to my Minio.
Endpoint: https://objstr.com Region: us-east-1 Bucket: helpy AccessKey: JIO6XRM9J29K6RBYP1MX SecretKey: hdrHJxMTeJHMJmISOGs8D9M4NvDqrWNZrzresdV9
These keys will keep in this week.
I modified config/initializers/fog-aws.rb as below:
CarrierWave.configure do |config|
config.fog_provider = 'fog/aws'
if Rails.env == 'test'
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: 'secretkeyid',
aws_secret_access_key: 'secretaccesskey',
region: 'abc',
endpoint: 'ayz'
}
config.fog_directory = 'testbucket'
else
if ENV['REMOTE_STORAGE'] == "true"
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: ENV['S3_KEY'],
aws_secret_access_key: ENV['S3_SECRET'],
aws_signature_version: ENV['S3_SIG_VER'],
region: ENV['S3_REGION'],
# host: 's3.amazon.com',
endpoint: ENV['S3_ENDPOINT'],
path_style: ENV['S3_PATH_STYLE'],
}
config.fog_directory = ENV['S3_BUCKET_NAME']
config.fog_public = true
config.fog_attributes = { cache_control: "public, max-age=#{365.day.to_i}" }
end
end
end
besites, set S3_PATH_STYLE=true and S3_SIG_VER=2, then Helpy works correctly, but when setting aws_signature_version to 4, it fails.
When signature 4, error appears in production.log
F, [2019-05-05T07:39:48.339420 #4835] FATAL -- :
Excon::Error::Forbidden (Expected(200) <=> Actual(403 Forbidden)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoe
sNotMatch</Code><Message>The request signature we calculated does not match the signature
you provided. Check your key and signing method.</Message><Key>uploads/user/profile_image/
1/Face_of_Myself.jpg</Key><BucketName>helpy</BucketName><Resource>/helpy/uploads/user/prof
ile_image/1/Face_of_Myself.jpg</Resource><RequestId>159BD05BA9F76667</RequestId><HostId>71
e60e4f-556c-4858-bdc6-6cda5d5801fb</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Content-Security-Policy" => "block-all-mixed-content"
"Content-Type" => "application/xml"
"Date" => "Sun, 05 May 2019 14:39:48 GMT"
"Server" => "MinIO/RELEASE.2019-05-02T19-07-09Z"
"Strict-Transport-Security" => "max-age=15552000; includeSubdomains;"
"Vary" => "Origin"
"X-Amz-Request-Id" => "159BD05BA9F76667"
"X-Content-Type-Options" => "nosniff"
"X-Frame-Options" => "SAMEORIGIN"
"X-Minio-Deployment-Id" => "71e60e4f-556c-4858-bdc6-6cda5d5801fb"
"X-Xss-Protection" => "1; mode=block"
}
:host => "objstr.com"
:local_address => "148.163.121.238"
:local_port => 46094
:path => "/helpy/uploads/user/profile_image/1/Face_of_Myself.jpg"
:port => 443
:reason_phrase => "Forbidden"
:remote_ip => "192.3.176.179"
:status => 403
:status_line => "HTTP/1.1 403 Forbidden\r\n"
):
app/controllers/admin/users_controller.rb:95:in `update'
app/controllers/application_controller.rb:195:in `set_time_zone'
somehow, signature 4 issue is resolved....But Logo.png and favicon.ico are not loaded from the remote storage, able to be loaded from local. Please fix it.
Hey @mzch I am happy to hear you were able to figure out these extra configurations! I will take a look at these settings items to make sure they are set to override to the remote store.
I tried to setting up Helpy to upload files to Minio, but failed.
Helpy reported, "Oops there has been an error... We log all errors and an engineers pager is going off somewhere!"
log/production.log