diff --git a/README.md b/README.md index 1815d86..cef0264 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,14 @@ -#### S3Storage +# S3Store -S3Storage is a storage module to make use of amazon's s3 object storage as a storage interface for CertMagic. S3Storage -is an implementation of the Storage interface which can be used to back services behind a load balancer without -needing to expose the servers themselves to the internet. It is expected that users needing this storage will -have the requisite knowledge to understand when it is necessary to use this Storage Type in lieu of the default -Filestorage type. Because this storage type is typically used behind a load balancer. it is most commonly used in -conjunction with the __DNS-01__ lego challenge. +S3Store is a storage module that uses Amazon's S3 object storage as a [storage interface](https://github.com/caddyserver/certmagic/wiki/Storage-Implementations) for [CertMagic](https://github.com/caddyserver/certmagic). -The `magicstorage.NewS3Storage(bucket, region string)` function requires the name of the s3 bucket to be used as well as -the region for the s3 bucket. __NOTE:__ Even though s3 buckets are "global", this is still a region associated with buckets. -do not pass an empty string +## Usage -The `NewS3Storage()` function will automatically use credentials from ENV vars, `~/.aws/credentials` files and any assumed roles. +The `NewS3Storage(bucket, region string)` function will automatically use credentials from ENV vars, `~/.aws/credentials` files and any assumed roles. It should not be necessary to provide any explicit credentials. -Used with the certmagic HTTPS command and a dns provider: -``` -dnsProvider, err := route53.NewDNSProvider() -if err != nil { - return err -} +Otherwise, if you want to provide explicit credentials, you can do so with `NewS3StorageWithCredentials(accessKey, secretKey, bucket, region string)`. -certmagic.DNSProvider = dnsProvider -certmagic.DefaultStorage = magicstorage.NewS3Storage("my-example-s3-bucket", "example-aws-region") +## License -//Then use as normal - -certmagic.HTTPS([]string{"example.com"}, handler) -``` \ No newline at end of file +This library is distributed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](https://github.com/aymanbagabas/s3store/blob/master/LICENSE) for more information. \ No newline at end of file