Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set meta tags (ContentEncoding, ContentType), priority #161

Open
davidecampello opened this issue May 20, 2020 · 6 comments
Open

Set meta tags (ContentEncoding, ContentType), priority #161

davidecampello opened this issue May 20, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@davidecampello
Copy link

Hi guys, first of all thanks for this interesting plugin.

At our company we use s3 to host our apps so now that we are moving to angular 9 for our new applications (before we were still using angularjs) we are looking for a way to easily deploy the code.
For our production deploys we usually set the cache-control meta, the content encoding, other meta and also we need to set the upload priority.
Is it possible to set this parameters with ngx-aws-deploy?
Eventually I can try to fork...

In the old applications we use https://github.com/MikaAK/s3-plugin-webpack

Thanks
Davide

@Jefiozie
Copy link
Owner

Hey @davidecampello, thanks for your issue.
If the AWS SDK is supporting this we could make this available in the deploy package. As far as I can tell it is possible to do it with the help of the SDK, could you verify this for me and tell me which of these parameters you are looking for? As I think this will be good enhancement would you be willing to make a PR for this? Happy to help you with it.

@Jefiozie Jefiozie added enhancement New feature or request help wanted Extra attention is needed labels May 20, 2020
@davidecampello
Copy link
Author

Hi @Jefiozie, thanks for your answer.
I'm trying to add the functionalities.
The parameters I need to set are ContentType, ContentEncoding, CacheControl. All are string and the property is available in the PutObjectRequest interface.

The problem is that that properties need to be set file by file. In the old plugin (a webpack plugin) we had a callback that pass the filename as parameter so we can run some logic based on extension or file name, but I don't know how I can do this with schematics.
Do you have any idea on how to do this? I'll try to experiment something.

We also need a way to exclude some files and to upload some file before others and this can be done with regexp.

@Jefiozie
Copy link
Owner

Hi @davidecampello , thanks for your quick response. For the content type is this always like the mime type of the file or is this in some cases different? Excluding files is not any problem. About the rest I need to think a bit about how we could implement this in a correct way.

I will try and come back to you within a couple of days.

@davidecampello
Copy link
Author

Thanks to you. In the past we had a edge case where we need to set a different ContentType (we had files without extension).

I'm also experimenting so I'll let you know.

@Jefiozie Jefiozie pinned this issue May 28, 2020
@davidecampello
Copy link
Author

Hi, after a lot of experiments I ended up making something that is not perfect and beautiful but fit to our needs.
I created a new configuration property in the schema.json that take a file path as input. This file expose a class for each environment I have (sandbox, production...) and each class implement all the property and the methods I need. Than the index.ts require the file and can access the files.
I also add a way to compress the files and a way to use external files (.env) to store the AWS access keys and secret because we don't save them on repository.
I know It's not the best elegant solution but It's working.
If you are interested I can make a code clean and a pull request.
Thanks

@maxletourneur
Copy link
Contributor

maxletourneur commented Apr 18, 2022

Hey @davidecampello @Jefiozie, I implemented the ability to set params on uploaded files CacheControl, ACL, etc
Check it out: #410

@Jefiozie Jefiozie self-assigned this Apr 18, 2022
@Jefiozie Jefiozie unpinned this issue Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants