From 3c33c48b4570658e0c84d649a8d8d4e2bcaba473 Mon Sep 17 00:00:00 2001 From: davwas Date: Thu, 15 Feb 2024 11:10:32 +0100 Subject: [PATCH] BC-6493 - Disable video upload in tldraw (#4761) * change allowed tldraw assets MIME types --- apps/server/src/modules/tldraw/config.ts | 4 ++-- config/default.schema.json | 10 +++++----- config/test.json | 2 +- src/services/config/publicAppConfigService.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/server/src/modules/tldraw/config.ts b/apps/server/src/modules/tldraw/config.ts index 9a141b5d621..ae3bd145074 100644 --- a/apps/server/src/modules/tldraw/config.ts +++ b/apps/server/src/modules/tldraw/config.ts @@ -12,7 +12,7 @@ export interface TldrawConfig { REDIS_URI: string; TLDRAW_ASSETS_ENABLED: boolean; TLDRAW_ASSETS_MAX_SIZE: number; - TLDRAW_ASSETS_ALLOWED_EXTENSIONS_LIST: string; + ASSETS_ALLOWED_MIME_TYPES_LIST: string; API_HOST: number; TLDRAW_MAX_DOCUMENT_SIZE: number; } @@ -32,7 +32,7 @@ const tldrawConfig = { REDIS_URI: Configuration.has('REDIS_URI') ? (Configuration.get('REDIS_URI') as string) : null, TLDRAW_ASSETS_ENABLED: Configuration.get('TLDRAW__ASSETS_ENABLED') as boolean, TLDRAW_ASSETS_MAX_SIZE: Configuration.get('TLDRAW__ASSETS_MAX_SIZE') as number, - TLDRAW_ASSETS_ALLOWED_EXTENSIONS_LIST: Configuration.get('TLDRAW__ASSETS_ALLOWED_EXTENSIONS_LIST') as string, + ASSETS_ALLOWED_MIME_TYPES_LIST: Configuration.get('TLDRAW__ASSETS_ALLOWED_MIME_TYPES_LIST') as string, API_HOST: Configuration.get('API_HOST') as string, TLDRAW_MAX_DOCUMENT_SIZE: Configuration.get('TLDRAW__MAX_DOCUMENT_SIZE') as number, }; diff --git a/config/default.schema.json b/config/default.schema.json index 2d7801ef46c..52aac87f4ac 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -1479,7 +1479,7 @@ "MAX_DOCUMENT_SIZE", "ASSETS_ENABLED", "ASSETS_MAX_SIZE", - "ASSETS_ALLOWED_EXTENSIONS_LIST" + "ASSETS_ALLOWED_MIME_TYPES_LIST" ], "properties": { "SOCKET_PORT": { @@ -1510,10 +1510,10 @@ "type": "integer", "description": "Maximum asset size in bytes" }, - "ASSETS_ALLOWED_EXTENSIONS_LIST": { + "ASSETS_ALLOWED_MIME_TYPES_LIST": { "type": "string", - "description": "List with allowed assets extensions, comma separated, empty if all extensions supported by tldraw should be allowed", - "examples": ["png,jpg,jpeg,svg,webp"] + "description": "List with allowed assets MIME types, comma separated, empty if all MIME types supported by tldraw should be allowed", + "examples": ["image/gif,image/jpeg,video/webm"] } }, "default": { @@ -1524,7 +1524,7 @@ "MAX_DOCUMENT_SIZE": 15000000, "ASSETS_ENABLED": true, "ASSETS_MAX_SIZE": 10485760, - "ASSETS_ALLOWED_EXTENSIONS_LIST": "" + "ASSETS_ALLOWED_MIME_TYPES_LIST": "image/png,image/jpeg,image/gif,image/svg+xml" } }, "TLDRAW_DB_URL": { diff --git a/config/test.json b/config/test.json index 3faf570739c..4e0ddd6628b 100644 --- a/config/test.json +++ b/config/test.json @@ -73,7 +73,7 @@ "MAX_DOCUMENT_SIZE": 15000000, "ASSETS_ENABLED": true, "ASSETS_MAX_SIZE": 25000000, - "ASSETS_ALLOWED_EXTENSIONS_LIST": "" + "ASSETS_ALLOWED_MIME_TYPES_LIST": "" }, "SCHULCONNEX_CLIENT": { "API_URL": "http://localhost:8888/v1/", diff --git a/src/services/config/publicAppConfigService.js b/src/services/config/publicAppConfigService.js index 48eafd598c8..db781bac0ae 100644 --- a/src/services/config/publicAppConfigService.js +++ b/src/services/config/publicAppConfigService.js @@ -70,7 +70,7 @@ const exposedVars = [ 'FEATURE_TLDRAW_ENABLED', 'TLDRAW__ASSETS_ENABLED', 'TLDRAW__ASSETS_MAX_SIZE', - 'TLDRAW__ASSETS_ALLOWED_EXTENSIONS_LIST', + 'TLDRAW__ASSETS_ALLOWED_MIME_TYPES_LIST', ]; /**