Add short_description to mastodon v1 instance api response. #821

Open
paulyd wants to merge 1 commit from paulyd/akkoma:add_short_description_to_masto_api into develop
Contributor

Context:

Some third party client applications are expecting theshort_description key in the v1 instance response.

See this issue:
https://github.com/Dimillian/IceCubesApp/issues/16
and this issue
https://github.com/Dimillian/IceCubesApp/issues/2105#issuecomment-2231466416

short_description is a required field as per the masto api docs.
https://docs.joinmastodon.org/entities/V1_Instance/#short_description

Insecurities / questions:

1️⃣ According to the mastodon docs, description is meant to allow html, short_description is meant to be plain text. Should we force html safe encode the short_description? Or would we prefer to actually add an instance config for a text only short_description ?
2️⃣ I don't have a way to test this locally with icecubes, so I am not convinced this actually fixes the integration. I realize keeping pace with the mastodon api is a moving target, but it seemed easy enough to try. 🤷

### Context: Some third party client applications are expecting the`short_description` key in the v1 instance response. See this issue: https://github.com/Dimillian/IceCubesApp/issues/16 and this issue https://github.com/Dimillian/IceCubesApp/issues/2105#issuecomment-2231466416 `short_description` is a required field as per the masto api docs. https://docs.joinmastodon.org/entities/V1_Instance/#short_description ### Insecurities / questions: 1️⃣ According to the mastodon docs, `description` is meant to allow html, `short_description` is meant to be plain text. Should we force html safe encode the short_description? Or would we prefer to actually add an instance config for a text only `short_description` ? 2️⃣ I don't have a way to test this locally with icecubes, so I am not convinced this actually fixes the integration. I realize keeping pace with the mastodon api is a moving target, but it seemed easy enough to try. 🤷
paulyd added 1 commit 2024-07-18 02:15:22 +00:00
Add short_description to mastodon v1 instance api response.
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
312ce5a1bf
Some third party client applications are expecting the
short_description key in the v1 instance response.

See this issue:
https://github.com/Dimillian/IceCubesApp/issues/16
and this issue
https://github.com/Dimillian/IceCubesApp/issues/2105#issuecomment-2231466416

short_description is a required field as per the masto
api docs.
https://docs.joinmastodon.org/entities/V1_Instance/#short_description
Member

Thanks, the thing is *oma’s MastoAPI was brought up a fair bit ago matching Mastodon 2.7 (January 2019). Random newer bits were added when useful or reported like here, but no comprehensive upgrade occured and we still advertise as version 2.7.2. *(Just compiling a list of which API bits changed per Mastodon version unfortunately isn’t that straightforward already; help appreciated)
For reference short_description was added in Mastodon 2.9.2 (June 2019).

description is meant to allow html, short_description is meant to be plain text. Should we force html safe encode the short_description? Or would we prefer to actually add an instance config for a text only short_description ?

Technically we could add a another HTML scrubber config converting everything to plain text only, but since this destroys layout a separate config will still be desireable sometimes. Imho it seems fine to default short_description to description, but if specified use a new short_description config instead.
When you add this, don't forget to also create it in config/description.exs (search for :description for the existing setting) and to update docs in docs/docs/configuration/cheatsheet.md.

Thanks, the thing is \*oma’s MastoAPI was brought up a fair bit ago matching Mastodon 2.7 (January 2019). Random newer bits were added when useful or reported like here, but no comprehensive upgrade occured and we still advertise as version 2.7.2. *(Just compiling a list of which API bits changed per Mastodon version unfortunately isn’t that straightforward already; help appreciated) For reference `short_description` was added in Mastodon 2.9.2 (June 2019). > `description` is meant to allow html, `short_description` is meant to be plain text. Should we force html safe encode the short_description? Or would we prefer to actually add an instance config for a text only short_description ? Technically we could add a another HTML scrubber config converting everything to plain text only, but since this destroys layout a separate config will still be desireable sometimes. Imho it seems fine to default `short_description` to `description`, but if specified use a new `short_description` config instead. When you add this, don't forget to also create it in `config/description.exs` *(search for `:description` for the existing setting)* and to update docs in `docs/docs/configuration/cheatsheet.md`.

PR is all good, i can patch up the docs/default config if needed

PR is all good, i can patch up the docs/default config if needed
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u add_short_description_to_masto_api:paulyd-add_short_description_to_masto_api
git checkout paulyd-add_short_description_to_masto_api
Sign in to join this conversation.
No description provided.