Cloudflare R2:导航设置与处理配置错误

那一行没有正确缩进。它应该像 after_code 一样精确地缩进 2 个空格。

这有问题吗?因为有些设置开头没有空格。编译时也没有报错。例如:

一切看起来都不错。我之前问过的 after_assets_precompile 部分看起来是什么样的?

您需要在“after_assets_precompile”前面插入两个空格。

2 个赞

我会这样做,然后告诉你。非常感谢你的时间 \u003c3

1 个赞

应用此设置后,会显示以下错误,并且无法加载,无法访问网站:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets failed with return #<Process::Status: pid 4803 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["sudo -E -u discourse bundle exec rake s3:upload_assets", "sudo -E -u discourse bundle exec rake s3:expire_missing_assets"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

我运行了 ./discourse-doctor,然后重新编译,出现了同样的错误。

当我进入容器并运行以下代码时,出现错误:

rake uploads:migrate_to_s3

错误:

rake uploads:migrate_to_s3 --trace
Plugin name is 'DiscourseMatheditor', but plugin directory is named 'discourse-matheditor'
Plugin name is 'discourse-post-voting', but plugin directory is named 'discourse-question-answer'
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'
** Invoke uploads:migrate_to_s3 (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute uploads:migrate_to_s3
Please note that migrating to S3 is currently not reversible!
[CTRL+c] to cancel, [ENTER] to continue

Migrating uploads to S3 for 'default'...
Some uploads were not migrated to the new scheme. Running the migration, this may take a while...
rake aborted!
FileStore::ToS3MigrationError: Some uploads could not be migrated to the new scheme. You need to fix this manually. (FileStore::ToS3MigrationError)
/var/www/discourse/lib/file_store/to_s3_migration.rb:156:in `migrate_to_s3'
/var/www/discourse/lib/file_store/to_s3_migration.rb:59:in `migrate'
/var/www/discourse/lib/tasks/uploads.rake:126:in `migrate_to_s3'
/var/www/discourse/lib/tasks/uploads.rake:106:in `block in migrate_to_s3_all_sites'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management.rb:21:in `each_connection'
/var/www/discourse/lib/tasks/uploads.rake:104:in `migrate_to_s3_all_sites'
/var/www/discourse/lib/tasks/uploads.rake:100:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => uploads:migrate_to_s3

一些类似的未解决问题:

您提到的其他主题中有关于手动完成上传的说明吗?

那只是最后的失败层,实际的错误会出现在更靠上的位置,因为它提到:

1 个赞

没有,我没看到。但是,编译后不添加它肯定是有原因的,我们应该能够看到这个错误。也许我可以看看是否说明了如何看到它。

我想再试一次。我在 app.yml 中添加了必要的 S3 连接并重新编译了它们。这次,我删除了 after_assets_precompile。所有 URL 都更改为 cdn,样式文件未加载。当我手动进入容器并尝试时:rake s3:upload_assets,我收到以下错误。

Attempting to apply ASSETS S3 CORS ruleset in bucket cloudflarebucketname.
rake aborted!
Aws::S3::Errors::AccessDenied: Access Denied (Aws::S3::Errors::AccessDenied)

如果我尝试这个:rake uploads:migrate_to_s3 --trace

我收到的错误:


Migrating uploads to S3 for 'default'...
Some uploads were not migrated to the new scheme. Running the migration, this may take a while...
rake aborted!
FileStore::ToS3MigrationError: Some uploads could not be migrated to the new scheme. You need to fix this manually. (FileStore::ToS3MigrationError)

“rake s3:upload_assets”的所有错误消息:

Plugin name is 'DiscourseMatheditor', but plugin directory is named 'discourse-matheditor'
Plugin name is 'discourse-post-voting', but plugin directory is named 'discourse-question-answer'
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'
** Invoke s3:upload_assets (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke s3:ensure_cors_rules (first_time)
** Invoke environment
** Execute s3:ensure_cors_rules
Installing CORS rules...
Attempting to apply ASSETS S3 CORS ruleset in bucket cloudflarebucketname.
rake aborted!
Aws::S3::Errors::AccessDenied: Access Denied (Aws::S3::Errors::AccessDenied)
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/raise_response_errors.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/sse_cpk.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/dualstack.rb:21:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/accelerate.rb:43:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/checksum_algorithm.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:16:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/idempotency_token.rb:19:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/param_converter.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/request_callback.rb:89:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/response_paging.rb:12:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/response_target.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/request.rb:72:in `send_request'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/client.rb:5424:in `get_bucket_cors'
/var/www/discourse/lib/s3_helper.rb:385:in `fetch_bucket_cors_rules'
/var/www/discourse/lib/s3_helper.rb:166:in `ensure_cors!'
/var/www/discourse/lib/tasks/s3.rake:184:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:241:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => s3:upload_assets => s3:ensure_cors_rules

很难摆脱这种困境。

我感觉 S3 代码在编译后只支持 Amazon S3。你怎么看?

对我来说是有效的。我认为有一个设置可以跳过 CORS 规则。你可以看看为上传配置 S3 兼容对象存储提供商来了解它是什么。

this?: DISCOURSE_S3_INSTALL_CORS_RULE: false

这效果很好,但有一个问题。theme-javascripts 文件未上传到 S3。自然,网站的设计受到了损坏。只有 assets 文件夹被加载。我们能做些什么来上传其他设计文件?

这是我最后一次告诉你,你包含了调用 rake 任务上传到 s3 的部分。

祝你好运。

1 个赞

我错过了什么?下面的代码已附加,当我重建它时,它会加载资产文件,但不会加载主题文件。


当我在容器中运行 rake uploads:migrate_to_s3 时,出现以下错误:

Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
1001 posts were flagged for a rebake
rake aborted!
FileStore::ToS3MigrationError: 9 of 3769 uploads are not migrated to S3. S3 migration failed for db 'default'. (FileStore::ToS3MigrationError)

我的 app.yml 文件如下。我关闭了此设置,因为它没有上传主题 JavaScript 和样式表:DISCOURSE_CDN_URL

我将在午夜再次尝试运行它并进行编译,但我不知道我错过了什么。我搜索了一下,看看你可能指的是“上传到 S3 的 rake 任务”之外的其他内容,但没有找到任何不同的东西。

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: 'auto'
  DISCOURSE_S3_ENDPOINT: 'https://xxxxx.eu.r2.cloudflarestorage.com'
  DISCOURSE_S3_ACCESS_KEY_ID: 'xxxxx'
  DISCOURSE_S3_SECRET_ACCESS_KEY: 'xxxxx'
  DISCOURSE_S3_CDN_URL: 'https://cdn.xxxxx.com'
  #DISCOURSE_CDN_URL: 'https://cdn.xxxxx.com'
  DISCOURSE_S3_BUCKET: 'cloudflarer2xxxxx'
  #DISCOURSE_S3_BACKUP_BUCKET: 'cloudflarer2xxxxxbackups'
  #DISCOURSE_BACKUP_LOCATION: 's3'
  DISCOURSE_INCLUDE_S3_UPLOADS_IN_BACKUPS: true
  DISCOURSE_S3_INSTALL_CORS_RULE: false

抱歉浪费了您的时间,但如果用户文档包含这些问题就好了。现在我们知道 r2 可以正常工作。只需添加以下两个设置:


DISCOURSE_S3_REGION: 'auto'
DISCOURSE_S3_INSTALL_CORS_RULE: false

我们可以将站点上的 images 和 assets 文件夹移动到 S3 区域。唯一的问题是主题文件和样式文件未传输,我将在午夜再次尝试。希望我会成功,当然,在解释解决方案后,我会将此问题标记为已解决。

注意:Postgresql 服务器是独立的,我没有使用本地主机上的服务器。我猜这没问题。
感谢所有抽出时间的人。

这是上传资源的命令。我猜你仍然有什么东西出了问题,导致资源无法上传。

1 个赞

好的,如果我没有做错什么,那么我需要找到问题所在。当我进入容器并运行“rake s3:upload_assets”代码时,一切似乎都正常。即使我打开或关闭此设置,它也不会加载样式文件(theme-javascripts 和 stylesheets):“DISCOURSE_CDN_URL: ‘https://cdn.xxxxx.com’”。

rake s3:upload_assets --trace
插件名称是 'DiscourseMatheditor',但插件目录名为 'discourse-matheditor'
插件名称是 'discourse-post-voting',但插件目录名为 'discourse-question-answer'
插件名称是 'discourse-topic-voting',但插件目录名为 'discourse-voting'
** 调用 s3:upload_assets (首次)\n** 调用 environment (首次)\n** 执行 environment\n** 调用 s3:ensure_cors_rules (首次)\n** 调用 environment\n** 执行 s3:ensure_cors_rules\n正在安装 CORS 规则...\n跳过\n** 执行 s3:upload_assets 跳过:assets/break_string-cc617154cd04790e.js\n....\n....\n....\n```

正如我所说,如果我没有做错什么,我会尝试找到错误以及如何修复它。如果有任何改进,我将在此处添加,谢谢。

大家好,

我想分享一下我如何成功为我的 Discourse 论坛配置 Cloudflare R2 以进行上传和备份的经验和步骤。希望这能帮助到其他正在寻找将 Cloudflare R2 与 Discourse 一起使用的人。

设置概述:

  • 平台: Discourse (Bitnami 安装)
  • 存储桶: Cloudflare R2
  • 自定义域名: 设置用于公开提供文件
  • 配置: 完全通过 Discourse 站点设置完成(未触及任何环境变量)

分步指南:

  1. 创建 Cloudflare R2 存储桶:
    • 登录您的 Cloudflare 账户并导航到 R2 存储。
    • 为您的 Discourse 上传创建一个新的存储桶(例如,forum-uploads)。
    • 记下存储桶 S3 API URL访问密钥 ID秘密访问密钥
  2. 设置自定义域名用于 CDN:
    • 要公开提供您的 R2 存储桶内容,请在 Cloudflare 中创建自定义域名。
    • 例如,我使用了 forumfiles.example.in
    • 确保将 DNS 设置指向 Cloudflare 提供的 CNAME。由于我的域名在 Cloudflare 上,它已为我完成。
  3. 配置 Discourse 站点设置:
    • s3_bucket: 您的 R2 存储桶名称(例如,forum-uploads)。
    • s3_region: 设置为美国东部(弗吉尼亚州)。没有自动选项。
    • s3_endpoint: 使用 Cloudflare 提供的存储桶 S3 API URL(例如,https://<your-bucket-unique-id>.r2.cloudflarestorage.com)。
    • s3_access_key_id: 您的 R2 访问密钥 ID
    • s3_secret_access_key: 您的 R2 秘密访问密钥
    • s3_cdn_url: 用于 CDN 的自定义域名(例如,https://forumfiles.example.in)。
    • 确保选中启用 S3 备份启用 S3 上传
  4. 调整权限和 CORS:
    • 将您的 R2 存储桶设置为私有并配置 CORS 策略:
[
  {
      "AllowedHeaders": ["*"],
      "AllowedMethods": ["GET", "POST", "PUT", "HEAD"],
      "AllowedOrigins": ["*"],
      "ExposeHeaders": ["ETag"],
      "MaxAgeSeconds": 3000
  }
]
*   这确保了上传能够正确工作而不会出现 CORS 问题。
  1. 测试设置:
    • 通过您的 Discourse 论坛上传测试文件或图片,以验证上传是否正常工作。
    • 检查文件是否可以通过您的自定义域名访问(例如,https://forumfiles.example.in/original/1X/...)。
    • 检查备份,我已成功执行备份。在 R2 存储桶中进行了交叉检查,并且它也列在站点设置中。

结论:

通过遵循这些步骤,我能够无缝地将 Cloudflare R2 与 Discourse 集成,高效地处理上传和备份。如果您有任何问题或遇到问题,请随时提问!

6 个赞

您是否测试过 discourse 是否可以从 Cloudflare R2 下载文件?例如,将 S3 上传包含在实例的完整备份中。

似乎不起作用,因为 Cloudflare 在 R2 S3 API 中缺少某些东西,而且 migrate_to_s3 也不起作用。

1 个赞