s3cache: expose add'l config options as URL params

this should allow using at least some s3-compatible services like minio.

Fixes #120, #147
This commit is contained in:
Will Norris 2019-01-12 06:37:00 +00:00
parent a903995ee7
commit e860748032
2 changed files with 31 additions and 1 deletions

View file

@ -108,12 +108,28 @@ enabled using the `-cache` flag. It supports the following values:
cache items no longer than 4 hours.
- directory on local disk (e.g. `/tmp/imageproxy`) - will cache images
on disk
- s3 URL (e.g. `s3://region/bucket-name/optional-path-prefix`) - will cache
images on Amazon S3. This requires either an IAM role and instance profile
with access to your your bucket or `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY`
environmental variables be set. (Additional methods of loading credentials
are documented in the [aws-sdk-go session
package](https://docs.aws.amazon.com/sdk-for-go/api/aws/session/)).
Additional configuration options ([further documented here][aws-options])
may be specified as URL query string parameters, which are mostly useful
when working with s3-compatible services:
- "endpoint" - specify an alternate API endpoint
- "disableSSL" - set to "1" to disable SSL when calling the API
- "s3ForcePathStyle" - set to "1" to force the request to use path-style addressing
For example, when working with [minio](https://minio.io), which doesn't use
regions, provide a dummy region value and custom endpoint value:
s3://fake-region/bucket/folder?endpoint=minio:9000&disableSSL=1&s3ForcePathStyle=1
[aws-options]: https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
- gcs URL (e.g. `gcs://bucket-name/optional-path-prefix`) - will cache images
on Google Cloud Storage. Authentication is documented in Google's
[Application Default Credentials