discourse/lib/site_settings
Régis Hanol 6212b0b736
FEATURE: Support non-image file uploads in site settings (#37005)
This change extends the upload type site setting to support non-image
files by adding two new optional attributes:

- `authorized_extensions`: pipe-separated list of allowed extensions
(e.g., "txt|json"). When not specified, only images are allowed.
- `max_file_size_kb`: maximum file size in KB. When not specified, uses
max_image_size_kb or max_attachment_size_kb based on file type.

The upload component has been rewritten as a Glimmer component with:
- Separate UI for image files (preview with lightbox) and non-image
files (file info with download link)
- Display of upload restrictions when configured
- Drag and drop support
- Progress bar during upload

Example usage in site_settings.yml:

```yaml
llms_txt:
  default: ""
  type: upload
  authorized_extensions: "txt|md"
  max_file_size_kb: 512
```

Ref - t/162690
Related #36939

**Empty site setting**
<img width="1762" height="1229" alt="2026-01-08 @ 09 32 13"
src="https://github.com/user-attachments/assets/8f1bad3a-7070-4313-b82f-66335e9dbaff"
/>

**Site setting with a file uploaded**
<img width="1762" height="1229" alt="2026-01-08 @ 09 32 26"
src="https://github.com/user-attachments/assets/f20cc78b-8e81-451b-b334-8f3dada213b1"
/>

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2026-01-19 22:37:38 +01:00
..
db_provider.rb FEATURE: Upcoming changes part 1 (#34617) 2025-10-30 10:46:14 +10:00
defaults_provider.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
dependency_graph.rb DEV: Allow specifying dependent settings in configuration (#36061) 2025-11-27 13:23:43 +08:00
deprecated_settings.rb DEV: Remove deprecated trust level access settings (#36414) 2025-12-11 11:09:29 +10:00
hidden_provider.rb DEV: support un-hiding site settings programmatically (#32824) 2025-05-20 21:44:56 +02:00
label_formatter.rb UX: Add more company/product names to setting LabelFormatter (#37071) 2026-01-14 09:30:04 +10:00
local_process_provider.rb DEV: Fix core backend CI tests timing out (#34281) 2025-08-13 16:06:19 +08:00
type_supervisor.rb FEATURE: Support non-image file uploads in site settings (#37005) 2026-01-19 22:37:38 +01:00
validations.rb DEV: Add setting to tag s3 objects enabling tag based access control policies (#32988) 2025-06-16 13:26:18 +08:00
yaml_loader.rb DEV: Remove older ruby version logic (#19971) 2023-01-24 10:42:56 +00:00