discourse/lib/backup_restore
Alan Guo Xiang Tan b02bc707de
DEV: Add setting to tag s3 objects enabling tag based access control policies (#32988)
This commit introduces a `s3_enable_access_control_tags` site setting
which,
when enabled, adds a `discourse:acl` tag with values `public` or
`private` to
S3 objects created by the application. The presence of the tags on S3
objects
enables bucket administrators to implement tag-based access control
policies, providing an alternative to
object ACLs which AWS now discourages.

The `discourse:acl` tag can be customized via the
`s3_access_control_tag_key ` site setting.
Values for `public` and `private` can also be customized via the
`s3_access_control_tag_public_value` and
`s3_access_control_tag_private_value ` site settings respectively.

### Reviewer Notes

To test it locally, run the following commands in your working discourse
directory:

1. `script/install_minio_binaries.rb`
2. Start a local minio server by running: `bundle exec rails runner
script/local_minio_s3.rb`
3. bundle exec rails runner "SiteSetting.enable_s3_uploads = true"
5. Start your development rails server with the following environment
variables: `DISCOURSE_ENABLE_S3_UPLOADS=true
DISCOURSE_S3_ENABLE_ACCESS_CONTROL_TAGS=true
DISCOURSE_BACKUP_LOCATION=s3`
2025-06-16 13:26:18 +08:00
..
backup_file_handler.rb FEATURE: Add utilities for importing and exporting backups (#32992) 2025-06-11 15:44:10 +03:00
backup_store.rb FEATURE: Delete backups based on time window (#24296) 2023-12-13 13:00:27 -05:00
backuper.rb FIX: truncate extremely long site name titles (#30977) 2025-01-24 15:47:05 +11:00
database_restorer.rb FEATURE: Allow pausing of restore before DB migration and uploads are restored (#30269) 2024-12-16 12:50:08 +01:00
factory.rb FIX: Restoring could fail due to missing path 2021-02-09 17:28:03 +01:00
local_backup_store.rb FEATURE: Delete backups based on time window (#24296) 2023-12-13 13:00:27 -05:00
logger.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
meta_data_handler.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
restorer.rb FEATURE: Add utilities for importing and exporting backups (#32992) 2025-06-11 15:44:10 +03:00
s3_backup_store.rb DEV: Add setting to tag s3 objects enabling tag based access control policies (#32988) 2025-06-16 13:26:18 +08:00
system_interface.rb DEV: Upgrade Sidekiq to v7.3.9 2025-03-10 15:02:48 +01:00
uploads_restorer.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00