diff --git a/config/default.schema.json b/config/default.schema.json index 9774124f911..58371e44347 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -1429,10 +1429,15 @@ "API_KEY": "" } }, + "FEATURE_TLDRAW_ENABLED": { + "type": "boolean", + "default": true, + "description": "Enables tldraw feature" + }, "TLDRAW": { "type": "object", - "description": "Tldraw managing variables.", - "required": ["PING_TIMEOUT", "SOCKET_PORT","GC_ENABLED", "DB_COLLECTION_NAME", "DB_FLUSH_SIZE", "DB_MULTIPLE_COLLECTIONS"], + "description": "Configuration of tldraw related settings", + "required": ["PING_TIMEOUT", "SOCKET_PORT","GC_ENABLED", "DB_COLLECTION_NAME", "DB_FLUSH_SIZE", "DB_MULTIPLE_COLLECTIONS", "ASSETS_ENABLED", "ASSETS_MAX_SIZE", "ASSETS_ALLOWED_EXTENSIONS_LIST"], "properties": { "SOCKET_PORT": { "type": "number", @@ -1457,15 +1462,31 @@ "DB_MULTIPLE_COLLECTIONS": { "type": "boolean", "description": "DB collection allowing multiple collections for drawing" + }, + "ASSETS_ENABLED": { + "type": "boolean", + "description": "Enables uploading assets to tldraw board" + }, + "ASSETS_MAX_SIZE": { + "type": "integer", + "description": "Maximum asset size in bytes" + }, + "ASSETS_ALLOWED_EXTENSIONS_LIST": { + "type": "string", + "description": "List with allowed assets extensions, comma separated, empty if all extensions should be allowed", + "examples": ["png,jpg,jpeg,svg,webp"] } }, "default": { "SOCKET_PORT": 3345, - "PING_TIMEOUT": 10000, + "PING_TIMEOUT": 30000, "GC_ENABLED": true, "DB_COLLECTION_NAME": "drawings", "DB_FLUSH_SIZE": 400, - "DB_MULTIPLE_COLLECTIONS": false + "DB_MULTIPLE_COLLECTIONS": false, + "ASSETS_ENABLED": true, + "ASSETS_MAX_SIZE": 25000000, + "ASSETS_ALLOWED_EXTENSIONS_LIST": "" } }, "TLDRAW_DB_URL": { @@ -1473,11 +1494,6 @@ "default": "mongodb://127.0.0.1:27017/tldraw", "description": "DB connection url" }, - "FEATURE_TLDRAW_ENABLED": { - "type": "boolean", - "default": true, - "description": "Tldraw feature enabled" - }, "TLDRAW_URI": { "type": "string", "default": "http://localhost:3349", diff --git a/src/services/config/publicAppConfigService.js b/src/services/config/publicAppConfigService.js index cdf6a815a25..d130322060d 100644 --- a/src/services/config/publicAppConfigService.js +++ b/src/services/config/publicAppConfigService.js @@ -65,6 +65,9 @@ const exposedVars = [ 'FEATURE_CTL_CONTEXT_CONFIGURATION_ENABLED', 'FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED', 'FEATURE_TLDRAW_ENABLED', + 'TLDRAW__ASSETS_ENABLED', + 'TLDRAW__ASSETS_MAX_SIZE', + 'TLDRAW__ASSETS_ALLOWED_EXTENSIONS_LIST', ]; /**