I'm using an S3 bucket to store static assets through the strapi-provider-upload-aws-s3 plugin. Also, I have a custom domain pointing to that bucket via SSL. Basically, https://my.domain.com/photo.jpg points to https://s3.amazonaws.com/my.domain.com/photo.jpg. Is there any way to let the plugin know this so it automatically changes the URLs from s3.amazonaws.com/my.domain.com to just my.domain.com before updating the field containing such a URL?
If this isn't possible via a straightforward configuration or the dashboard, is there any way to tweak the code itself to incorporate this functionality? And if so (am strongly hoping there is), what file holds this logic should one were to go this route?
I think in your case the best way is to update the plugin upload itself (./plugins/upload). There is currently no customisation for your need.
To do so you will have to update the findAll
function and replace the host manually in the map
before sending the data.
Here is the code I speak about: https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-upload/controllers/Upload.js#L122
You will have to replace the url to match with your need.