Skip to main content

A thumbor server extension for DASH

Project description

thumbor_dash

A thumbor server extension for DASH

Setup

Requirements

  • Python >= 3.9
  • Pip >= 21.1
  • Thumbor == 7.0.0a5

See the requirements for setting up thumbor in the documentation

1. Install thumbor_dash

pip install thumbor_dash

Note: thumbor_dash, thumbor, and other required dependencies will be installed

2. Create a thumbor configuration file

thumbor-config > thumbor.conf

3. Add these lines to thumbor.conf file

# Set allowed dimensions
MIN_WIDTH = 1
MIN_HEIGHT = 1
MAX_WIDTH = 1200
MAX_HEIGHT = 800

# Set security key
SECURITY_KEY = "0"

# Use only signed URL
ALLOW_UNSAFE_URL = False

# Set user moderation rules
REQUEST_TIME_LIMIT = 1 # time between requests in minutes
USAGE_VIOLATION_LIMIT = 5 # total number of times a requester can violate the time limit before ban
BAN_DURATION = 10 # requester ban duration in minutes

Usage

1. Start thumbor_dash server

thumbor_dash --conf=thumbor.conf

2. Sign image URL

thumbor_dash-url --key="<SECURITY_KEY>" --width=<width> --height=<height> --dashauth="requester(<requesterId>):contract(<contractId>):document(<documentType>):field(<avatarUrl>):owner(<ownerId>):updatedAt(<updatedAt>)" --filters="<filters>" <imageURL>

output:

/<signature>/<width>x<height>/dashauth:requester(<requesterId>):contract(<contractId>):document(<documentType>):field(<field>):owner(<ownerId>):updatedAt(<updatedAt>)/filters:format(<format>)/<encodedImageUrl>

3. Thumbor_dash image retrieval URL

http://<thumbor_dash-server>/<signature>/<width>x<height>/dashauth:requester(<requesterId>):contract(<contractId>):document(<documentType>):field(<field>):owner(<ownerId>):updatedAt(<updatedAt>)/filters:format(<format>)/<encodedImageUrl>

Note: If running the server locally, <thumbor_dash-server> should be localhost:8888

Example

This is a signed thumbor_dash url. Simply run thumbor_dash and paste this link in your browser.

http://localhost:8888/Ai-ZyWWtJ0MHUQAm0GAlBTQMZ_Y=/1200x800/dashauth:requester(GCAFKUdw7PtUcDEG8j3sicMJ4ngx1aTqCdb4HD5n5WZ7):contract(En3GRoMNAnt69firp32h3NEBxyveLcHQMUbwhDW2UqoX):document(thumbnailField):field(avatarUrl):owner(GCAFKUdw7PtUcDEG8j3sicMJ4ngx1aTqCdb4HD5n5WZ7):updatedAt(1627076771396)/filters:format(jpeg)/https%3A//github.com/thumbor/thumbor/raw/master/example.jpg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thumbor_dash-0.0.5.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

thumbor_dash-0.0.5-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file thumbor_dash-0.0.5.tar.gz.

File metadata

  • Download URL: thumbor_dash-0.0.5.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for thumbor_dash-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d6b27063ed7ae457f2b24a7710e5c3de2f959a2688c60e427d40846380aa6e26
MD5 4d5b59a96ea18db3a11d1ece3c37ac7c
BLAKE2b-256 30e6ed50a9bf02ada833e36610ea21fb7bead0d644d3ef194f8e7f515c576d84

See more details on using hashes here.

File details

Details for the file thumbor_dash-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: thumbor_dash-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for thumbor_dash-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7931f9e3ca633ef40e4760c517299bcb12cf529a0749513e0d49e7b764195817
MD5 c94a9565f16481a3fe789f2df44267bd
BLAKE2b-256 fbcd9b0b2cbfbf698de7b0524ff40df167316411b39a767d6f42d9567a344d3c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page