From 0e63f0b9245e5100c8c0bcc2a4987705947ccca9 Mon Sep 17 00:00:00 2001 From: cdn0x12 Date: Mon, 21 Apr 2025 07:55:23 +0800 Subject: [PATCH] Update zh-cn translations to 6addd5cf525adec1859f48c52dafcfe1f96e558a --- content/zh-cn/admin/config.md | 4 ++ content/zh-cn/admin/elasticsearch.md | 6 -- .../admin/optional/object-storage-proxy.md | 6 ++ .../zh-cn/admin/optional/object-storage.md | 3 + content/zh-cn/entities/Instance.md | 27 +++++++- content/zh-cn/entities/TermsOfService.md | 62 +++++++++++++++++++ content/zh-cn/methods/instance.md | 60 ++++++++++++++++-- 7 files changed, 157 insertions(+), 11 deletions(-) create mode 100644 content/zh-cn/entities/TermsOfService.md diff --git a/content/zh-cn/admin/config.md b/content/zh-cn/admin/config.md index c3fef5b..bd20dc3 100644 --- a/content/zh-cn/admin/config.md +++ b/content/zh-cn/admin/config.md @@ -862,6 +862,10 @@ OTEL 服务名称的前缀。服务名称将是 `$prefix/web` 和 `$prefix/sidek #### `S3_ALIAS_HOST` +#### `EXTRA_MEDIA_HOSTS` + +**版本历史:**\ +4.4.0 - 添加 #### `S3_OPEN_TIMEOUT` diff --git a/content/zh-cn/admin/elasticsearch.md b/content/zh-cn/admin/elasticsearch.md index 176058a..df52e2b 100644 --- a/content/zh-cn/admin/elasticsearch.md +++ b/content/zh-cn/admin/elasticsearch.md @@ -27,12 +27,6 @@ Mastodon 的全文搜索允许已登录用户查找以下内容: Mastodon 经过测试与 Elasticsearch 7 版本兼容。它理论上也支持 OpenSearch 以及 Elasticsearch 6 和 8 版本,但这些设置不受官方支持。 {{< /hint >}} -Elasticsearch 需要 Java 运行环境。如果你尚未安装 Java,请立即进行安装。假设你以 `root` 用户身份登录: - -```bash -apt install openjdk-17-jre-headless -``` - 将 Elasticsearch 官方仓库添加到 apt: ```bash diff --git a/content/zh-cn/admin/optional/object-storage-proxy.md b/content/zh-cn/admin/optional/object-storage-proxy.md index b6bea5f..8aea849 100644 --- a/content/zh-cn/admin/optional/object-storage-proxy.md +++ b/content/zh-cn/admin/optional/object-storage-proxy.md @@ -115,6 +115,12 @@ systemctl reload nginx S3_ALIAS_HOST=files.example.com ``` +(可选)如果你的 S3_ALIAS_HOST 使用了 301 重定向或类似方式,请将最终跳转的目标地址添加到 EXTRA_MEDIA_HOSTS。 + +```bash +EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com +``` + 然后重启 Mastodon: ```bash diff --git a/content/zh-cn/admin/optional/object-storage.md b/content/zh-cn/admin/optional/object-storage.md index 61bac54..3dd3df2 100644 --- a/content/zh-cn/admin/optional/object-storage.md +++ b/content/zh-cn/admin/optional/object-storage.md @@ -62,6 +62,9 @@ Mastodon 会向 Web 界面、Mastodon API 客户端和 ActivityPub 服务器发 除隐藏存储提供商之外,这还可以让你在从存储提供商拉取媒体后缓存媒体,从而降低存储提供商的出口带宽成本。 这可以在你自己的反向代理中完成,也可以通过使用 CDN 来完成。 +`EXTRA_MEDIA_HOSTS` 允许你追加一组额外的域名,这些域名将被允许为你的实例提供媒体资源。如果你在自定义 CSS 或关于页面中包含了外部媒体,或者你的数据存储提供商会重定向到其他域名时,这个设置非常有用。 +例如:`EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com` + {{< page-ref page="admin/optional/object-storage-proxy.md" >}} {{< hint style="info" >}} diff --git a/content/zh-cn/entities/Instance.md b/content/zh-cn/entities/Instance.md index 14fc947..dac70d4 100644 --- a/content/zh-cn/entities/Instance.md +++ b/content/zh-cn/entities/Instance.md @@ -57,7 +57,10 @@ aliases: [ ], "configuration": { "urls": { - "streaming": "wss://mastodon.social" + "streaming": "wss://mastodon.social", + "about": "https://mastodon.social/about", + "privacy_policy": "https://mastodon.social/privacy-policy", + "terms_of_service": "https://mastodon.social/terms-of-service" }, "vapid": { "public_key": "BCkMmVdKDnKYwzVCDC99Iuc9GvId-x7-kKtuHnLgfF98ENiZp_aj-UNthbCdI70DqN1zUVis-x0Wrot2sBagkMc=" @@ -325,6 +328,28 @@ aliases: [ **版本历史:**\ 4.0.0 - 添加 +##### `configuration[urls][about]` {#about_url} + +**描述:** 实例“关于”页面的 URL。\ +**类型:** 字符串 (URL)\ +**版本历史:**\ +4.4.0 - 添加 + +##### `configuration[urls][privacy_policy]` {#privacy_policy} + +**描述:** 实例隐私政策页面的 URL。\ +**类型:** 字符串 (URL) 或 null\ +**版本历史:**\ +4.4.0 - 添加 + +##### `configuration[urls][terms_of_service]` {#terms_of_service} + +**描述:** 实例当前服务条款页面的 URL。\ +**类型:** {{}} 字符串 (URL)\ +**版本历史:**\ +4.4.0 - 添加 + + ### `configuration[vapid][public_key]` {#vapid_public_key} **描述:** 实例的 VAPID 公钥,用于推送通知,与 [WebPushSubscription#server_key]({{< relref "entities/WebPushSubscription#server_key" >}}) 相同。\ **类型:** 字符串\ diff --git a/content/zh-cn/entities/TermsOfService.md b/content/zh-cn/entities/TermsOfService.md new file mode 100644 index 0000000..334a7f3 --- /dev/null +++ b/content/zh-cn/entities/TermsOfService.md @@ -0,0 +1,62 @@ +--- +title: TermsOfService +description: 表示当前实例的服务条款。 +menu: + docs: + parent: entities +aliases: [ + "/entities/termsofservice", + "/entities/TermsOfService", + "/api/entities/termsofservice", + "/api/entities/TermsOfService", +] +--- + +## 示例 + +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

\n", + "succeeded_by": null +} +``` + +## 属性 + +### `effective_date` {#effective_date} + +**说明:** 这些服务条款生效或已生效的日期。\ +**类型:** 字符串([Date](/api/datetime-format#date))\ +**版本历史:**\ +4.4.0 - 添加 + +### `effective` {#effective} + +**说明:** 当前这些服务条款是否正在生效。\ +**类型:** 布尔值\ +**版本历史:**\ +4.4.0 - 添加 + +### `content` {#content} + +**说明:** 服务条款的已渲染 HTML 内容。\ +**类型:** 字符串(HTML)\ +**版本历史:**\ +4.4.0 - 添加 + +### `succeeded_by` {#succeeded_by} + +**说明:** 如果存在更新的服务条款,则为其生效日期。\ +**类型:** {{}} 字符串([Date](/api/datetime-format#date))\ +**版本历史:**\ +4.4.0 - 添加 + +## 另请参阅 + +{{< page-relref ref="methods/instance#terms_of_service" caption="GET /api/v1/instance/terms_of_service" >}} + +{{< page-relref ref="methods/instance#terms_of_service_date" caption="GET /api/v1/instance/terms_of_service/:date" >}} + +{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/terms_of_service_serializer.rb" caption="app/serializers/rest/terms_of_service_serializer.rb" >}} \ No newline at end of file diff --git a/content/zh-cn/methods/instance.md b/content/zh-cn/methods/instance.md index aa406fb..353610e 100644 --- a/content/zh-cn/methods/instance.md +++ b/content/zh-cn/methods/instance.md @@ -549,16 +549,68 @@ GET /api/v1/instance/terms_of_service HTTP/1.1 获取此实例的服务条款的内容(若已配置)。 -**返回:** [PrivacyPolicy]({{< relref "entities/PrivacyPolicy" >}})\ -**OAuth:** 公开\ -**版本历史:**\ -4.4.0 - 添加 +**返回:** [TermsOfService]({{< relref "entities/TermsOfService" >}}) +**OAuth:** 公开 +**版本历史:** +4.4.0 - 新增 #### 响应 ##### 200: OK +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

\n", + "succeeded_by": null +} +``` +##### 404: 未找到 + +本实例尚未配置服务条款。 + +```json +{ + "error": "Record not found" +} +``` + +--- + +## 查看特定版本的服务条款 {#terms_of_service_date} + +```http +GET /api/v1/instance/terms_of_service/:date HTTP/1.1 +``` + +获取本实例指定日期的服务条款内容(如有配置)。 + +**返回:** [TermsOfService]({{< relref "entities/TermsOfService" >}}) +**OAuth:** 公开 +**版本历史:** +4.4.0 - 新增 + +#### 请求 + +##### 路径参数 + +:date +: {{}} 字符串。服务条款生效日期。 + +#### 响应 + +##### 200: OK + +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

\n", + "succeeded_by": null +} +``` ##### 404: Not found