From 28643f5c484c82a68900613aa374228caac65da6 Mon Sep 17 00:00:00 2001 From: Kurt <10924313+Kurt108@users.noreply.github.com> Date: Sat, 10 Dec 2022 18:41:20 +0100 Subject: [PATCH] Upgrade thumbor 7 3 0 (#49) * enable official thumbor image and config for 7.3.0 * yamllint trailing spaces * dont test for outdated clusters * enhance docs * fix entrypoint and config-file --- charts/thumbor/Chart.yaml | 2 +- charts/thumbor/README.md | 11 +- charts/thumbor/templates/configmap.yaml | 154 ----------------------- charts/thumbor/templates/deployment.yaml | 3 +- 4 files changed, 5 insertions(+), 165 deletions(-) mode change 100755 => 100644 charts/thumbor/Chart.yaml diff --git a/charts/thumbor/Chart.yaml b/charts/thumbor/Chart.yaml old mode 100755 new mode 100644 index e8194f4..778ca29 --- a/charts/thumbor/Chart.yaml +++ b/charts/thumbor/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: thumbor icon: https://camo.githubusercontent.com/8add159463b5ef31481d1e0cc9fb590cd662fe62/68747470733a2f2f73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f6d696e696d616c2d636f6d706163742f696d616765732f6d632d7468756d626f722e706e67 -version: 2.0.0 +version: 2.0.1 appVersion: "7.3.0" description: A chart containing Thumbor home: http://thumbor.org/ diff --git a/charts/thumbor/README.md b/charts/thumbor/README.md index bb34b55..04152bc 100644 --- a/charts/thumbor/README.md +++ b/charts/thumbor/README.md @@ -1,7 +1,7 @@ # thumbor A chart containing Thumbor -2.0.0 +2.0.1 [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kurt108)](https://artifacthub.io/packages/search?repo=kurt108) Based on the fanastic work from Cloudposse: https://charts.cloudposse.com/incubator/ @@ -30,20 +30,13 @@ NAME: my-release | autoscaling.maxReplicas | int | `1` | | | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | -| conf.allowUnsafeUrl | string | `"True"` | | | conf.allowedSources | string | `"'http://domain_or_wildcard', 'comma_seperated'"` | | -| conf.detectors | string | `""` | | -| conf.maxAge | string | `"259200"` | | -| conf.maxAgeTempImage | string | `"60"` | | -| conf.respectOrientation | string | `"False"` | | -| conf.resultStorage | string | `"'thumbor.result_storages.file_storage'"` | | -| conf.resultStorageExpirationSeconds | string | `"86400"` | | -| conf.storageExpirationSeconds | string | `"86400"` | | | env.open.ALLOW_UNSAFE_URL | string | `"True"` | | | env.open.AUTO_WEBP | string | `"True"` | | | env.open.CORS_ALLOW_ORIGIN | string | `"*"` | | | env.open.HEALTHCHECK_ROUTE | string | `"/healthcheck"` | | | env.open.LOG_LEVEL | string | `"error"` | | +| env.open.SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS | string | `"True"` | Speed Up Browsing-Experience for Clients. Storage need to support this | | env.open.THUMBOR_LOG_CONFIG | string | `"None"` | Can be JSON or None | | env.open.THUMBOR_PORT | string | `"80"` | | | image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/charts/thumbor/templates/configmap.yaml b/charts/thumbor/templates/configmap.yaml index c97ef39..2b5aa54 100644 --- a/charts/thumbor/templates/configmap.yaml +++ b/charts/thumbor/templates/configmap.yaml @@ -9,164 +9,10 @@ metadata: app: {{ template "thumbor.name" . }} data: thumbor.conf: | - THUMBOR_LOG_CONFIG = None - THUMBOR_LOG_FORMAT = '%(asctime)s %(name)s:%(levelname)s %(message)s' - THUMBOR_LOG_DATE_FORMAT = '%Y-%m-%d %H:%M:%S' - MAX_WIDTH = 0 - MAX_HEIGHT = 0 - MAX_PIXELS = 75000000 - MIN_WIDTH = 1 - MIN_HEIGHT = 1 ALLOWED_SOURCES = [{{ .Values.conf.allowedSources }}] - QUALITY = 80 - PROGRESSIVE_JPEG = True - PILLOW_JPEG_SUBSAMPLING = None - PILLOW_JPEG_QTABLES = None - PILLOW_RESAMPLING_FILTER = 'LANCZOS' - WEBP_QUALITY = None - PNG_COMPRESSION_LEVEL = 6 - AUTO_WEBP = True - AUTO_PNG_TO_JPG = False - SVG_DPI = 150 - MAX_AGE = {{ .Values.conf.maxAge }} - MAX_AGE_TEMP_IMAGE = {{ .Values.conf.maxAgeTempImage }} - RESPECT_ORIENTATION = {{ .Values.conf.respectOrientation }} - IGNORE_SMART_ERRORS = False - SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = False - PRESERVE_EXIF_INFO = False - ALLOW_ANIMATED_GIFS = True - USE_GIFSICLE_ENGINE = False - USE_BLACKLIST = False - ENGINE_THREADPOOL_SIZE = 0 - METRICS = 'thumbor.metrics.logger_metrics' - LOADER = 'thumbor.loaders.http_loader' - STORAGE = 'thumbor.storages.file_storage' - STORAGE_BUCKET = '' - RESULT_STORAGE_BUCKET = '' - RESULT_STORAGE = {{ .Values.conf.resultStorage }} - ENGINE = 'thumbor.engines.pil' - GIF_ENGINE = 'thumbor.engines.gif' - URL_SIGNER = 'libthumbor.url_signers.base64_hmac_sha1' - SECURITY_KEY = 'MY_SECURE_KEY' - ALLOW_UNSAFE_URL = {{ .Values.conf.allowUnsafeUrl }} - ALLOW_OLD_URLS = True - AWS_ACCESS_KEY = '' - AWS_SECRET_KEY = '' - ENABLE_ETAGS = True - MAX_ID_LENGTH = 32 - HEALTHCHECK_ROUTE = '/healthcheck' - STATSD_PORT = 8125 - FILE_LOADER_ROOT_PATH = '/data/loader' - HTTP_LOADER_CONNECT_TIMEOUT = 5 - HTTP_LOADER_REQUEST_TIMEOUT = 20 - HTTP_LOADER_FOLLOW_REDIRECTS = True - HTTP_LOADER_MAX_REDIRECTS = 5 - HTTP_LOADER_MAX_CLIENTS = 10 - HTTP_LOADER_FORWARD_ALL_HEADERS = False - HTTP_LOADER_FORWARD_USER_AGENT = False - HTTP_LOADER_FORWARD_HEADERS_WHITELIST = [] - HTTP_LOADER_DEFAULT_USER_AGENT = 'Thumbor/6.3.0' - HTTP_LOADER_PROXY_HOST = None - HTTP_LOADER_PROXY_PORT = None - HTTP_LOADER_PROXY_USERNAME = None - HTTP_LOADER_PROXY_PASSWORD = None - HTTP_LOADER_CA_CERTS = None - HTTP_LOADER_VALIDATE_CERTS = True - HTTP_LOADER_CLIENT_KEY = None - HTTP_LOADER_CLIENT_CERT = None - HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = False - STORAGE_EXPIRATION_SECONDS = {{ .Values.conf.storageExpirationSeconds }} - STORES_CRYPTO_KEY_FOR_EACH_IMAGE = False FILE_STORAGE_ROOT_PATH = '/data/storage/source' - UPLOAD_MAX_SIZE = 0 - UPLOAD_ENABLED = False - UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage' - UPLOAD_DELETE_ALLOWED = False - UPLOAD_PUT_ALLOWED = False - UPLOAD_DEFAULT_FILENAME = 'image' - MONGO_STORAGE_SERVER_HOST = 'mongo' - MONGO_STORAGE_SERVER_PORT = 27017 - MONGO_STORAGE_SERVER_DB = 'thumbor' - MONGO_STORAGE_SERVER_COLLECTION = 'images' - REDIS_STORAGE_SERVER_HOST = 'redis' - REDIS_STORAGE_SERVER_PORT = 6379 - REDIS_STORAGE_SERVER_DB = 0 - REDIS_STORAGE_SERVER_PASSWORD = None - REDIS_STORAGE_IGNORE_ERRORS = True - REDIS_RESULT_STORAGE_SERVER_HOST = 'redis' - REDIS_RESULT_STORAGE_SERVER_PORT = 6379 - REDIS_RESULT_STORAGE_SERVER_DB = 0 - REDIS_RESULT_STORAGE_SERVER_PASSWORD = None - REDIS_RESULT_STORAGE_IGNORE_ERRORS = True - MEMCACHE_STORAGE_SERVERS = ['localhost:11211'] - MIXED_STORAGE_FILE_STORAGE = 'thumbor.storages.no_storage' - MIXED_STORAGE_CRYPTO_STORAGE = 'thumbor.storages.no_storage' - MIXED_STORAGE_DETECTOR_STORAGE = 'thumbor.storages.no_storage' - META_CALLBACK_NAME = None - #DETECTORS = [ - #'thumbor.detectors.queued_detector.queued_complete_detector', - #'thumbor.detectors.queued_detector.queued_face_detector', - #'thumbor.detectors.queued_detector.queued_feature_detector', - #'thumbor.detectors.feature_detector', - #'thumbor.detectors.face_detector', - #] DETECTORS = [{{ .Values.conf.detectors }}] FACE_DETECTOR_CASCADE_FILE = 'haarcascade_frontalface_alt.xml' GLASSES_DETECTOR_CASCADE_FILE = 'haarcascade_eye_tree_eyeglasses.xml' PROFILE_DETECTOR_CASCADE_FILE = 'haarcascade_profileface.xml' - OPTIMIZERS = [] - JPEGTRAN_PATH = '/usr/bin/jpegtran' - # Path for the progressive scans file to use with jpegtran optimizer. Implies progressive jpeg output - JPEGTRAN_SCANS_FILE = '' - PROGRESSIVE_JPEG = True - FFMPEG_PATH = '/usr/bin/ffmpeg' # Default path for the docker installation in debian - RESULT_STORAGE_EXPIRATION_SECONDS = {{ .Values.conf.resultStorageExpirationSeconds }} RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '/data/storage/result' - RESULT_STORAGE_STORES_UNSAFE = True - REDIS_QUEUE_SERVER_HOST = 'redis' - REDIS_QUEUE_SERVER_PORT = 6379 - REDIS_QUEUE_SERVER_DB = 0 - REDIS_QUEUE_SERVER_PASSWORD = None - SQS_QUEUE_KEY_ID = None - SQS_QUEUE_KEY_SECRET = None - SQS_QUEUE_REGION = 'us-east-1' - USE_CUSTOM_ERROR_HANDLING = False - ERROR_HANDLER_MODULE = 'thumbor.error_handlers.sentry' - ERROR_FILE_LOGGER = None - ERROR_FILE_NAME_USE_CONTEXT = False - SENTRY_DSN_URL = '' - # The amount of time to wait before shutting down the server, i.e. stop accepting requests. - MAX_WAIT_SECONDS_BEFORE_SERVER_SHUTDOWN = 0 - # The amount of time to waut before shutting down all io, after the server has been stopped - MAX_WAIT_SECONDS_BEFORE_IO_SHUTDOWN = 0 - APP_CLASS = 'thumbor.app.ThumborServiceApp' - TC_AWS_REGION = 'eu-west-1' # AWS Region - # Custom S3 endpoint URL (for GCP, Minio, etc.) - TC_AWS_STORAGE_BUCKET = '' # S3 bucket for Storage - TC_AWS_STORAGE_ROOT_PATH = '' # S3 path prefix for Storage bucket - TC_AWS_LOADER_BUCKET = '' #S3 bucket for loader - TC_AWS_LOADER_ROOT_PATH = '' # S3 path prefix for Loader bucket - TC_AWS_RESULT_STORAGE_BUCKET = '' # S3 bucket for result Storage - TC_AWS_RESULT_STORAGE_ROOT_PATH = '' # S3 path prefix for Result storage bucket - # put data into S3 using the Server Side Encryption functionality to - # encrypt data at rest in S3 - # https://aws.amazon.com/about-aws/whats-new/2011/10/04/amazon-s3-announces-server-side-encryption-support/ - TC_AWS_STORAGE_SSE = False - # put data into S3 with Reduced Redundancy - # https://aws.amazon.com/about-aws/whats-new/2010/05/19/announcing-amazon-s3-reduced-redundancy-storage/ - TC_AWS_STORAGE_RRS = False - # Add some randomization in the S3 keys for the Storage and Result Storage. - # Defaults to False for Backwards Compatibility, set it to True for performance. - TC_AWS_RANDOMIZE_KEYS = False - # Enable HTTP Loader as well? - # This would allow you to load watermarks in over your images dynamically through a URI - # E.g. - # http://your-thumbor.com/unsafe/filters:watermark(http://example.com/watermark.png,0,0,50)/s3_bucket/photo.jpg - TC_AWS_ENABLE_HTTP_LOADER = False - TC_AWS_ALLOWED_BUCKETS = False # List of allowed bucket to be requested - TC_AWS_STORE_METADATA = False # Store result with metadata (for instance content-type) - CLOUD_STORAGE_BUCKET_ID = '' - CLOUD_STORAGE_PROJECT_ID = '' - RESULT_STORAGE_CLOUD_STORAGE_PROJECT_ID = '' - RESULT_STORAGE_CLOUD_STORAGE_BUCKET_ID = '' - PROMETHEUS_SCRAPE_PORT = 8000 # Port the prometheus client should listen on \ No newline at end of file diff --git a/charts/thumbor/templates/deployment.yaml b/charts/thumbor/templates/deployment.yaml index a74d9f6..6738ac2 100755 --- a/charts/thumbor/templates/deployment.yaml +++ b/charts/thumbor/templates/deployment.yaml @@ -42,7 +42,8 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - - "thumbor" + - "-c" + - "/app/thumbor.conf" ports: - name: http containerPort: 80