diff --git a/docker/config/thumbor/thumbor.conf.tpl b/docker/config/thumbor/thumbor.conf.tpl index a3d58fc..7078e18 100644 --- a/docker/config/thumbor/thumbor.conf.tpl +++ b/docker/config/thumbor/thumbor.conf.tpl @@ -2,15 +2,22 @@ ## Logging configuration as json ## Defaults to: None -THUMBOR_LOG_CONFIG = {{ THUMBOR_LOG_CONFIG | default(None) }} +{% if THUMBOR_LOG_CONFIG is defined %} +THUMBOR_LOG_CONFIG = '{{ THUMBOR_LOG_CONFIG }}' +{% endif %} ## Log Format to be used by thumbor when writing log messages. ## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s -THUMBOR_LOG_FORMAT = '{{ THUMBOR_LOG_FORMAT | default('%(asctime)s %(name)s:%(levelname)s %(message)s') }}' +{% if THUMBOR_LOG_FORMAT is defined %} +THUMBOR_LOG_FORMAT = '{{ THUMBOR_LOG_FORMAT }}' +{% endif %} + ## Date Format to be used by thumbor when writing log messages. ## Defaults to: %Y-%m-%d %H:%M:%S -THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT | default('%Y-%m-%d %H:%M:%S') }}' +{% if THUMBOR_LOG_DATE_FORMAT is defined %} +THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT }}' +{% endif %} ################################################################################ @@ -19,37 +26,52 @@ THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT | default('%Y-%m-%d %H:%M: ## Max width in pixels for images read or generated by thumbor ## Defaults to: 0 -MAX_WIDTH = {{ MAX_WIDTH | default(0) }} +{% if MAX_WIDTH is defined %} +MAX_WIDTH = {{ MAX_WIDTH }} +{% endif %} ## Max height in pixels for images read or generated by thumbor ## Defaults to: 0 -MAX_HEIGHT = {{ MAX_HEIGHT | default(0) }} +{% if MAX_HEIGHT is defined %} +MAX_HEIGHT = {{ MAX_HEIGHT }} +{% endif %} ## Max pixel count for images read by thumbor. Set to prevent decompression bomb DOS attack. -## Defaults to: 75000000 pixels -MAX_PIXELS = {{ MAX_PIXELS | default(75000000) }} +## Defaults to: 75000000.0 +{% if MAX_PIXELS is defined %} +MAX_PIXELS = {{ MAX_PIXELS }} +{% endif %} ## Min width in pixels for images read or generated by thumbor ## Defaults to: 1 -MIN_WIDTH = {{ MIN_WIDTH | default(1) }} +{% if MIN_WIDTH is defined %} +MIN_WIDTH = {{ MIN_WIDTH }} +{% endif %} ## Min width in pixels for images read or generated by thumbor ## Defaults to: 1 -MIN_HEIGHT = {{ MIN_HEIGHT | default(1) }} +{% if MIN_HEIGHT is defined %} +MIN_HEIGHT = {{ MIN_HEIGHT }} +{% endif %} ## Allowed domains for the http loader to download. These are regular ## expressions. ## Defaults to: [] -ALLOWED_SOURCES = {{ ALLOWED_SOURCES | default([]) }} - +{% if ALLOWED_SOURCES is defined %} +ALLOWED_SOURCES = {{ ALLOWED_SOURCES }} +{% endif %} ## Quality index used for generated JPEG images ## Defaults to: 80 -QUALITY = {{ QUALITY | default(80) }} +{% if QUALITY is defined %} +QUALITY = {{ QUALITY }} +{% endif %} -## Exports JPEG images with the progressive flag set. +## Exports JPEG images with the `progressive` flag set. ## Defaults to: True -PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} +{% if PROGRESSIVE_JPEG is defined %} +PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG }} +{% endif %} ## Specify subsampling behavior for Pillow (see `subsampling` in ## http://pillow.readthedocs.org/en/latest/handbook/image-file- @@ -57,38 +79,128 @@ PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} ## notation. Will ignore `quality`. Using `keep` will copy the original file's ## subsampling. ## Defaults to: None -PILLOW_JPEG_SUBSAMPLING = {{ PILLOW_JPEG_SUBSAMPLING | default(None) }} +{% if PILLOW_JPEG_SUBSAMPLING is defined %} +PILLOW_JPEG_SUBSAMPLING = '{{ PILLOW_JPEG_SUBSAMPLING }}' +{% endif %} + ## Specify quantization tables for Pillow (see `qtables` in ## http://pillow.readthedocs.org/en/latest/handbook/image-file- ## formats.html#jpeg). Will ignore `quality`. Using `keep` will copy the ## original file's qtables. ## Defaults to: None -PILLOW_JPEG_QTABLES = {{ PILLOW_JPEG_QTABLES | default(None) }} +{% if PILLOW_JPEG_QTABLES is defined %} +PILLOW_JPEG_QTABLES = '{{ PILLOW_JPEG_QTABLES }}' +{% endif %} + -## Specify resampling filter for Pillow resize method.One of LANCZOS, NEAREST, +## Specify resampling filter for Pillow resize method. One of LANCZOS, NEAREST, ## BILINEAR, BICUBIC, HAMMING (Pillow>=3.4.0). ## Defaults to: 'LANCZOS' -PILLOW_RESAMPLING_FILTER = '{{ PILLOW_RESAMPLING_FILTER | default('LANCZOS') }}' +{% if PILLOW_RESAMPLING_FILTER is defined %} +PILLOW_RESAMPLING_FILTER = '{{ PILLOW_RESAMPLING_FILTER }}' +{% endif %} ## Quality index used for generated WebP images. If not set (None) the same level ## of JPEG quality will be used. If 100 the `lossless` flag will be used. ## Defaults to: None -WEBP_QUALITY = {{ WEBP_QUALITY | default(None) }} +{% if WEBP_QUALITY is defined %} +WEBP_QUALITY = {{ WEBP_QUALITY }} +{% endif %} + +## Quality index used for generated AVIF images. If not set (None) the same level +## of JPEG quality will be used. Controls the max quantizer setting, with +## quality=0 corresponding to max quantizer 63, and quality=100 to max +## quantizer=0 +## Defaults to: None +{% if AVIF_QUALITY is defined %} +AVIF_QUALITY = {{ AVIF_QUALITY }} +{% endif %} + +## Quality/speed trade-off (0=slower-better, 10=fastest). +## Defaults to: None +{% if AVIF_SPEED is defined %} +AVIF_SPEED = {{ AVIF_SPEED }} +{% endif %} + +## Codec to use for encoding AVIF images. Can be `auto`, `aom`, `rav1e`, or +## `svt`, depending on what is compiled into libavif. +## Defaults to: 'auto' +{% if AVIF_CODEC is defined %} +AVIF_CODEC = '{{ AVIF_CODEC }}' +{% endif %} + +## Codec to use for encoding AVIF images if `AVIF_CODEC` cannot be used. For +## instance, if AVIF_CODEC is `svt` but an image is too small or too large to +## be encoded with that codec, the image will be encoded using the codec from +## this setting instead. +## Defaults to: 'auto' +{% if AVIF_CODEC_FALLBACK is defined %} +AVIF_CODEC_FALLBACK = '{{ AVIF_CODEC_FALLBACK }}' +{% endif %} + +## Quality index used for generated HEIF images. If not set (None) the same level +## of JPEG quality will be used. +## Defaults to: None +{% if HEIF_QUALITY is defined %} +HEIF_QUALITY = {{ HEIF_QUALITY }} +{% endif %} + +## Path to the file containing the sRGB ICC profile to use when images need to be +## converted from other color spaces. If None, uses the default SRGB profile +## from Pillow ImageCMS. +## Defaults to: None +{% if SRGB_PROFILE is defined %} +SRGB_PROFILE = {{ SRGB_PROFILE }} +{% endif %} ## Compression level for generated PNG images. ## Defaults to: 6 -PNG_COMPRESSION_LEVEL = {{ PNG_COMPRESSION_LEVEL | default(6) }} +{% if PNG_COMPRESSION_LEVEL is defined %} +PNG_COMPRESSION_LEVEL = {{ PNG_COMPRESSION_LEVEL }} +{% endif %} ## Indicates if final image should preserve indexed mode (P or 1) of original ## image ## Defaults to: True -PILLOW_PRESERVE_INDEXED_MODE = {{ PILLOW_PRESERVE_INDEXED_MODE | default(True) }} +{% if PILLOW_PRESERVE_INDEXED_MODE is defined %} +PILLOW_PRESERVE_INDEXED_MODE = {{ PILLOW_PRESERVE_INDEXED_MODE }} +{% endif %} ## Specifies whether WebP format should be used automatically if the request ## accepts it (via Accept header) ## Defaults to: False -AUTO_WEBP = {{ AUTO_WEBP | default(False) }} +{% if AUTO_WEBP is defined %} +AUTO_WEBP = {{ AUTO_WEBP }} +{% endif %} + +## Specifies whether Avif format should be used automatically if the request +## accepts it (via Accept header) and pillow-avif-plugin is enabled +## Defaults to: False +{% if AUTO_AVIF is defined %} +AUTO_AVIF = {{ AUTO_AVIF }} +{% endif %} + +## Specifies whether JPG format should be used automatically if the request +## accepts it (via Accept header) +## Defaults to: False +{% if AUTO_JPG is defined %} +AUTO_JPG = {{ AUTO_JPG }} +{% endif %} + +## Specifies whether Heif format should be used automatically if the request +## accepts it (via Accept header) and pillow-heif is enabled +## Defaults to: False +{% if AUTO_HEIF is defined %} +AUTO_HEIF = {{ AUTO_HEIF }} +{% endif %} + +## Specifies whether PNG format should be used automatically if the request +## accepts it (via Accept header) +## Defaults to: False +{% if AUTO_PNG is defined %} +AUTO_PNG = {{ AUTO_PNG }} +{% endif %} ## Specifies whether a PNG image should be used automatically if the png image ## has no transparency (via alpha layer). WARNING: Depending on case, this is @@ -98,64 +210,99 @@ AUTO_WEBP = {{ AUTO_WEBP | default(False) }} ## maybe will be bigger. You have to evaluate the majority of your use cases ## to take a decision about the usage of this conf. ## Defaults to: False -AUTO_PNG_TO_JPG = {{ AUTO_PNG_TO_JPG | default(False) }} +{% if AUTO_PNG_TO_JPG is defined %} +AUTO_PNG_TO_JPG = {{ AUTO_PNG_TO_JPG }} +{% endif %} -## Specify the ratio between 1in and 1px for SVG images. This is only used -## whenrasterizing SVG images having their size units in cm or inches. +## Specify the ratio between 1in and 1px for SVG images. This is only used when +## rasterizing SVG images having their size units in cm or inches. ## Defaults to: 150 -SVG_DPI = {{ SVG_DPI | default(150) }} +{% if SVG_DPI is defined %} +SVG_DPI = {{ SVG_DPI }} +{% endif %} ## Max AGE sent as a header for the image served by thumbor in seconds ## Defaults to: 86400 -MAX_AGE = {{ MAX_AGE | default(86400) }} +{% if MAX_AGE is defined %} +MAX_AGE = {{ MAX_AGE }} +{% endif %} ## Indicates the Max AGE header in seconds for temporary images (images with ## failed smart detection) ## Defaults to: 0 -MAX_AGE_TEMP_IMAGE = {{ MAX_AGE_TEMP_IMAGE | default(0) }} +{% if MAX_AGE_TEMP_IMAGE is defined %} +MAX_AGE_TEMP_IMAGE = {{ MAX_AGE_TEMP_IMAGE }} +{% endif %} ## Indicates whether thumbor should rotate images that have an Orientation EXIF ## header ## Defaults to: False -RESPECT_ORIENTATION = {{ RESPECT_ORIENTATION | default(False) }} +{% if RESPECT_ORIENTATION is defined %} +RESPECT_ORIENTATION = {{ RESPECT_ORIENTATION }} +{% endif %} ## Ignore errors during smart detections and return image as a temp image (not ## saved in result storage and with MAX_AGE_TEMP_IMAGE age) ## Defaults to: False -IGNORE_SMART_ERRORS = {{ IGNORE_SMART_ERRORS | default(False) }} +{% if IGNORE_SMART_ERRORS is defined %} +IGNORE_SMART_ERRORS = {{ IGNORE_SMART_ERRORS }} +{% endif %} ## Sends If-Modified-Since & Last-Modified headers; requires support from result ## storage ## Defaults to: False -SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = {{ SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS | default(False) }} +{% if SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS is defined %} +SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = {{ SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS }} +{% endif %} ## Preserves exif information in generated images. Increases image size in ## kbytes, use with caution. ## Defaults to: False -PRESERVE_EXIF_INFO = {{ PRESERVE_EXIF_INFO | default(False) }} +{% if PRESERVE_EXIF_INFO is defined %} +PRESERVE_EXIF_INFO = {{ PRESERVE_EXIF_INFO }} +{% endif %} + +## Preserves Exif copyright information in generated images. +## Defaults to: False +{% if PRESERVE_EXIF_COPYRIGHT_INFO is defined %} +PRESERVE_EXIF_COPYRIGHT_INFO = {{ PRESERVE_EXIF_COPYRIGHT_INFO }} +{% endif %} + +## Preserves Jpeg IPTC information in generated images. +## Defaults to: False +{% if PRESERVE_IPTC_INFO is defined %} +PRESERVE_IPTC_INFO = {{ PRESERVE_IPTC_INFO }} +{% endif %} ## Indicates whether thumbor should enable the EXPERIMENTAL support for animated ## gifs. ## Defaults to: True -ALLOW_ANIMATED_GIFS = {{ ALLOW_ANIMATED_GIFS | default(True) }} +{% if ALLOW_ANIMATED_GIFS is defined %} +ALLOW_ANIMATED_GIFS = {{ ALLOW_ANIMATED_GIFS }} +{% endif %} ## Indicates whether thumbor should use gifsicle engine. Please note that smart ## cropping and filters are not supported for gifs using gifsicle (but won't ## give an error). ## Defaults to: False -USE_GIFSICLE_ENGINE = {{ USE_GIFSICLE_ENGINE | default(False) }} +{% if USE_GIFSICLE_ENGINE is defined %} +USE_GIFSICLE_ENGINE = {{ USE_GIFSICLE_ENGINE }} +{% endif %} ## Indicates whether thumbor should enable blacklist functionality to prevent ## processing certain images. ## Defaults to: False -USE_BLACKLIST = {{ USE_BLACKLIST | default(False) }} +{% if USE_BLACKLIST is defined %} +USE_BLACKLIST = {{ USE_BLACKLIST }} +{% endif %} -## Size of the thread pool used for image transformations. The default value is -## 0 (don't use a threadpoool. Increase this if you are seeing your IOLoop +## Size of the thread pool used for image transformations. The default value is 0 +## (don't use a threadpoool). Increase this if you are seeing your IOLoop ## getting blocked (often indicated by your upstream HTTP requests timing out) ## Defaults to: 0 -ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE | default(0) }} - +{% if ENGINE_THREADPOOL_SIZE is defined %} +ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE }} +{% endif %} ################################################################################ @@ -166,42 +313,51 @@ ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE | default(0) }} ## The metrics backend thumbor should use to measure internal actions. This must ## be the full name of a python module (python must be able to import it) ## Defaults to: 'thumbor.metrics.logger_metrics' -METRICS = '{{ METRICS | default('thumbor.metrics.logger_metrics') }}' +{% if METRICS is defined %} +METRICS = '{{ METRICS }}' +{% endif %} ## The loader thumbor should use to load the original image. This must be the ## full name of a python module (python must be able to import it) ## Defaults to: 'thumbor.loaders.http_loader' -LOADER = '{{ LOADER | default('thumbor.loaders.http_loader') }}' +{% if LOADER is defined %} +LOADER = '{{ LOADER }}' +{% endif %} ## The file storage thumbor should use to store original images. This must be the ## full name of a python module (python must be able to import it) ## Defaults to: 'thumbor.storages.file_storage' -STORAGE = '{{ STORAGE | default('thumbor.storages.file_storage') }}' +{% if STORAGE is defined %} +STORAGE = '{{ STORAGE }}' +{% endif %} ## The result storage thumbor should use to store generated images. This must be ## the full name of a python module (python must be able to import it) ## Defaults to: None -RESULT_STORAGE = '{{ RESULT_STORAGE | default('thumbor.result_storages.file_storage') }}' +{% if RESULT_STORAGE is defined %} +RESULT_STORAGE = '{{ RESULT_STORAGE }}' +{% endif %} ## The imaging engine thumbor should use to perform image operations. This must ## be the full name of a python module (python must be able to import it) -## Possible values: 'thumbor.engines.pil', 'thumbor.engines.opencv' ## Defaults to: 'thumbor.engines.pil' -ENGINE = '{{ ENGINE | default('thumbor.engines.pil') }}' +{% if ENGINE is defined %} +ENGINE = '{{ ENGINE }}' +{% endif %} ## The gif engine thumbor should use to perform image operations. This must be ## the full name of a python module (python must be able to import it) ## Defaults to: 'thumbor.engines.gif' -GIF_ENGINE = '{{ GIF_ENGINE | default('thumbor.engines.gif') }}' +{% if GIF_ENGINE is defined %} +GIF_ENGINE = '{{ GIF_ENGINE }}' +{% endif %} ## The url signer thumbor should use to verify url signatures.This must be the ## full name of a python module (python must be able to import it) ## Defaults to: 'libthumbor.url_signers.base64_hmac_sha1' -URL_SIGNER = '{{ URL_SIGNER | default('libthumbor.url_signers.base64_hmac_sha1') }}' - -## Preserves Jpeg IPTC information in generated images. -## More info: https://github.com/thumbor/thumbor/pull/1555 -PRESERVE_IPTC_INFO = {{ PRESERVE_IPTC_INFO | default(False) }} +{% if URL_SIGNER is defined %} +URL_SIGNER = '{{ URL_SIGNER }}' +{% endif %} ################################################################################ @@ -218,11 +374,14 @@ ALLOW_UNSAFE_URL = {{ ALLOW_UNSAFE_URL | default(False) }} ################################################################################ + ##################################### HTTP ##################################### ## Enables automatically generated etags ## Defaults to: True -ENABLE_ETAGS = {{ ENABLE_ETAGS | default(True) }} +{% if ENABLE_ETAGS is defined %} +ENABLE_ETAGS = {{ ENABLE_ETAGS }} +{% endif %} ################################################################################ @@ -231,7 +390,9 @@ ENABLE_ETAGS = {{ ENABLE_ETAGS | default(True) }} ## Set maximum id length for images when stored ## Defaults to: 32 -MAX_ID_LENGTH = {{ MAX_ID_LENGTH | default(32) }} +{% if MAX_ID_LENGTH is defined %} +MAX_ID_LENGTH = {{ MAX_ID_LENGTH }} +{% endif %} ################################################################################ @@ -240,7 +401,9 @@ MAX_ID_LENGTH = {{ MAX_ID_LENGTH | default(32) }} ## Set garbage collection interval in seconds ## Defaults to: None -GC_INTERVAL = {{ GC_INTERVAL | default(None) }} +{% if GC_INTERVAL is defined %} +GC_INTERVAL = {{ GC_INTERVAL }} +{% endif %} ################################################################################ @@ -264,7 +427,9 @@ STATSD_HOST = '{{ STATSD_HOST }}' ## Port to send statsd instrumentation to ## Defaults to: 8125 -STATSD_PORT = {{ STATSD_PORT | default(8125) }} +{% if STATSD_PORT is defined %} +STATSD_PORT = {{ STATSD_PORT }} +{% endif %} ## Prefix for statsd ## Defaults to: None @@ -274,10 +439,10 @@ STATSD_PREFIX = '{{ STATSD_PREFIX }}' ################################################################################ + ################################# File Loader ################################## ## The root path where the File Loader will try to find images -## Defaults to: /tmp FILE_LOADER_ROOT_PATH = '{{ FILE_LOADER_ROOT_PATH | default('/data/loader') }}' ################################################################################ @@ -288,77 +453,113 @@ FILE_LOADER_ROOT_PATH = '{{ FILE_LOADER_ROOT_PATH | default('/data/loader') }}' ## The maximum number of seconds libcurl can take to connect to an image being ## loaded ## Defaults to: 5 -HTTP_LOADER_CONNECT_TIMEOUT = {{ HTTP_LOADER_CONNECT_TIMEOUT | default(5) }} +{% if HTTP_LOADER_CONNECT_TIMEOUT is defined %} +HTTP_LOADER_CONNECT_TIMEOUT = {{ HTTP_LOADER_CONNECT_TIMEOUT }} +{% endif %} ## The maximum number of seconds libcurl can take to download an image ## Defaults to: 20 -HTTP_LOADER_REQUEST_TIMEOUT = {{ HTTP_LOADER_REQUEST_TIMEOUT | default(20) }} +{% if HTTP_LOADER_REQUEST_TIMEOUT is defined %} +HTTP_LOADER_REQUEST_TIMEOUT = {{ HTTP_LOADER_REQUEST_TIMEOUT }} +{% endif %} ## Indicates whether libcurl should follow redirects when downloading an image ## Defaults to: True -HTTP_LOADER_FOLLOW_REDIRECTS = {{ HTTP_LOADER_FOLLOW_REDIRECTS | default(True) }} +{% if HTTP_LOADER_FOLLOW_REDIRECTS is defined %} +HTTP_LOADER_FOLLOW_REDIRECTS = {{ HTTP_LOADER_FOLLOW_REDIRECTS }} +{% endif %} ## Indicates the number of redirects libcurl should follow when downloading an ## image ## Defaults to: 5 -HTTP_LOADER_MAX_REDIRECTS = {{ HTTP_LOADER_MAX_REDIRECTS | default(5) }} +{% if HTTP_LOADER_MAX_REDIRECTS is defined %} +HTTP_LOADER_MAX_REDIRECTS = {{ HTTP_LOADER_MAX_REDIRECTS }} +{% endif %} ## The maximum number of simultaneous HTTP connections the loader can make before ## queuing ## Defaults to: 10 -HTTP_LOADER_MAX_CLIENTS = {{ HTTP_LOADER_MAX_CLIENTS | default(10) }} +{% if HTTP_LOADER_MAX_CLIENTS is defined %} +HTTP_LOADER_MAX_CLIENTS = {{ HTTP_LOADER_MAX_CLIENTS }} +{% endif %} ## Indicates whether thumbor should forward the user agent of the requesting user ## Defaults to: False -HTTP_LOADER_FORWARD_USER_AGENT = {{ HTTP_LOADER_FORWARD_USER_AGENT | default(False) }} +{% if HTTP_LOADER_FORWARD_USER_AGENT is defined %} +HTTP_LOADER_FORWARD_USER_AGENT = {{ HTTP_LOADER_FORWARD_USER_AGENT }} +{% endif %} ## Indicates whether thumbor should forward the headers of the request ## Defaults to: False -HTTP_LOADER_FORWARD_ALL_HEADERS = {{ HTTP_LOADER_FORWARD_ALL_HEADERS | default(False) }} +{% if HTTP_LOADER_FORWARD_ALL_HEADERS is defined %} +HTTP_LOADER_FORWARD_ALL_HEADERS = {{ HTTP_LOADER_FORWARD_ALL_HEADERS }} +{% endif %} ## Indicates which headers should be forwarded among all the headers of the request ## Defaults to: [] -HTTP_LOADER_FORWARD_HEADERS_WHITELIST = {{ HTTP_LOADER_FORWARD_HEADERS_WHITELIST | default([]) }} +{% if HTTP_LOADER_FORWARD_HEADERS_WHITELIST is defined %} +HTTP_LOADER_FORWARD_HEADERS_WHITELIST = {{ HTTP_LOADER_FORWARD_HEADERS_WHITELIST }} +{% endif %} ## Default user agent for thumbor http loader requests ## Defaults to: 'Thumbor/7.7' -HTTP_LOADER_DEFAULT_USER_AGENT = '{{ HTTP_LOADER_DEFAULT_USER_AGENT | default('Thumbor/7.7') }}' +{% if HTTP_LOADER_DEFAULT_USER_AGENT is defined %} +HTTP_LOADER_DEFAULT_USER_AGENT = '{{ HTTP_LOADER_DEFAULT_USER_AGENT }}' +{% endif %} ## The proxy host needed to load images through ## Defaults to: None -HTTP_LOADER_PROXY_HOST = {{ HTTP_LOADER_PROXY_HOST | default(None) }} +{% if HTTP_LOADER_PROXY_HOST is defined %} +HTTP_LOADER_PROXY_HOST = '{{ HTTP_LOADER_PROXY_HOST }}' +{% endif %} ## The proxy port for the proxy host ## Defaults to: None -HTTP_LOADER_PROXY_PORT = {{ HTTP_LOADER_PROXY_PORT | default(None) }} +{% if HTTP_LOADER_PROXY_PORT is defined %} +HTTP_LOADER_PROXY_PORT = {{ HTTP_LOADER_PROXY_PORT }} +{% endif %} ## The proxy username for the proxy host ## Defaults to: None -HTTP_LOADER_PROXY_USERNAME = {{ HTTP_LOADER_PROXY_USERNAME | default(None) }} +{% if HTTP_LOADER_PROXY_USERNAME is defined %} +HTTP_LOADER_PROXY_USERNAME = '{{ HTTP_LOADER_PROXY_USERNAME }}' +{% endif %} ## The proxy password for the proxy host ## Defaults to: None -HTTP_LOADER_PROXY_PASSWORD = {{ HTTP_LOADER_PROXY_PASSWORD | default(None) }} +{% if HTTP_LOADER_PROXY_PASSWORD is defined %} +HTTP_LOADER_PROXY_PASSWORD = '{{ HTTP_LOADER_PROXY_PASSWORD }}' +{% endif %} ## The filename of CA certificates in PEM format ## Defaults to: None -HTTP_LOADER_CA_CERTS = {{ HTTP_LOADER_CA_CERTS | default(None) }} +{% if HTTP_LOADER_CA_CERTS is defined %} +HTTP_LOADER_CA_CERTS = '{{ HTTP_LOADER_CA_CERTS }}' +{% endif %} ## Validate the server’s certificate for HTTPS requests ## Defaults to: None -HTTP_LOADER_VALIDATE_CERTS = {{ HTTP_LOADER_VALIDATE_CERTS | default(None) }} +{% if HTTP_LOADER_VALIDATE_CERTS is defined %} +HTTP_LOADER_VALIDATE_CERTS = '{{ HTTP_LOADER_VALIDATE_CERTS }}' +{% endif %} ## The filename for client SSL key ## Defaults to: None -HTTP_LOADER_CLIENT_KEY = {{ HTTP_LOADER_CLIENT_KEY | default(None) }} +{% if HTTP_LOADER_CLIENT_KEY is defined %} +HTTP_LOADER_CLIENT_KEY = '{{ HTTP_LOADER_CLIENT_KEY }}' +{% endif %} ## The filename for client SSL certificate ## Defaults to: None -HTTP_LOADER_CLIENT_CERT = {{ HTTP_LOADER_CLIENT_CERT | default(None) }} +{% if HTTP_LOADER_CLIENT_CERT is defined %} +HTTP_LOADER_CLIENT_CERT = '{{ HTTP_LOADER_CLIENT_CERT }}' +{% endif %} ## If the CurlAsyncHTTPClient should be used ## Defaults to: False -HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT | default(False) }} +{% if HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT is defined %} +HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT }} +{% endif %} ################################################################################ @@ -370,19 +571,39 @@ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT | def ## timeout if the speed is below HTTP_LOADER_CURL_LOW_SPEED_LIMIT for that ## long ## Defaults to: 0 -HTTP_LOADER_CURL_LOW_SPEED_TIME = {{ HTTP_LOADER_CURL_LOW_SPEED_TIME | default(0) }} +{% if HTTP_LOADER_CURL_LOW_SPEED_TIME is defined %} +HTTP_LOADER_CURL_LOW_SPEED_TIME = {{ HTTP_LOADER_CURL_LOW_SPEED_TIME }} +{% endif %} ## If HTTP_LOADER_CURL_LOW_SPEED_TIME and HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT are ## set, then this is the limit in bytes per second as integer which should ## timeout if the speed is below that limit for ## HTTP_LOADER_CURL_LOW_SPEED_TIME seconds ## Defaults to: 0 -HTTP_LOADER_CURL_LOW_SPEED_LIMIT = {{ HTTP_LOADER_CURL_LOW_SPEED_LIMIT | default(0) }} +{% if HTTP_LOADER_CURL_LOW_SPEED_LIMIT is defined %} +HTTP_LOADER_CURL_LOW_SPEED_LIMIT = {{ HTTP_LOADER_CURL_LOW_SPEED_LIMIT }} +{% endif %} + +## If True, thumbor will ensure that the socket from the file descriptor number +## passed using the --fd flag is non-blocking. This setting has no effect if +## the --fd flag is a path, sockets created that way are always non-blocking. +## Defaults to: False +{% if NON_BLOCKING_SOCKETS is defined %} +NON_BLOCKING_SOCKETS = {{ NON_BLOCKING_SOCKETS }} +{% endif %} ## Custom app class to override ThumborServiceApp. This config value is ## overridden by the -a command-line parameter. ## Defaults to: 'thumbor.app.ThumborServiceApp' -APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' +{% if APP_CLASS is defined %} +APP_CLASS = '{{ APP_CLASS }}' +{% endif %} + +## Sends Access-Control-Allow-Origin header +## Defaults to: False +{% if ACCESS_CONTROL_ALLOW_ORIGIN_HEADER is defined %} +ACCESS_CONTROL_ALLOW_ORIGIN_HEADER = {{ ACCESS_CONTROL_ALLOW_ORIGIN_HEADER }} +{% endif %} ################################################################################ @@ -392,13 +613,17 @@ APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' ## Expiration in seconds for the images in the File Storage. Defaults to one ## month ## Defaults to: 2592000 -STORAGE_EXPIRATION_SECONDS = {{ STORAGE_EXPIRATION_SECONDS | default(2592000) }} +{% if STORAGE_EXPIRATION_SECONDS is defined %} +STORAGE_EXPIRATION_SECONDS = {{ STORAGE_EXPIRATION_SECONDS }} +{% endif %} ## Indicates whether thumbor should store the signing key for each image in the ## file storage. This allows the key to be changed and old images to still be ## properly found ## Defaults to: False -STORES_CRYPTO_KEY_FOR_EACH_IMAGE = {{ STORES_CRYPTO_KEY_FOR_EACH_IMAGE | default(False) }} +{% if STORES_CRYPTO_KEY_FOR_EACH_IMAGE is defined %} +STORES_CRYPTO_KEY_FOR_EACH_IMAGE = {{ STORES_CRYPTO_KEY_FOR_EACH_IMAGE }} +{% endif %} ## The root path where the File Storage will try to find images ## Defaults to: '/tmp/thumbor/storage' @@ -412,31 +637,43 @@ FILE_STORAGE_ROOT_PATH = '{{ FILE_STORAGE_ROOT_PATH | default('/data/storage') } ## Max size in bytes for images uploaded to thumbor ## Aliases: MAX_SIZE ## Defaults to: 0 -UPLOAD_MAX_SIZE = {{ UPLOAD_MAX_SIZE | default(0) }} +{% if UPLOAD_MAX_SIZE is defined %} +UPLOAD_MAX_SIZE = {{ UPLOAD_MAX_SIZE }} +{% endif %} ## Indicates whether thumbor should enable File uploads ## Aliases: ENABLE_ORIGINAL_PHOTO_UPLOAD ## Defaults to: False -UPLOAD_ENABLED = {{ UPLOAD_ENABLED | default(False) }} +{% if UPLOAD_ENABLED is defined %} +UPLOAD_ENABLED = {{ UPLOAD_ENABLED }} +{% endif %} ## The type of storage to store uploaded images with ## Aliases: ORIGINAL_PHOTO_STORAGE ## Defaults to: 'thumbor.storages.file_storage' -UPLOAD_PHOTO_STORAGE = '{{ UPLOAD_PHOTO_STORAGE | default('thumbor.storages.file_storage') }}' +{% if UPLOAD_PHOTO_STORAGE is defined %} +UPLOAD_PHOTO_STORAGE = '{{ UPLOAD_PHOTO_STORAGE }}' +{% endif %} ## Indicates whether image deletion should be allowed ## Aliases: ALLOW_ORIGINAL_PHOTO_DELETION ## Defaults to: False -UPLOAD_DELETE_ALLOWED = {{ UPLOAD_DELETE_ALLOWED | default(False) }} +{% if UPLOAD_DELETE_ALLOWED is defined %} +UPLOAD_DELETE_ALLOWED = {{ UPLOAD_DELETE_ALLOWED }} +{% endif %} ## Indicates whether image overwrite should be allowed ## Aliases: ALLOW_ORIGINAL_PHOTO_PUTTING ## Defaults to: False -UPLOAD_PUT_ALLOWED = {{ UPLOAD_PUT_ALLOWED | default(False) }} +{% if UPLOAD_PUT_ALLOWED is defined %} +UPLOAD_PUT_ALLOWED = {{ UPLOAD_PUT_ALLOWED }} +{% endif %} ## Default filename for image uploaded ## Defaults to: 'image' -UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME | default('image') }}' +{% if UPLOAD_DEFAULT_FILENAME is defined %} +UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME }}' +{% endif %} ################################################################################ @@ -446,17 +683,23 @@ UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME | default('image') }}' ## Mixed Storage file storage. This must be the full name of a python module ## (python must be able to import it) ## Defaults to: 'thumbor.storages.no_storage' -MIXED_STORAGE_FILE_STORAGE = '{{ MIXED_STORAGE_FILE_STORAGE | default('thumbor.storages.no_storage') }}' +{% if MIXED_STORAGE_FILE_STORAGE is defined %} +MIXED_STORAGE_FILE_STORAGE = '{{ MIXED_STORAGE_FILE_STORAGE }}' +{% endif %} ## Mixed Storage signing key storage. This must be the full name of a python ## module (python must be able to import it) ## Defaults to: 'thumbor.storages.no_storage' -MIXED_STORAGE_CRYPTO_STORAGE = '{{ MIXED_STORAGE_CRYPTO_STORAGE | default('thumbor.storages.no_storage') }}' +{% if MIXED_STORAGE_CRYPTO_STORAGE is defined %} +MIXED_STORAGE_CRYPTO_STORAGE = '{{ MIXED_STORAGE_CRYPTO_STORAGE }}' +{% endif %} ## Mixed Storage detector information storage. This must be the full name of a ## python module (python must be able to import it) ## Defaults to: 'thumbor.storages.no_storage' -MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE | default('thumbor.storages.no_storage') }}' +{% if MIXED_STORAGE_DETECTOR_STORAGE is defined %} +MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE }}' +{% endif %} ################################################################################ @@ -466,7 +709,9 @@ MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE | default('t ## The callback function name that should be used by the META route for JSONP ## access ## Defaults to: None -META_CALLBACK_NAME = {{ META_CALLBACK_NAME | default(None) }} +{% if META_CALLBACK_NAME is defined %} +META_CALLBACK_NAME = '{{ META_CALLBACK_NAME }}' +{% endif %} ################################################################################ @@ -484,19 +729,27 @@ META_CALLBACK_NAME = {{ META_CALLBACK_NAME | default(None) }} #'thumbor.detectors.feature_detector', #'thumbor.detectors.face_detector', #] -DETECTORS = {{ DETECTORS | default([]) }} +{% if DETECTORS is defined %} +DETECTORS = {{ DETECTORS }} +{% endif %} ## The cascade file that opencv will use to detect faces. ## Defaults to: 'haarcascade_frontalface_alt.xml' -FACE_DETECTOR_CASCADE_FILE = '{{ FACE_DETECTOR_CASCADE_FILE | default('haarcascade_frontalface_alt.xml') }}' +{% if FACE_DETECTOR_CASCADE_FILE is defined %} +FACE_DETECTOR_CASCADE_FILE = '{{ FACE_DETECTOR_CASCADE_FILE }}' +{% endif %} ## The cascade file that opencv will use to detect glasses. ## Defaults to: 'haarcascade_eye_tree_eyeglasses.xml' -GLASSES_DETECTOR_CASCADE_FILE = '{{ GLASSES_DETECTOR_CASCADE_FILE | default('haarcascade_eye_tree_eyeglasses.xml') }}' +{% if GLASSES_DETECTOR_CASCADE_FILE is defined %} +GLASSES_DETECTOR_CASCADE_FILE = '{{ GLASSES_DETECTOR_CASCADE_FILE }}' +{% endif %} ## The cascade file that opencv will use to detect profile faces. ## Defaults to: 'haarcascade_profileface.xml' -PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE | default('haarcascade_profileface.xml') }}' +{% if PROFILE_DETECTOR_CASCADE_FILE is defined %} +PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE }}' +{% endif %} ################################################################################ @@ -504,9 +757,11 @@ PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE | default('haa ################################## Optimizers ################################## ## List of optimizers that thumbor will use to optimize images -## Defaults to: [] --> ['thumbor.optimizers.jpegtran',] -OPTIMIZERS = {{ OPTIMIZERS | default([]) }} - +## Defaults to: [ +#] +{% if OPTIMIZERS is defined %} +OPTIMIZERS = {{ OPTIMIZERS }} +{% endif %} ## Path for the jpegtran binary ## Defaults to: '/usr/bin/jpegtran' @@ -515,7 +770,9 @@ JPEGTRAN_PATH = '{{ JPEGTRAN_PATH | default('/usr/bin/jpegtran') }}' ## Path for the progressive scans file to use with jpegtran optimizer. Implies ## progressive jpeg output ## Defaults to: '' -JPEGTRAN_SCANS_FILE = '{{ JPEGTRAN_SCANS_FILE | default('') }}' +{% if JPEGTRAN_SCANS_FILE is defined %} +JPEGTRAN_SCANS_FILE = '{{ JPEGTRAN_SCANS_FILE }}' +{% endif %} ## Path for the ffmpeg binary used to generate gifv(h.264) ## Defaults to: '/usr/local/bin/ffmpeg' @@ -573,7 +830,9 @@ FILTERS = {{ FILTERS }} ## Expiration in seconds of generated images in the result storage ## Defaults to: 0 -RESULT_STORAGE_EXPIRATION_SECONDS = {{ RESULT_STORAGE_EXPIRATION_SECONDS | default(0) }} +{% if RESULT_STORAGE_EXPIRATION_SECONDS is defined %} +RESULT_STORAGE_EXPIRATION_SECONDS = {{ RESULT_STORAGE_EXPIRATION_SECONDS }} +{% endif %} ## Path where the Result storage will store generated images ## Defaults to: '/tmp/thumbor/result_storage' @@ -581,7 +840,9 @@ RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '{{ RESULT_STORAGE_FILE_STORAGE_ROOT_PAT ## Indicates whether unsafe requests should also be stored in the Result Storage ## Defaults to: False -RESULT_STORAGE_STORES_UNSAFE = {{ RESULT_STORAGE_STORES_UNSAFE | default(False) }} +{% if RESULT_STORAGE_STORES_UNSAFE is defined %} +RESULT_STORAGE_STORES_UNSAFE = {{ RESULT_STORAGE_STORES_UNSAFE }} +{% endif %} ################################################################################ @@ -594,15 +855,63 @@ REDIS_QUEUE_SERVER_HOST = '{{ REDIS_QUEUE_SERVER_HOST | default('redis') }}' ## Server port for the queued redis detector ## Defaults to: 6379 -REDIS_QUEUE_SERVER_PORT = {{ REDIS_QUEUE_SERVER_PORT | default(6379) }} +{% if REDIS_QUEUE_SERVER_PORT is defined %} +REDIS_QUEUE_SERVER_PORT = {{ REDIS_QUEUE_SERVER_PORT }} +{% endif %} ## Server database index for the queued redis detector ## Defaults to: 0 -REDIS_QUEUE_SERVER_DB = {{ REDIS_QUEUE_SERVER_DB | default(0) }} +{% if REDIS_QUEUE_SERVER_DB is defined %} +REDIS_QUEUE_SERVER_DB = {{ REDIS_QUEUE_SERVER_DB }} +{% endif %} ## Server password for the queued redis detector ## Defaults to: None -REDIS_QUEUE_SERVER_PASSWORD = {{ REDIS_QUEUE_SERVER_PASSWORD | default(None) }} +{% if REDIS_QUEUE_SERVER_PASSWORD is defined %} +REDIS_QUEUE_SERVER_PASSWORD = '{{ REDIS_QUEUE_SERVER_PASSWORD }}' +{% endif %} + +## Redis operation mode 'single_node' or 'sentinel' +## Defaults to: 'single_node' +{% if REDIS_QUEUE_MODE is defined %} +REDIS_QUEUE_MODE = '{{ REDIS_QUEUE_MODE }}' +{% endif %} + +## Sentinel server instances for the queued redis detector +## Defaults to: 'localhost:26379' +{% if REDIS_QUEUE_SENTINEL_INSTANCES is defined %} +REDIS_QUEUE_SENTINEL_INSTANCES = '{{ REDIS_QUEUE_SENTINEL_INSTANCES }}' +{% endif %} + +## Sentinel server password for the queued redis detector +## Defaults to: None +{% if REDIS_QUEUE_SENTINEL_PASSWORD is defined %} +REDIS_QUEUE_SENTINEL_PASSWORD = '{{ REDIS_QUEUE_SENTINEL_PASSWORD }}' +{% endif %} + +## Sentinel server master instance for the queued redis detector +## Defaults to: 'master' +{% if REDIS_QUEUE_SENTINEL_MASTER_INSTANCE is defined %} +REDIS_QUEUE_SENTINEL_MASTER_INSTANCE = '{{ REDIS_QUEUE_SENTINEL_MASTER_INSTANCE }}' +{% endif %} + +## Sentinel server master password for the queued redis detector +## Defaults to: None +{% if REDIS_QUEUE_SENTINEL_MASTER_PASSWORD is defined %} +REDIS_QUEUE_SENTINEL_MASTER_PASSWORD = '{{ REDIS_QUEUE_SENTINEL_MASTER_PASSWORD }}' +{% endif %} + +## Sentinel server master database index for the queued redis detector +## Defaults to: 0 +{% if REDIS_QUEUE_SENTINEL_MASTER_DB is defined %} +REDIS_QUEUE_SENTINEL_MASTER_DB = {{ REDIS_QUEUE_SENTINEL_MASTER_DB }} +{% endif %} + +## Sentinel server socket timeout for the queued redis detector +## Defaults to: 10.0 +{% if REDIS_QUEUE_SENTINEL_SOCKET_TIMEOUT is defined %} +REDIS_QUEUE_SENTINEL_SOCKET_TIMEOUT = {{ REDIS_QUEUE_SENTINEL_SOCKET_TIMEOUT }} +{% endif %} ################################################################################ @@ -611,15 +920,21 @@ REDIS_QUEUE_SERVER_PASSWORD = {{ REDIS_QUEUE_SERVER_PASSWORD | default(None) }} ## AWS key id ## Defaults to: None -SQS_QUEUE_KEY_ID = {{ SQS_QUEUE_KEY_ID | default(None) }} +{% if SQS_QUEUE_KEY_ID is defined %} +SQS_QUEUE_KEY_ID = '{{ SQS_QUEUE_KEY_ID }}' +{% endif %} ## AWS key secret ## Defaults to: None -SQS_QUEUE_KEY_SECRET = {{ SQS_QUEUE_KEY_SECRET | default(None) }} +{% if SQS_QUEUE_KEY_SECRET is defined %} +SQS_QUEUE_KEY_SECRET = '{{ SQS_QUEUE_KEY_SECRET }}' +{% endif %} ## AWS SQS region ## Defaults to: 'us-east-1' -SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION | default('us-east-1') }}' +{% if SQS_QUEUE_REGION is defined %} +SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION }}' +{% endif %} ################################################################################ @@ -629,20 +944,28 @@ SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION | default('us-east-1') }}' ## This configuration indicates whether thumbor should use a custom error ## handler. ## Defaults to: False -USE_CUSTOM_ERROR_HANDLING = {{ USE_CUSTOM_ERROR_HANDLING | default(False) }} +{% if USE_CUSTOM_ERROR_HANDLING is defined %} +USE_CUSTOM_ERROR_HANDLING = {{ USE_CUSTOM_ERROR_HANDLING }} +{% endif %} ## Error reporting module. Needs to contain a class called ErrorHandler with a ## handle_error(context, handler, exception) method. ## Defaults to: 'thumbor.error_handlers.sentry' -ERROR_HANDLER_MODULE = '{{ ERROR_HANDLER_MODULE | default('thumbor.error_handlers.sentry') }}' +{% if ERROR_HANDLER_MODULE is defined %} +ERROR_HANDLER_MODULE = '{{ ERROR_HANDLER_MODULE }}' +{% endif %} ## File of error log as json ## Defaults to: None -ERROR_FILE_LOGGER = {{ ERROR_FILE_LOGGER | default(None) }} +{% if ERROR_FILE_LOGGER is defined %} +ERROR_FILE_LOGGER = '{{ ERROR_FILE_LOGGER }}' +{% endif %} ## File of error log name is parametrized with context attribute ## Defaults to: False -ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT | default('False') }} +{% if ERROR_FILE_NAME_USE_CONTEXT is defined %} +ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT }} +{% endif %} ################################################################################ @@ -652,11 +975,15 @@ ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT | default('False') ## Sentry thumbor project dsn. i.e.: http://5a63d58ae7b94f1dab3dee740b301d6a:73ee ## a45d3e8649239a973087e8f21f98@localhost:9000/2 ## Defaults to: '' -SENTRY_DSN_URL = '{{ SENTRY_DSN_URL | default('') }}' +{% if SENTRY_DSN_URL is defined %} +SENTRY_DSN_URL = '{{ SENTRY_DSN_URL }}' +{% endif %} ## Sentry environment i.e.: staging ## Defaults to: None -SENTRY_ENVIRONMENT = {{ SENTRY_ENVIRONMENT | default(None) }} +{% if SENTRY_ENVIRONMENT is defined %} +SENTRY_ENVIRONMENT = '{{ SENTRY_ENVIRONMENT }}' +{% endif %} ################################################################################ @@ -666,12 +993,16 @@ SENTRY_ENVIRONMENT = {{ SENTRY_ENVIRONMENT | default(None) }} ## The amount of time to wait before shutting down the server, i.e. stop ## accepting requests. ## Defaults to: 0 -MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN | default(0) }} +{% if MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN is defined %} +MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN }} +{% endif %} -## The amount of time to waut before shutting down all io, after the server has +## The amount of time to wait before shutting down all io, after the server has ## been stopped ## Defaults to: 0 -MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN | default(0) }} +{% if MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN is defined %} +MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN }} +{% endif %} ################################################################################ @@ -696,23 +1027,33 @@ HANDLER_LISTS = {{ HANDLER_LISTS }} ## Region where thumbor's objects are going to be loaded from. ## Defaults to: 'us-east-1' -AWS_LOADER_REGION_NAME = '{{ AWS_LOADER_REGION_NAME | default('us-east-1') }}' +{% if AWS_LOADER_REGION_NAME is defined %} +AWS_LOADER_REGION_NAME = '{{ AWS_LOADER_REGION_NAME }}' +{% endif %} ## S3 Bucket where thumbor's objects are loaded from. ## Defaults to: 'thumbor' -AWS_LOADER_BUCKET_NAME = '{{ AWS_LOADER_BUCKET_NAME | default('thumbor') }}' +{% if AWS_LOADER_BUCKET_NAME is defined %} +AWS_LOADER_BUCKET_NAME = '{{ AWS_LOADER_BUCKET_NAME }}' +{% endif %} ## Secret access key for S3 Loader. ## Defaults to: None -AWS_LOADER_S3_SECRET_ACCESS_KEY = '{{ AWS_LOADER_S3_SECRET_ACCESS_KEY | default(None) }}' +{% if AWS_LOADER_S3_SECRET_ACCESS_KEY is defined %} +AWS_LOADER_S3_SECRET_ACCESS_KEY = '{{ AWS_LOADER_S3_SECRET_ACCESS_KEY }}' +{% endif %} ## Access key ID for S3 Loader. ## Defaults to: None -AWS_LOADER_S3_ACCESS_KEY_ID = '{{ AWS_LOADER_S3_ACCESS_KEY_ID | default(None) }}' +{% if AWS_LOADER_S3_ACCESS_KEY_ID is defined %} +AWS_LOADER_S3_ACCESS_KEY_ID = '{{ AWS_LOADER_S3_ACCESS_KEY_ID }}' +{% endif %} ## Endpoint URL for S3 API. Very useful for testing. ## Defaults to: None -AWS_LOADER_S3_ENDPOINT_URL = '{{ AWS_LOADER_S3_ENDPOINT_URL | default(None) }}' +{% if AWS_LOADER_S3_ENDPOINT_URL is defined %} +AWS_LOADER_S3_ENDPOINT_URL = '{{ AWS_LOADER_S3_ENDPOINT_URL }}' +{% endif %} ## Loader prefix path. ## Defaults to: '' @@ -734,15 +1075,27 @@ AWS_STORAGE_BUCKET_NAME = '{{ AWS_STORAGE_BUCKET_NAME | default('thumbor') }}' ## Secret access key for S3 to allow thumbor to store objects there. ## Defaults to: None -AWS_STORAGE_S3_SECRET_ACCESS_KEY = '{{ AWS_STORAGE_S3_SECRET_ACCESS_KEY | default(None) }}' +{% if AWS_STORAGE_S3_SECRET_ACCESS_KEY is defined %} +AWS_STORAGE_S3_SECRET_ACCESS_KEY = '{{ AWS_STORAGE_S3_SECRET_ACCESS_KEY }}' +{% else %} +AWS_STORAGE_S3_SECRET_ACCESS_KEY = None +{% endif %} ## Access key ID for S3 to allow thumbor to store objects there. ## Defaults to: None -AWS_STORAGE_S3_ACCESS_KEY_ID = '{{ AWS_STORAGE_S3_ACCESS_KEY_ID | default(None) }}' +{% if AWS_STORAGE_S3_ACCESS_KEY_ID is defined %} +AWS_STORAGE_S3_ACCESS_KEY_ID = '{{ AWS_STORAGE_S3_ACCESS_KEY_ID }}' +{% else %} +AWS_STORAGE_S3_ACCESS_KEY_ID = None +{% endif %} ## Endpoint URL for S3 API. Very useful for testing. ## Defaults to: None -AWS_STORAGE_S3_ENDPOINT_URL = '{{ AWS_STORAGE_S3_ENDPOINT_URL | default(None) }}' +{% if AWS_STORAGE_S3_ENDPOINT_URL is defined %} +AWS_STORAGE_S3_ENDPOINT_URL = '{{ AWS_STORAGE_S3_ENDPOINT_URL }}' +{% else %} +AWS_STORAGE_S3_ENDPOINT_URL = None +{% endif %} ## Storage prefix path. ## Defaults to: '' @@ -750,12 +1103,16 @@ AWS_STORAGE_ROOT_PATH = '{{ AWS_STORAGE_ROOT_PATH | default('') }}' ## Storage ACL for files written in bucket ## Defaults to: 'public-read' -AWS_STORAGE_S3_ACL = '{{ AWS_STORAGE_S3_ACL | default('public-read') }}' +{% if AWS_STORAGE_S3_ACL is defined %} +AWS_STORAGE_S3_ACL = '{{ AWS_STORAGE_S3_ACL }}' +{% endif %} ## Default location to use if S3 does not return location header. Can use ## {bucket_name} var. ## Defaults to: 'https://{bucket_name}.s3.amazonaws.com' -AWS_DEFAULT_LOCATION = '{{ AWS_DEFAULT_LOCATION | default('https://{bucket_name}.s3.amazonaws.com') }}' +{% if AWS_DEFAULT_LOCATION is defined %} +AWS_DEFAULT_LOCATION = '{{ AWS_DEFAULT_LOCATION }}' +{% endif %} ################################################################################ @@ -765,36 +1122,57 @@ AWS_DEFAULT_LOCATION = '{{ AWS_DEFAULT_LOCATION | default('https://{bucket_name} ## Region where thumbor's objects are going to be stored. ## Defaults to: 'us-east-1' -AWS_RESULT_STORAGE_REGION_NAME = '{{ AWS_RESULT_STORAGE_REGION_NAME | default('us-east-1') }}' +{% if AWS_RESULT_STORAGE_REGION_NAME is defined %} +AWS_RESULT_STORAGE_REGION_NAME = '{{ AWS_RESULT_STORAGE_REGION_NAME }}' +{% endif %} ## S3 Bucket where thumbor's objects are going to be stored. ## Defaults to: 'thumbor' -AWS_RESULT_STORAGE_BUCKET_NAME = '{{ AWS_RESULT_STORAGE_BUCKET_NAME | default('thumbor') }}' +{% if AWS_RESULT_STORAGE_BUCKET_NAME is defined %} +AWS_RESULT_STORAGE_BUCKET_NAME = '{{ AWS_RESULT_STORAGE_BUCKET_NAME }}' +{% endif %} ## Secret access key for S3 to allow thumbor to store objects there. ## Defaults to: None -AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY = '{{ AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY | default(None) }}' +{% if AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY is defined %} +AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY = '{{ AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY }}' +{% endif %} ## Access key ID for S3 to allow thumbor to store objects there. ## Defaults to: None -AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID = '{{ AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID | default(None) }}' +{% if AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID is defined %} +AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID = '{{ AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID }}' +{% endif %} ## Endpoint URL for S3 API. Very useful for testing. ## Defaults to: None -AWS_RESULT_STORAGE_S3_ENDPOINT_URL = '{{ AWS_RESULT_STORAGE_S3_ENDPOINT_URL | default(None) }}' +{% if AWS_RESULT_STORAGE_S3_ENDPOINT_URL is defined %} +AWS_RESULT_STORAGE_S3_ENDPOINT_URL = '{{ AWS_RESULT_STORAGE_S3_ENDPOINT_URL }}' +{% endif %} ## Result Storage prefix path. -## Defaults to: '/rs' -AWS_RESULT_STORAGE_ROOT_PATH = '{{ AWS_RESULT_STORAGE_ROOT_PATH | default('/rs') }}' +## Defaults to: '' +AWS_RESULT_STORAGE_ROOT_PATH = '{{ AWS_RESULT_STORAGE_ROOT_PATH | default('') }}' ## ACL to use for storing items in S3. ## Defaults to: None -AWS_RESULT_STORAGE_S3_ACL = '{{ AWS_RESULT_STORAGE_S3_ACL | default(None) }}' +{% if AWS_RESULT_STORAGE_S3_ACL is defined %} +AWS_RESULT_STORAGE_S3_ACL = '{{ AWS_RESULT_STORAGE_S3_ACL }}' +{% endif %} ################################################################################ ######################### tc_prometheus ######################################## -PROMETHEUS_SCRAPE_PORT = {{ PROMETHEUS_SCRAPE_PORT | default(8000) }} # Port the prometheus client should listen on +# Documentation: # Documentation: https://github.com/thumbor/thumbor-aws#result-storage + +# Port the prometheus client should listen on +## Defaults to: 8000 +{% if PROMETHEUS_SCRAPE_PORT is defined %} +PROMETHEUS_SCRAPE_PORT = {{ PROMETHEUS_SCRAPE_PORT }} +{% endif %} ##################### Thumbor Community Extensions ############################# -COMMUNITY_EXTENSIONS = {{ COMMUNITY_EXTENSIONS | default([]) }} +## Defaults to: [] +{% if COMMUNITY_EXTENSIONS is defined %} +COMMUNITY_EXTENSIONS = {{ COMMUNITY_EXTENSIONS }} +{% endif %} diff --git a/docker/thumbor-7.7/debian.Dockerfile b/docker/thumbor-7.7/debian.Dockerfile index 1524ec5..76061a2 100644 --- a/docker/thumbor-7.7/debian.Dockerfile +++ b/docker/thumbor-7.7/debian.Dockerfile @@ -48,8 +48,7 @@ RUN set -eux \ # remotecv is required for queued OpenCV processing "remotecv==5.*,>=5.1.8" \ # thumbor - thumbor[all]==7.7.* thumbor-aws==0.8.* tc_prometheus==2.* \ - && thumbor --version && envtpl --help + thumbor[all]==7.7.* thumbor-aws==0.8.* tc_prometheus==2.* ARG TZ='UTC' ENV TZ=$TZ @@ -74,7 +73,14 @@ RUN set -eux \ && mkdir /data/ \ && mkdir /docker-entrypoint.init.d/ \ # Running `thumbor-doctor` to smoke test functionality - && thumbor-doctor + && thumbor-doctor \ + && thumbor --version \ + && envtpl --help \ + && jpegtran -version \ + && ffmpeg -version \ + && gifsicle --version + + ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] CMD ["thumbor"] diff --git a/docker/thumbor-7.7/slim-alpine.Dockerfile b/docker/thumbor-7.7/slim-alpine.Dockerfile index ab535dc..d6a31b8 100644 --- a/docker/thumbor-7.7/slim-alpine.Dockerfile +++ b/docker/thumbor-7.7/slim-alpine.Dockerfile @@ -45,7 +45,6 @@ RUN set -eux \ "numpy==1.*,>=1.26.3" \ # pycurl is required for thumbor "pycurl==7.*,>=7.45.2" thumbor==7.7.* thumbor-aws==0.8.* tc_prometheus==2.* \ - && thumbor --version && envtpl --help \ ## ## Optional extensions ## @@ -76,7 +75,10 @@ RUN set -eux \ # /data/ dir is used by thumbor && mkdir /data/ \ && mkdir /docker-entrypoint.init.d/ \ - && thumbor --version + && thumbor --version \ + && envtpl --help \ + && jpegtran -version \ + && gifsicle --version # Enable nobody user #RUN set -eux \ diff --git a/examples/read-from-S3-cache-to-S3/docker-compose.yml b/examples/read-from-S3-cache-to-S3/docker-compose.yml index b1460f0..2a6a239 100644 --- a/examples/read-from-S3-cache-to-S3/docker-compose.yml +++ b/examples/read-from-S3-cache-to-S3/docker-compose.yml @@ -2,13 +2,13 @@ services: thumbor: - image: ghcr.io/beeyev/thumbor-s3:slim-alpine-test + image: ghcr.io/beeyev/thumbor-s3:7-debian restart: unless-stopped tty: true ports: - '8888:8888' environment: - - 'LOG_LEVEL=info' + - 'LOG_LEVEL=debug' - 'LOADER=thumbor_aws.loader' - 'AWS_LOADER_REGION_NAME=local' @@ -16,14 +16,16 @@ services: - 'AWS_LOADER_S3_ACCESS_KEY_ID=admin' - 'AWS_LOADER_S3_SECRET_ACCESS_KEY=12345678' - 'AWS_LOADER_S3_ENDPOINT_URL=http://minio:9000/' + ## Define prefix for S3 buckets if needed + #- 'AWS_LOADER_ROOT_PATH=/st' - 'RESULT_STORAGE=thumbor_aws.result_storage' - 'AWS_RESULT_STORAGE_BUCKET_NAME=img-cache' - 'AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID=admin' - 'AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY=12345678' - 'AWS_RESULT_STORAGE_S3_ENDPOINT_URL=http://minio:9000/' - # Result Storage prefix path - - 'AWS_RESULT_STORAGE_ROOT_PATH=rs' + ## Define prefix for S3 buckets if needed + #- 'AWS_RESULT_STORAGE_ROOT_PATH=/rs' - 'RESULT_STORAGE_STORES_UNSAFE=True' - 'ALLOW_UNSAFE_URL=True'