Skip to content

Conversation

Oaphi
Copy link
Member

@Oaphi Oaphi commented Aug 10, 2025

closes #1769

This PR:

  • fixes inability to upload .jpg images due to a change in web_image_content_types that we used to rely on;

  • removes the check for "submitted extension" completely as we already check the actual type of the file and don't need the submitted extension for anything (not to mention that extension checking is brittle and should be avoided in the first place. Case in point - the issue at hand);

  • adds a new options column (YAML array encoded) for site settings, as well as a matching array type;

  • a new global site setting in the "Site Details" category - AllowedUploadTypes that allows admins to choose allowed file types (important note: to avoid scope creep & unforeseen consequences, the setting can only be restricted for now but can easily be extended later):

    Screenshot from 2025-08-10 16-50-24 Screenshot from 2025-08-10 16-50-56

    I did not bother with human-friendly labels at this point as changing the setting itself requires expertise, and adding them in our current setup is a bit burdensome, but if anyone thinks it'll be beneficial to do so now, happy to oblige. The setting's description could also use some work - suggestions welcome (quesiton for @ArtOfCode-: do we have any reverse proxy or AWS settings / policies that admins need to be made aware of when editing the setting?).

Note for reviewers: there's both a new seed and a new migration. Don't forget to run & rollback both when switching between branches. There's also a new gem (mime-types), so remember to install it first.

@Oaphi Oaphi requested review from ArtOfCode-, cellio, trichoplax and a team August 10, 2025 14:02

# Is the setting boolean-valued?
# @return [Boolena] check result
# @return [Boolean] check result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I, for one, think Boolena was a perfectly fitting alternative. Poor Boolena.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too bad Boolena will be busy on calls from now on and never return...

@ArtOfCode- ArtOfCode- merged commit 16a4657 into develop Aug 10, 2025
11 checks passed
@ArtOfCode- ArtOfCode- deleted the 0valt/1769/uploads branch August 10, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No longer possible to upload a .jpg image
2 participants