tc-aws


Nametc-aws JSON
Version 7.0.2 PyPI version JSON
download
home_page
SummaryThumbor AWS extensions
upload_time2022-12-07 16:28:43
maintainer
docs_urlNone
authorThumbor-Community & William King
requires_python
license
keywords thumbor aws
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Thumbor AWS

[![Join the chat at https://gitter.im/thumbor-community/aws](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/thumbor-community/aws?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Circle CI](https://circleci.com/gh/thumbor-community/aws.svg?style=svg)](https://circleci.com/gh/thumbor-community/aws)

## Installation

```bash
    pip install tc_aws
```

### Authentication

Authentication is handled by botocore, see [Boto3 documentation](https://boto3.readthedocs.org/en/latest/guide/quickstart.html#configuration).

## Origin story

This is a fork of [willtrking thumbor_aws](https://github.com/willtrking/thumbor_aws); as this repository was not maintained anymore,
we decided to maintain it under the [thumbor-community](https://github.com/thumbor-community) organization.

## Contribution

First you need to fork this project.
Clone your repo at your computer
Next, inside a folder for project:

```bash
    make setup
    make test
```

If all test passed, you have an environment ready to start.
We recommend to use python-virtualevn (virtualenv and virtualenv-wrapper)

## Features

 * *tc_aws.loaders.s3_loader* - takes a S3 key path and optional bucket name, and downloads the file through the S3 API.
 * *tc_aws.result_storages.s3_storage*
 * *tc_aws.storages.s3_storage*

### What is the purpose of the S3 loader?

You might ask yourself why the S3 loaders are necessary? Aren't files on S3 already available through HTTP already? Why wouldn't you just give the S3 url of your file to Thumbor and let it query the file through HTTP?

If your S3 assets are not public, you'll need to generate a signed URL. This url will be different everytime you sign it. Thumbor will be unable to understand that these urls all refer to the same file, and thus won be able to cache it.

The S3 loader avoids this problem, since you'll only be including the S3 key name in the Thumbor url. Thumbor itself will have the AWS authorization keys to fetch the file.

## Additional Configuration values used:

### General settings

```.ini
# AWS Region the bucket is located in.
TC_AWS_REGION='eu-west-1'
# A custom AWS endpoint.
TC_AWS_ENDPOINT=''
```

###  Loader settings

When using ``tc_aws.loaders.s3_loader``.

```.ini
TC_AWS_STORAGE_BUCKET='' # S3 bucket for Storage
TC_AWS_STORAGE_ROOT_PATH='' # S3 path prefix for Storage bucket

# S3 bucket for Loader. If given, source urls are interpreted as keys
# within this bucket. If not given, source urls are expected to contain
# the bucket name, such as 's3-bucket/keypath'.
TC_AWS_LOADER_BUCKET=''

# S3 path prefix for Loader bucket. If given, this is prefixed to
# all S3 keys.
TC_AWS_LOADER_ROOT_PATH=''

# Enable HTTP Loader as well?
# This would allow you to load watermarks in over your images dynamically through a URI
# E.g.
# http://your-thumbor.com/unsafe/filters:watermark(http://example.com/watermark.png,0,0,50)/s3_bucket/photo.jpg
TC_AWS_ENABLE_HTTP_LOADER=False

TC_AWS_ALLOWED_BUCKETS=False # List of allowed bucket to be requested
```

###  Storage settings

When ``tc_aws.storages.s3_storage`` is enabled.

```.ini
TC_AWS_STORAGE_BUCKET='' # S3 bucket for Storage
TC_AWS_STORAGE_ROOT_PATH='' # S3 path prefix for Storage bucket

# put data into S3 using the Server Side Encryption functionality to
# encrypt data at rest in S3
# https://aws.amazon.com/about-aws/whats-new/2011/10/04/amazon-s3-announces-server-side-encryption-support/
TC_AWS_STORAGE_SSE=False

# put data into S3 with Reduced Redundancy
# https://aws.amazon.com/about-aws/whats-new/2010/05/19/announcing-amazon-s3-reduced-redundancy-storage/
TC_AWS_STORAGE_RRS=False
```

###  Result storage settings

When ``tc_aws.result_storages.s3_storage`` is enabled.

```.ini
TC_AWS_RESULT_STORAGE_BUCKET='' # S3 bucket for result Storage
TC_AWS_RESULT_STORAGE_ROOT_PATH='' # S3 path prefix for Result storage bucket
TC_AWS_MAX_RETRY=0 # Max retries for get image from S3 Bucket. Default is 0

TC_AWS_STORE_METADATA=False # Store result with metadata (for instance content-type)
```

### Key settings

```.ini
TC_AWS_RANDOMIZE_KEYS=False # Adds some randomization in the S3 keys for the Storage and Result Storage. Defaults to False for Backwards Compatibility, set it to True for performance.
TC_AWS_ROOT_IMAGE_NAME='root_image' # Sets a default name for requested images ending with a trailing /. Those images will be stored in result_storage and storage under the name set in this configuration.
```

## Troubleshooting

### Check your configuration

You may have errors due to unproperly formatted configuration. For instance, if you've set the value "None" or "", this will default to the string value, and not the False or None value exepected, which can lead to issues later on. So if you're running into issues, try to re-read the configuration, taking care of the formatting.

### Make it work with riak

You'll need to tweak a bit your aws configuration (see boto doc), which should in the end look as follows:

```
[default]
aws_access_key_id = (KEY)
aws_secret_access_key =(SECRET)
s3 =
    signature_version = s3
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tc-aws",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "thumbor aws",
    "author": "Thumbor-Community & William King",
    "author_email": "h.briand@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/44/31/eb0fc62990d060ccab8300eb08c05f49a83b40eeed2efa80510a7e32f80e/tc_aws-7.0.2.tar.gz",
    "platform": null,
    "description": "# Thumbor AWS\n\n[![Join the chat at https://gitter.im/thumbor-community/aws](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/thumbor-community/aws?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n[![Circle CI](https://circleci.com/gh/thumbor-community/aws.svg?style=svg)](https://circleci.com/gh/thumbor-community/aws)\n\n## Installation\n\n```bash\n    pip install tc_aws\n```\n\n### Authentication\n\nAuthentication is handled by botocore, see [Boto3 documentation](https://boto3.readthedocs.org/en/latest/guide/quickstart.html#configuration).\n\n## Origin story\n\nThis is a fork of [willtrking thumbor_aws](https://github.com/willtrking/thumbor_aws); as this repository was not maintained anymore,\nwe decided to maintain it under the [thumbor-community](https://github.com/thumbor-community) organization.\n\n## Contribution\n\nFirst you need to fork this project.\nClone your repo at your computer\nNext, inside a folder for project:\n\n```bash\n    make setup\n    make test\n```\n\nIf all test passed, you have an environment ready to start.\nWe recommend to use python-virtualevn (virtualenv and virtualenv-wrapper)\n\n## Features\n\n * *tc_aws.loaders.s3_loader* - takes a S3 key path and optional bucket name, and downloads the file through the S3 API.\n * *tc_aws.result_storages.s3_storage*\n * *tc_aws.storages.s3_storage*\n\n### What is the purpose of the S3 loader?\n\nYou might ask yourself why the S3 loaders are necessary? Aren't files on S3 already available through HTTP already? Why wouldn't you just give the S3 url of your file to Thumbor and let it query the file through HTTP?\n\nIf your S3 assets are not public, you'll need to generate a signed URL. This url will be different everytime you sign it. Thumbor will be unable to understand that these urls all refer to the same file, and thus won be able to cache it.\n\nThe S3 loader avoids this problem, since you'll only be including the S3 key name in the Thumbor url. Thumbor itself will have the AWS authorization keys to fetch the file.\n\n## Additional Configuration values used:\n\n### General settings\n\n```.ini\n# AWS Region the bucket is located in.\nTC_AWS_REGION='eu-west-1'\n# A custom AWS endpoint.\nTC_AWS_ENDPOINT=''\n```\n\n###  Loader settings\n\nWhen using ``tc_aws.loaders.s3_loader``.\n\n```.ini\nTC_AWS_STORAGE_BUCKET='' # S3 bucket for Storage\nTC_AWS_STORAGE_ROOT_PATH='' # S3 path prefix for Storage bucket\n\n# S3 bucket for Loader. If given, source urls are interpreted as keys\n# within this bucket. If not given, source urls are expected to contain\n# the bucket name, such as 's3-bucket/keypath'.\nTC_AWS_LOADER_BUCKET=''\n\n# S3 path prefix for Loader bucket. If given, this is prefixed to\n# all S3 keys.\nTC_AWS_LOADER_ROOT_PATH=''\n\n# Enable HTTP Loader as well?\n# This would allow you to load watermarks in over your images dynamically through a URI\n# E.g.\n# http://your-thumbor.com/unsafe/filters:watermark(http://example.com/watermark.png,0,0,50)/s3_bucket/photo.jpg\nTC_AWS_ENABLE_HTTP_LOADER=False\n\nTC_AWS_ALLOWED_BUCKETS=False # List of allowed bucket to be requested\n```\n\n###  Storage settings\n\nWhen ``tc_aws.storages.s3_storage`` is enabled.\n\n```.ini\nTC_AWS_STORAGE_BUCKET='' # S3 bucket for Storage\nTC_AWS_STORAGE_ROOT_PATH='' # S3 path prefix for Storage bucket\n\n# put data into S3 using the Server Side Encryption functionality to\n# encrypt data at rest in S3\n# https://aws.amazon.com/about-aws/whats-new/2011/10/04/amazon-s3-announces-server-side-encryption-support/\nTC_AWS_STORAGE_SSE=False\n\n# put data into S3 with Reduced Redundancy\n# https://aws.amazon.com/about-aws/whats-new/2010/05/19/announcing-amazon-s3-reduced-redundancy-storage/\nTC_AWS_STORAGE_RRS=False\n```\n\n###  Result storage settings\n\nWhen ``tc_aws.result_storages.s3_storage`` is enabled.\n\n```.ini\nTC_AWS_RESULT_STORAGE_BUCKET='' # S3 bucket for result Storage\nTC_AWS_RESULT_STORAGE_ROOT_PATH='' # S3 path prefix for Result storage bucket\nTC_AWS_MAX_RETRY=0 # Max retries for get image from S3 Bucket. Default is 0\n\nTC_AWS_STORE_METADATA=False # Store result with metadata (for instance content-type)\n```\n\n### Key settings\n\n```.ini\nTC_AWS_RANDOMIZE_KEYS=False # Adds some randomization in the S3 keys for the Storage and Result Storage. Defaults to False for Backwards Compatibility, set it to True for performance.\nTC_AWS_ROOT_IMAGE_NAME='root_image' # Sets a default name for requested images ending with a trailing /. Those images will be stored in result_storage and storage under the name set in this configuration.\n```\n\n## Troubleshooting\n\n### Check your configuration\n\nYou may have errors due to unproperly formatted configuration. For instance, if you've set the value \"None\" or \"\", this will default to the string value, and not the False or None value exepected, which can lead to issues later on. So if you're running into issues, try to re-read the configuration, taking care of the formatting.\n\n### Make it work with riak\n\nYou'll need to tweak a bit your aws configuration (see boto doc), which should in the end look as follows:\n\n```\n[default]\naws_access_key_id = (KEY)\naws_secret_access_key =(SECRET)\ns3 =\n    signature_version = s3\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Thumbor AWS extensions",
    "version": "7.0.2",
    "split_keywords": [
        "thumbor",
        "aws"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "f43313723ea33006a4e30f9d57f4e7df",
                "sha256": "73faf24c9577b682877ea710e6181a12c1890f143312c9c0bb3f6c6c4201bd33"
            },
            "downloads": -1,
            "filename": "tc_aws-7.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "f43313723ea33006a4e30f9d57f4e7df",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16464,
            "upload_time": "2022-12-07T16:28:43",
            "upload_time_iso_8601": "2022-12-07T16:28:43.179667Z",
            "url": "https://files.pythonhosted.org/packages/44/31/eb0fc62990d060ccab8300eb08c05f49a83b40eeed2efa80510a7e32f80e/tc_aws-7.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-07 16:28:43",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "tc-aws"
}
        
Elapsed time: 0.04365s