Merge remote-tracking branch 'upstream/main'

This commit is contained in:
CDN 2025-04-21 07:41:43 +08:00
commit a30b7e2499
Signed by: CDN
GPG key ID: 0C656827F9F80080
7 changed files with 157 additions and 9 deletions

View file

@ -862,6 +862,10 @@ The bucket must support access control lists (ACLs). For AWS S3, this means sett
#### `S3_ALIAS_HOST`
#### `EXTRA_MEDIA_HOSTS`
**Version history:**\
4.4.0 - added
#### `S3_OPEN_TIMEOUT`

View file

@ -27,12 +27,6 @@ It deliberately does not allow searching for arbitrary strings in the entire dat
Mastodon is tested with Elasticsearch version 7. It should support OpenSearch, as well as Elasticsearch versions 6 and 8, but those setups are not officially supported.
{{< /hint >}}
Elasticsearch requires a Java runtime. If you dont have Java already installed, do it now. Assuming you are logged in as `root`:
```bash
apt install openjdk-17-jre-headless
```
Add the official Elasticsearch repository to apt:
```bash

View file

@ -115,6 +115,12 @@ At last, you'll want to make sure Mastodon is using your new proxy to generate f
S3_ALIAS_HOST=files.example.com
```
(Optional) If your S3_ALIAS_HOST is using a 301 redirection or similar. Add the final location to the EXTRA_MEDIA_HOSTS
```bash
EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com
```
And restart Mastodon:
```bash

View file

@ -101,6 +101,12 @@ provider, reducing egress bandwidth costs from the storage
provider. This can be done in your own reverse proxy, or by using a
CDN.
`EXTRA_MEDIA_HOSTS` offers appending an additional list of hosts that
are allowed to serve media for your instance. This is useful if you
include external media in your custom CSS or about page, or if your
data storage provider makes use of redirects to other domains.
`EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com`
{{< page-ref page="admin/optional/object-storage-proxy.md" >}}
{{< hint style="info" >}}

View file

@ -18,7 +18,7 @@ aliases: [
{
"domain": "mastodon.social",
"title": "Mastodon",
"version": "4.0.0rc1",
"version": "4.4.0-alpha.3",
"source_url": "https://github.com/mastodon/mastodon",
"description": "The original server operated by the Mastodon gGmbH non-profit",
"usage": {
@ -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,27 @@ aliases: [
**Version history:**\
4.0.0 - added
##### `configuration[urls][about]` {#about_url}
**Description:** The URL of the server's about page.\
**Type:** String (URL)\
**Version history:**\
4.4.0 - added
##### `configuration[urls][privacy_policy]` {#privacy_policy}
**Description:** The URL of the server's privacy policy.\
**Type:** String (URL) or null\
**Version history:**\
4.4.0 - added
##### `configuration[urls][terms_of_service]` {#terms_of_service}
**Description:** The URL of the server's current terms of service, if any.\
**Type:** {{<nullable>}} String (URL)\
**Version history:**\
4.4.0 - added
### `configuration[vapid][public_key]` {#vapid_public_key}
**Description:** The instances VAPID public key, used for push notifications, the same as [WebPushSubscription#server_key]({{< relref "entities/WebPushSubscription#server_key" >}}).\
**Type:** String\

View file

@ -0,0 +1,62 @@
---
title: TermsOfService
description: Represents the terms of service of the instance.
menu:
docs:
parent: entities
aliases: [
"/entities/termsofservice",
"/entities/TermsOfService",
"/api/entities/termsofservice",
"/api/entities/TermsOfService",
]
---
## Example
```json
{
"effective_date": "2025-04-15",
"effective": true,
"content": "<p>Foo bar newer</p>\n",
"succeeded_by": null
}
```
## Attributes
### `effective_date` {#effective_date}
**Description:** The date these terms of service are coming or have come in effect.\
**Type:** String ([Date](/api/datetime-format#date))\
**Version history:**\
4.4.0 - added
### `effective` {#effective}
**Description:** Whether these terms of service are currently in effect.\
**Type:** Boolean\
**Version history:**\
4.4.0 - added
### `content` {#content}
**Description:** The rendered HTML content of the terms of service.\
**Type:** String (HTML)\
**Version history:**\
4.4.0 - added
### `succeeded_by` {#succeeded_by}
**Description:** If there are newer terms of service, their effective date.\
**Type:** {{<nullable>}} String ([Date](/api/datetime-format#date))\
**Version history:**\
4.4.0 - added
## See also
{{< 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" >}}

View file

@ -549,7 +549,7 @@ GET /api/v1/instance/terms_of_service HTTP/1.1
Obtain the contents of this server's terms of service, if configured.
**Returns:** [PrivacyPolicy]({{< relref "entities/PrivacyPolicy" >}})\
**Returns:** [TermsOfService]({{< relref "entities/TermsOfService" >}})\
**OAuth:** Public\
**Version history:**\
4.4.0 - added
@ -558,7 +558,59 @@ Obtain the contents of this server's terms of service, if configured.
##### 200: OK
```json
{
"effective_date": "2025-04-15",
"effective": true,
"content": "<p>Foo bar newer</p>\n",
"succeeded_by": null
}
```
##### 404: Not Found
No terms of service have been configured for this instance.
```json
{
"error": "Record not found"
}
```
---
## View a specific version of the terms of service {#terms_of_service_date}
```http
GET /api/v1/instance/terms_of_service/:date HTTP/1.1
```
Obtain the contents of this server's terms of service, for a specified date, if configured.
**Returns:** [TermsOfService]({{< relref "entities/TermsOfService" >}})\
**OAuth:** Public\
**Version history:**\
4.4.0 - added
#### Request
##### Path parameters
:date
: {{<required>}} String. The effective date of the terms of service.
#### Response
##### 200: OK
```json
{
"effective_date": "2025-04-15",
"effective": true,
"content": "<p>Foo bar newer</p>\n",
"succeeded_by": null
}
```
##### 404: Not Found