gl-store-s3.js/README.md

65 lines
2.5 KiB
Markdown
Raw Normal View History

2019-05-08 13:06:36 +00:00
[![CircleCI](https://circleci.com/gh/cderche/greenlock-storage-s3.svg?style=svg)](https://circleci.com/gh/cderche/greenlock-storage-s3)
2019-05-08 17:23:31 +00:00
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5698848a7ffc4781a46f7094513cb1d5)](https://www.codacy.com/app/c.derche/greenlock-storage-s3?utm_source=github.com&utm_medium=referral&utm_content=cderche/greenlock-storage-s3&utm_campaign=Badge_Grade)
2019-05-08 15:28:43 +00:00
[![Known Vulnerabilities](https://snyk.io/test/github/cderche/greenlock-storage-s3/badge.svg)](https://snyk.io/test/github/cderche/greenlock-storage-s3)
2019-05-08 15:26:33 +00:00
[![BCH compliance](https://bettercodehub.com/edge/badge/cderche/greenlock-storage-s3?branch=master)](https://bettercodehub.com/)
2019-05-08 17:22:55 +00:00
!["Lifetime Downloads"](https://img.shields.io/npm/dt/greenlock-storage-s3.svg "Lifetime Download Count can't be shown")
!["Monthly Downloads"](https://img.shields.io/npm/dm/greenlock-storage-s3.svg "Monthly Download Count can't be shown")
!["Weekly Downloads"](https://img.shields.io/npm/dw/greenlock-storage-s3.svg "Weekly Download Count can't be shown")
2019-05-08 13:06:36 +00:00
2019-05-08 09:38:04 +00:00
# greenlock-storage-s3
2019-05-08 09:42:14 +00:00
S3 backed storage strategy for greenlock-express.js (and greenlock.js)
## Requirements
2019-05-08 14:25:23 +00:00
You will need a s3 bucket and the corresponding credentials.
2019-05-08 14:20:09 +00:00
## Integration
### greenlock-express.js
```javascript
2019-05-08 14:25:23 +00:00
let store = require('greenlock-storage-s3').create({
2019-05-08 14:51:26 +00:00
accessKeyId: accessKeyId // Replace with your accessKeyId
, secretAccessKey: secretAccessKey // Replace with your secretAccessKey
, regionName: regionName // Replace with your regionName
, bucketName: bucketName // Replace with your bucketName
2019-05-08 14:20:09 +00:00
, configDir: 'acme/' // Recommended
, accountsDir: 'accounts/' // Recommended
, debug: true // Debug
});
var Greenlock = require("greenlock-express");
var greenlock = Greenlock.create({
// Other options
, store: store
});
// Continue your greenlock setup
```
2019-05-08 14:49:17 +00:00
## Testing
2019-05-08 17:29:53 +00:00
The strategy is tested against the [greenlock-store-test](https://git.coolaj86.com/coolaj86/greenlock-store-test.js)
2019-05-08 14:49:17 +00:00
To run the tests yourself, create a `.env` file with the following
```
// .env file
2019-05-08 14:51:26 +00:00
AWS_ACCESS_KEY_ID=abc // Replace with your accessKeyId
AWS_SECRET_ACCESS_KEY=abc // Replace with your secretAccessKey
AWS_BUCKET_REGION=abc // Replace with your regionName
AWS_BUCKET_NAME=abc // Replace with your bucketName
2019-05-08 14:49:17 +00:00
```
2019-05-08 14:51:26 +00:00
Run the following command:
```console
$ npm run clean && npm run test && npm run clean
```
2019-05-08 14:49:17 +00:00
## License
2019-05-08 13:06:36 +00:00
ISC