mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +08:00
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. |
||
|---|---|---|
| .. | ||
| db_provider.rb | ||
| defaults_provider.rb | ||
| dependency_graph.rb | ||
| deprecated_settings.rb | ||
| hidden_provider.rb | ||
| label_formatter.rb | ||
| local_process_provider.rb | ||
| object_uploads_normalizer.rb | ||
| type_supervisor.rb | ||
| validations.rb | ||
| yaml_loader.rb | ||