AssetSync / asset_sync

Synchronises Assets between Rails and S3
1.89k stars 346 forks source link

Option to disable fog’s signature v4 streaming #430

Closed sunny closed 1 year ago

sunny commented 1 year ago

In Fog we can disable AWS’s enable_signature_v4_streaming: false. This helps when using S3-compatible hosting providers that don’t implement streaming. Without this option an error is raised saying "STREAMING-AWS4-HMAC-SHA256-PAYLOAD" is not implemented.

One workaround is doing the following:

module DisableFogSignatureV4Streaming
  def fog_options
    super.merge(enable_signature_v4_streaming: false)
  end
end

AssetSync.configure do |config|
  config.extend(DisableFogSignatureV4Streaming)

  # …
end

To make this more robust, we could add a new option to asset_sync. Either:

What do you think? I’d be happy to provide a pull-request if any of these solutions seem good.

PikachuEXE commented 1 year ago

I guess the current style would be introducing another option

https://github.com/AssetSync/asset_sync/blob/d261cd4f8e0076729f3c457cc2970ebde5e5a985/lib/asset_sync/config.rb#L286-L303

But if you want to implement a way to add more flexible fog options that's welcome too I have no preference :)