From 5ef698a542bdc260fe1e18cd1d7be3ea5d84fb93 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 7 Apr 2025 15:16:42 +0200 Subject: [PATCH 1/5] Add documentation for `about`, `privacy_policy` and `terms_of_service` URLs (#1606) Add documentation for https://github.com/mastodon/mastodon/pull/33849 --- content/en/entities/Instance.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/content/en/entities/Instance.md b/content/en/entities/Instance.md index 1373c75..9d10415 100644 --- a/content/en/entities/Instance.md +++ b/content/en/entities/Instance.md @@ -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:** 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\ From e0a1b3366fa6418d97d2a6cbf4ad6f30a763735e Mon Sep 17 00:00:00 2001 From: Shlee Date: Tue, 8 Apr 2025 07:27:11 +0000 Subject: [PATCH 2/5] EXTRA_DATA_HOSTS (#1612) * Update object-storage.md * Update config.md * Update object-storage-proxy.md * Update object-storage.md * Update config.md * Update object-storage-proxy.md * Update object-storage.md * Update config.md * Update content/en/admin/config.md Co-authored-by: Claire --------- Co-authored-by: Claire --- content/en/admin/config.md | 4 ++++ content/en/admin/optional/object-storage-proxy.md | 6 ++++++ content/en/admin/optional/object-storage.md | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/content/en/admin/config.md b/content/en/admin/config.md index 9ae2cce..0842d5e 100644 --- a/content/en/admin/config.md +++ b/content/en/admin/config.md @@ -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` diff --git a/content/en/admin/optional/object-storage-proxy.md b/content/en/admin/optional/object-storage-proxy.md index 66ad68b..748ad0d 100644 --- a/content/en/admin/optional/object-storage-proxy.md +++ b/content/en/admin/optional/object-storage-proxy.md @@ -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 diff --git a/content/en/admin/optional/object-storage.md b/content/en/admin/optional/object-storage.md index 7879873..e27b6f4 100644 --- a/content/en/admin/optional/object-storage.md +++ b/content/en/admin/optional/object-storage.md @@ -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" >}} From a21d5807f5b016186947e48d51d16fbb58a28b94 Mon Sep 17 00:00:00 2001 From: danielcolquitt <81052145+danielcolquitt@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:29:23 +0100 Subject: [PATCH 3/5] Remove installation of OpenJDK (#1597) ElasticSearch is bundled with its own version of OpenJDK. Using a standalone JDK is not necessary or recommended. --- content/en/admin/elasticsearch.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/content/en/admin/elasticsearch.md b/content/en/admin/elasticsearch.md index db4bc35..1a39585 100644 --- a/content/en/admin/elasticsearch.md +++ b/content/en/admin/elasticsearch.md @@ -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 don’t 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 From 764ed11fc5822eea718354f0b8b013b2b7671845 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 16 Apr 2025 07:20:37 +0200 Subject: [PATCH 4/5] Fix `terms_of_service` URL and `privacy_policy` URL having incorrect nullable flags (#1629) Those were swapped --- content/en/entities/Instance.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/entities/Instance.md b/content/en/entities/Instance.md index 9d10415..7640641 100644 --- a/content/en/entities/Instance.md +++ b/content/en/entities/Instance.md @@ -338,14 +338,14 @@ aliases: [ ##### `configuration[urls][privacy_policy]` {#privacy_policy} **Description:** The URL of the server's privacy policy.\ -**Type:** {{}} String (URL) or null\ +**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:** String (URL)\ +**Type:** {{}} String (URL)\ **Version history:**\ 4.4.0 - added From 6addd5cf525adec1859f48c52dafcfe1f96e558a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 16 Apr 2025 08:39:58 +0200 Subject: [PATCH 5/5] Add documentation for `GET /api/v1/instance/terms_of_service` (#1634) --- content/en/entities/TermsOfService.md | 62 +++++++++++++++++++++++++++ content/en/methods/instance.md | 54 ++++++++++++++++++++++- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 content/en/entities/TermsOfService.md diff --git a/content/en/entities/TermsOfService.md b/content/en/entities/TermsOfService.md new file mode 100644 index 0000000..0f96552 --- /dev/null +++ b/content/en/entities/TermsOfService.md @@ -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": "

Foo bar newer

\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:** {{}} 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" >}} diff --git a/content/en/methods/instance.md b/content/en/methods/instance.md index c144af9..edb2a20 100644 --- a/content/en/methods/instance.md +++ b/content/en/methods/instance.md @@ -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": "

Foo bar newer

\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 +: {{}} String. The effective date of the terms of service. + +#### Response + +##### 200: OK + +```json +{ + "effective_date": "2025-04-15", + "effective": true, + "content": "

Foo bar newer

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