# 寻找将 discourse 与 digital ocean spaces 连接的文档

**URL:** https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917
**Category:** Support
**Created:** [2020年十二月10日 20:16 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917 "2020-12-10T20:16:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Pierre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pierre/32/36467_2.png) [@Pierre](https://meta.discourse.org/u/Pierre)
#### Post date: [2020年十二月10日 20:16 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/1 "2020-12-10T20:16:24Z")

</div>

搜索将我引导至该主题：

> [@(Superseded) Set up backup and image uploads to DigitalOcean Spaces](https://meta.discourse.org/t/setting-up-backup-and-image-uploads-to-digitalocean-spaces/92502):
>
> This topic is superseded by [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916).

随后我又查看了该主题：

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916):
>
> information_source This topic covers how to configure some common S3 compatible Object Storage providers (S3 clones). See [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) for more details about Amazon AWS S3 configuration, which is officially supported and used internally by Discourse for our hosting services. Provider Service Name Works with Discourse? [Amazon AWS](#aws-s3-2) S3 Yes [Digital Ocean](#digital-ocean-spaces-3) Spaces Yes [Linode](#linode-object-storage-4) Object Storage Yes [Google Cloud](#google-cloud-platform-storage-5) Storage Yes [Scaleway](#scaleway-object-storage-6) Object Storage Yes [Vultr](#vultr-object-storage-7) Obj…

我对设置的处理方式感到困惑。

@Falco 提到需要在 app.yml 中添加以下配置：

```
after_assets_precompile:
    - exec:
        cd: $home
        cmd:
          - sudo -E -u discourse bundle exec rake s3:upload_assets

```

那么 Digital Ocean Spaces 的配置呢？我是应该将其添加到同一部分，还是不同的部分？或者这些设置会出现在管理面板中？

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2020年十二月10日 20:31 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/2 "2020-12-10T20:31:05Z")

</div>

> [@Pierre](#):
>
> Digital Ocean Spaces 的配置呢？

该指南中为每个兼容的提供商都设有相应章节。请向下滚动查看，Digital Ocean Spaces 是第二个。

---

<div class="post-metadata">

### Author: ![Pierre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pierre/32/36467_2.png) [@Pierre](https://meta.discourse.org/u/Pierre)
#### Post date: [2020年十二月10日 20:36 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/3 "2020-12-10T20:36:28Z")

</div>

是的，看到了，谢谢！

那我该如何配置 Digital Ocean Spaces 呢？

我是应该将 Digital Ocean Spaces 的配置添加到 app.yml 的同一部分，还是添加到不同的部分？  
或者这些设置会出现在管理面板中？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年十二月10日 20:50 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/4 "2020-12-10T20:50:50Z")

</div>

> [@Pierre](#):
>
> 我应该把 Digital Ocean Spaces 的配置添加到 app.yml 的同一个部分吗？

文中写道：

> [@Falco](#):
>
> 要使用它，请将以下内容添加到 app.yml 文件的 `env` 部分，并相应调整值：

这难道没有表明你应该将这些设置添加到 `app.yml` 的 `env` 部分吗？

不会，它们不会出现在管理界面中。通过 ENV 变量设置的设置会在管理界面中隐藏。

---

<div class="post-metadata">

### Author: ![Pierre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pierre/32/36467_2.png) [@Pierre](https://meta.discourse.org/u/Pierre)
#### Post date: [2020年十二月10日 21:03 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/5 "2020-12-10T21:03:05Z")

</div>

> [@pfaffman](#):
>
> 这难道不是在暗示你应该将这些设置添加到你的 `app.yml` 中的 `env` 部分吗？

抱歉，直到你提到后我才注意到，因为那个小细节列在 AWS S3 下面。由于我正在使用 Digital Ocean Spaces，所以我跳过了它。我会试试看，谢谢！

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年十二月10日 21:06 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/6 "2020-12-10T21:06:04Z")

</div>

> [@Pierre](#):
>
> 抱歉，直到你提到后我才注意到，因为那个小细节是列在 AWS S3 下的。

这说得通。

这有帮助吗？

> [@Falco](#):
>
> 在以下示例中，`https://falcoland-files-cdn.falco.dev` 是一个配置为提供存储桶下文件的 CDN。在我的示例中，存储桶名称设置为 `falcoland-files`。
> 
> 从下面的列表中选择你的提供商，并将这些设置添加到你的 `app.yml` 文件的 `env` 部分，相应地调整数值：
> 
> ### AWS S3
> 
> 这是我们官方支持并在内部使用的。他们的 CDN 服务 Cloudfront 也可以用于前置存储桶文件。

---

<div class="post-metadata">

### Author: ![Pierre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pierre/32/36467_2.png) [@Pierre](https://meta.discourse.org/u/Pierre)
#### Post date: [2020年十二月10日 23:06 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/7 "2020-12-10T23:06:31Z")

</div>

看起来不错，感谢更新！

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2021年一月9日 23:06 UTC](https://meta.discourse.org/t/looking-for-doc-to-connect-discourse-with-digital-ocean-spaces/172917/8 "2021-01-09T23:06:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
