DEV: Rename secure_media to secure_uploads (#18376)

This commit renames all secure_media related settings to secure_uploads_* along with the associated functionality.

This is being done because "media" does not really cover it, we aren't just doing this for images and videos etc. but for all uploads in the site.

Additionally, in future we want to secure more types of uploads, and enable a kind of "mixed mode" where some uploads are secure and some are not, so keeping media in the name is just confusing.

This also keeps compatibility with the `secure-media-uploads` path, and changes new
secure URLs to be `secure-uploads`.

Deprecated settings:

* secure_media -> secure_uploads
* secure_media_allow_embed_images_in_emails -> secure_uploads_allow_embed_images_in_emails
* secure_media_max_email_embed_image_size_kb -> secure_uploads_max_email_embed_image_size_kb
This commit is contained in:
Martin Brennan
2022-09-29 09:24:33 +10:00
committed by GitHub
parent 70b96ac4e7
commit 8ebd5edd1e
67 changed files with 442 additions and 361 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
##
# There are certain conditions with secure media when the security of
# There are certain conditions with secure uploads when the security of
# uploads will need to change depending on the context they reside in.
#
# For example on these conditions:
@ -38,16 +38,16 @@ class TopicUploadSecurityManager
end
end
return if !SiteSetting.secure_media
return if !SiteSetting.secure_uploads
# we only want to do this if secure media is enabled. if
# we only want to do this if secure uploads is enabled. if
# the setting is turned on after a site has been running
# already, we want to make sure that any post moves after
# this are handled and upload secure statuses and ACLs
# are updated appropriately, as well as setting the access control
# post for secure uploads missing it.
#
# examples (all after secure media is enabled):
# examples (all after secure uploads is enabled):
#
# -> a public topic is moved to a private category after
# -> a PM is converted to a public topic