0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/lib/site_settings
Alan Guo Xiang Tan b5773b93b8
FIX: Don't require S3 ACLs to enable secure uploads (#40596)
Previously, enabling the `secure_uploads` site setting required the
`s3_use_acls` site setting to be enabled. Object ACLs are not the only
way to keep uploads private: `FileStore::S3Store` applies S3 access
control tags when the hidden `s3_enable_access_control_tags` site
setting is enabled, and access control can be enforced entirely through
a bucket policy Discourse never sees. Sites can also opt to disable the
`s3_use_acls` site setting and manage object permissions themselves.

This PR relaxes the validation that runs when enabling the
`secure_uploads` site setting so that it only requires S3 uploads to be
enabled, and rewords the validation's error message accordingly.

Key technical changes:

1. Drop the `s3_use_acls` site setting check from
`SiteSettings::Validations#validate_secure_uploads`, the method that
validates changes to the `secure_uploads` site setting. ACL and
access-control-tag site settings have no bearing on enabling secure
uploads; `FileStore::S3Store#default_s3_options` applies each mechanism
only when its site setting is enabled and works with both disabled.

2. Add no validation for the opposite change: disabling the
`s3_use_acls` or `s3_enable_access_control_tags` site settings while the
`secure_uploads` site setting is enabled remains allowed, since running
with both disabled is a valid configuration when a bucket policy
enforces access control.
2026-06-05 13:56:14 +08:00
..
db_provider.rb FEATURE: Upcoming changes part 1 (#34617) 2025-10-30 10:46:14 +10:00
defaults_provider.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
dependency_graph.rb DEV: Detect circular site setting dependencies (#38165) 2026-03-04 10:10:38 +10:00
deprecated_settings.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
hidden_provider.rb DEV: support un-hiding site settings programmatically (#32824) 2025-05-20 21:44:56 +02:00
label_formatter.rb DEV: Linkify site setting references in descriptions (#40338) 2026-06-01 10:31:18 +02:00
local_process_provider.rb DEV: Fix core backend CI tests timing out (#34281) 2025-08-13 16:06:19 +08:00
object_uploads_normalizer.rb FIX: type: objects uploads should be stored as IDs (#40178) 2026-05-21 13:45:27 -03:00
type_supervisor.rb UX: Drop legacy mobile-mode site settings (#40226) 2026-05-26 09:23:13 +01:00
validations.rb FIX: Don't require S3 ACLs to enable secure uploads (#40596) 2026-06-05 13:56:14 +08:00
yaml_loader.rb