mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FEATURE: Secure uploads in PMs only (#23398)
This adds a new secure_uploads_pm_only site setting. When secure_uploads is true with this setting, only uploads created in PMs will be marked secure; no uploads in secure categories will be marked as secure, and the login_required site setting has no bearing on upload security either. This is meant to be a stopgap solution to prevent secure uploads in a single place (private messages) for sensitive admin data exports. Ideally we would want a more comprehensive way of saying that certain upload types get secured which is a hybrid/mixed mode secure uploads, but for now this will do the trick.
This commit is contained in:
@ -141,7 +141,7 @@ module SystemHelpers
|
||||
page.execute_script(js, selector, start, offset)
|
||||
end
|
||||
|
||||
def setup_s3_system_test
|
||||
def setup_s3_system_test(enable_secure_uploads: false, enable_direct_s3_uploads: true)
|
||||
SiteSetting.enable_s3_uploads = true
|
||||
|
||||
SiteSetting.s3_upload_bucket = "discoursetest"
|
||||
@ -151,6 +151,9 @@ module SystemHelpers
|
||||
SiteSetting.s3_secret_access_key = MinioRunner.config.minio_root_password
|
||||
SiteSetting.s3_endpoint = MinioRunner.config.minio_server_url
|
||||
|
||||
SiteSetting.enable_direct_s3_uploads = enable_direct_s3_uploads
|
||||
SiteSetting.secure_uploads = enable_secure_uploads
|
||||
|
||||
MinioRunner.start
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user