> For the complete documentation index, see [llms.txt](https://academy.shade.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.shade.inc/shade-academy/shade-academy-zh/byos/connecting-shade-with-google-cloud-storage.md).

# 将 Shade 连接到 Google Cloud Storage

Shade 支持自带 S3（BYOS3），兼容 AWS、GCP、MinIO、Wasabi、Backblaze 等多个提供商。以下是如何将 Shade 与您现有的 GCP 账户连接起来。

### 在 Google Cloud Storage 中创建新存储桶

{% hint style="info" %}
虽然并非严格必须配置一个新存储桶，但我们强烈建议为 Shade 配置一个新存储桶。由于 ShadeFS 的特性，Shade 无法使用现有存储桶中的文件。Shade 将创建两个新文件夹 `blobs` 和 `chunks` 到你连接的任何存储桶中。
{% endhint %}

要在 GCS 中创建新存储桶，请登录您的账户，前往云存储，并“创建新存储桶”：

<figure><img src="/files/2bc3943f0f9d279eac29ddd5a68e57ecc53c91fc" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
ShadeFS 不要求在该存储桶上设置任何其他特定属性。你可以根据业务需要选择复制数据、记录日志或设置版本控制。
{% endhint %}

### 配置 CORS

跨域资源共享（Cross-Origin Resource Sharing）是一项重要特性，它允许存储桶可从其他来源访问（例如 <https://app.shade.inc>）。这对于 Shade 从我们的应用中为您访问并下载原始媒体至关重要。要设置 CORS，您需要按照以下步骤操作 [这里](https://cloud.google.com/storage/docs/using-cors#command-line) 来安装 `gcloud CLI` 并配置 CORS。

建议使用以下 JSON：

```json
[
  {
    "origin": ["*"],
    "method": ["*"],
    "responseHeader": ["*"],
    "maxAgeSeconds": 3600
  }
]
```

### 创建 HMAC 密钥

为了让 Shade 访问您的 GCS 存储桶，您需要为服务账号配置一个 HMAC 密钥。

前往 Cloud Storage > Settings > Interoperability 以访问或生成您的 HMAC 密钥。

<figure><img src="/files/207560f30c1c430ba9e5ad833ee9ce427cf9a57c" alt=""><figcaption></figcaption></figure>

创建新密钥后，将生成的访问密钥和密钥复制到剪贴板，并在接下来的几个步骤中保存好。

### 在 Shade 中创建 BYOS 盘

到这一步，你应该已经成功获取以下项目：

1. Shade 工作区
2. 存储桶名称
3. 存储桶区域
4. 访问密钥
5. 密钥

如果你还没有工作区，可以创建一个 [这里](https://app.shade.inc).

在你的 Shade 工作区中，你现在可以创建一个盘。点击“My drives”旁边的加号按钮 > BYOS drive。

<figure><img src="/files/d07efaa0a4604daf4f68fc28e329a67b4ebd8b74" alt=""><figcaption></figcaption></figure>

#### 选择模板

<figure><img src="/files/cc62629d5c3921039c9e65d4830be0217b0eb9d1" alt=""><figcaption></figcaption></figure>

我们的模板通过额外的元数据和视图帮助你快速使用 Shade，从而帮助你组织文件和素材。有关我们的 AI 的更多信息，你可以查看我们的 [学院](https://academy.shade.inc/ai-tools/custom-and-automated-metadata)。在本例中，我们选择了 Video Production。

#### 创建我们的 GCS 驱动

接下来，我们确定驱动名称并选择我们的提供商 GCS。

<figure><img src="/files/441ea725a610a669783d0f7ce3f11080a70302bb" alt=""><figcaption></figcaption></figure>

#### 添加我们的 GCS 凭据

根据前面的步骤，我们添加 GCS 凭据，包括存储桶名称、区域、访问密钥和密钥。

{% hint style="info" %}
这里必须填写您在 GCS 中创建的存储桶名称。这与您在上一屏创建的驱动名称不同。
{% endhint %}

{% hint style="info" %}
另外请注意：如果您为 GCS 存储桶选择了多个区域，您可以安全地选择任意区域。所有区域都指向 <https://storage.googleapis.com>
{% endhint %}

<figure><img src="/files/0a51b78bbc2b7b350d4f20275b3bb9c8eceacc21" alt=""><figcaption></figcaption></figure>

### 上传你的第一个文件

完成前面的步骤后，你现在就可以向你的 Shade 盘上传第一个文件了。如果配置成功，你应该能够上传文件，并从 [Shade 桌面应用](https://shade.inc/download)

<figure><img src="/files/4377f6ba0f3955312e17f50a4f33bc1811b8614c" alt=""><figcaption></figcaption></figure>

### 故障排除提示

如果你有更多问题——欢迎通过以下方式联系我们： <support@shade.inc> 或加入我们的 [Discord](https://discord.gg/h8wqFMJ4vK).

#### 我无法上传，怎么回事？

如果你无法上传，请检查存储桶的 CORS 设置，或者检查你的密钥/访问密钥及其关联权限。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://academy.shade.inc/shade-academy/shade-academy-zh/byos/connecting-shade-with-google-cloud-storage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
