Skip to content

Commit

Permalink
add env vars related to tldraw asset upload
Browse files Browse the repository at this point in the history
  • Loading branch information
davwas committed Jan 9, 2024
1 parent 5344554 commit a40ee1b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
34 changes: 25 additions & 9 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -1457,27 +1462,38 @@
"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": {
"type": "string",
"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",
Expand Down
3 changes: 3 additions & 0 deletions src/services/config/publicAppConfigService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

/**
Expand Down

0 comments on commit a40ee1b

Please sign in to comment.