├── 6 ├── fundamentals │ ├── docker-entrypoint.sh │ └── Dockerfile ├── alpine │ ├── docker-entrypoint.sh │ ├── Dockerfile │ └── thumbor.conf.tpl └── slim │ ├── docker-entrypoint.sh │ ├── Dockerfile │ └── thumbor.conf.tpl ├── 7 ├── alpine │ ├── docker-entrypoint.sh │ ├── Dockerfile │ └── thumbor.conf.tpl ├── slim │ ├── docker-entrypoint.sh │ ├── Dockerfile │ └── thumbor.conf.tpl └── fundamentals │ ├── Dockerfile │ └── fundamentals.sh ├── LICENSE ├── tests.html ├── tests.php └── README.md /6/fundamentals/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | echo "PNGQUANT_PATH = '/usr/bin/pngquant'" >> /usr/local/thumbor/thumbor.conf 4 | echo "PNGQUANT_SPEED = 3" >> /usr/local/thumbor/thumbor.conf 5 | 6 | echo "MOZJPEG_PATH = '/usr/local/bin/mozjpeg'" >> /usr/local/thumbor/thumbor.conf 7 | echo "MOZJPEG_QUALITY = 80" >> /usr/local/thumbor/thumbor.conf 8 | -------------------------------------------------------------------------------- /7/alpine/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /usr/local/etc/thumbor.conf ]; then 4 | envtpl /usr/local/etc/thumbor.conf.tpl --allow-missing --keep-template --output /usr/local/thumbor/thumbor.conf 5 | fi 6 | 7 | # If log level is defined we configure it, else use default log_level = info 8 | if [ -n "$LOG_LEVEL" ]; then 9 | LOG_PARAMETER="-l $LOG_LEVEL" 10 | fi 11 | 12 | # Check if thumbor port is defined -> (default port 8888) 13 | if [ -z ${THUMBOR_PORT+x} ]; then 14 | THUMBOR_PORT=8888 15 | fi 16 | 17 | for f in /docker-entrypoint.init.d/*; do 18 | case "$f" in 19 | *.sh) # this should match the set of files we check for below 20 | . $f 21 | break 22 | ;; 23 | esac 24 | done 25 | 26 | if [ "$1" = 'thumbor' ]; then 27 | exec thumbor --port=$THUMBOR_PORT --conf=/usr/local/thumbor/thumbor.conf $LOG_PARAMETER 28 | fi 29 | 30 | exec "$@" 31 | -------------------------------------------------------------------------------- /7/slim/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f /usr/local/etc/thumbor.conf ]; then 4 | envtpl /usr/local/etc/thumbor.conf.tpl --allow-missing --keep-template --output /usr/local/thumbor/thumbor.conf 5 | fi 6 | 7 | # If log level is defined we configure it, else use default log_level = info 8 | if [ -n "$LOG_LEVEL" ]; then 9 | LOG_PARAMETER="-l $LOG_LEVEL" 10 | fi 11 | 12 | # Check if thumbor port is defined -> (default port 8888) 13 | if [ -z ${THUMBOR_PORT+x} ]; then 14 | THUMBOR_PORT=8888 15 | fi 16 | 17 | for f in /docker-entrypoint.init.d/*; do 18 | case "$f" in 19 | *.sh) # this should match the set of files we check for below 20 | . $f 21 | break 22 | ;; 23 | esac 24 | done 25 | 26 | if [ "$1" = 'thumbor' ]; then 27 | exec thumbor --port=$THUMBOR_PORT --conf=/usr/local/thumbor/thumbor.conf $LOG_PARAMETER 28 | fi 29 | 30 | exec "$@" 31 | -------------------------------------------------------------------------------- /6/alpine/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /usr/local/etc/thumbor.conf ]; then 4 | envtpl /usr/local/etc/thumbor.conf.tpl --allow-missing --keep-template --output /usr/local/thumbor/thumbor.conf 5 | fi 6 | 7 | # If log level is defined we configure it, else use default log_level = info 8 | if [ -n "$LOG_LEVEL" ]; then 9 | LOG_PARAMETER="-l $LOG_LEVEL" 10 | fi 11 | 12 | # Check if thumbor port is defined -> (default port 8888) 13 | if [ -z ${THUMBOR_PORT+x} ]; then 14 | THUMBOR_PORT=8888 15 | fi 16 | 17 | 18 | for f in /docker-entrypoint.init.d/*; do 19 | case "$f" in 20 | *.sh) # this should match the set of files we check for below 21 | . $f 22 | break 23 | ;; 24 | esac 25 | done 26 | 27 | if [ "$1" = 'thumbor' ]; then 28 | exec python -m thumbor/server --port=$THUMBOR_PORT --conf=/usr/local/thumbor/thumbor.conf $LOG_PARAMETER 29 | fi 30 | 31 | exec "$@" 32 | -------------------------------------------------------------------------------- /6/slim/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /usr/local/etc/thumbor.conf ]; then 4 | envtpl /usr/local/etc/thumbor.conf.tpl --allow-missing --keep-template --output /usr/local/thumbor/thumbor.conf 5 | fi 6 | 7 | # If log level is defined we configure it, else use default log_level = info 8 | if [ -n "$LOG_LEVEL" ]; then 9 | LOG_PARAMETER="-l $LOG_LEVEL" 10 | fi 11 | 12 | # Check if thumbor port is defined -> (default port 8888) 13 | if [ -z ${THUMBOR_PORT+x} ]; then 14 | THUMBOR_PORT=8888 15 | fi 16 | 17 | 18 | for f in /docker-entrypoint.init.d/*; do 19 | case "$f" in 20 | *.sh) # this should match the set of files we check for below 21 | . $f 22 | break 23 | ;; 24 | esac 25 | done 26 | 27 | if [ "$1" = 'thumbor' ]; then 28 | exec python -m thumbor/server --port=$THUMBOR_PORT --conf=/usr/local/thumbor/thumbor.conf $LOG_PARAMETER 29 | fi 30 | 31 | exec "$@" 32 | -------------------------------------------------------------------------------- /6/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:2-slim 2 | MAINTAINER Michael Hirschler 3 | 4 | RUN groupadd --gid 1000 thumbor && \ 5 | useradd --uid 1000 --gid thumbor --shell /bin/sh thumbor 6 | RUN mkdir /usr/local/thumbor && chown thumbor:thumbor /usr/local/thumbor 7 | 8 | RUN apt-get update && \ 9 | apt-get install -y -q --no-install-recommends \ 10 | gcc \ 11 | imagemagick webp coreutils gifsicle libvpx? \ 12 | libvpx-dev libimage-exiftool-perl libcairo2-dev \ 13 | ffmpeg libffi-dev \ 14 | libcurl4-gnutls-dev libgnutls28-dev \ 15 | python-dev && \ 16 | rm -rf /var/lib/apt/lists/* 17 | 18 | RUN pip install --no-cache-dir thumbor==6.7.5 envtpl==0.6.0 19 | 20 | COPY thumbor.conf.tpl /usr/local/etc/thumbor.conf.tpl 21 | COPY docker-entrypoint.sh /docker-entrypoint.sh 22 | 23 | USER thumbor 24 | WORKDIR /usr/local/thumbor 25 | ENV HOME /usr/local/thumbor 26 | 27 | ENTRYPOINT ["/docker-entrypoint.sh"] 28 | CMD ["thumbor"] 29 | 30 | EXPOSE 8888 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Michael Hirschler 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /6/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.8 2 | MAINTAINER Michael Hirschler 3 | RUN apk add --no-cache --virtual .build-deps \ 4 | cairo-dev \ 5 | curl-dev \ 6 | gcc \ 7 | libc-dev \ 8 | libjpeg-turbo-dev \ 9 | libffi-dev \ 10 | libressl-dev \ 11 | libwebp-dev \ 12 | python-dev \ 13 | tiff-dev \ 14 | zlib-dev \ 15 | && apk add --no-cache \ 16 | cairo \ 17 | coreutils \ 18 | exiftool \ 19 | ffmpeg \ 20 | gifsicle \ 21 | imagemagick \ 22 | libcurl \ 23 | libjpeg-turbo \ 24 | libvpx \ 25 | libwebp \ 26 | python \ 27 | py-pip \ 28 | tiff \ 29 | zlib \ 30 | && pip install --no-cache-dir thumbor==6.7.5 envtpl==0.6.0 \ 31 | && apk del .build-deps \ 32 | && rm -rf /var/cache/apk/* \ 33 | && rm -rf /root/.cache 34 | 35 | COPY thumbor.conf.tpl /usr/local/etc/thumbor.conf.tpl 36 | COPY docker-entrypoint.sh /docker-entrypoint.sh 37 | 38 | WORKDIR /usr/local/thumbor 39 | 40 | ENTRYPOINT ["/docker-entrypoint.sh"] 41 | CMD ["thumbor"] 42 | 43 | EXPOSE 8888 44 | -------------------------------------------------------------------------------- /7/fundamentals/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim as mozjpeg 2 | ENV VERSION 3.3.1 3 | 4 | RUN apt-get update && \ 5 | apt-get install -y --no-install-recommends autoconf automake checkinstall libpng-dev libtool make nasm pkg-config && \ 6 | rm -rf /var/lib/apt/lists/* 7 | 8 | ADD https://github.com/mozilla/mozjpeg/archive/v$VERSION.tar.gz /usr/local/share 9 | 10 | WORKDIR /usr/local/share 11 | RUN mkdir mozjpeg && \ 12 | tar --strip-components=1 --extract --file v$VERSION.tar.gz -C mozjpeg mozjpeg-$VERSION/ 13 | 14 | WORKDIR /usr/local/share/mozjpeg 15 | RUN autoreconf -fiv && \ 16 | mkdir build 17 | 18 | WORKDIR /usr/local/share/mozjpeg/build 19 | RUN ../configure && make 20 | 21 | 22 | FROM mvhirsch/thumbor:7.5.2 23 | 24 | RUN pip install --user --no-cache-dir thumbor-aws==0.6.0 thumbor-plugins 25 | 26 | COPY --from=mozjpeg /usr/local/share/mozjpeg/build /usr/local/share/mozjpeg/build 27 | RUN ln -s /usr/local/share/mozjpeg/build/cjpeg /usr/local/bin/mozjpeg 28 | 29 | RUN apt-get update && \ 30 | apt-get install -y --no-install-recommends pngquant && \ 31 | rm -rf /var/lib/apt/lists/* 32 | 33 | COPY fundamentals.sh /docker-entrypoint.init.d/ 34 | -------------------------------------------------------------------------------- /6/fundamentals/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim as mozjpeg 2 | ENV VERSION 3.3.1 3 | 4 | RUN apt-get update && \ 5 | apt-get install -y --no-install-recommends autoconf automake checkinstall libpng-dev libtool make nasm pkg-config && \ 6 | rm -rf /var/lib/apt/lists/* 7 | 8 | ADD https://github.com/mozilla/mozjpeg/archive/v$VERSION.tar.gz /usr/local/share 9 | 10 | WORKDIR /usr/local/share 11 | RUN mkdir mozjpeg && \ 12 | tar --strip-components=1 --extract --file v$VERSION.tar.gz -C mozjpeg mozjpeg-$VERSION/ 13 | 14 | WORKDIR /usr/local/share/mozjpeg 15 | RUN autoreconf -fiv && \ 16 | mkdir build 17 | 18 | WORKDIR /usr/local/share/mozjpeg/build 19 | RUN ../configure && make 20 | 21 | 22 | # thumbor-fundamentals 23 | FROM mvhirsch/thumbor:slim 24 | MAINTAINER Michael Hirschler 25 | 26 | USER root 27 | 28 | RUN apt-get update && \ 29 | apt-get install -y --no-install-recommends pngquant && \ 30 | rm -rf /var/lib/apt/lists/* 31 | 32 | # install jpegtran (with mozjpeg) 33 | COPY --from=mozjpeg /usr/local/share/mozjpeg/build /usr/local/share/mozjpeg/build 34 | RUN ln -s /usr/local/share/mozjpeg/build/cjpeg /usr/local/bin/mozjpeg 35 | 36 | RUN pip install --no-cache-dir thumbor-plugins tc_mongodb tc_aws CairoSVG==1.0.22 sentry-sdk==0.10.2 37 | 38 | ENV OPTIMIZERS="['thumbor_plugins.optimizers.pngquant', 'thumbor_plugins.optimizers.mozjpeg']" 39 | 40 | COPY docker-entrypoint.sh /docker-entrypoint.init.d/ 41 | USER thumbor 42 | -------------------------------------------------------------------------------- /7/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | MAINTAINER Michael Hirschler 3 | 4 | RUN groupadd --gid 1000 thumbor \ 5 | && useradd --uid 1000 --gid thumbor --shell /bin/sh thumbor 6 | 7 | RUN mkdir /usr/local/thumbor 8 | ENV HOME /usr/local/thumbor 9 | ENV PATH $PATH:/usr/local/thumbor/.local/bin 10 | ENV OPTIMIZERS "['thumbor.optimizers.jpegtran']" 11 | 12 | RUN apt-get update \ 13 | && apt-get install --yes --quiet --no-install-recommends \ 14 | gcc g++ python3-dev python3-all-dev \ 15 | # libraries: py3exiv2 deps 16 | libexiv2-dev libboost-python-dev \ 17 | # libraries: pycurl deps (libcurl4 is required at runtime) 18 | libcurl4-openssl-dev libgnutls28-dev libssl-dev libcurl4 \ 19 | # libraries: cairosvg deps (libcairo2 is required at runtime) 20 | libffi-dev libcairo2 \ 21 | # extensions 22 | libjpeg-progs gifsicle \ 23 | && ln -s /usr/lib/x86_64-linux-gnu/libboost_python39.so /usr/local/lib/libboost_python310.so \ 24 | && pip install --user --no-cache-dir cairosvg pycurl py3exiv2 thumbor==7.5.2 envtpl==0.7.2 \ 25 | && apt-get autoremove --yes gcc g++ libffi-dev python3-dev python3-all-dev libcurl4-openssl-dev libgnutls28-dev libexiv2-dev \ 26 | && rm -rf /var/lib/apt/lists/* \ 27 | && chown -R thumbor:thumbor /usr/local/thumbor 28 | 29 | WORKDIR /usr/local/thumbor 30 | COPY --chown=thumbor:thumbor thumbor.conf.tpl /usr/local/etc/thumbor.conf.tpl 31 | COPY docker-entrypoint.sh /docker-entrypoint.sh 32 | 33 | ENTRYPOINT ["/docker-entrypoint.sh"] 34 | CMD ["thumbor"] 35 | 36 | EXPOSE 8888 37 | -------------------------------------------------------------------------------- /7/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-alpine 2 | MAINTAINER Michael Hirschler 3 | 4 | RUN apk add --update --no-cache \ 5 | cairo \ 6 | exiftool \ 7 | gifsicle \ 8 | openjpeg-tools \ 9 | imagemagick \ 10 | libcurl \ 11 | libjpeg-turbo \ 12 | libvpx \ 13 | libwebp \ 14 | tiff \ 15 | zlib \ 16 | libc-dev binutils \ 17 | && rm -rf /var/cache/apk/* 18 | 19 | RUN apk add --update --no-cache --virtual .build-deps \ 20 | blas-dev \ 21 | eigen-dev \ 22 | ffmpeg-dev \ 23 | freetype-dev \ 24 | glew-dev \ 25 | gstreamer-dev \ 26 | harfbuzz-dev \ 27 | hdf5-dev \ 28 | lapack-dev \ 29 | libdc1394-dev \ 30 | libgphoto2-dev \ 31 | libtbb-dev \ 32 | mesa-dev \ 33 | openexr-dev \ 34 | openjpeg-dev \ 35 | py3-setuptools \ 36 | qt5-qtbase-dev \ 37 | vtk-dev \ 38 | cmake \ 39 | samurai \ 40 | python3-dev \ 41 | cairo-dev \ 42 | curl-dev \ 43 | gcc \ 44 | g++ \ 45 | libjpeg-turbo-dev \ 46 | libffi-dev \ 47 | libressl-dev \ 48 | libwebp-dev \ 49 | python3-dev \ 50 | tiff-dev \ 51 | zlib-dev \ 52 | && pip install --no-cache numpy \ 53 | && pip install --no-cache-dir thumbor==7.5.2 envtpl==0.7.2 \ 54 | && apk del .build-deps \ 55 | && rm -rf /var/cache/apk/* \ 56 | && rm -rf /root/.cache 57 | 58 | COPY thumbor.conf.tpl /usr/local/etc/thumbor.conf.tpl 59 | COPY docker-entrypoint.sh /docker-entrypoint.sh 60 | 61 | WORKDIR /usr/local/thumbor 62 | 63 | ENTRYPOINT ["/docker-entrypoint.sh"] 64 | CMD ["thumbor"] 65 | 66 | EXPOSE 8888 67 | -------------------------------------------------------------------------------- /tests.html: -------------------------------------------------------------------------------- 1 |

original

2 | 3 | 4 |

thumborized

5 | 6 | 7 |

crop

8 | 9 | 10 |

smart crop

11 | 12 | 13 |

oversize

14 | 15 | 16 |

jpeg

17 | 18 | 19 |

jpeg2000

20 | 21 | 22 |

webp

23 | 24 | 25 |

png

26 | 27 | -------------------------------------------------------------------------------- /tests.php: -------------------------------------------------------------------------------- 1 | 51 | 52 |

Images

53 | 54 | 56 | 57 |

58 | 59 | 68 | 71 | 73 |
69 | 70 |
74 | 76 | 77 |

Gifs/Videos

78 | 79 | 81 |

82 | 83 | 87 | 92 | 94 | 97 | 100 |
88 | 91 | 95 | 96 |
101 | 83 | AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY: 84 | 85 | # configure storage (cache) 86 | STORAGE: thumbor_aws.storage 87 | AWS_STORAGE_ROOT_PATH: /storage 88 | AWS_STORAGE_BUCKET_NAME: thumbor 89 | AWS_STORAGE_S3_ACCESS_KEY_ID: 90 | AWS_STORAGE_S3_SECRET_ACCESS_KEY: 91 | ``` 92 | -------------------------------------------------------------------------------- /7/fundamentals/fundamentals.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # mozjpeg 4 | echo "MOZJPEG_PATH = '/usr/local/bin/mozjpeg'" >> /usr/local/thumbor/thumbor.conf 5 | echo "MOZJPEG_QUALITY = 80" >> /usr/local/thumbor/thumbor.conf 6 | 7 | # pngquant 8 | echo "PNGQUANT_PATH = '/usr/bin/pngquant'" >> /usr/local/thumbor/thumbor.conf 9 | echo "PNGQUANT_SPEED = 3" >> /usr/local/thumbor/thumbor.conf 10 | 11 | # set OPTIMIZERS 12 | echo "OPTIMIZERS = ['thumbor_plugins.optimizers.mozjpeg', 'thumbor_plugins.optimizers.pngquant']" >> /usr/local/thumbor/thumbor.conf 13 | 14 | # configure AWS 15 | AWS=$(cat <> /usr/local/thumbor/thumbor.conf 93 | -------------------------------------------------------------------------------- /7/slim/thumbor.conf.tpl: -------------------------------------------------------------------------------- 1 | ################################### Logging #################################### 2 | 3 | ## Logging configuration as json 4 | ## Defaults to: None 5 | THUMBOR_LOG_CONFIG = {{ THUMBOR_LOG_CONFIG | default(None) }} 6 | 7 | ## Log Format to be used by thumbor when writing log messages. 8 | ## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s 9 | THUMBOR_LOG_FORMAT = '{{ THUMBOR_LOG_FORMAT | default('%(asctime)s %(name)s:%(levelname)s %(message)s') }}' 10 | 11 | ## Date Format to be used by thumbor when writing log messages. 12 | ## Defaults to: %Y-%m-%d %H:%M:%S 13 | THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT | default('%Y-%m-%d %H:%M:%S') }}' 14 | 15 | ################################################################################ 16 | 17 | 18 | ################################### Imaging #################################### 19 | 20 | ## Max width in pixels for images read or generated by thumbor 21 | ## Defaults to: 0 22 | MAX_WIDTH = {{ MAX_WIDTH | default(0) }} 23 | 24 | ## Max height in pixels for images read or generated by thumbor 25 | ## Defaults to: 0 26 | MAX_HEIGHT = {{ MAX_HEIGHT | default(0) }} 27 | 28 | ## Max pixel count for images read by thumbor. Set to prevent decompression bomb DOS attack. 29 | ## Defaults to: 75000000 pixels 30 | MAX_PIXELS = {{ MAX_PIXELS | default(75000000) }} 31 | 32 | ## Min width in pixels for images read or generated by thumbor 33 | ## Defaults to: 1 34 | MIN_WIDTH = {{ MIN_WIDTH | default(1) }} 35 | 36 | ## Min width in pixels for images read or generated by thumbor 37 | ## Defaults to: 1 38 | MIN_HEIGHT = {{ MIN_HEIGHT | default(1) }} 39 | 40 | ## Allowed domains for the http loader to download. These are regular 41 | ## expressions. 42 | ## Defaults to: [] 43 | ALLOWED_SOURCES = {{ ALLOWED_SOURCES | default([]) }} 44 | 45 | 46 | ## Quality index used for generated JPEG images 47 | ## Defaults to: 80 48 | QUALITY = {{ QUALITY | default(80) }} 49 | 50 | ## Exports JPEG images with the progressive flag set. 51 | ## Defaults to: True 52 | PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} 53 | 54 | ## Specify subsampling behavior for Pillow (see `subsampling` in 55 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 56 | ## formats.html#jpeg).Be careful to use int for 0,1,2 and string for "4:4:4" 57 | ## notation. Will ignore `quality`. Using `keep` will copy the original file's 58 | ## subsampling. 59 | ## Defaults to: None 60 | PILLOW_JPEG_SUBSAMPLING = {{ PILLOW_JPEG_SUBSAMPLING | default(None) }} 61 | 62 | ## Specify quantization tables for Pillow (see `qtables` in 63 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 64 | ## formats.html#jpeg). Will ignore `quality`. Using `keep` will copy the 65 | ## original file's qtables. 66 | ## Defaults to: None 67 | PILLOW_JPEG_QTABLES = {{ PILLOW_JPEG_QTABLES | default(None) }} 68 | 69 | ## Specify resampling filter for Pillow resize method.One of LANCZOS, NEAREST, 70 | ## BILINEAR, BICUBIC, HAMMING (Pillow>=3.4.0). 71 | ## Defaults to: 'LANCZOS' 72 | PILLOW_RESAMPLING_FILTER = '{{ PILLOW_RESAMPLING_FILTER | default('LANCZOS') }}' 73 | 74 | ## Quality index used for generated WebP images. If not set (None) the same level 75 | ## of JPEG quality will be used. 76 | ## Defaults to: None 77 | WEBP_QUALITY = {{ WEBP_QUALITY | default(None) }} 78 | 79 | 80 | ## Compression level for generated PNG images. 81 | ## Defaults to: 6 82 | PNG_COMPRESSION_LEVEL = {{ PNG_COMPRESSION_LEVEL | default(6) }} 83 | 84 | ## Indicates if final image should preserve indexed mode (P or 1) of original 85 | ## image 86 | ## Defaults to: True 87 | PILLOW_PRESERVE_INDEXED_MODE = {{ PILLOW_PRESERVE_INDEXED_MODE | default(True) }} 88 | 89 | ## Specifies whether WebP format should be used automatically if the request 90 | ## accepts it (via Accept header) 91 | ## Defaults to: False 92 | AUTO_WEBP = {{ AUTO_WEBP | default(False) }} 93 | 94 | ## Specifies whether a PNG image should be used automatically if the png image 95 | ## has no transparency (via alpha layer). WARNING: Depending on case, this is 96 | ## not a good deal. This transformation maybe causes distortions or the size 97 | ## of image can increase. Images with texts, for example, the result image 98 | ## maybe will be distorced. Dark images, for example, the size of result image 99 | ## maybe will be bigger. You have to evaluate the majority of your use cases 100 | ## to take a decision about the usage of this conf. 101 | ## Defaults to: False 102 | AUTO_PNG_TO_JPG = {{ AUTO_PNG_TO_JPG | default(False) }} 103 | 104 | ## Specify the ratio between 1in and 1px for SVG images. This is only used 105 | ## whenrasterizing SVG images having their size units in cm or inches. 106 | ## Defaults to: 150 107 | SVG_DPI = {{ SVG_DPI | default(150) }} 108 | 109 | ## Max AGE sent as a header for the image served by thumbor in seconds 110 | ## Defaults to: 86400 111 | MAX_AGE = {{ MAX_AGE | default(86400) }} 112 | 113 | ## Indicates the Max AGE header in seconds for temporary images (images with 114 | ## failed smart detection) 115 | ## Defaults to: 0 116 | MAX_AGE_TEMP_IMAGE = {{ MAX_AGE_TEMP_IMAGE | default(0) }} 117 | 118 | ## Indicates whether thumbor should rotate images that have an Orientation EXIF 119 | ## header 120 | ## Defaults to: False 121 | RESPECT_ORIENTATION = {{ RESPECT_ORIENTATION | default(False) }} 122 | 123 | ## Ignore errors during smart detections and return image as a temp image (not 124 | ## saved in result storage and with MAX_AGE_TEMP_IMAGE age) 125 | ## Defaults to: False 126 | IGNORE_SMART_ERRORS = {{ IGNORE_SMART_ERRORS | default(False) }} 127 | 128 | ## Sends If-Modified-Since & Last-Modified headers; requires support from result 129 | ## storage 130 | ## Defaults to: False 131 | SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = {{ SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS | default(False) }} 132 | 133 | ## Preserves exif information in generated images. Increases image size in 134 | ## kbytes, use with caution. 135 | ## Defaults to: False 136 | PRESERVE_EXIF_INFO = {{ PRESERVE_EXIF_INFO | default(False) }} 137 | 138 | ## Indicates whether thumbor should enable the EXPERIMENTAL support for animated 139 | ## gifs. 140 | ## Defaults to: True 141 | ALLOW_ANIMATED_GIFS = {{ ALLOW_ANIMATED_GIFS | default(True) }} 142 | 143 | ## Indicates whether thumbor should use gifsicle engine. Please note that smart 144 | ## cropping and filters are not supported for gifs using gifsicle (but won't 145 | ## give an error). 146 | ## Defaults to: False 147 | USE_GIFSICLE_ENGINE = {{ USE_GIFSICLE_ENGINE | default(False) }} 148 | 149 | ## Indicates whether thumbor should enable blacklist functionality to prevent 150 | ## processing certain images. 151 | ## Defaults to: False 152 | USE_BLACKLIST = {{ USE_BLACKLIST | default(False) }} 153 | 154 | ## Size of the thread pool used for image transformations. The default value is 155 | ## 0 (don't use a threadpoool. Increase this if you are seeing your IOLoop 156 | ## getting blocked (often indicated by your upstream HTTP requests timing out) 157 | ## Defaults to: 0 158 | ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE | default(0) }} 159 | 160 | 161 | 162 | ################################################################################ 163 | 164 | 165 | ################################ Extensibility ################################# 166 | 167 | ## The metrics backend thumbor should use to measure internal actions. This must 168 | ## be the full name of a python module (python must be able to import it) 169 | ## Defaults to: 'thumbor.metrics.logger_metrics' 170 | METRICS = '{{ METRICS | default('thumbor.metrics.logger_metrics') }}' 171 | 172 | ## The loader thumbor should use to load the original image. This must be the 173 | ## full name of a python module (python must be able to import it) 174 | ## Defaults to: thumbor.loaders.http_loader 175 | LOADER = '{{ LOADER | default('thumbor.loaders.http_loader') }}' 176 | 177 | ## The file storage thumbor should use to store original images. This must be the 178 | ## full name of a python module (python must be able to import it) 179 | ## Defaults to: thumbor.storages.file_storage 180 | STORAGE = '{{ STORAGE | default('thumbor.storages.file_storage') }}' 181 | 182 | ## The result storage thumbor should use to store generated images. This must be 183 | ## the full name of a python module (python must be able to import it) 184 | ## Defaults to: None 185 | RESULT_STORAGE = '{{ RESULT_STORAGE | default('thumbor.result_storages.file_storage') }}' 186 | 187 | ## The imaging engine thumbor should use to perform image operations. This must 188 | ## be the full name of a python module (python must be able to import it) 189 | ## Defaults to: thumbor.engines.pil 190 | ENGINE = '{{ ENGINE | default('thumbor.engines.pil') }}' 191 | 192 | ## The gif engine thumbor should use to perform image operations. This must be 193 | ## the full name of a python module (python must be able to import it) 194 | ## Defaults to: 'thumbor.engines.gif' 195 | GIF_ENGINE = '{{ GIF_ENGINE | default('thumbor.engines.gif') }}' 196 | 197 | ## The url signer thumbor should use to verify url signatures.This must be the 198 | ## full name of a python module (python must be able to import it) 199 | ## Defaults to: 'libthumbor.url_signers.base64_hmac_sha1' 200 | URL_SIGNER = '{{ URL_SIGNER | default('libthumbor.url_signers.base64_hmac_sha1') }}' 201 | 202 | ################################################################################ 203 | 204 | 205 | ################################### Security ################################### 206 | 207 | ## The security key thumbor uses to sign image URLs 208 | ## Defaults to: MY_SECURE_KEY 209 | SECURITY_KEY = '{{ SECURITY_KEY | default('MY_SECURE_KEY') }}' 210 | 211 | ## Indicates if the /unsafe URL should be available 212 | ## Defaults to: True 213 | ALLOW_UNSAFE_URL = {{ ALLOW_UNSAFE_URL | default(True) }} 214 | 215 | ################################################################################ 216 | 217 | ##################################### HTTP ##################################### 218 | 219 | ## Enables automatically generated etags 220 | ## Defaults to: True 221 | ENABLE_ETAGS = {{ ENABLE_ETAGS | default(True) }} 222 | 223 | ################################################################################ 224 | 225 | 226 | ################################### Storage #################################### 227 | 228 | ## Set maximum id length for images when stored 229 | ## Defaults to: 32 230 | MAX_ID_LENGTH = {{ MAX_ID_LENGTH | default(32) }} 231 | 232 | ################################################################################ 233 | 234 | 235 | ################################# Performance ################################## 236 | 237 | ## Set garbage collection interval in seconds 238 | ## Defaults to: None 239 | GC_INTERVAL = {{ GC_INTERVAL | default(None) }} 240 | 241 | ################################################################################ 242 | 243 | 244 | ################################# Healthcheck ################################## 245 | 246 | ## Healthcheck route. 247 | ## Defaults to: '/healthcheck/?' 248 | HEALTHCHECK_ROUTE = '{{ HEALTHCHECK_ROUTE | default('/healthcheck/?') }}' 249 | 250 | ################################################################################ 251 | 252 | 253 | ################################### Metrics #################################### 254 | 255 | ## Host to send statsd instrumentation to 256 | ## Defaults to: None 257 | STATSD_HOST = {{ STATSD_HOST | default(None) }} 258 | 259 | ## Port to send statsd instrumentation to 260 | ## Defaults to: 8125 261 | STATSD_PORT = {{ STATSD_PORT | default(8125) }} 262 | 263 | ## Prefix for statsd 264 | ## Defaults to: None 265 | STATSD_PREFIX = {{ STATSD_PREFIX | default(None) }} 266 | 267 | ################################################################################ 268 | 269 | ################################# File Loader ################################## 270 | 271 | ## The root path where the File Loader will try to find images 272 | ## Defaults to: '/usr/local/thumbor' 273 | FILE_LOADER_ROOT_PATH = '{{ FILE_LOADER_ROOT_PATH | default('/usr/local/thumbor/loader') }}' 274 | 275 | ################################################################################ 276 | 277 | 278 | ################################# HTTP Loader ################################## 279 | 280 | ## The maximum number of seconds libcurl can take to connect to an image being 281 | ## loaded 282 | ## Defaults to: 5 283 | HTTP_LOADER_CONNECT_TIMEOUT = {{ HTTP_LOADER_CONNECT_TIMEOUT | default(5) }} 284 | 285 | ## The maximum number of seconds libcurl can take to download an image 286 | ## Defaults to: 20 287 | HTTP_LOADER_REQUEST_TIMEOUT = {{ HTTP_LOADER_REQUEST_TIMEOUT | default(20) }} 288 | 289 | ## Indicates whether libcurl should follow redirects when downloading an image 290 | ## Defaults to: True 291 | HTTP_LOADER_FOLLOW_REDIRECTS = {{ HTTP_LOADER_FOLLOW_REDIRECTS | default(True) }} 292 | 293 | ## Indicates the number of redirects libcurl should follow when downloading an 294 | ## image 295 | ## Defaults to: 5 296 | HTTP_LOADER_MAX_REDIRECTS = {{ HTTP_LOADER_MAX_REDIRECTS | default(5) }} 297 | 298 | ## The maximum number of simultaneous HTTP connections the loader can make before 299 | ## queuing 300 | ## Defaults to: 10 301 | HTTP_LOADER_MAX_CLIENTS = {{ HTTP_LOADER_MAX_CLIENTS | default(10) }} 302 | 303 | ## Indicates whether thumbor should forward the user agent of the requesting user 304 | ## Defaults to: False 305 | HTTP_LOADER_FORWARD_USER_AGENT = {{ HTTP_LOADER_FORWARD_USER_AGENT | default(False) }} 306 | 307 | ## Indicates whether thumbor should forward the headers of the request 308 | ## Defaults to: False 309 | HTTP_LOADER_FORWARD_ALL_HEADERS = {{ HTTP_LOADER_FORWARD_ALL_HEADERS | default(False) }} 310 | 311 | ## Indicates which headers should be forwarded among all the headers of the 312 | ## request 313 | ## Defaults to: [] 314 | HTTP_LOADER_FORWARD_HEADERS_WHITELIST = {{ HTTP_LOADER_FORWARD_HEADERS_WHITELIST | default([]) }} 315 | 316 | ## Default user agent for thumbor http loader requests 317 | ## Defaults to: Thumbor/7.5.2 318 | HTTP_LOADER_DEFAULT_USER_AGENT = '{{ HTTP_LOADER_DEFAULT_USER_AGENT | default('Thumbor/7.5.2') }}' 319 | 320 | ## The proxy host needed to load images through 321 | ## Defaults to: None 322 | HTTP_LOADER_PROXY_HOST = {{ HTTP_LOADER_PROXY_HOST | default(None) }} 323 | 324 | ## The proxy port for the proxy host 325 | ## Defaults to: None 326 | HTTP_LOADER_PROXY_PORT = {{ HTTP_LOADER_PROXY_PORT | default(None) }} 327 | 328 | ## The proxy username for the proxy host 329 | ## Defaults to: None 330 | HTTP_LOADER_PROXY_USERNAME = {{ HTTP_LOADER_PROXY_USERNAME | default(None) }} 331 | 332 | ## The proxy password for the proxy host 333 | ## Defaults to: None 334 | HTTP_LOADER_PROXY_PASSWORD = {{ HTTP_LOADER_PROXY_PASSWORD | default(None) }} 335 | 336 | ## The filename of CA certificates in PEM format 337 | ## Defaults to: None 338 | HTTP_LOADER_CA_CERTS = {{ HTTP_LOADER_CA_CERTS | default(None) }} 339 | 340 | ## Validate the servers certificate for HTTPS requests 341 | ## Defaults to: None 342 | HTTP_LOADER_VALIDATE_CERTS = {{ HTTP_LOADER_VALIDATE_CERTS | default(None) }} 343 | 344 | ## The filename for client SSL key 345 | ## Defaults to: None 346 | HTTP_LOADER_CLIENT_KEY = {{ HTTP_LOADER_CLIENT_KEY | default(None) }} 347 | 348 | ## The filename for client SSL certificate 349 | ## Defaults to: None 350 | HTTP_LOADER_CLIENT_CERT = {{ HTTP_LOADER_CLIENT_CERT | default(None) }} 351 | 352 | ## If the CurlAsyncHTTPClient should be used 353 | ## Defaults to: False 354 | HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT | default(False) }} 355 | 356 | ################################################################################ 357 | 358 | 359 | ################################### General #################################### 360 | 361 | ## If HTTP_LOADER_CURL_LOW_SPEED_LIMIT and HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT are 362 | ## set, then this is the time in seconds as integer after a download should 363 | ## timeout if the speed is below HTTP_LOADER_CURL_LOW_SPEED_LIMIT for that 364 | ## long 365 | ## Defaults to: 0 366 | HTTP_LOADER_CURL_LOW_SPEED_TIME = {{ HTTP_LOADER_CURL_LOW_SPEED_TIME | default(0) }} 367 | 368 | ## If HTTP_LOADER_CURL_LOW_SPEED_TIME and HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT are 369 | ## set, then this is the limit in bytes per second as integer which should 370 | ## timeout if the speed is below that limit for 371 | ## HTTP_LOADER_CURL_LOW_SPEED_TIME seconds 372 | ## Defaults to: 0 373 | HTTP_LOADER_CURL_LOW_SPEED_LIMIT = {{ HTTP_LOADER_CURL_LOW_SPEED_LIMIT | default(0) }} 374 | 375 | ## Custom app class to override ThumborServiceApp. This config value is 376 | ## overridden by the -a command-line parameter. 377 | ## Defaults to: 'thumbor.app.ThumborServiceApp' 378 | APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' 379 | 380 | ################################################################################ 381 | 382 | 383 | ################################# File Storage ################################# 384 | 385 | ## Expiration in seconds for the images in the File Storage. Defaults to one 386 | ## month 387 | ## Defaults to: 2592000 388 | STORAGE_EXPIRATION_SECONDS = {{ STORAGE_EXPIRATION_SECONDS | default(2592000) }} 389 | 390 | ## Indicates whether thumbor should store the signing key for each image in the 391 | ## file storage. This allows the key to be changed and old images to still be 392 | ## properly found 393 | ## Defaults to: False 394 | STORES_CRYPTO_KEY_FOR_EACH_IMAGE = {{ STORES_CRYPTO_KEY_FOR_EACH_IMAGE | default(False) }} 395 | 396 | ## The root path where the File Storage will try to find images 397 | ## Defaults to: /tmp/thumbor/storage 398 | FILE_STORAGE_ROOT_PATH = '{{ FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/storage') }}' 399 | 400 | ################################################################################ 401 | 402 | 403 | #################################### Upload #################################### 404 | 405 | ## Max size in Kb for images uploaded to thumbor 406 | ## Aliases: MAX_SIZE 407 | ## Defaults to: 0 408 | UPLOAD_MAX_SIZE = {{ UPLOAD_MAX_SIZE | default(0) }} 409 | 410 | ## Indicates whether thumbor should enable File uploads 411 | ## Aliases: ENABLE_ORIGINAL_PHOTO_UPLOAD 412 | ## Defaults to: False 413 | UPLOAD_ENABLED = {{ UPLOAD_ENABLED | default(False) }} 414 | 415 | ## The type of storage to store uploaded images with 416 | ## Aliases: ORIGINAL_PHOTO_STORAGE 417 | ## Defaults to: thumbor.storages.file_storage 418 | UPLOAD_PHOTO_STORAGE = '{{ UPLOAD_PHOTO_STORAGE | default('thumbor.storages.file_storage') }}' 419 | 420 | ## Indicates whether image deletion should be allowed 421 | ## Aliases: ALLOW_ORIGINAL_PHOTO_DELETION 422 | ## Defaults to: False 423 | UPLOAD_DELETE_ALLOWED = {{ UPLOAD_DELETE_ALLOWED | default(False) }} 424 | 425 | ## Indicates whether image overwrite should be allowed 426 | ## Aliases: ALLOW_ORIGINAL_PHOTO_PUTTING 427 | ## Defaults to: False 428 | UPLOAD_PUT_ALLOWED = {{ UPLOAD_PUT_ALLOWED | default(False) }} 429 | 430 | ## Default filename for image uploaded 431 | ## Defaults to: image 432 | UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME | default('image') }}' 433 | 434 | ################################################################################ 435 | 436 | 437 | ################################# Mixed Storage ################################# 438 | 439 | ## Mixed Storage file storage. This must be the full name of a python module 440 | ## (python must be able to import it) 441 | ## Defaults to: 'thumbor.storages.no_storage' 442 | MIXED_STORAGE_FILE_STORAGE = '{{ MIXED_STORAGE_FILE_STORAGE | default('thumbor.storages.no_storage') }}' 443 | 444 | ## Mixed Storage signing key storage. This must be the full name of a python 445 | ## module (python must be able to import it) 446 | ## Defaults to: 'thumbor.storages.no_storage' 447 | MIXED_STORAGE_CRYPTO_STORAGE = '{{ MIXED_STORAGE_CRYPTO_STORAGE | default('thumbor.storages.no_storage') }}' 448 | 449 | ## Mixed Storage detector information storage. This must be the full name of a 450 | ## python module (python must be able to import it) 451 | ## Defaults to: 'thumbor.storages.no_storage' 452 | MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE | default('thumbor.storages.no_storage') }}' 453 | 454 | ################################################################################ 455 | 456 | 457 | ##################################### Meta ##################################### 458 | 459 | ## The callback function name that should be used by the META route for JSONP 460 | ## access 461 | ## Defaults to: None 462 | META_CALLBACK_NAME = {{ META_CALLBACK_NAME | default(None) }} 463 | 464 | ################################################################################ 465 | 466 | 467 | ################################## Detection ################################### 468 | 469 | ## List of detectors that thumbor should use to find faces and/or features. All 470 | ## of them must be full names of python modules (python must be able to import 471 | ## it) 472 | ## Defaults to: [] 473 | DETECTORS = {{ DETECTORS | default([]) }} 474 | 475 | ## The cascade file that opencv will use to detect faces 476 | ## Defaults to: haarcascade_frontalface_alt.xml 477 | FACE_DETECTOR_CASCADE_FILE = '{{ FACE_DETECTOR_CASCADE_FILE | default('haarcascade_frontalface_alt.xml') }}' 478 | 479 | ## The cascade file that opencv will use to detect glasses. 480 | ## Defaults to: 'haarcascade_eye_tree_eyeglasses.xml' 481 | GLASSES_DETECTOR_CASCADE_FILE = '{{ GLASSES_DETECTOR_CASCADE_FILE | default('haarcascade_eye_tree_eyeglasses.xml') }}' 482 | 483 | ## The cascade file that opencv will use to detect profile faces. 484 | ## Defaults to: 'haarcascade_profileface.xml' 485 | PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE | default('haarcascade_profileface.xml') }}' 486 | 487 | ################################################################################ 488 | 489 | 490 | ################################## Optimizers ################################## 491 | 492 | ## List of optimizers that thumbor will use to optimize images 493 | ## Defaults to: [] --> ['thumbor.optimizers.jpegtran',] 494 | OPTIMIZERS = {{ OPTIMIZERS | default([]) }} 495 | 496 | 497 | ## Path for the jpegtran binary 498 | ## Defaults to: /usr/bin/jpegtran 499 | JPEGTRAN_PATH = '{{ JPEGTRAN_PATH | default('/usr/bin/jpegtran') }}' 500 | 501 | ## Path for the progressive scans file to use with jpegtran optimizer. Implies 502 | ## progressive jpeg output 503 | ## Defaults to: '' 504 | JPEGTRAN_SCANS_FILE = '{{ JPEGTRAN_SCANS_FILE | default('') }}' 505 | 506 | ## Path for the ffmpeg binary used to generate gifv(h.264) 507 | ## Defaults to: '/usr/local/bin/ffmpeg' 508 | FFMPEG_PATH = '{{ FFMPEG_PATH | default('/usr/bin/ffmpeg') }}' 509 | 510 | ################################################################################ 511 | 512 | 513 | ################################### Filters #################################### 514 | 515 | ## List of filters that thumbor will allow to be used in generated images. All of 516 | ## them must be full names of python modules (python must be able to import 517 | ## it) 518 | ## Defaults to: [ 519 | # 'thumbor.filters.brightness', 520 | # 'thumbor.filters.colorize', 521 | # 'thumbor.filters.contrast', 522 | # 'thumbor.filters.rgb', 523 | # 'thumbor.filters.round_corner', 524 | # 'thumbor.filters.quality', 525 | # 'thumbor.filters.noise', 526 | # 'thumbor.filters.watermark', 527 | # 'thumbor.filters.equalize', 528 | # 'thumbor.filters.fill', 529 | # 'thumbor.filters.sharpen', 530 | # 'thumbor.filters.strip_exif', 531 | # 'thumbor.filters.strip_icc', 532 | # 'thumbor.filters.frame', 533 | # 'thumbor.filters.grayscale', 534 | # 'thumbor.filters.rotate', 535 | # 'thumbor.filters.format', 536 | # 'thumbor.filters.max_bytes', 537 | # 'thumbor.filters.convolution', 538 | # 'thumbor.filters.blur', 539 | # 'thumbor.filters.extract_focal', 540 | # 'thumbor.filters.focal', 541 | # 'thumbor.filters.no_upscale', 542 | # 'thumbor.filters.saturation', 543 | # 'thumbor.filters.max_age', 544 | # 'thumbor.filters.curve', 545 | # 'thumbor.filters.background_color', 546 | # 'thumbor.filters.upscale', 547 | # 'thumbor.filters.proportion', 548 | # 'thumbor.filters.stretch', 549 | #] 550 | {% if FILTERS is defined %} 551 | FILTERS = {{ FILTERS }} 552 | {% endif %} 553 | 554 | ################################################################################ 555 | 556 | 557 | ################################ Result Storage ################################ 558 | 559 | ## Expiration in seconds of generated images in the result storage 560 | ## Defaults to: 0 561 | RESULT_STORAGE_EXPIRATION_SECONDS = {{ RESULT_STORAGE_EXPIRATION_SECONDS | default(0) }} 562 | 563 | ## Path where the Result storage will store generated images 564 | ## Defaults to: /tmp/thumbor/result_storage 565 | RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '{{ RESULT_STORAGE_FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/result_storage') }}' 566 | 567 | ## Indicates whether unsafe requests should also be stored in the Result Storage 568 | ## Defaults to: False 569 | RESULT_STORAGE_STORES_UNSAFE = {{ RESULT_STORAGE_STORES_UNSAFE | default(False) }} 570 | 571 | ################################################################################ 572 | 573 | 574 | ############################ Queued Redis Detector ############################# 575 | 576 | ## Server host for the queued redis detector 577 | ## Defaults to: localhost 578 | REDIS_QUEUE_SERVER_HOST = '{{ REDIS_QUEUE_SERVER_HOST | default('localhost') }}' 579 | 580 | ## Server port for the queued redis detector 581 | ## Defaults to: 6379 582 | REDIS_QUEUE_SERVER_PORT = {{ REDIS_QUEUE_SERVER_PORT | default(6379) }} 583 | 584 | ## Server database index for the queued redis detector 585 | ## Defaults to: 0 586 | REDIS_QUEUE_SERVER_DB = {{ REDIS_QUEUE_SERVER_DB | default(0) }} 587 | 588 | ## Server password for the queued redis detector 589 | ## Defaults to: None 590 | REDIS_QUEUE_SERVER_PASSWORD = {{ REDIS_QUEUE_SERVER_PASSWORD | default(None) }} 591 | 592 | ################################################################################ 593 | 594 | 595 | ############################# Queued SQS Detector ############################## 596 | 597 | ## AWS key id 598 | ## Defaults to: None 599 | SQS_QUEUE_KEY_ID = {{ SQS_QUEUE_KEY_ID | default(None) }} 600 | 601 | ## AWS key secret 602 | ## Defaults to: None 603 | SQS_QUEUE_KEY_SECRET = {{ SQS_QUEUE_KEY_SECRET | default(None) }} 604 | 605 | ## AWS SQS region 606 | ## Defaults to: us-east-1 607 | SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION | default('us-east-1') }}' 608 | 609 | ################################################################################ 610 | 611 | 612 | #################################### Errors #################################### 613 | 614 | ## This configuration indicates whether thumbor should use a custom error 615 | ## handler. 616 | ## Defaults to: False 617 | USE_CUSTOM_ERROR_HANDLING = {{ USE_CUSTOM_ERROR_HANDLING | default(False) }} 618 | 619 | ## Error reporting module. Needs to contain a class called ErrorHandler with a 620 | ## handle_error(context, handler, exception) method. 621 | ## Defaults to: thumbor.error_handlers.sentry 622 | ERROR_HANDLER_MODULE = '{{ ERROR_HANDLER_MODULE | default('thumbor.error_handlers.sentry') }}' 623 | 624 | ## File of error log as json 625 | ## Defaults to: None 626 | ERROR_FILE_LOGGER = {{ ERROR_FILE_LOGGER | default(None) }} 627 | 628 | ## File of error log name is parametrized with context attribute 629 | ## Defaults to: False 630 | ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT | default('False') }} 631 | 632 | ################################################################################ 633 | 634 | 635 | ############################### Errors - Sentry ################################ 636 | 637 | ## Sentry thumbor project dsn. i.e.: http://5a63d58ae7b94f1dab3dee740b301d6a:73ee 638 | ## a45d3e8649239a973087e8f21f98@localhost:9000/2 639 | ## Defaults to: 640 | SENTRY_DSN_URL = '{{ SENTRY_DSN_URL | default('') }}' 641 | 642 | ## Sentry environment i.e.: staging 643 | ## Defaults to: None 644 | SENTRY_ENVIRONMENT = {{ SENTRY_ENVIRONMENT | default(None) }} 645 | 646 | ################################################################################ 647 | 648 | ################################### General #################################### 649 | 650 | ## Custom app class to override ThumborServiceApp. This config value is 651 | ## overridden by the -a command-line parameter. 652 | ## Defaults to: 'thumbor.app.ThumborServiceApp' 653 | APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' 654 | 655 | ################################################################################ 656 | 657 | 658 | #################################### Server #################################### 659 | 660 | ## The amount of time to wait before shutting down the server, i.e. stop 661 | ## accepting requests. 662 | ## Defaults to: 0 663 | MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN | default(0) }} 664 | 665 | ## The amount of time to waut before shutting down all io, after the server has 666 | ## been stopped 667 | ## Defaults to: 0 668 | MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN | default(0) }} 669 | 670 | ################################################################################ 671 | 672 | 673 | ################################# HandlerLists ################################# 674 | 675 | ## Handler Lists are responsible for adding new handlers to thumbor app. 676 | ## Defaults to: [ 677 | # 'thumbor.handler_lists.healthcheck', 678 | # 'thumbor.handler_lists.upload', 679 | # 'thumbor.handler_lists.blacklist', 680 | #] 681 | HANDLER_LISTS = {{ HANDLER_LISTS | default(['thumbor.handler_lists.healthcheck', 'thumbor.handler_lists.upload', 'thumbor.handler_lists.blacklist']) }} 682 | 683 | 684 | ################################################################################ 685 | 686 | 687 | ################################# Compatibility ################################# 688 | 689 | ## Loader that will be used with the compatibility layer, instead of the 690 | ## compatibility loader. Please only use this if you can't use up-to-date 691 | ## loaders. 692 | ## Defaults to: None 693 | COMPATIBILITY_LEGACY_LOADER = {{ COMPATIBILITY_LEGACY_LOADER | default(None) }} 694 | 695 | ## Storage that will be used with the compatibility layer, instead of the 696 | ## compatibility storage. Please only use this if you can't use up-to-date 697 | ## storages. 698 | ## Defaults to: None 699 | COMPATIBILITY_LEGACY_STORAGE = {{ COMPATIBILITY_LEGACY_STORAGE | default(None) }} 700 | 701 | ## Result Storage that will be used with the compatibility layer, instead of the 702 | ## compatibility result storage. Please only use this if you can't use up-to- 703 | ## date result storages. 704 | ## Defaults to: None 705 | COMPATIBILITY_LEGACY_STORAGE = {{ COMPATIBILITY_LEGACY_STORAGE | default(None) }} 706 | 707 | ################################################################################ 708 | -------------------------------------------------------------------------------- /6/alpine/thumbor.conf.tpl: -------------------------------------------------------------------------------- 1 | ################################### Logging #################################### 2 | 3 | ## Logging configuration as json 4 | ## Defaults to: None 5 | THUMBOR_LOG_CONFIG = {{ THUMBOR_LOG_CONFIG | default(None) }} 6 | 7 | ## Log Format to be used by thumbor when writing log messages. 8 | ## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s 9 | THUMBOR_LOG_FORMAT = '{{ THUMBOR_LOG_FORMAT | default('%(asctime)s %(name)s:%(levelname)s %(message)s') }}' 10 | 11 | ## Date Format to be used by thumbor when writing log messages. 12 | ## Defaults to: %Y-%m-%d %H:%M:%S 13 | THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT | default('%Y-%m-%d %H:%M:%S') }}' 14 | 15 | ################################################################################ 16 | 17 | 18 | ################################### Imaging #################################### 19 | 20 | ## Max width in pixels for images read or generated by thumbor 21 | ## Defaults to: 0 22 | MAX_WIDTH = {{ MAX_WIDTH | default(0) }} 23 | 24 | ## Max height in pixels for images read or generated by thumbor 25 | ## Defaults to: 0 26 | MAX_HEIGHT = {{ MAX_HEIGHT | default(0) }} 27 | 28 | ## Max pixel count for images read by thumbor. Set to prevent decompression bomb DOS attack. 29 | ## Defaults to: 75000000 pixels 30 | MAX_PIXELS = {{ MAX_PIXELS | default(75000000) }} 31 | 32 | ## Min width in pixels for images read or generated by thumbor 33 | ## Defaults to: 1 34 | MIN_WIDTH = {{ MIN_WIDTH | default(1) }} 35 | 36 | ## Min width in pixels for images read or generated by thumbor 37 | ## Defaults to: 1 38 | MIN_HEIGHT = {{ MIN_HEIGHT | default(1) }} 39 | 40 | ## Allowed domains for the http loader to download. These are regular 41 | ## expressions. 42 | ## Defaults to: [] 43 | ALLOWED_SOURCES = {{ ALLOWED_SOURCES | default([]) }} 44 | 45 | 46 | ## Quality index used for generated JPEG images 47 | ## Defaults to: 80 48 | QUALITY = {{ QUALITY | default(80) }} 49 | 50 | ## Exports JPEG images with the progressive flag set. 51 | ## Defaults to: True 52 | PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} 53 | 54 | ## Specify subsampling behavior for Pillow (see `subsampling` in 55 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 56 | ## formats.html#jpeg).Be careful to use int for 0,1,2 and string for "4:4:4" 57 | ## notation. Will ignore `quality`. Using `keep` will copy the original file's 58 | ## subsampling. 59 | ## Defaults to: None 60 | PILLOW_JPEG_SUBSAMPLING = {{ PILLOW_JPEG_SUBSAMPLING | default(None) }} 61 | 62 | ## Specify quantization tables for Pillow (see `qtables` in 63 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 64 | ## formats.html#jpeg). Will ignore `quality`. Using `keep` will copy the 65 | ## original file's qtables. 66 | ## Defaults to: None 67 | PILLOW_JPEG_QTABLES = {{ PILLOW_JPEG_QTABLES | default(None) }} 68 | 69 | ## Specify resampling filter for Pillow resize method.One of LANCZOS, NEAREST, 70 | ## BILINEAR, BICUBIC, HAMMING (Pillow>=3.4.0). 71 | ## Defaults to: 'LANCZOS' 72 | PILLOW_RESAMPLING_FILTER = '{{ PILLOW_RESAMPLING_FILTER | default('LANCZOS') }}' 73 | 74 | ## Quality index used for generated WebP images. If not set (None) the same level 75 | ## of JPEG quality will be used. 76 | ## Defaults to: None 77 | WEBP_QUALITY = {{ WEBP_QUALITY | default(None) }} 78 | 79 | 80 | ## Compression level for generated PNG images. 81 | ## Defaults to: 6 82 | PNG_COMPRESSION_LEVEL = {{ PNG_COMPRESSION_LEVEL | default(6) }} 83 | 84 | ## Specifies whether WebP format should be used automatically if the request 85 | ## accepts it (via Accept header) 86 | ## Defaults to: False 87 | AUTO_WEBP = {{ AUTO_WEBP | default(False) }} 88 | 89 | ## Specify the ratio between 1in and 1px for SVG images. This is only used 90 | ## whenrasterizing SVG images having their size units in cm or inches. 91 | ## Defaults to: 150 92 | SVG_DPI = {{ SVG_DPI | default(150) }} 93 | 94 | ## Max AGE sent as a header for the image served by thumbor in seconds 95 | ## Defaults to: 86400 96 | MAX_AGE = {{ MAX_AGE | default(86400) }} 97 | 98 | ## Indicates the Max AGE header in seconds for temporary images (images with 99 | ## failed smart detection) 100 | ## Defaults to: 0 101 | MAX_AGE_TEMP_IMAGE = {{ MAX_AGE_TEMP_IMAGE | default(0) }} 102 | 103 | ## Indicates whether thumbor should rotate images that have an Orientation EXIF 104 | ## header 105 | ## Defaults to: False 106 | RESPECT_ORIENTATION = {{ RESPECT_ORIENTATION | default(False) }} 107 | 108 | ## Ignore errors during smart detections and return image as a temp image (not 109 | ## saved in result storage and with MAX_AGE_TEMP_IMAGE age) 110 | ## Defaults to: False 111 | IGNORE_SMART_ERRORS = {{ IGNORE_SMART_ERRORS | default(False) }} 112 | 113 | ## Sends If-Modified-Since & Last-Modified headers; requires support from result 114 | ## storage 115 | ## Defaults to: False 116 | SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = {{ SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS | default(False) }} 117 | 118 | ## Preserves exif information in generated images. Increases image size in 119 | ## kbytes, use with caution. 120 | ## Defaults to: False 121 | PRESERVE_EXIF_INFO = {{ PRESERVE_EXIF_INFO | default(False) }} 122 | 123 | ## Indicates whether thumbor should enable the EXPERIMENTAL support for animated 124 | ## gifs. 125 | ## Defaults to: True 126 | ALLOW_ANIMATED_GIFS = {{ ALLOW_ANIMATED_GIFS | default(True) }} 127 | 128 | ## Indicates whether thumbor should use gifsicle engine. Please note that smart 129 | ## cropping and filters are not supported for gifs using gifsicle (but won't 130 | ## give an error). 131 | ## Defaults to: False 132 | USE_GIFSICLE_ENGINE = {{ USE_GIFSICLE_ENGINE | default(False) }} 133 | 134 | ## Indicates whether thumbor should enable blacklist functionality to prevent 135 | ## processing certain images. 136 | ## Defaults to: False 137 | USE_BLACKLIST = {{ USE_BLACKLIST | default(False) }} 138 | 139 | ## Size of the thread pool used for image transformations. The default value is 140 | ## 0 (don't use a threadpoool. Increase this if you are seeing your IOLoop 141 | ## getting blocked (often indicated by your upstream HTTP requests timing out) 142 | ## Defaults to: 0 143 | ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE | default(0) }} 144 | 145 | 146 | 147 | ################################################################################ 148 | 149 | 150 | ################################ Extensibility ################################# 151 | 152 | ## The metrics backend thumbor should use to measure internal actions. This must 153 | ## be the full name of a python module (python must be able to import it) 154 | ## Defaults to: 'thumbor.metrics.logger_metrics' 155 | METRICS = '{{ METRICS | default('thumbor.metrics.logger_metrics') }}' 156 | 157 | ## The loader thumbor should use to load the original image. This must be the 158 | ## full name of a python module (python must be able to import it) 159 | ## Defaults to: thumbor.loaders.http_loader 160 | LOADER = '{{ LOADER | default('thumbor.loaders.http_loader') }}' 161 | 162 | ## The file storage thumbor should use to store original images. This must be the 163 | ## full name of a python module (python must be able to import it) 164 | ## Defaults to: thumbor.storages.file_storage 165 | STORAGE = '{{ STORAGE | default('thumbor.storages.file_storage') }}' 166 | STORAGE_BUCKET = '{{ STORAGE_BUCKET | default('') }}' 167 | RESULT_STORAGE_BUCKET = '{{ RESULT_STORAGE_BUCKET | default('') }}' 168 | 169 | 170 | ## The result storage thumbor should use to store generated images. This must be 171 | ## the full name of a python module (python must be able to import it) 172 | ## Defaults to: None 173 | 174 | RESULT_STORAGE = '{{ RESULT_STORAGE | default('thumbor.result_storages.file_storage') }}' 175 | 176 | 177 | ## The imaging engine thumbor should use to perform image operations. This must 178 | ## be the full name of a python module (python must be able to import it) 179 | ## Defaults to: thumbor.engines.pil 180 | ENGINE = '{{ ENGINE | default('thumbor.engines.pil') }}' 181 | 182 | ## The gif engine thumbor should use to perform image operations. This must be 183 | ## the full name of a python module (python must be able to import it) 184 | ## Defaults to: 'thumbor.engines.gif' 185 | GIF_ENGINE = '{{ GIF_ENGINE | default('thumbor.engines.gif') }}' 186 | 187 | ## The url signer thumbor should use to verify url signatures.This must be the 188 | ## full name of a python module (python must be able to import it) 189 | ## Defaults to: 'libthumbor.url_signers.base64_hmac_sha1' 190 | URL_SIGNER = '{{ URL_SIGNER | default('libthumbor.url_signers.base64_hmac_sha1') }}' 191 | 192 | ################################################################################ 193 | 194 | 195 | ################################### Security ################################### 196 | 197 | ## The security key thumbor uses to sign image URLs 198 | ## Defaults to: MY_SECURE_KEY 199 | SECURITY_KEY = '{{ SECURITY_KEY | default('MY_SECURE_KEY') }}' 200 | 201 | ## Indicates if the /unsafe URL should be available 202 | ## Defaults to: True 203 | ALLOW_UNSAFE_URL = {{ ALLOW_UNSAFE_URL | default(True) }} 204 | 205 | ## Indicates if encrypted (old style) URLs should be allowed 206 | ## Defaults to: True 207 | ALLOW_OLD_URLS = {{ ALLOW_OLD_URLS | default(True) }} 208 | 209 | ## AWS access keys - used in thumbor_aws storage 210 | AWS_ACCESS_KEY = '{{ AWS_ACCESS_KEY_ID | default('') }}' 211 | AWS_SECRET_KEY = '{{ AWS_SECRET_ACCESS_KEY | default('') }}' 212 | 213 | ################################################################################ 214 | 215 | ##################################### HTTP ##################################### 216 | 217 | ## Enables automatically generated etags 218 | ## Defaults to: True 219 | ENABLE_ETAGS = {{ ENABLE_ETAGS | default(True) }} 220 | 221 | ################################################################################ 222 | 223 | 224 | ################################### Storage #################################### 225 | 226 | ## Set maximum id length for images when stored 227 | ## Defaults to: 32 228 | MAX_ID_LENGTH = {{ MAX_ID_LENGTH | default(32) }} 229 | 230 | ################################################################################ 231 | 232 | 233 | ################################# Healthcheck ################################## 234 | 235 | ## The URL path to a healthcheck. This will return a 200 and the text 'WORKING'. 236 | ## Defaults to: '/healthcheck' 237 | HEALTHCHECK_ROUTE = '{{ HEALTHCHECK_ROUTE | default('/healthcheck') }}' 238 | 239 | ################################################################################ 240 | 241 | 242 | ################################### Metrics #################################### 243 | 244 | ## Host to send statsd instrumentation to 245 | ## Defaults to: None 246 | STATSD_HOST = {{ STATSD_HOST | default(None) }} 247 | 248 | ## Port to send statsd instrumentation to 249 | ## Defaults to: 8125 250 | STATSD_PORT = {{ STATSD_PORT | default(8125) }} 251 | 252 | ## Prefix for statsd 253 | ## Defaults to: None 254 | STATSD_PREFIX = {{ STATSD_PREFIX | default(None) }} 255 | 256 | ################################################################################ 257 | 258 | ################################# File Loader ################################## 259 | 260 | ## The root path where the File Loader will try to find images 261 | ## Defaults to: /tmp 262 | FILE_LOADER_ROOT_PATH = '{{ FILE_LOADER_ROOT_PATH | default('/usr/local/thumbor/loader') }}' 263 | 264 | ################################################################################ 265 | 266 | 267 | ################################# HTTP Loader ################################## 268 | 269 | ## The maximum number of seconds libcurl can take to connect to an image being 270 | ## loaded 271 | ## Defaults to: 5 272 | HTTP_LOADER_CONNECT_TIMEOUT = {{ HTTP_LOADER_CONNECT_TIMEOUT | default(5) }} 273 | 274 | ## The maximum number of seconds libcurl can take to download an image 275 | ## Defaults to: 20 276 | HTTP_LOADER_REQUEST_TIMEOUT = {{ HTTP_LOADER_REQUEST_TIMEOUT | default(20) }} 277 | 278 | ## Indicates whether libcurl should follow redirects when downloading an image 279 | ## Defaults to: True 280 | HTTP_LOADER_FOLLOW_REDIRECTS = {{ HTTP_LOADER_FOLLOW_REDIRECTS | default(True) }} 281 | 282 | ## Indicates the number of redirects libcurl should follow when downloading an 283 | ## image 284 | ## Defaults to: 5 285 | HTTP_LOADER_MAX_REDIRECTS = {{ HTTP_LOADER_MAX_REDIRECTS | default(5) }} 286 | 287 | ## The maximum number of simultaneous HTTP connections the loader can make before 288 | ## queuing 289 | ## Defaults to: 10 290 | HTTP_LOADER_MAX_CLIENTS = {{ HTTP_LOADER_MAX_CLIENTS | default(10) }} 291 | 292 | ## Indicates whether thumbor should forward the user agent of the requesting user 293 | ## Defaults to: False 294 | HTTP_LOADER_FORWARD_USER_AGENT = {{ HTTP_LOADER_FORWARD_USER_AGENT | default(False) }} 295 | 296 | ## Default user agent for thumbor http loader requests 297 | ## Defaults to: Thumbor/6.3.0 298 | HTTP_LOADER_DEFAULT_USER_AGENT = '{{ HTTP_LOADER_DEFAULT_USER_AGENT | default('Thumbor/6.3.0') }}' 299 | 300 | ## The proxy host needed to load images through 301 | ## Defaults to: None 302 | HTTP_LOADER_PROXY_HOST = {{ HTTP_LOADER_PROXY_HOST | default(None) }} 303 | 304 | ## The proxy port for the proxy host 305 | ## Defaults to: None 306 | HTTP_LOADER_PROXY_PORT = {{ HTTP_LOADER_PROXY_PORT | default(None) }} 307 | 308 | ## The proxy username for the proxy host 309 | ## Defaults to: None 310 | HTTP_LOADER_PROXY_USERNAME = {{ HTTP_LOADER_PROXY_USERNAME | default(None) }} 311 | 312 | ## The proxy password for the proxy host 313 | ## Defaults to: None 314 | HTTP_LOADER_PROXY_PASSWORD = {{ HTTP_LOADER_PROXY_PASSWORD | default(None) }} 315 | 316 | ## The filename of CA certificates in PEM format 317 | ## Defaults to: None 318 | HTTP_LOADER_CA_CERTS = {{ HTTP_LOADER_CA_CERTS | default(None) }} 319 | 320 | ## Validate the servers certificate for HTTPS requests 321 | ## Defaults to: True 322 | HTTP_LOADER_VALIDATE_CERTS = {{ HTTP_LOADER_VALIDATE_CERTS | default(True) }} 323 | 324 | ## The filename for client SSL key 325 | ## Defaults to: None 326 | HTTP_LOADER_CLIENT_KEY = {{ HTTP_LOADER_CLIENT_KEY | default(None) }} 327 | 328 | ## The filename for client SSL certificate 329 | ## Defaults to: None 330 | HTTP_LOADER_CLIENT_CERT = {{ HTTP_LOADER_CLIENT_CERT | default(None) }} 331 | 332 | ## If the CurlAsyncHTTPClient should be used 333 | ## Defaults to: False 334 | HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT | default(False) }} 335 | 336 | 337 | ################################################################################ 338 | 339 | 340 | ################################# File Storage ################################# 341 | 342 | ## Expiration in seconds for the images in the File Storage. Defaults to one 343 | ## month 344 | ## Defaults to: 2592000 345 | STORAGE_EXPIRATION_SECONDS = {{ STORAGE_EXPIRATION_SECONDS | default(2592000) }} 346 | 347 | ## Indicates whether thumbor should store the signing key for each image in the 348 | ## file storage. This allows the key to be changed and old images to still be 349 | ## properly found 350 | ## Defaults to: False 351 | STORES_CRYPTO_KEY_FOR_EACH_IMAGE = {{ STORES_CRYPTO_KEY_FOR_EACH_IMAGE | default(False) }} 352 | 353 | ## The root path where the File Storage will try to find images 354 | ## Defaults to: /tmp/thumbor/storage 355 | FILE_STORAGE_ROOT_PATH = '{{ FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/storage') }}' 356 | 357 | ################################################################################ 358 | 359 | 360 | #################################### Upload #################################### 361 | 362 | ## Max size in Kb for images uploaded to thumbor 363 | ## Aliases: MAX_SIZE 364 | ## Defaults to: 0 365 | UPLOAD_MAX_SIZE = {{ UPLOAD_MAX_SIZE | default(0) }} 366 | 367 | ## Indicates whether thumbor should enable File uploads 368 | ## Aliases: ENABLE_ORIGINAL_PHOTO_UPLOAD 369 | ## Defaults to: False 370 | UPLOAD_ENABLED = {{ UPLOAD_ENABLED | default(False) }} 371 | 372 | ## The type of storage to store uploaded images with 373 | ## Aliases: ORIGINAL_PHOTO_STORAGE 374 | ## Defaults to: thumbor.storages.file_storage 375 | UPLOAD_PHOTO_STORAGE = '{{ UPLOAD_PHOTO_STORAGE | default('thumbor.storages.file_storage') }}' 376 | 377 | ## Indicates whether image deletion should be allowed 378 | ## Aliases: ALLOW_ORIGINAL_PHOTO_DELETION 379 | ## Defaults to: False 380 | UPLOAD_DELETE_ALLOWED = {{ UPLOAD_DELETE_ALLOWED | default(False) }} 381 | 382 | ## Indicates whether image overwrite should be allowed 383 | ## Aliases: ALLOW_ORIGINAL_PHOTO_PUTTING 384 | ## Defaults to: False 385 | UPLOAD_PUT_ALLOWED = {{ UPLOAD_PUT_ALLOWED | default(False) }} 386 | 387 | ## Default filename for image uploaded 388 | ## Defaults to: image 389 | UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME | default('image') }}' 390 | 391 | ################################################################################ 392 | 393 | 394 | ############################### MongoDB Storage ################################ 395 | 396 | ## MongoDB storage server host 397 | ## Defaults to: localhost 398 | MONGO_STORAGE_SERVER_HOST = '{{ MONGO_STORAGE_SERVER_HOST | default('mongo') }}' 399 | 400 | ## MongoDB storage server port 401 | ## Defaults to: 27017 402 | MONGO_STORAGE_SERVER_PORT = {{ MONGO_STORAGE_SERVER_PORT | default(27017) }} 403 | 404 | ## MongoDB storage server database name 405 | ## Defaults to: thumbor 406 | MONGO_STORAGE_SERVER_DB = '{{ MONGO_STORAGE_SERVER_DB | default('thumbor') }}' 407 | 408 | ## MongoDB storage image collection 409 | ## Defaults to: images 410 | MONGO_STORAGE_SERVER_COLLECTION = '{{ MONGO_STORAGE_SERVER_COLLECTION | default('images') }}' 411 | 412 | ################################################################################ 413 | 414 | 415 | ################################ Redis Storage ################################# 416 | 417 | ## Redis storage server host 418 | ## Defaults to: localhost 419 | REDIS_STORAGE_SERVER_HOST = '{{ REDIS_STORAGE_SERVER_HOST | default('redis') }}' 420 | 421 | ## Redis storage server port 422 | ## Defaults to: 6379 423 | REDIS_STORAGE_SERVER_PORT = {{ REDIS_STORAGE_SERVER_PORT | default(6379) }} 424 | 425 | ## Redis storage database index 426 | ## Defaults to: 0 427 | REDIS_STORAGE_SERVER_DB = {{ REDIS_STORAGE_SERVER_DB | default(0) }} 428 | 429 | ## Redis storage server password 430 | ## Defaults to: None 431 | REDIS_STORAGE_SERVER_PASSWORD = {{ REDIS_STORAGE_SERVER_PASSWORD | default(None) }} 432 | 433 | ################################################################################ 434 | 435 | 436 | ################################ Redis Result Storage ################################# 437 | 438 | ## Redis storage server host 439 | ## Defaults to: localhost 440 | REDIS_RESULT_STORAGE_SERVER_HOST = '{{ REDIS_RESULT_STORAGE_SERVER_HOST | default('redis') }}' 441 | 442 | ## Redis storage server port 443 | ## Defaults to: 6379 444 | REDIS_RESULT_STORAGE_SERVER_PORT = {{ REDIS_RESULT_STORAGE_SERVER_PORT | default(6379) }} 445 | 446 | ## Redis storage database index 447 | ## Defaults to: 0 448 | REDIS_RESULT_STORAGE_SERVER_DB = {{ REDIS_RESULT_STORAGE_SERVER_DB | default(0) }} 449 | 450 | ## Redis storage server password 451 | ## Defaults to: None 452 | REDIS_RESULT_STORAGE_SERVER_PASSWORD = {{ REDIS_STORAGE_SERVER_PASSWORD | default(None) }} 453 | 454 | ################################################################################ 455 | 456 | 457 | ############################### Memcache Storage ############################### 458 | 459 | ## List of Memcache storage server hosts 460 | ## Defaults to: ['localhost:11211'] 461 | MEMCACHE_STORAGE_SERVERS = {{ MEMCACHE_STORAGE_SERVERS | default(['localhost:11211',]) }} 462 | 463 | 464 | ################################################################################ 465 | 466 | 467 | ################################ Mixed Storage ################################# 468 | 469 | ## Mixed Storage file storage. This must be the full name of a python module 470 | ## (python must be able to import it) 471 | ## Defaults to: thumbor.storages.no_storage 472 | MIXED_STORAGE_FILE_STORAGE = '{{ MIXED_STORAGE_FILE_STORAGE | default('thumbor.storages.no_storage') }}' 473 | 474 | ## Mixed Storage signing key storage. This must be the full name of a python 475 | ## module (python must be able to import it) 476 | ## Defaults to: thumbor.storages.no_storage 477 | MIXED_STORAGE_CRYPTO_STORAGE = '{{ MIXED_STORAGE_CRYPTO_STORAGE | default('thumbor.storages.no_storage') }}' 478 | 479 | ## Mixed Storage detector information storage. This must be the full name of a 480 | ## python module (python must be able to import it) 481 | ## Defaults to: thumbor.storages.no_storage 482 | MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE | default('thumbor.storages.no_storage') }}' 483 | 484 | ################################################################################ 485 | 486 | 487 | ##################################### Meta ##################################### 488 | 489 | ## The callback function name that should be used by the META route for JSONP 490 | ## access 491 | ## Defaults to: None 492 | META_CALLBACK_NAME = {{ META_CALLBACK_NAME | default(None) }} 493 | 494 | ################################################################################ 495 | 496 | 497 | ################################## Detection ################################### 498 | 499 | ## List of detectors that thumbor should use to find faces and/or features. All 500 | ## of them must be full names of python modules (python must be able to import 501 | ## it) 502 | ## Defaults to: [] 503 | #DETECTORS = [ 504 | #'thumbor.detectors.queued_detector.queued_complete_detector', 505 | #'thumbor.detectors.queued_detector.queued_face_detector', 506 | #'thumbor.detectors.queued_detector.queued_feature_detector', 507 | #'thumbor.detectors.feature_detector', 508 | #'thumbor.detectors.face_detector', 509 | #] 510 | DETECTORS = {{ DETECTORS | default([]) }} 511 | 512 | ## The cascade file that opencv will use to detect faces 513 | ## Defaults to: haarcascade_frontalface_alt.xml 514 | FACE_DETECTOR_CASCADE_FILE = '{{ FACE_DETECTOR_CASCADE_FILE | default('haarcascade_frontalface_alt.xml') }}' 515 | 516 | ## The cascade file that opencv will use to detect glasses. 517 | ## Defaults to: 'haarcascade_eye_tree_eyeglasses.xml' 518 | GLASSES_DETECTOR_CASCADE_FILE = '{{ GLASSES_DETECTOR_CASCADE_FILE | default('haarcascade_eye_tree_eyeglasses.xml') }}' 519 | 520 | ## The cascade file that opencv will use to detect profile faces. 521 | ## Defaults to: 'haarcascade_profileface.xml' 522 | PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE | default('haarcascade_profileface.xml') }}' 523 | 524 | ################################################################################ 525 | 526 | 527 | ################################## Optimizers ################################## 528 | 529 | ## List of optimizers that thumbor will use to optimize images 530 | ## Defaults to: [] --> ['thumbor.optimizers.jpegtran',] 531 | OPTIMIZERS = {{ OPTIMIZERS | default([]) }} 532 | 533 | 534 | ## Path for the jpegtran binary 535 | ## Defaults to: /usr/bin/jpegtran 536 | JPEGTRAN_PATH = '{{ JPEGTRAN_PATH | default('/usr/bin/jpegtran') }}' 537 | PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} 538 | FFMPEG_PATH = '{{ FFMPEG_PATH | default('/usr/bin/ffmpeg') }}' # Default path for the docker installation in debian 539 | 540 | ################################################################################ 541 | 542 | 543 | ################################### Filters #################################### 544 | 545 | ## List of filters that thumbor will allow to be used in generated images. All of 546 | ## them must be full names of python modules (python must be able to import 547 | ## it) 548 | ## using thumbor's default, unless specified. 549 | {% if FILTERS is defined %} 550 | FILTERS = {{ FILTERS }} 551 | {% endif %} 552 | 553 | ################################################################################ 554 | 555 | 556 | ################################ Result Storage ################################ 557 | 558 | ## Expiration in seconds of generated images in the result storage 559 | ## Defaults to: 0 560 | RESULT_STORAGE_EXPIRATION_SECONDS = {{ RESULT_STORAGE_EXPIRATION_SECONDS | default(0) }} 561 | 562 | ## Path where the Result storage will store generated images 563 | ## Defaults to: /tmp/thumbor/result_storage 564 | RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '{{ RESULT_STORAGE_FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/result_storage') }}' 565 | 566 | ## Indicates whether unsafe requests should also be stored in the Result Storage 567 | ## Defaults to: False 568 | RESULT_STORAGE_STORES_UNSAFE = {{ RESULT_STORAGE_STORES_UNSAFE | default(False) }} 569 | 570 | ################################################################################ 571 | 572 | 573 | ############################ Queued Redis Detector ############################# 574 | 575 | ## Server host for the queued redis detector 576 | ## Defaults to: localhost 577 | REDIS_QUEUE_SERVER_HOST = '{{ REDIS_QUEUE_SERVER_HOST | default('redis') }}' 578 | 579 | ## Server port for the queued redis detector 580 | ## Defaults to: 6379 581 | REDIS_QUEUE_SERVER_PORT = {{ REDIS_QUEUE_SERVER_PORT | default(6379) }} 582 | 583 | ## Server database index for the queued redis detector 584 | ## Defaults to: 0 585 | REDIS_QUEUE_SERVER_DB = {{ REDIS_QUEUE_SERVER_DB | default(0) }} 586 | 587 | ## Server password for the queued redis detector 588 | ## Defaults to: None 589 | REDIS_QUEUE_SERVER_PASSWORD = {{ REDIS_QUEUE_SERVER_PASSWORD | default(None) }} 590 | 591 | ################################################################################ 592 | 593 | 594 | ############################# Queued SQS Detector ############################## 595 | 596 | ## AWS key id 597 | ## Defaults to: None 598 | SQS_QUEUE_KEY_ID = {{ SQS_QUEUE_KEY_ID | default(None) }} 599 | 600 | ## AWS key secret 601 | ## Defaults to: None 602 | SQS_QUEUE_KEY_SECRET = {{ SQS_QUEUE_KEY_SECRET | default(None) }} 603 | 604 | ## AWS SQS region 605 | ## Defaults to: us-east-1 606 | SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION | default('us-east-1') }}' 607 | 608 | ################################################################################ 609 | 610 | 611 | #################################### Errors #################################### 612 | 613 | ## This configuration indicates whether thumbor should use a custom error 614 | ## handler. 615 | ## Defaults to: False 616 | USE_CUSTOM_ERROR_HANDLING = {{ USE_CUSTOM_ERROR_HANDLING | default(False) }} 617 | 618 | ## Error reporting module. Needs to contain a class called ErrorHandler with a 619 | ## handle_error(context, handler, exception) method. 620 | ## Defaults to: thumbor.error_handlers.sentry 621 | ERROR_HANDLER_MODULE = '{{ ERROR_HANDLER_MODULE | default('thumbor.error_handlers.sentry') }}' 622 | 623 | ## File of error log as json 624 | ## Defaults to: None 625 | ERROR_FILE_LOGGER = {{ ERROR_FILE_LOGGER | default(None) }} 626 | 627 | ## File of error log name is parametrized with context attribute 628 | ## Defaults to: False 629 | ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT | default('False') }} 630 | 631 | ################################################################################ 632 | 633 | 634 | ############################### Errors - Sentry ################################ 635 | 636 | ## Sentry thumbor project dsn. i.e.: http://5a63d58ae7b94f1dab3dee740b301d6a:73ee 637 | ## a45d3e8649239a973087e8f21f98@localhost:9000/2 638 | ## Defaults to: 639 | SENTRY_DSN_URL = '{{ SENTRY_DSN_URL | default('') }}' 640 | 641 | ################################################################################ 642 | 643 | ################################### General #################################### 644 | 645 | ## Custom app class to override ThumborServiceApp. This config value is 646 | ## overridden by the -a command-line parameter. 647 | ## Defaults to: 'thumbor.app.ThumborServiceApp' 648 | APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' 649 | 650 | ################################################################################ 651 | 652 | ############################## TC_AWS ########################################## 653 | TC_AWS_REGION = '{{ TC_AWS_REGION | default('eu-west-1') }}' # AWS Region 654 | 655 | TC_AWS_ENDPOINT = {{ TC_AWS_ENDPOINT | default(None) }} # Custom S3 endpoint URL (for GCP, Minio, etc.) 656 | 657 | TC_AWS_STORAGE_BUCKET = '{{ TC_AWS_STORAGE_BUCKET | default('') }}' # S3 bucket for Storage 658 | TC_AWS_STORAGE_ROOT_PATH = '{{ TC_AWS_STORAGE_ROOT_PATH | default('') }}' # S3 path prefix for Storage bucket 659 | 660 | TC_AWS_LOADER_BUCKET = '{{ TC_AWS_LOADER_BUCKET | default('') }}' #S3 bucket for loader 661 | TC_AWS_LOADER_ROOT_PATH = '{{ TC_AWS_LOADER_ROOT_PATH | default('') }}' # S3 path prefix for Loader bucket 662 | 663 | TC_AWS_RESULT_STORAGE_BUCKET = '{{ TC_AWS_RESULT_STORAGE_BUCKET | default('') }}' # S3 bucket for result Storage 664 | TC_AWS_RESULT_STORAGE_ROOT_PATH = '{{ TC_AWS_RESULT_STORAGE_ROOT_PATH | default('') }}' # S3 path prefix for Result storage bucket 665 | 666 | # put data into S3 using the Server Side Encryption functionality to 667 | # encrypt data at rest in S3 668 | # https://aws.amazon.com/about-aws/whats-new/2011/10/04/amazon-s3-announces-server-side-encryption-support/ 669 | TC_AWS_STORAGE_SSE = {{ TC_AWS_STORAGE_SSE | default(False) }} 670 | 671 | # put data into S3 with Reduced Redundancy 672 | # https://aws.amazon.com/about-aws/whats-new/2010/05/19/announcing-amazon-s3-reduced-redundancy-storage/ 673 | TC_AWS_STORAGE_RRS = {{ TC_AWS_STORAGE_RRS | default(False) }} 674 | 675 | # Add some randomization in the S3 keys for the Storage and Result Storage. 676 | # Defaults to False for Backwards Compatibility, set it to True for performance. 677 | TC_AWS_RANDOMIZE_KEYS = {{ TC_AWS_RANDOMIZE_KEYS | default(False) }} 678 | 679 | # Enable HTTP Loader as well? 680 | # This would allow you to load watermarks in over your images dynamically through a URI 681 | # E.g. 682 | # http://your-thumbor.com/unsafe/filters:watermark(http://example.com/watermark.png,0,0,50)/s3_bucket/photo.jpg 683 | TC_AWS_ENABLE_HTTP_LOADER = {{ TC_AWS_ENABLE_HTTP_LOADER | default(False) }} 684 | 685 | TC_AWS_ALLOWED_BUCKETS = {{ TC_AWS_ALLOWED_BUCKETS | default(False) }} # List of allowed bucket to be requested 686 | TC_AWS_STORE_METADATA = {{ TC_AWS_STORE_METADATA | default(False) }} # Store result with metadata (for instance content-type) 687 | ################################################################################ 688 | 689 | ########################## Google Cloud Storage ################################ 690 | CLOUD_STORAGE_BUCKET_ID = '{{ CLOUD_STORAGE_BUCKET_ID | default('') }}' 691 | CLOUD_STORAGE_PROJECT_ID = '{{ CLOUD_STORAGE_PROJECT_ID | default('') }}' 692 | 693 | RESULT_STORAGE_CLOUD_STORAGE_PROJECT_ID = '{{ RESULT_STORAGE_CLOUD_STORAGE_PROJECT_ID | default('') }}' 694 | RESULT_STORAGE_CLOUD_STORAGE_BUCKET_ID = '{{ RESULT_STORAGE_CLOUD_STORAGE_BUCKET_ID | default('') }}' 695 | ################################################################################ 696 | -------------------------------------------------------------------------------- /6/slim/thumbor.conf.tpl: -------------------------------------------------------------------------------- 1 | ################################### Logging #################################### 2 | 3 | ## Logging configuration as json 4 | ## Defaults to: None 5 | THUMBOR_LOG_CONFIG = {{ THUMBOR_LOG_CONFIG | default(None) }} 6 | 7 | ## Log Format to be used by thumbor when writing log messages. 8 | ## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s 9 | THUMBOR_LOG_FORMAT = '{{ THUMBOR_LOG_FORMAT | default('%(asctime)s %(name)s:%(levelname)s %(message)s') }}' 10 | 11 | ## Date Format to be used by thumbor when writing log messages. 12 | ## Defaults to: %Y-%m-%d %H:%M:%S 13 | THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT | default('%Y-%m-%d %H:%M:%S') }}' 14 | 15 | ################################################################################ 16 | 17 | 18 | ################################### Imaging #################################### 19 | 20 | ## Max width in pixels for images read or generated by thumbor 21 | ## Defaults to: 0 22 | MAX_WIDTH = {{ MAX_WIDTH | default(0) }} 23 | 24 | ## Max height in pixels for images read or generated by thumbor 25 | ## Defaults to: 0 26 | MAX_HEIGHT = {{ MAX_HEIGHT | default(0) }} 27 | 28 | ## Max pixel count for images read by thumbor. Set to prevent decompression bomb DOS attack. 29 | ## Defaults to: 75000000 pixels 30 | MAX_PIXELS = {{ MAX_PIXELS | default(75000000) }} 31 | 32 | ## Min width in pixels for images read or generated by thumbor 33 | ## Defaults to: 1 34 | MIN_WIDTH = {{ MIN_WIDTH | default(1) }} 35 | 36 | ## Min width in pixels for images read or generated by thumbor 37 | ## Defaults to: 1 38 | MIN_HEIGHT = {{ MIN_HEIGHT | default(1) }} 39 | 40 | ## Allowed domains for the http loader to download. These are regular 41 | ## expressions. 42 | ## Defaults to: [] 43 | ALLOWED_SOURCES = {{ ALLOWED_SOURCES | default([]) }} 44 | 45 | 46 | ## Quality index used for generated JPEG images 47 | ## Defaults to: 80 48 | QUALITY = {{ QUALITY | default(80) }} 49 | 50 | ## Exports JPEG images with the progressive flag set. 51 | ## Defaults to: True 52 | PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} 53 | 54 | ## Specify subsampling behavior for Pillow (see `subsampling` in 55 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 56 | ## formats.html#jpeg).Be careful to use int for 0,1,2 and string for "4:4:4" 57 | ## notation. Will ignore `quality`. Using `keep` will copy the original file's 58 | ## subsampling. 59 | ## Defaults to: None 60 | PILLOW_JPEG_SUBSAMPLING = {{ PILLOW_JPEG_SUBSAMPLING | default(None) }} 61 | 62 | ## Specify quantization tables for Pillow (see `qtables` in 63 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 64 | ## formats.html#jpeg). Will ignore `quality`. Using `keep` will copy the 65 | ## original file's qtables. 66 | ## Defaults to: None 67 | PILLOW_JPEG_QTABLES = {{ PILLOW_JPEG_QTABLES | default(None) }} 68 | 69 | ## Specify resampling filter for Pillow resize method.One of LANCZOS, NEAREST, 70 | ## BILINEAR, BICUBIC, HAMMING (Pillow>=3.4.0). 71 | ## Defaults to: 'LANCZOS' 72 | PILLOW_RESAMPLING_FILTER = '{{ PILLOW_RESAMPLING_FILTER | default('LANCZOS') }}' 73 | 74 | ## Quality index used for generated WebP images. If not set (None) the same level 75 | ## of JPEG quality will be used. 76 | ## Defaults to: None 77 | WEBP_QUALITY = {{ WEBP_QUALITY | default(None) }} 78 | 79 | 80 | ## Compression level for generated PNG images. 81 | ## Defaults to: 6 82 | PNG_COMPRESSION_LEVEL = {{ PNG_COMPRESSION_LEVEL | default(6) }} 83 | 84 | ## Specifies whether WebP format should be used automatically if the request 85 | ## accepts it (via Accept header) 86 | ## Defaults to: False 87 | AUTO_WEBP = {{ AUTO_WEBP | default(False) }} 88 | 89 | ## Specify the ratio between 1in and 1px for SVG images. This is only used 90 | ## whenrasterizing SVG images having their size units in cm or inches. 91 | ## Defaults to: 150 92 | SVG_DPI = {{ SVG_DPI | default(150) }} 93 | 94 | ## Max AGE sent as a header for the image served by thumbor in seconds 95 | ## Defaults to: 86400 96 | MAX_AGE = {{ MAX_AGE | default(86400) }} 97 | 98 | ## Indicates the Max AGE header in seconds for temporary images (images with 99 | ## failed smart detection) 100 | ## Defaults to: 0 101 | MAX_AGE_TEMP_IMAGE = {{ MAX_AGE_TEMP_IMAGE | default(0) }} 102 | 103 | ## Indicates whether thumbor should rotate images that have an Orientation EXIF 104 | ## header 105 | ## Defaults to: False 106 | RESPECT_ORIENTATION = {{ RESPECT_ORIENTATION | default(False) }} 107 | 108 | ## Ignore errors during smart detections and return image as a temp image (not 109 | ## saved in result storage and with MAX_AGE_TEMP_IMAGE age) 110 | ## Defaults to: False 111 | IGNORE_SMART_ERRORS = {{ IGNORE_SMART_ERRORS | default(False) }} 112 | 113 | ## Sends If-Modified-Since & Last-Modified headers; requires support from result 114 | ## storage 115 | ## Defaults to: False 116 | SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = {{ SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS | default(False) }} 117 | 118 | ## Preserves exif information in generated images. Increases image size in 119 | ## kbytes, use with caution. 120 | ## Defaults to: False 121 | PRESERVE_EXIF_INFO = {{ PRESERVE_EXIF_INFO | default(False) }} 122 | 123 | ## Indicates whether thumbor should enable the EXPERIMENTAL support for animated 124 | ## gifs. 125 | ## Defaults to: True 126 | ALLOW_ANIMATED_GIFS = {{ ALLOW_ANIMATED_GIFS | default(True) }} 127 | 128 | ## Indicates whether thumbor should use gifsicle engine. Please note that smart 129 | ## cropping and filters are not supported for gifs using gifsicle (but won't 130 | ## give an error). 131 | ## Defaults to: False 132 | USE_GIFSICLE_ENGINE = {{ USE_GIFSICLE_ENGINE | default(False) }} 133 | 134 | ## Indicates whether thumbor should enable blacklist functionality to prevent 135 | ## processing certain images. 136 | ## Defaults to: False 137 | USE_BLACKLIST = {{ USE_BLACKLIST | default(False) }} 138 | 139 | ## Size of the thread pool used for image transformations. The default value is 140 | ## 0 (don't use a threadpoool. Increase this if you are seeing your IOLoop 141 | ## getting blocked (often indicated by your upstream HTTP requests timing out) 142 | ## Defaults to: 0 143 | ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE | default(0) }} 144 | 145 | 146 | 147 | ################################################################################ 148 | 149 | 150 | ################################ Extensibility ################################# 151 | 152 | ## The metrics backend thumbor should use to measure internal actions. This must 153 | ## be the full name of a python module (python must be able to import it) 154 | ## Defaults to: 'thumbor.metrics.logger_metrics' 155 | METRICS = '{{ METRICS | default('thumbor.metrics.logger_metrics') }}' 156 | 157 | ## The loader thumbor should use to load the original image. This must be the 158 | ## full name of a python module (python must be able to import it) 159 | ## Defaults to: thumbor.loaders.http_loader 160 | LOADER = '{{ LOADER | default('thumbor.loaders.http_loader') }}' 161 | 162 | ## The file storage thumbor should use to store original images. This must be the 163 | ## full name of a python module (python must be able to import it) 164 | ## Defaults to: thumbor.storages.file_storage 165 | STORAGE = '{{ STORAGE | default('thumbor.storages.file_storage') }}' 166 | STORAGE_BUCKET = '{{ STORAGE_BUCKET | default('') }}' 167 | RESULT_STORAGE_BUCKET = '{{ RESULT_STORAGE_BUCKET | default('') }}' 168 | 169 | 170 | ## The result storage thumbor should use to store generated images. This must be 171 | ## the full name of a python module (python must be able to import it) 172 | ## Defaults to: None 173 | 174 | RESULT_STORAGE = '{{ RESULT_STORAGE | default('thumbor.result_storages.file_storage') }}' 175 | 176 | 177 | ## The imaging engine thumbor should use to perform image operations. This must 178 | ## be the full name of a python module (python must be able to import it) 179 | ## Defaults to: thumbor.engines.pil 180 | ENGINE = '{{ ENGINE | default('thumbor.engines.pil') }}' 181 | 182 | ## The gif engine thumbor should use to perform image operations. This must be 183 | ## the full name of a python module (python must be able to import it) 184 | ## Defaults to: 'thumbor.engines.gif' 185 | GIF_ENGINE = '{{ GIF_ENGINE | default('thumbor.engines.gif') }}' 186 | 187 | ## The url signer thumbor should use to verify url signatures.This must be the 188 | ## full name of a python module (python must be able to import it) 189 | ## Defaults to: 'libthumbor.url_signers.base64_hmac_sha1' 190 | URL_SIGNER = '{{ URL_SIGNER | default('libthumbor.url_signers.base64_hmac_sha1') }}' 191 | 192 | ################################################################################ 193 | 194 | 195 | ################################### Security ################################### 196 | 197 | ## The security key thumbor uses to sign image URLs 198 | ## Defaults to: MY_SECURE_KEY 199 | SECURITY_KEY = '{{ SECURITY_KEY | default('MY_SECURE_KEY') }}' 200 | 201 | ## Indicates if the /unsafe URL should be available 202 | ## Defaults to: True 203 | ALLOW_UNSAFE_URL = {{ ALLOW_UNSAFE_URL | default(True) }} 204 | 205 | ## Indicates if encrypted (old style) URLs should be allowed 206 | ## Defaults to: True 207 | ALLOW_OLD_URLS = {{ ALLOW_OLD_URLS | default(True) }} 208 | 209 | ## AWS access keys - used in thumbor_aws storage 210 | AWS_ACCESS_KEY = '{{ AWS_ACCESS_KEY_ID | default('') }}' 211 | AWS_SECRET_KEY = '{{ AWS_SECRET_ACCESS_KEY | default('') }}' 212 | 213 | ################################################################################ 214 | 215 | ##################################### HTTP ##################################### 216 | 217 | ## Enables automatically generated etags 218 | ## Defaults to: True 219 | ENABLE_ETAGS = {{ ENABLE_ETAGS | default(True) }} 220 | 221 | ################################################################################ 222 | 223 | 224 | ################################### Storage #################################### 225 | 226 | ## Set maximum id length for images when stored 227 | ## Defaults to: 32 228 | MAX_ID_LENGTH = {{ MAX_ID_LENGTH | default(32) }} 229 | 230 | ################################################################################ 231 | 232 | 233 | ################################# Healthcheck ################################## 234 | 235 | ## The URL path to a healthcheck. This will return a 200 and the text 'WORKING'. 236 | ## Defaults to: '/healthcheck' 237 | HEALTHCHECK_ROUTE = '{{ HEALTHCHECK_ROUTE | default('/healthcheck') }}' 238 | 239 | ################################################################################ 240 | 241 | 242 | ################################### Metrics #################################### 243 | 244 | ## Host to send statsd instrumentation to 245 | ## Defaults to: None 246 | STATSD_HOST = {{ STATSD_HOST | default(None) }} 247 | 248 | ## Port to send statsd instrumentation to 249 | ## Defaults to: 8125 250 | STATSD_PORT = {{ STATSD_PORT | default(8125) }} 251 | 252 | ## Prefix for statsd 253 | ## Defaults to: None 254 | STATSD_PREFIX = {{ STATSD_PREFIX | default(None) }} 255 | 256 | ################################################################################ 257 | 258 | ################################# File Loader ################################## 259 | 260 | ## The root path where the File Loader will try to find images 261 | ## Defaults to: /tmp 262 | FILE_LOADER_ROOT_PATH = '{{ FILE_LOADER_ROOT_PATH | default('/usr/local/thumbor/loader') }}' 263 | 264 | ################################################################################ 265 | 266 | 267 | ################################# HTTP Loader ################################## 268 | 269 | ## The maximum number of seconds libcurl can take to connect to an image being 270 | ## loaded 271 | ## Defaults to: 5 272 | HTTP_LOADER_CONNECT_TIMEOUT = {{ HTTP_LOADER_CONNECT_TIMEOUT | default(5) }} 273 | 274 | ## The maximum number of seconds libcurl can take to download an image 275 | ## Defaults to: 20 276 | HTTP_LOADER_REQUEST_TIMEOUT = {{ HTTP_LOADER_REQUEST_TIMEOUT | default(20) }} 277 | 278 | ## Indicates whether libcurl should follow redirects when downloading an image 279 | ## Defaults to: True 280 | HTTP_LOADER_FOLLOW_REDIRECTS = {{ HTTP_LOADER_FOLLOW_REDIRECTS | default(True) }} 281 | 282 | ## Indicates the number of redirects libcurl should follow when downloading an 283 | ## image 284 | ## Defaults to: 5 285 | HTTP_LOADER_MAX_REDIRECTS = {{ HTTP_LOADER_MAX_REDIRECTS | default(5) }} 286 | 287 | ## The maximum number of simultaneous HTTP connections the loader can make before 288 | ## queuing 289 | ## Defaults to: 10 290 | HTTP_LOADER_MAX_CLIENTS = {{ HTTP_LOADER_MAX_CLIENTS | default(10) }} 291 | 292 | ## Indicates whether thumbor should forward the user agent of the requesting user 293 | ## Defaults to: False 294 | HTTP_LOADER_FORWARD_USER_AGENT = {{ HTTP_LOADER_FORWARD_USER_AGENT | default(False) }} 295 | 296 | ## Default user agent for thumbor http loader requests 297 | ## Defaults to: Thumbor/6.3.0 298 | HTTP_LOADER_DEFAULT_USER_AGENT = '{{ HTTP_LOADER_DEFAULT_USER_AGENT | default('Thumbor/6.3.0') }}' 299 | 300 | ## The proxy host needed to load images through 301 | ## Defaults to: None 302 | HTTP_LOADER_PROXY_HOST = {{ HTTP_LOADER_PROXY_HOST | default(None) }} 303 | 304 | ## The proxy port for the proxy host 305 | ## Defaults to: None 306 | HTTP_LOADER_PROXY_PORT = {{ HTTP_LOADER_PROXY_PORT | default(None) }} 307 | 308 | ## The proxy username for the proxy host 309 | ## Defaults to: None 310 | HTTP_LOADER_PROXY_USERNAME = {{ HTTP_LOADER_PROXY_USERNAME | default(None) }} 311 | 312 | ## The proxy password for the proxy host 313 | ## Defaults to: None 314 | HTTP_LOADER_PROXY_PASSWORD = {{ HTTP_LOADER_PROXY_PASSWORD | default(None) }} 315 | 316 | ## The filename of CA certificates in PEM format 317 | ## Defaults to: None 318 | HTTP_LOADER_CA_CERTS = {{ HTTP_LOADER_CA_CERTS | default(None) }} 319 | 320 | ## Validate the servers certificate for HTTPS requests 321 | ## Defaults to: True 322 | HTTP_LOADER_VALIDATE_CERTS = {{ HTTP_LOADER_VALIDATE_CERTS | default(True) }} 323 | 324 | ## The filename for client SSL key 325 | ## Defaults to: None 326 | HTTP_LOADER_CLIENT_KEY = {{ HTTP_LOADER_CLIENT_KEY | default(None) }} 327 | 328 | ## The filename for client SSL certificate 329 | ## Defaults to: None 330 | HTTP_LOADER_CLIENT_CERT = {{ HTTP_LOADER_CLIENT_CERT | default(None) }} 331 | 332 | ## If the CurlAsyncHTTPClient should be used 333 | ## Defaults to: False 334 | HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT | default(False) }} 335 | 336 | 337 | ################################################################################ 338 | 339 | 340 | ################################# File Storage ################################# 341 | 342 | ## Expiration in seconds for the images in the File Storage. Defaults to one 343 | ## month 344 | ## Defaults to: 2592000 345 | STORAGE_EXPIRATION_SECONDS = {{ STORAGE_EXPIRATION_SECONDS | default(2592000) }} 346 | 347 | ## Indicates whether thumbor should store the signing key for each image in the 348 | ## file storage. This allows the key to be changed and old images to still be 349 | ## properly found 350 | ## Defaults to: False 351 | STORES_CRYPTO_KEY_FOR_EACH_IMAGE = {{ STORES_CRYPTO_KEY_FOR_EACH_IMAGE | default(False) }} 352 | 353 | ## The root path where the File Storage will try to find images 354 | ## Defaults to: /tmp/thumbor/storage 355 | FILE_STORAGE_ROOT_PATH = '{{ FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/storage') }}' 356 | 357 | ################################################################################ 358 | 359 | 360 | #################################### Upload #################################### 361 | 362 | ## Max size in Kb for images uploaded to thumbor 363 | ## Aliases: MAX_SIZE 364 | ## Defaults to: 0 365 | UPLOAD_MAX_SIZE = {{ UPLOAD_MAX_SIZE | default(0) }} 366 | 367 | ## Indicates whether thumbor should enable File uploads 368 | ## Aliases: ENABLE_ORIGINAL_PHOTO_UPLOAD 369 | ## Defaults to: False 370 | UPLOAD_ENABLED = {{ UPLOAD_ENABLED | default(False) }} 371 | 372 | ## The type of storage to store uploaded images with 373 | ## Aliases: ORIGINAL_PHOTO_STORAGE 374 | ## Defaults to: thumbor.storages.file_storage 375 | UPLOAD_PHOTO_STORAGE = '{{ UPLOAD_PHOTO_STORAGE | default('thumbor.storages.file_storage') }}' 376 | 377 | ## Indicates whether image deletion should be allowed 378 | ## Aliases: ALLOW_ORIGINAL_PHOTO_DELETION 379 | ## Defaults to: False 380 | UPLOAD_DELETE_ALLOWED = {{ UPLOAD_DELETE_ALLOWED | default(False) }} 381 | 382 | ## Indicates whether image overwrite should be allowed 383 | ## Aliases: ALLOW_ORIGINAL_PHOTO_PUTTING 384 | ## Defaults to: False 385 | UPLOAD_PUT_ALLOWED = {{ UPLOAD_PUT_ALLOWED | default(False) }} 386 | 387 | ## Default filename for image uploaded 388 | ## Defaults to: image 389 | UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME | default('image') }}' 390 | 391 | ################################################################################ 392 | 393 | 394 | ############################### MongoDB Storage ################################ 395 | 396 | ## MongoDB storage server host 397 | ## Defaults to: localhost 398 | MONGO_STORAGE_SERVER_HOST = '{{ MONGO_STORAGE_SERVER_HOST | default('mongo') }}' 399 | 400 | ## MongoDB storage server port 401 | ## Defaults to: 27017 402 | MONGO_STORAGE_SERVER_PORT = {{ MONGO_STORAGE_SERVER_PORT | default(27017) }} 403 | 404 | ## MongoDB storage server database name 405 | ## Defaults to: thumbor 406 | MONGO_STORAGE_SERVER_DB = '{{ MONGO_STORAGE_SERVER_DB | default('thumbor') }}' 407 | 408 | ## MongoDB storage image collection 409 | ## Defaults to: images 410 | MONGO_STORAGE_SERVER_COLLECTION = '{{ MONGO_STORAGE_SERVER_COLLECTION | default('images') }}' 411 | 412 | ################################################################################ 413 | 414 | 415 | ################################ Redis Storage ################################# 416 | 417 | ## Redis storage server host 418 | ## Defaults to: localhost 419 | REDIS_STORAGE_SERVER_HOST = '{{ REDIS_STORAGE_SERVER_HOST | default('redis') }}' 420 | 421 | ## Redis storage server port 422 | ## Defaults to: 6379 423 | REDIS_STORAGE_SERVER_PORT = {{ REDIS_STORAGE_SERVER_PORT | default(6379) }} 424 | 425 | ## Redis storage database index 426 | ## Defaults to: 0 427 | REDIS_STORAGE_SERVER_DB = {{ REDIS_STORAGE_SERVER_DB | default(0) }} 428 | 429 | ## Redis storage server password 430 | ## Defaults to: None 431 | REDIS_STORAGE_SERVER_PASSWORD = {{ REDIS_STORAGE_SERVER_PASSWORD | default(None) }} 432 | 433 | ################################################################################ 434 | 435 | 436 | ################################ Redis Result Storage ################################# 437 | 438 | ## Redis storage server host 439 | ## Defaults to: localhost 440 | REDIS_RESULT_STORAGE_SERVER_HOST = '{{ REDIS_RESULT_STORAGE_SERVER_HOST | default('redis') }}' 441 | 442 | ## Redis storage server port 443 | ## Defaults to: 6379 444 | REDIS_RESULT_STORAGE_SERVER_PORT = {{ REDIS_RESULT_STORAGE_SERVER_PORT | default(6379) }} 445 | 446 | ## Redis storage database index 447 | ## Defaults to: 0 448 | REDIS_RESULT_STORAGE_SERVER_DB = {{ REDIS_RESULT_STORAGE_SERVER_DB | default(0) }} 449 | 450 | ## Redis storage server password 451 | ## Defaults to: None 452 | REDIS_RESULT_STORAGE_SERVER_PASSWORD = {{ REDIS_STORAGE_SERVER_PASSWORD | default(None) }} 453 | 454 | ################################################################################ 455 | 456 | 457 | ############################### Memcache Storage ############################### 458 | 459 | ## List of Memcache storage server hosts 460 | ## Defaults to: ['localhost:11211'] 461 | MEMCACHE_STORAGE_SERVERS = {{ MEMCACHE_STORAGE_SERVERS | default(['localhost:11211',]) }} 462 | 463 | 464 | ################################################################################ 465 | 466 | 467 | ################################ Mixed Storage ################################# 468 | 469 | ## Mixed Storage file storage. This must be the full name of a python module 470 | ## (python must be able to import it) 471 | ## Defaults to: thumbor.storages.no_storage 472 | MIXED_STORAGE_FILE_STORAGE = '{{ MIXED_STORAGE_FILE_STORAGE | default('thumbor.storages.no_storage') }}' 473 | 474 | ## Mixed Storage signing key storage. This must be the full name of a python 475 | ## module (python must be able to import it) 476 | ## Defaults to: thumbor.storages.no_storage 477 | MIXED_STORAGE_CRYPTO_STORAGE = '{{ MIXED_STORAGE_CRYPTO_STORAGE | default('thumbor.storages.no_storage') }}' 478 | 479 | ## Mixed Storage detector information storage. This must be the full name of a 480 | ## python module (python must be able to import it) 481 | ## Defaults to: thumbor.storages.no_storage 482 | MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE | default('thumbor.storages.no_storage') }}' 483 | 484 | ################################################################################ 485 | 486 | 487 | ##################################### Meta ##################################### 488 | 489 | ## The callback function name that should be used by the META route for JSONP 490 | ## access 491 | ## Defaults to: None 492 | META_CALLBACK_NAME = {{ META_CALLBACK_NAME | default(None) }} 493 | 494 | ################################################################################ 495 | 496 | 497 | ################################## Detection ################################### 498 | 499 | ## List of detectors that thumbor should use to find faces and/or features. All 500 | ## of them must be full names of python modules (python must be able to import 501 | ## it) 502 | ## Defaults to: [] 503 | #DETECTORS = [ 504 | #'thumbor.detectors.queued_detector.queued_complete_detector', 505 | #'thumbor.detectors.queued_detector.queued_face_detector', 506 | #'thumbor.detectors.queued_detector.queued_feature_detector', 507 | #'thumbor.detectors.feature_detector', 508 | #'thumbor.detectors.face_detector', 509 | #] 510 | DETECTORS = {{ DETECTORS | default([]) }} 511 | 512 | ## The cascade file that opencv will use to detect faces 513 | ## Defaults to: haarcascade_frontalface_alt.xml 514 | FACE_DETECTOR_CASCADE_FILE = '{{ FACE_DETECTOR_CASCADE_FILE | default('haarcascade_frontalface_alt.xml') }}' 515 | 516 | ## The cascade file that opencv will use to detect glasses. 517 | ## Defaults to: 'haarcascade_eye_tree_eyeglasses.xml' 518 | GLASSES_DETECTOR_CASCADE_FILE = '{{ GLASSES_DETECTOR_CASCADE_FILE | default('haarcascade_eye_tree_eyeglasses.xml') }}' 519 | 520 | ## The cascade file that opencv will use to detect profile faces. 521 | ## Defaults to: 'haarcascade_profileface.xml' 522 | PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE | default('haarcascade_profileface.xml') }}' 523 | 524 | ################################################################################ 525 | 526 | 527 | ################################## Optimizers ################################## 528 | 529 | ## List of optimizers that thumbor will use to optimize images 530 | ## Defaults to: [] --> ['thumbor.optimizers.jpegtran',] 531 | OPTIMIZERS = {{ OPTIMIZERS | default([]) }} 532 | 533 | 534 | ## Path for the jpegtran binary 535 | ## Defaults to: /usr/bin/jpegtran 536 | JPEGTRAN_PATH = '{{ JPEGTRAN_PATH | default('/usr/bin/jpegtran') }}' 537 | PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} 538 | FFMPEG_PATH = '{{ FFMPEG_PATH | default('/usr/bin/ffmpeg') }}' # Default path for the docker installation in debian 539 | 540 | ################################################################################ 541 | 542 | 543 | ################################### Filters #################################### 544 | 545 | ## List of filters that thumbor will allow to be used in generated images. All of 546 | ## them must be full names of python modules (python must be able to import 547 | ## it) 548 | ## using thumbor's default, unless specified. 549 | {% if FILTERS is defined %} 550 | FILTERS = {{ FILTERS }} 551 | {% endif %} 552 | 553 | ################################################################################ 554 | 555 | 556 | ################################ Result Storage ################################ 557 | 558 | ## Expiration in seconds of generated images in the result storage 559 | ## Defaults to: 0 560 | RESULT_STORAGE_EXPIRATION_SECONDS = {{ RESULT_STORAGE_EXPIRATION_SECONDS | default(0) }} 561 | 562 | ## Path where the Result storage will store generated images 563 | ## Defaults to: /tmp/thumbor/result_storage 564 | RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '{{ RESULT_STORAGE_FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/result_storage') }}' 565 | 566 | ## Indicates whether unsafe requests should also be stored in the Result Storage 567 | ## Defaults to: False 568 | RESULT_STORAGE_STORES_UNSAFE = {{ RESULT_STORAGE_STORES_UNSAFE | default(False) }} 569 | 570 | ################################################################################ 571 | 572 | 573 | ############################ Queued Redis Detector ############################# 574 | 575 | ## Server host for the queued redis detector 576 | ## Defaults to: localhost 577 | REDIS_QUEUE_SERVER_HOST = '{{ REDIS_QUEUE_SERVER_HOST | default('redis') }}' 578 | 579 | ## Server port for the queued redis detector 580 | ## Defaults to: 6379 581 | REDIS_QUEUE_SERVER_PORT = {{ REDIS_QUEUE_SERVER_PORT | default(6379) }} 582 | 583 | ## Server database index for the queued redis detector 584 | ## Defaults to: 0 585 | REDIS_QUEUE_SERVER_DB = {{ REDIS_QUEUE_SERVER_DB | default(0) }} 586 | 587 | ## Server password for the queued redis detector 588 | ## Defaults to: None 589 | REDIS_QUEUE_SERVER_PASSWORD = {{ REDIS_QUEUE_SERVER_PASSWORD | default(None) }} 590 | 591 | ################################################################################ 592 | 593 | 594 | ############################# Queued SQS Detector ############################## 595 | 596 | ## AWS key id 597 | ## Defaults to: None 598 | SQS_QUEUE_KEY_ID = {{ SQS_QUEUE_KEY_ID | default(None) }} 599 | 600 | ## AWS key secret 601 | ## Defaults to: None 602 | SQS_QUEUE_KEY_SECRET = {{ SQS_QUEUE_KEY_SECRET | default(None) }} 603 | 604 | ## AWS SQS region 605 | ## Defaults to: us-east-1 606 | SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION | default('us-east-1') }}' 607 | 608 | ################################################################################ 609 | 610 | 611 | #################################### Errors #################################### 612 | 613 | ## This configuration indicates whether thumbor should use a custom error 614 | ## handler. 615 | ## Defaults to: False 616 | USE_CUSTOM_ERROR_HANDLING = {{ USE_CUSTOM_ERROR_HANDLING | default(False) }} 617 | 618 | ## Error reporting module. Needs to contain a class called ErrorHandler with a 619 | ## handle_error(context, handler, exception) method. 620 | ## Defaults to: thumbor.error_handlers.sentry 621 | ERROR_HANDLER_MODULE = '{{ ERROR_HANDLER_MODULE | default('thumbor.error_handlers.sentry') }}' 622 | 623 | ## File of error log as json 624 | ## Defaults to: None 625 | ERROR_FILE_LOGGER = {{ ERROR_FILE_LOGGER | default(None) }} 626 | 627 | ## File of error log name is parametrized with context attribute 628 | ## Defaults to: False 629 | ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT | default('False') }} 630 | 631 | ################################################################################ 632 | 633 | 634 | ############################### Errors - Sentry ################################ 635 | 636 | ## Sentry thumbor project dsn. i.e.: http://5a63d58ae7b94f1dab3dee740b301d6a:73ee 637 | ## a45d3e8649239a973087e8f21f98@localhost:9000/2 638 | ## Defaults to: 639 | SENTRY_DSN_URL = '{{ SENTRY_DSN_URL | default('') }}' 640 | 641 | ################################################################################ 642 | 643 | ################################### General #################################### 644 | 645 | ## Custom app class to override ThumborServiceApp. This config value is 646 | ## overridden by the -a command-line parameter. 647 | ## Defaults to: 'thumbor.app.ThumborServiceApp' 648 | APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' 649 | 650 | ################################################################################ 651 | 652 | ############################## TC_AWS ########################################## 653 | TC_AWS_REGION = '{{ TC_AWS_REGION | default('eu-west-1') }}' # AWS Region 654 | 655 | TC_AWS_ENDPOINT = {{ TC_AWS_ENDPOINT | default(None) }} # Custom S3 endpoint URL (for GCP, Minio, etc.) 656 | 657 | TC_AWS_STORAGE_BUCKET = '{{ TC_AWS_STORAGE_BUCKET | default('') }}' # S3 bucket for Storage 658 | TC_AWS_STORAGE_ROOT_PATH = '{{ TC_AWS_STORAGE_ROOT_PATH | default('') }}' # S3 path prefix for Storage bucket 659 | 660 | TC_AWS_LOADER_BUCKET = '{{ TC_AWS_LOADER_BUCKET | default('') }}' #S3 bucket for loader 661 | TC_AWS_LOADER_ROOT_PATH = '{{ TC_AWS_LOADER_ROOT_PATH | default('') }}' # S3 path prefix for Loader bucket 662 | 663 | TC_AWS_RESULT_STORAGE_BUCKET = '{{ TC_AWS_RESULT_STORAGE_BUCKET | default('') }}' # S3 bucket for result Storage 664 | TC_AWS_RESULT_STORAGE_ROOT_PATH = '{{ TC_AWS_RESULT_STORAGE_ROOT_PATH | default('') }}' # S3 path prefix for Result storage bucket 665 | 666 | # put data into S3 using the Server Side Encryption functionality to 667 | # encrypt data at rest in S3 668 | # https://aws.amazon.com/about-aws/whats-new/2011/10/04/amazon-s3-announces-server-side-encryption-support/ 669 | TC_AWS_STORAGE_SSE = {{ TC_AWS_STORAGE_SSE | default(False) }} 670 | 671 | # put data into S3 with Reduced Redundancy 672 | # https://aws.amazon.com/about-aws/whats-new/2010/05/19/announcing-amazon-s3-reduced-redundancy-storage/ 673 | TC_AWS_STORAGE_RRS = {{ TC_AWS_STORAGE_RRS | default(False) }} 674 | 675 | # Add some randomization in the S3 keys for the Storage and Result Storage. 676 | # Defaults to False for Backwards Compatibility, set it to True for performance. 677 | TC_AWS_RANDOMIZE_KEYS = {{ TC_AWS_RANDOMIZE_KEYS | default(False) }} 678 | 679 | # Enable HTTP Loader as well? 680 | # This would allow you to load watermarks in over your images dynamically through a URI 681 | # E.g. 682 | # http://your-thumbor.com/unsafe/filters:watermark(http://example.com/watermark.png,0,0,50)/s3_bucket/photo.jpg 683 | TC_AWS_ENABLE_HTTP_LOADER = {{ TC_AWS_ENABLE_HTTP_LOADER | default(False) }} 684 | 685 | TC_AWS_ALLOWED_BUCKETS = {{ TC_AWS_ALLOWED_BUCKETS | default(False) }} # List of allowed bucket to be requested 686 | TC_AWS_STORE_METADATA = {{ TC_AWS_STORE_METADATA | default(False) }} # Store result with metadata (for instance content-type) 687 | ################################################################################ 688 | 689 | ########################## Google Cloud Storage ################################ 690 | CLOUD_STORAGE_BUCKET_ID = '{{ CLOUD_STORAGE_BUCKET_ID | default('') }}' 691 | CLOUD_STORAGE_PROJECT_ID = '{{ CLOUD_STORAGE_PROJECT_ID | default('') }}' 692 | 693 | RESULT_STORAGE_CLOUD_STORAGE_PROJECT_ID = '{{ RESULT_STORAGE_CLOUD_STORAGE_PROJECT_ID | default('') }}' 694 | RESULT_STORAGE_CLOUD_STORAGE_BUCKET_ID = '{{ RESULT_STORAGE_CLOUD_STORAGE_BUCKET_ID | default('') }}' 695 | ################################################################################ 696 | -------------------------------------------------------------------------------- /7/alpine/thumbor.conf.tpl: -------------------------------------------------------------------------------- 1 | ################################### Logging #################################### 2 | 3 | ## Logging configuration as json 4 | ## Defaults to: None 5 | THUMBOR_LOG_CONFIG = {{ THUMBOR_LOG_CONFIG | default(None) }} 6 | 7 | ## Log Format to be used by thumbor when writing log messages. 8 | ## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s 9 | THUMBOR_LOG_FORMAT = '{{ THUMBOR_LOG_FORMAT | default('%(asctime)s %(name)s:%(levelname)s %(message)s') }}' 10 | 11 | ## Date Format to be used by thumbor when writing log messages. 12 | ## Defaults to: %Y-%m-%d %H:%M:%S 13 | THUMBOR_LOG_DATE_FORMAT = '{{ THUMBOR_LOG_DATE_FORMAT | default('%Y-%m-%d %H:%M:%S') }}' 14 | 15 | ################################################################################ 16 | 17 | 18 | ################################### Imaging #################################### 19 | 20 | ## Max width in pixels for images read or generated by thumbor 21 | ## Defaults to: 0 22 | MAX_WIDTH = {{ MAX_WIDTH | default(0) }} 23 | 24 | ## Max height in pixels for images read or generated by thumbor 25 | ## Defaults to: 0 26 | MAX_HEIGHT = {{ MAX_HEIGHT | default(0) }} 27 | 28 | ## Max pixel count for images read by thumbor. Set to prevent decompression bomb DOS attack. 29 | ## Defaults to: 75000000 pixels 30 | MAX_PIXELS = {{ MAX_PIXELS | default(75000000) }} 31 | 32 | ## Min width in pixels for images read or generated by thumbor 33 | ## Defaults to: 1 34 | MIN_WIDTH = {{ MIN_WIDTH | default(1) }} 35 | 36 | ## Min width in pixels for images read or generated by thumbor 37 | ## Defaults to: 1 38 | MIN_HEIGHT = {{ MIN_HEIGHT | default(1) }} 39 | 40 | ## Allowed domains for the http loader to download. These are regular 41 | ## expressions. 42 | ## Defaults to: [] 43 | ALLOWED_SOURCES = {{ ALLOWED_SOURCES | default([]) }} 44 | 45 | 46 | ## Quality index used for generated JPEG images 47 | ## Defaults to: 80 48 | QUALITY = {{ QUALITY | default(80) }} 49 | 50 | ## Exports JPEG images with the progressive flag set. 51 | ## Defaults to: True 52 | PROGRESSIVE_JPEG = {{ PROGRESSIVE_JPEG | default(True) }} 53 | 54 | ## Specify subsampling behavior for Pillow (see `subsampling` in 55 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 56 | ## formats.html#jpeg).Be careful to use int for 0,1,2 and string for "4:4:4" 57 | ## notation. Will ignore `quality`. Using `keep` will copy the original file's 58 | ## subsampling. 59 | ## Defaults to: None 60 | PILLOW_JPEG_SUBSAMPLING = {{ PILLOW_JPEG_SUBSAMPLING | default(None) }} 61 | 62 | ## Specify quantization tables for Pillow (see `qtables` in 63 | ## http://pillow.readthedocs.org/en/latest/handbook/image-file- 64 | ## formats.html#jpeg). Will ignore `quality`. Using `keep` will copy the 65 | ## original file's qtables. 66 | ## Defaults to: None 67 | PILLOW_JPEG_QTABLES = {{ PILLOW_JPEG_QTABLES | default(None) }} 68 | 69 | ## Specify resampling filter for Pillow resize method.One of LANCZOS, NEAREST, 70 | ## BILINEAR, BICUBIC, HAMMING (Pillow>=3.4.0). 71 | ## Defaults to: 'LANCZOS' 72 | PILLOW_RESAMPLING_FILTER = '{{ PILLOW_RESAMPLING_FILTER | default('LANCZOS') }}' 73 | 74 | ## Quality index used for generated WebP images. If not set (None) the same level 75 | ## of JPEG quality will be used. 76 | ## Defaults to: None 77 | WEBP_QUALITY = {{ WEBP_QUALITY | default(None) }} 78 | 79 | 80 | ## Compression level for generated PNG images. 81 | ## Defaults to: 6 82 | PNG_COMPRESSION_LEVEL = {{ PNG_COMPRESSION_LEVEL | default(6) }} 83 | 84 | ## Indicates if final image should preserve indexed mode (P or 1) of original 85 | ## image 86 | ## Defaults to: True 87 | PILLOW_PRESERVE_INDEXED_MODE = {{ PILLOW_PRESERVE_INDEXED_MODE | default(True) }} 88 | 89 | ## Specifies whether WebP format should be used automatically if the request 90 | ## accepts it (via Accept header) 91 | ## Defaults to: False 92 | AUTO_WEBP = {{ AUTO_WEBP | default(False) }} 93 | 94 | ## Specifies whether a PNG image should be used automatically if the png image 95 | ## has no transparency (via alpha layer). WARNING: Depending on case, this is 96 | ## not a good deal. This transformation maybe causes distortions or the size 97 | ## of image can increase. Images with texts, for example, the result image 98 | ## maybe will be distorced. Dark images, for example, the size of result image 99 | ## maybe will be bigger. You have to evaluate the majority of your use cases 100 | ## to take a decision about the usage of this conf. 101 | ## Defaults to: False 102 | AUTO_PNG_TO_JPG = {{ AUTO_PNG_TO_JPG | default(False) }} 103 | 104 | ## Specify the ratio between 1in and 1px for SVG images. This is only used 105 | ## whenrasterizing SVG images having their size units in cm or inches. 106 | ## Defaults to: 150 107 | SVG_DPI = {{ SVG_DPI | default(150) }} 108 | 109 | ## Max AGE sent as a header for the image served by thumbor in seconds 110 | ## Defaults to: 86400 111 | MAX_AGE = {{ MAX_AGE | default(86400) }} 112 | 113 | ## Indicates the Max AGE header in seconds for temporary images (images with 114 | ## failed smart detection) 115 | ## Defaults to: 0 116 | MAX_AGE_TEMP_IMAGE = {{ MAX_AGE_TEMP_IMAGE | default(0) }} 117 | 118 | ## Indicates whether thumbor should rotate images that have an Orientation EXIF 119 | ## header 120 | ## Defaults to: False 121 | RESPECT_ORIENTATION = {{ RESPECT_ORIENTATION | default(False) }} 122 | 123 | ## Ignore errors during smart detections and return image as a temp image (not 124 | ## saved in result storage and with MAX_AGE_TEMP_IMAGE age) 125 | ## Defaults to: False 126 | IGNORE_SMART_ERRORS = {{ IGNORE_SMART_ERRORS | default(False) }} 127 | 128 | ## Sends If-Modified-Since & Last-Modified headers; requires support from result 129 | ## storage 130 | ## Defaults to: False 131 | SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = {{ SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS | default(False) }} 132 | 133 | ## Preserves exif information in generated images. Increases image size in 134 | ## kbytes, use with caution. 135 | ## Defaults to: False 136 | PRESERVE_EXIF_INFO = {{ PRESERVE_EXIF_INFO | default(False) }} 137 | 138 | ## Indicates whether thumbor should enable the EXPERIMENTAL support for animated 139 | ## gifs. 140 | ## Defaults to: True 141 | ALLOW_ANIMATED_GIFS = {{ ALLOW_ANIMATED_GIFS | default(True) }} 142 | 143 | ## Indicates whether thumbor should use gifsicle engine. Please note that smart 144 | ## cropping and filters are not supported for gifs using gifsicle (but won't 145 | ## give an error). 146 | ## Defaults to: False 147 | USE_GIFSICLE_ENGINE = {{ USE_GIFSICLE_ENGINE | default(False) }} 148 | 149 | ## Indicates whether thumbor should enable blacklist functionality to prevent 150 | ## processing certain images. 151 | ## Defaults to: False 152 | USE_BLACKLIST = {{ USE_BLACKLIST | default(False) }} 153 | 154 | ## Size of the thread pool used for image transformations. The default value is 155 | ## 0 (don't use a threadpoool. Increase this if you are seeing your IOLoop 156 | ## getting blocked (often indicated by your upstream HTTP requests timing out) 157 | ## Defaults to: 0 158 | ENGINE_THREADPOOL_SIZE = {{ ENGINE_THREADPOOL_SIZE | default(0) }} 159 | 160 | 161 | 162 | ################################################################################ 163 | 164 | 165 | ################################ Extensibility ################################# 166 | 167 | ## The metrics backend thumbor should use to measure internal actions. This must 168 | ## be the full name of a python module (python must be able to import it) 169 | ## Defaults to: 'thumbor.metrics.logger_metrics' 170 | METRICS = '{{ METRICS | default('thumbor.metrics.logger_metrics') }}' 171 | 172 | ## The loader thumbor should use to load the original image. This must be the 173 | ## full name of a python module (python must be able to import it) 174 | ## Defaults to: thumbor.loaders.http_loader 175 | LOADER = '{{ LOADER | default('thumbor.loaders.http_loader') }}' 176 | 177 | ## The file storage thumbor should use to store original images. This must be the 178 | ## full name of a python module (python must be able to import it) 179 | ## Defaults to: thumbor.storages.file_storage 180 | STORAGE = '{{ STORAGE | default('thumbor.storages.file_storage') }}' 181 | 182 | ## The result storage thumbor should use to store generated images. This must be 183 | ## the full name of a python module (python must be able to import it) 184 | ## Defaults to: None 185 | RESULT_STORAGE = '{{ RESULT_STORAGE | default('thumbor.result_storages.file_storage') }}' 186 | 187 | ## The imaging engine thumbor should use to perform image operations. This must 188 | ## be the full name of a python module (python must be able to import it) 189 | ## Defaults to: thumbor.engines.pil 190 | ENGINE = '{{ ENGINE | default('thumbor.engines.pil') }}' 191 | 192 | ## The gif engine thumbor should use to perform image operations. This must be 193 | ## the full name of a python module (python must be able to import it) 194 | ## Defaults to: 'thumbor.engines.gif' 195 | GIF_ENGINE = '{{ GIF_ENGINE | default('thumbor.engines.gif') }}' 196 | 197 | ## The url signer thumbor should use to verify url signatures.This must be the 198 | ## full name of a python module (python must be able to import it) 199 | ## Defaults to: 'libthumbor.url_signers.base64_hmac_sha1' 200 | URL_SIGNER = '{{ URL_SIGNER | default('libthumbor.url_signers.base64_hmac_sha1') }}' 201 | 202 | ################################################################################ 203 | 204 | 205 | ################################### Security ################################### 206 | 207 | ## The security key thumbor uses to sign image URLs 208 | ## Defaults to: MY_SECURE_KEY 209 | SECURITY_KEY = '{{ SECURITY_KEY | default('MY_SECURE_KEY') }}' 210 | 211 | ## Indicates if the /unsafe URL should be available 212 | ## Defaults to: True 213 | ALLOW_UNSAFE_URL = {{ ALLOW_UNSAFE_URL | default(True) }} 214 | 215 | ################################################################################ 216 | 217 | ##################################### HTTP ##################################### 218 | 219 | ## Enables automatically generated etags 220 | ## Defaults to: True 221 | ENABLE_ETAGS = {{ ENABLE_ETAGS | default(True) }} 222 | 223 | ################################################################################ 224 | 225 | 226 | ################################### Storage #################################### 227 | 228 | ## Set maximum id length for images when stored 229 | ## Defaults to: 32 230 | MAX_ID_LENGTH = {{ MAX_ID_LENGTH | default(32) }} 231 | 232 | ################################################################################ 233 | 234 | 235 | ################################# Performance ################################## 236 | 237 | ## Set garbage collection interval in seconds 238 | ## Defaults to: None 239 | GC_INTERVAL = {{ GC_INTERVAL | default(None) }} 240 | 241 | ################################################################################ 242 | 243 | 244 | ################################# Healthcheck ################################## 245 | 246 | ## Healthcheck route. 247 | ## Defaults to: '/healthcheck/?' 248 | HEALTHCHECK_ROUTE = '{{ HEALTHCHECK_ROUTE | default('/healthcheck/?') }}' 249 | 250 | ################################################################################ 251 | 252 | 253 | ################################### Metrics #################################### 254 | 255 | ## Host to send statsd instrumentation to 256 | ## Defaults to: None 257 | STATSD_HOST = {{ STATSD_HOST | default(None) }} 258 | 259 | ## Port to send statsd instrumentation to 260 | ## Defaults to: 8125 261 | STATSD_PORT = {{ STATSD_PORT | default(8125) }} 262 | 263 | ## Prefix for statsd 264 | ## Defaults to: None 265 | STATSD_PREFIX = {{ STATSD_PREFIX | default(None) }} 266 | 267 | ################################################################################ 268 | 269 | ################################# File Loader ################################## 270 | 271 | ## The root path where the File Loader will try to find images 272 | ## Defaults to: '/usr/local/thumbor' 273 | FILE_LOADER_ROOT_PATH = '{{ FILE_LOADER_ROOT_PATH | default('/usr/local/thumbor/loader') }}' 274 | 275 | ################################################################################ 276 | 277 | 278 | ################################# HTTP Loader ################################## 279 | 280 | ## The maximum number of seconds libcurl can take to connect to an image being 281 | ## loaded 282 | ## Defaults to: 5 283 | HTTP_LOADER_CONNECT_TIMEOUT = {{ HTTP_LOADER_CONNECT_TIMEOUT | default(5) }} 284 | 285 | ## The maximum number of seconds libcurl can take to download an image 286 | ## Defaults to: 20 287 | HTTP_LOADER_REQUEST_TIMEOUT = {{ HTTP_LOADER_REQUEST_TIMEOUT | default(20) }} 288 | 289 | ## Indicates whether libcurl should follow redirects when downloading an image 290 | ## Defaults to: True 291 | HTTP_LOADER_FOLLOW_REDIRECTS = {{ HTTP_LOADER_FOLLOW_REDIRECTS | default(True) }} 292 | 293 | ## Indicates the number of redirects libcurl should follow when downloading an 294 | ## image 295 | ## Defaults to: 5 296 | HTTP_LOADER_MAX_REDIRECTS = {{ HTTP_LOADER_MAX_REDIRECTS | default(5) }} 297 | 298 | ## The maximum number of simultaneous HTTP connections the loader can make before 299 | ## queuing 300 | ## Defaults to: 10 301 | HTTP_LOADER_MAX_CLIENTS = {{ HTTP_LOADER_MAX_CLIENTS | default(10) }} 302 | 303 | ## Indicates whether thumbor should forward the user agent of the requesting user 304 | ## Defaults to: False 305 | HTTP_LOADER_FORWARD_USER_AGENT = {{ HTTP_LOADER_FORWARD_USER_AGENT | default(False) }} 306 | 307 | ## Indicates whether thumbor should forward the headers of the request 308 | ## Defaults to: False 309 | HTTP_LOADER_FORWARD_ALL_HEADERS = {{ HTTP_LOADER_FORWARD_ALL_HEADERS | default(False) }} 310 | 311 | ## Indicates which headers should be forwarded among all the headers of the 312 | ## request 313 | ## Defaults to: [] 314 | HTTP_LOADER_FORWARD_HEADERS_WHITELIST = {{ HTTP_LOADER_FORWARD_HEADERS_WHITELIST | default([]) }} 315 | 316 | ## Default user agent for thumbor http loader requests 317 | ## Defaults to: Thumbor/7.5.2 318 | HTTP_LOADER_DEFAULT_USER_AGENT = '{{ HTTP_LOADER_DEFAULT_USER_AGENT | default('Thumbor/7.5.2') }}' 319 | 320 | ## The proxy host needed to load images through 321 | ## Defaults to: None 322 | HTTP_LOADER_PROXY_HOST = {{ HTTP_LOADER_PROXY_HOST | default(None) }} 323 | 324 | ## The proxy port for the proxy host 325 | ## Defaults to: None 326 | HTTP_LOADER_PROXY_PORT = {{ HTTP_LOADER_PROXY_PORT | default(None) }} 327 | 328 | ## The proxy username for the proxy host 329 | ## Defaults to: None 330 | HTTP_LOADER_PROXY_USERNAME = {{ HTTP_LOADER_PROXY_USERNAME | default(None) }} 331 | 332 | ## The proxy password for the proxy host 333 | ## Defaults to: None 334 | HTTP_LOADER_PROXY_PASSWORD = {{ HTTP_LOADER_PROXY_PASSWORD | default(None) }} 335 | 336 | ## The filename of CA certificates in PEM format 337 | ## Defaults to: None 338 | HTTP_LOADER_CA_CERTS = {{ HTTP_LOADER_CA_CERTS | default(None) }} 339 | 340 | ## Validate the servers certificate for HTTPS requests 341 | ## Defaults to: None 342 | HTTP_LOADER_VALIDATE_CERTS = {{ HTTP_LOADER_VALIDATE_CERTS | default(None) }} 343 | 344 | ## The filename for client SSL key 345 | ## Defaults to: None 346 | HTTP_LOADER_CLIENT_KEY = {{ HTTP_LOADER_CLIENT_KEY | default(None) }} 347 | 348 | ## The filename for client SSL certificate 349 | ## Defaults to: None 350 | HTTP_LOADER_CLIENT_CERT = {{ HTTP_LOADER_CLIENT_CERT | default(None) }} 351 | 352 | ## If the CurlAsyncHTTPClient should be used 353 | ## Defaults to: False 354 | HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = {{ HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT | default(False) }} 355 | 356 | ################################################################################ 357 | 358 | 359 | ################################### General #################################### 360 | 361 | ## If HTTP_LOADER_CURL_LOW_SPEED_LIMIT and HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT are 362 | ## set, then this is the time in seconds as integer after a download should 363 | ## timeout if the speed is below HTTP_LOADER_CURL_LOW_SPEED_LIMIT for that 364 | ## long 365 | ## Defaults to: 0 366 | HTTP_LOADER_CURL_LOW_SPEED_TIME = {{ HTTP_LOADER_CURL_LOW_SPEED_TIME | default(0) }} 367 | 368 | ## If HTTP_LOADER_CURL_LOW_SPEED_TIME and HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT are 369 | ## set, then this is the limit in bytes per second as integer which should 370 | ## timeout if the speed is below that limit for 371 | ## HTTP_LOADER_CURL_LOW_SPEED_TIME seconds 372 | ## Defaults to: 0 373 | HTTP_LOADER_CURL_LOW_SPEED_LIMIT = {{ HTTP_LOADER_CURL_LOW_SPEED_LIMIT | default(0) }} 374 | 375 | ## Custom app class to override ThumborServiceApp. This config value is 376 | ## overridden by the -a command-line parameter. 377 | ## Defaults to: 'thumbor.app.ThumborServiceApp' 378 | APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' 379 | 380 | ################################################################################ 381 | 382 | 383 | ################################# File Storage ################################# 384 | 385 | ## Expiration in seconds for the images in the File Storage. Defaults to one 386 | ## month 387 | ## Defaults to: 2592000 388 | STORAGE_EXPIRATION_SECONDS = {{ STORAGE_EXPIRATION_SECONDS | default(2592000) }} 389 | 390 | ## Indicates whether thumbor should store the signing key for each image in the 391 | ## file storage. This allows the key to be changed and old images to still be 392 | ## properly found 393 | ## Defaults to: False 394 | STORES_CRYPTO_KEY_FOR_EACH_IMAGE = {{ STORES_CRYPTO_KEY_FOR_EACH_IMAGE | default(False) }} 395 | 396 | ## The root path where the File Storage will try to find images 397 | ## Defaults to: /tmp/thumbor/storage 398 | FILE_STORAGE_ROOT_PATH = '{{ FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/storage') }}' 399 | 400 | ################################################################################ 401 | 402 | 403 | #################################### Upload #################################### 404 | 405 | ## Max size in Kb for images uploaded to thumbor 406 | ## Aliases: MAX_SIZE 407 | ## Defaults to: 0 408 | UPLOAD_MAX_SIZE = {{ UPLOAD_MAX_SIZE | default(0) }} 409 | 410 | ## Indicates whether thumbor should enable File uploads 411 | ## Aliases: ENABLE_ORIGINAL_PHOTO_UPLOAD 412 | ## Defaults to: False 413 | UPLOAD_ENABLED = {{ UPLOAD_ENABLED | default(False) }} 414 | 415 | ## The type of storage to store uploaded images with 416 | ## Aliases: ORIGINAL_PHOTO_STORAGE 417 | ## Defaults to: thumbor.storages.file_storage 418 | UPLOAD_PHOTO_STORAGE = '{{ UPLOAD_PHOTO_STORAGE | default('thumbor.storages.file_storage') }}' 419 | 420 | ## Indicates whether image deletion should be allowed 421 | ## Aliases: ALLOW_ORIGINAL_PHOTO_DELETION 422 | ## Defaults to: False 423 | UPLOAD_DELETE_ALLOWED = {{ UPLOAD_DELETE_ALLOWED | default(False) }} 424 | 425 | ## Indicates whether image overwrite should be allowed 426 | ## Aliases: ALLOW_ORIGINAL_PHOTO_PUTTING 427 | ## Defaults to: False 428 | UPLOAD_PUT_ALLOWED = {{ UPLOAD_PUT_ALLOWED | default(False) }} 429 | 430 | ## Default filename for image uploaded 431 | ## Defaults to: image 432 | UPLOAD_DEFAULT_FILENAME = '{{ UPLOAD_DEFAULT_FILENAME | default('image') }}' 433 | 434 | ################################################################################ 435 | 436 | 437 | ################################# Mixed Storage ################################# 438 | 439 | ## Mixed Storage file storage. This must be the full name of a python module 440 | ## (python must be able to import it) 441 | ## Defaults to: 'thumbor.storages.no_storage' 442 | MIXED_STORAGE_FILE_STORAGE = '{{ MIXED_STORAGE_FILE_STORAGE | default('thumbor.storages.no_storage') }}' 443 | 444 | ## Mixed Storage signing key storage. This must be the full name of a python 445 | ## module (python must be able to import it) 446 | ## Defaults to: 'thumbor.storages.no_storage' 447 | MIXED_STORAGE_CRYPTO_STORAGE = '{{ MIXED_STORAGE_CRYPTO_STORAGE | default('thumbor.storages.no_storage') }}' 448 | 449 | ## Mixed Storage detector information storage. This must be the full name of a 450 | ## python module (python must be able to import it) 451 | ## Defaults to: 'thumbor.storages.no_storage' 452 | MIXED_STORAGE_DETECTOR_STORAGE = '{{ MIXED_STORAGE_DETECTOR_STORAGE | default('thumbor.storages.no_storage') }}' 453 | 454 | ################################################################################ 455 | 456 | 457 | ##################################### Meta ##################################### 458 | 459 | ## The callback function name that should be used by the META route for JSONP 460 | ## access 461 | ## Defaults to: None 462 | META_CALLBACK_NAME = {{ META_CALLBACK_NAME | default(None) }} 463 | 464 | ################################################################################ 465 | 466 | 467 | ################################## Detection ################################### 468 | 469 | ## List of detectors that thumbor should use to find faces and/or features. All 470 | ## of them must be full names of python modules (python must be able to import 471 | ## it) 472 | ## Defaults to: [] 473 | DETECTORS = {{ DETECTORS | default([]) }} 474 | 475 | ## The cascade file that opencv will use to detect faces 476 | ## Defaults to: haarcascade_frontalface_alt.xml 477 | FACE_DETECTOR_CASCADE_FILE = '{{ FACE_DETECTOR_CASCADE_FILE | default('haarcascade_frontalface_alt.xml') }}' 478 | 479 | ## The cascade file that opencv will use to detect glasses. 480 | ## Defaults to: 'haarcascade_eye_tree_eyeglasses.xml' 481 | GLASSES_DETECTOR_CASCADE_FILE = '{{ GLASSES_DETECTOR_CASCADE_FILE | default('haarcascade_eye_tree_eyeglasses.xml') }}' 482 | 483 | ## The cascade file that opencv will use to detect profile faces. 484 | ## Defaults to: 'haarcascade_profileface.xml' 485 | PROFILE_DETECTOR_CASCADE_FILE = '{{ PROFILE_DETECTOR_CASCADE_FILE | default('haarcascade_profileface.xml') }}' 486 | 487 | ################################################################################ 488 | 489 | 490 | ################################## Optimizers ################################## 491 | 492 | ## List of optimizers that thumbor will use to optimize images 493 | ## Defaults to: [] --> ['thumbor.optimizers.jpegtran',] 494 | OPTIMIZERS = {{ OPTIMIZERS | default([]) }} 495 | 496 | 497 | ## Path for the jpegtran binary 498 | ## Defaults to: /usr/bin/jpegtran 499 | JPEGTRAN_PATH = '{{ JPEGTRAN_PATH | default('/usr/bin/jpegtran') }}' 500 | 501 | ## Path for the progressive scans file to use with jpegtran optimizer. Implies 502 | ## progressive jpeg output 503 | ## Defaults to: '' 504 | JPEGTRAN_SCANS_FILE = '{{ JPEGTRAN_SCANS_FILE | default('') }}' 505 | 506 | ## Path for the ffmpeg binary used to generate gifv(h.264) 507 | ## Defaults to: '/usr/local/bin/ffmpeg' 508 | FFMPEG_PATH = '{{ FFMPEG_PATH | default('/usr/bin/ffmpeg') }}' 509 | 510 | ################################################################################ 511 | 512 | 513 | ################################### Filters #################################### 514 | 515 | ## List of filters that thumbor will allow to be used in generated images. All of 516 | ## them must be full names of python modules (python must be able to import 517 | ## it) 518 | ## Defaults to: [ 519 | # 'thumbor.filters.brightness', 520 | # 'thumbor.filters.colorize', 521 | # 'thumbor.filters.contrast', 522 | # 'thumbor.filters.rgb', 523 | # 'thumbor.filters.round_corner', 524 | # 'thumbor.filters.quality', 525 | # 'thumbor.filters.noise', 526 | # 'thumbor.filters.watermark', 527 | # 'thumbor.filters.equalize', 528 | # 'thumbor.filters.fill', 529 | # 'thumbor.filters.sharpen', 530 | # 'thumbor.filters.strip_exif', 531 | # 'thumbor.filters.strip_icc', 532 | # 'thumbor.filters.frame', 533 | # 'thumbor.filters.grayscale', 534 | # 'thumbor.filters.rotate', 535 | # 'thumbor.filters.format', 536 | # 'thumbor.filters.max_bytes', 537 | # 'thumbor.filters.convolution', 538 | # 'thumbor.filters.blur', 539 | # 'thumbor.filters.extract_focal', 540 | # 'thumbor.filters.focal', 541 | # 'thumbor.filters.no_upscale', 542 | # 'thumbor.filters.saturation', 543 | # 'thumbor.filters.max_age', 544 | # 'thumbor.filters.curve', 545 | # 'thumbor.filters.background_color', 546 | # 'thumbor.filters.upscale', 547 | # 'thumbor.filters.proportion', 548 | # 'thumbor.filters.stretch', 549 | #] 550 | {% if FILTERS is defined %} 551 | FILTERS = {{ FILTERS }} 552 | {% endif %} 553 | 554 | ################################################################################ 555 | 556 | 557 | ################################ Result Storage ################################ 558 | 559 | ## Expiration in seconds of generated images in the result storage 560 | ## Defaults to: 0 561 | RESULT_STORAGE_EXPIRATION_SECONDS = {{ RESULT_STORAGE_EXPIRATION_SECONDS | default(0) }} 562 | 563 | ## Path where the Result storage will store generated images 564 | ## Defaults to: /tmp/thumbor/result_storage 565 | RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '{{ RESULT_STORAGE_FILE_STORAGE_ROOT_PATH | default('/usr/local/thumbor/result_storage') }}' 566 | 567 | ## Indicates whether unsafe requests should also be stored in the Result Storage 568 | ## Defaults to: False 569 | RESULT_STORAGE_STORES_UNSAFE = {{ RESULT_STORAGE_STORES_UNSAFE | default(False) }} 570 | 571 | ################################################################################ 572 | 573 | 574 | ############################ Queued Redis Detector ############################# 575 | 576 | ## Server host for the queued redis detector 577 | ## Defaults to: localhost 578 | REDIS_QUEUE_SERVER_HOST = '{{ REDIS_QUEUE_SERVER_HOST | default('localhost') }}' 579 | 580 | ## Server port for the queued redis detector 581 | ## Defaults to: 6379 582 | REDIS_QUEUE_SERVER_PORT = {{ REDIS_QUEUE_SERVER_PORT | default(6379) }} 583 | 584 | ## Server database index for the queued redis detector 585 | ## Defaults to: 0 586 | REDIS_QUEUE_SERVER_DB = {{ REDIS_QUEUE_SERVER_DB | default(0) }} 587 | 588 | ## Server password for the queued redis detector 589 | ## Defaults to: None 590 | REDIS_QUEUE_SERVER_PASSWORD = {{ REDIS_QUEUE_SERVER_PASSWORD | default(None) }} 591 | 592 | ################################################################################ 593 | 594 | 595 | ############################# Queued SQS Detector ############################## 596 | 597 | ## AWS key id 598 | ## Defaults to: None 599 | SQS_QUEUE_KEY_ID = {{ SQS_QUEUE_KEY_ID | default(None) }} 600 | 601 | ## AWS key secret 602 | ## Defaults to: None 603 | SQS_QUEUE_KEY_SECRET = {{ SQS_QUEUE_KEY_SECRET | default(None) }} 604 | 605 | ## AWS SQS region 606 | ## Defaults to: us-east-1 607 | SQS_QUEUE_REGION = '{{ SQS_QUEUE_REGION | default('us-east-1') }}' 608 | 609 | ################################################################################ 610 | 611 | 612 | #################################### Errors #################################### 613 | 614 | ## This configuration indicates whether thumbor should use a custom error 615 | ## handler. 616 | ## Defaults to: False 617 | USE_CUSTOM_ERROR_HANDLING = {{ USE_CUSTOM_ERROR_HANDLING | default(False) }} 618 | 619 | ## Error reporting module. Needs to contain a class called ErrorHandler with a 620 | ## handle_error(context, handler, exception) method. 621 | ## Defaults to: thumbor.error_handlers.sentry 622 | ERROR_HANDLER_MODULE = '{{ ERROR_HANDLER_MODULE | default('thumbor.error_handlers.sentry') }}' 623 | 624 | ## File of error log as json 625 | ## Defaults to: None 626 | ERROR_FILE_LOGGER = {{ ERROR_FILE_LOGGER | default(None) }} 627 | 628 | ## File of error log name is parametrized with context attribute 629 | ## Defaults to: False 630 | ERROR_FILE_NAME_USE_CONTEXT = {{ ERROR_FILE_NAME_USE_CONTEXT | default('False') }} 631 | 632 | ################################################################################ 633 | 634 | 635 | ############################### Errors - Sentry ################################ 636 | 637 | ## Sentry thumbor project dsn. i.e.: http://5a63d58ae7b94f1dab3dee740b301d6a:73ee 638 | ## a45d3e8649239a973087e8f21f98@localhost:9000/2 639 | ## Defaults to: 640 | SENTRY_DSN_URL = '{{ SENTRY_DSN_URL | default('') }}' 641 | 642 | ## Sentry environment i.e.: staging 643 | ## Defaults to: None 644 | SENTRY_ENVIRONMENT = {{ SENTRY_ENVIRONMENT | default(None) }} 645 | 646 | ################################################################################ 647 | 648 | ################################### General #################################### 649 | 650 | ## Custom app class to override ThumborServiceApp. This config value is 651 | ## overridden by the -a command-line parameter. 652 | ## Defaults to: 'thumbor.app.ThumborServiceApp' 653 | APP_CLASS = '{{ APP_CLASS | default('thumbor.app.ThumborServiceApp') }}' 654 | 655 | ################################################################################ 656 | 657 | 658 | #################################### Server #################################### 659 | 660 | ## The amount of time to wait before shutting down the server, i.e. stop 661 | ## accepting requests. 662 | ## Defaults to: 0 663 | MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN | default(0) }} 664 | 665 | ## The amount of time to waut before shutting down all io, after the server has 666 | ## been stopped 667 | ## Defaults to: 0 668 | MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN = {{ MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN | default(0) }} 669 | 670 | ################################################################################ 671 | 672 | 673 | ################################# HandlerLists ################################# 674 | 675 | ## Handler Lists are responsible for adding new handlers to thumbor app. 676 | ## Defaults to: [ 677 | # 'thumbor.handler_lists.healthcheck', 678 | # 'thumbor.handler_lists.upload', 679 | # 'thumbor.handler_lists.blacklist', 680 | #] 681 | HANDLER_LISTS = {{ HANDLER_LISTS | default(['thumbor.handler_lists.healthcheck', 'thumbor.handler_lists.upload', 'thumbor.handler_lists.blacklist']) }} 682 | 683 | 684 | ################################################################################ 685 | 686 | 687 | ################################# Compatibility ################################# 688 | 689 | ## Loader that will be used with the compatibility layer, instead of the 690 | ## compatibility loader. Please only use this if you can't use up-to-date 691 | ## loaders. 692 | ## Defaults to: None 693 | COMPATIBILITY_LEGACY_LOADER = {{ COMPATIBILITY_LEGACY_LOADER | default(None) }} 694 | 695 | ## Storage that will be used with the compatibility layer, instead of the 696 | ## compatibility storage. Please only use this if you can't use up-to-date 697 | ## storages. 698 | ## Defaults to: None 699 | COMPATIBILITY_LEGACY_STORAGE = {{ COMPATIBILITY_LEGACY_STORAGE | default(None) }} 700 | 701 | ## Result Storage that will be used with the compatibility layer, instead of the 702 | ## compatibility result storage. Please only use this if you can't use up-to- 703 | ## date result storages. 704 | ## Defaults to: None 705 | COMPATIBILITY_LEGACY_STORAGE = {{ COMPATIBILITY_LEGACY_STORAGE | default(None) }} 706 | 707 | ################################################################################ 708 | --------------------------------------------------------------------------------