GitbookIO / nuts

:chestnut: Releases/downloads server with auto-updater and GitHub as a backend
http://nuts.gitbook.com
Apache License 2.0
1.25k stars 299 forks source link

(feature) Add Amazon S3 backend #105

Open mariotacke opened 7 years ago

mariotacke commented 7 years ago

This PR adds Amazon S3 backend support to Nuts. Assets are proxied through Nuts and do not need to be public. Access to the assets is facilitated through Amazon access key and secret key which can be set through environment variables. This is a rudimentary implementation and serves as a base.

Added Environment Variables

solgarius commented 7 years ago

Although I'm not a maintainer, I wonder if the configuration for backends should be contained per backend. So for example, rather than opts.credentials.aws.* and opts.configuration.aws.* perhaps it should be opts.backends.aws.* ?

Also to avoid clashes with other software on a system, perhaps the env items should all start with NUTS with a failover to a non-NUTS prefix. So for example instead of accessKeyId: process.env.AWS_ACCESS_KEY_ID it becomes: accessKeyId: process.env.NUTS_AWS_ACCESS_KEY_ID || process.env.AWS_ACCESS_KEY_ID

That way users can have the aws access key defined once for all their apps if they want or if they have different permissions for different apps there is a NUTS specific aws access key that can be used?

mariotacke commented 7 years ago

I agree, the configuration should be compartmentalized per back-end. I implemented it this way to have less friction with the current structure. Overall, I agree with you however. I used the generic AWS env keys, because it worked for my use-case (I'm setting the same ENV for AWS for multiple processes). You could even specify an ENV key to use, or otherwise fall back to the default as it is.

loprima-l commented 1 year ago

Hi, I merged the project to a new repo to start maintain it, I would be glad if you can put your pull request here : https://github.com/loprima-l/nuts-2