summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/API/admin_api.md341
-rw-r--r--docs/API/chats.md248
-rw-r--r--docs/API/differences_in_mastoapi_responses.md144
-rw-r--r--docs/API/pleroma_api.md207
-rw-r--r--docs/administration/CLI_tasks/config.md29
-rw-r--r--docs/administration/CLI_tasks/database.md132
-rw-r--r--docs/administration/CLI_tasks/digest.md32
-rw-r--r--docs/administration/CLI_tasks/email.md32
-rw-r--r--docs/administration/CLI_tasks/emoji.md55
-rw-r--r--docs/administration/CLI_tasks/frontend.md69
-rw-r--r--docs/administration/CLI_tasks/instance.md16
-rw-r--r--docs/administration/CLI_tasks/oauth_app.md20
-rw-r--r--docs/administration/CLI_tasks/relay.md48
-rw-r--r--docs/administration/CLI_tasks/robots_txt.md21
-rw-r--r--docs/administration/CLI_tasks/uploads.md16
-rw-r--r--docs/administration/CLI_tasks/user.md291
-rw-r--r--docs/administration/backup.md5
-rw-r--r--docs/administration/updating.md2
-rw-r--r--docs/ap_extensions.md35
-rw-r--r--docs/clients.md52
-rw-r--r--docs/configuration/cheatsheet.md364
-rw-r--r--docs/configuration/howto_database_config.md153
-rw-r--r--docs/configuration/howto_theming_your_instance.md2
-rw-r--r--docs/configuration/mrf.md26
-rw-r--r--docs/configuration/postgresql.md31
-rw-r--r--docs/configuration/static_dir.md65
-rw-r--r--docs/configuration/storing_remote_media.md38
-rw-r--r--docs/dev.md23
-rw-r--r--docs/index.md26
-rw-r--r--docs/installation/alpine_linux_en.md8
-rw-r--r--docs/installation/arch_linux_en.md8
-rw-r--r--docs/installation/debian_based_en.md22
-rw-r--r--docs/installation/debian_based_jp.md34
-rw-r--r--docs/installation/freebsd_en.md210
-rw-r--r--docs/installation/further_reading.include5
-rw-r--r--docs/installation/gentoo_en.md8
-rw-r--r--docs/installation/migrating_from_source_otp_en.md48
-rw-r--r--docs/installation/netbsd_en.md9
-rw-r--r--docs/installation/openbsd_en.md11
-rw-r--r--docs/installation/openbsd_fi.md2
-rw-r--r--docs/installation/otp_en.md191
-rw-r--r--docs/introduction.md65
42 files changed, 2453 insertions, 691 deletions
diff --git a/docs/API/admin_api.md b/docs/API/admin_api.md
index 26f3b1932..c0ea074f0 100644
--- a/docs/API/admin_api.md
+++ b/docs/API/admin_api.md
@@ -19,6 +19,7 @@ Configuration options:
- `local`: only local users
- `external`: only external users
- `active`: only active users
+ - `need_approval`: only unapproved users
- `deactivated`: only deactivated users
- `is_admin`: users with admin role
- `is_moderator`: users with moderator role
@@ -46,7 +47,10 @@ Configuration options:
"local": bool,
"tags": array,
"avatar": string,
- "display_name": string
+ "display_name": string,
+ "confirmation_pending": bool,
+ "approval_pending": bool,
+ "registration_reason": string,
},
...
]
@@ -242,6 +246,24 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
}
```
+## `PATCH /api/pleroma/admin/users/approve`
+
+### Approve user
+
+- Params:
+ - `nicknames`: nicknames array
+- Response:
+
+```json
+{
+ users: [
+ {
+ // user object
+ }
+ ]
+}
+```
+
## `GET /api/pleroma/admin/users/:nickname_or_id`
### Retrive the details of a user
@@ -291,31 +313,53 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- On failure: `Not found`
- On success: JSON array of user's latest statuses
+## `GET /api/pleroma/admin/relay`
+
+### List Relays
+
+Params: none
+Response:
+
+* On success: JSON array of relays
+
+```json
+[
+ {"actor": "https://example.com/relay", "followed_back": true},
+ {"actor": "https://example2.com/relay", "followed_back": false}
+]
+```
+
## `POST /api/pleroma/admin/relay`
### Follow a Relay
-- Params:
- - `relay_url`
-- Response:
- - On success: URL of the followed relay
+Params:
+
+* `relay_url`
+
+Response:
+
+* On success: relay json object
+
+```json
+{"actor": "https://example.com/relay", "followed_back": true}
+```
## `DELETE /api/pleroma/admin/relay`
### Unfollow a Relay
-- Params:
- - `relay_url`
-- Response:
- - On success: URL of the unfollowed relay
+Params:
-## `GET /api/pleroma/admin/relay`
+* `relay_url`
-### List Relays
+Response:
-- Params: none
-- Response:
- - On success: JSON array of relays
+* On success: URL of the unfollowed relay
+
+```json
+{"https://example.com/relay"}
+```
## `POST /api/pleroma/admin/users/invite_token`
@@ -392,10 +436,24 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- `email`
- `name`, optional
+- Response:
+ - On success: `204`, empty response
+ - On failure:
+ - 400 Bad Request, JSON:
+
+ ```json
+ [
+ {
+ "error": "Appropriate error message here"
+ }
+ ]
+ ```
+
## `GET /api/pleroma/admin/users/:nickname/password_reset`
### Get a password reset token for a given nickname
+
- Params: none
- Response:
@@ -414,6 +472,14 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- `nicknames`
- Response: none (code `204`)
+## PUT `/api/pleroma/admin/users/disable_mfa`
+
+### Disable mfa for user's account.
+
+- Params:
+ - `nickname`
+- Response: User’s nickname
+
## `GET /api/pleroma/admin/users/:nickname/credentials`
### Get the user's email, password, display and settings-related fields
@@ -466,30 +532,52 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
### Change the user's email, password, display and settings-related fields
-- Params:
- - `email`
- - `password`
- - `name`
- - `bio`
- - `avatar`
- - `locked`
- - `no_rich_text`
- - `default_scope`
- - `banner`
- - `hide_follows`
- - `hide_followers`
- - `hide_followers_count`
- - `hide_follows_count`
- - `hide_favorites`
- - `allow_following_move`
- - `background`
- - `show_role`
- - `skip_thread_containment`
- - `fields`
- - `discoverable`
- - `actor_type`
-
-- Response: none (code `200`)
+* Params:
+ * `email`
+ * `password`
+ * `name`
+ * `bio`
+ * `avatar`
+ * `locked`
+ * `no_rich_text`
+ * `default_scope`
+ * `banner`
+ * `hide_follows`
+ * `hide_followers`
+ * `hide_followers_count`
+ * `hide_follows_count`
+ * `hide_favorites`
+ * `allow_following_move`
+ * `background`
+ * `show_role`
+ * `skip_thread_containment`
+ * `fields`
+ * `discoverable`
+ * `actor_type`
+
+* Responses:
+
+Status: 200
+
+```json
+{"status": "success"}
+```
+
+Status: 400
+
+```json
+{"errors":
+ {"actor_type": "is invalid"},
+ {"email": "has invalid format"},
+ ...
+ }
+```
+
+Status: 404
+
+```json
+{"error": "Not found"}
+```
## `GET /api/pleroma/admin/reports`
@@ -509,7 +597,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
```json
{
- "totalReports" : 1,
+ "total" : 1,
"reports": [
{
"account": {
@@ -730,7 +818,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- 400 Bad Request `"Invalid parameters"` when `status` is missing
- On success: `204`, empty response
-## `POST /api/pleroma/admin/reports/:report_id/notes/:id`
+## `DELETE /api/pleroma/admin/reports/:report_id/notes/:id`
### Delete report note
@@ -742,6 +830,17 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- 400 Bad Request `"Invalid parameters"` when `status` is missing
- On success: `204`, empty response
+## `GET /api/pleroma/admin/statuses/:id`
+
+### Show status by id
+
+- Params:
+ - `id`: required, status id
+- Response:
+ - On failure:
+ - 404 Not Found `"Not Found"`
+ - On success: JSON, Mastodon Status entity
+
## `PUT /api/pleroma/admin/statuses/:id`
### Change the scope of an individual reported status
@@ -855,6 +954,8 @@ Some modifications are necessary to save the config settings correctly:
Most of the settings will be applied in `runtime`, this means that you don't need to restart the instance. But some settings are applied in `compile time` and require a reboot of the instance, such as:
- all settings inside these keys:
- `:hackney_pools`
+ - `:connections_pool`
+ - `:pools`
- `:chat`
- partially settings inside these keys:
- `:seconds_valid` in `Pleroma.Captcha`
@@ -1061,6 +1162,10 @@ Loads json generated from `config/descriptions.exs`.
### Stats
+- Query Params:
+ - *optional* `instance`: **string** instance hostname (without protocol) to get stats for
+- Example: `https://mypleroma.org/api/pleroma/admin/stats?instance=lain.com`
+
- Response:
```json
@@ -1073,3 +1178,159 @@ Loads json generated from `config/descriptions.exs`.
}
}
```
+
+## `GET /api/pleroma/admin/oauth_app`
+
+### List OAuth app
+
+- Params:
+ - *optional* `name`
+ - *optional* `client_id`
+ - *optional* `page`
+ - *optional* `page_size`
+ - *optional* `trusted`
+
+- Response:
+
+```json
+{
+ "apps": [
+ {
+ "id": 1,
+ "name": "App name",
+ "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
+ "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
+ "redirect_uri": "https://example.com/oauth-callback",
+ "website": "https://example.com",
+ "trusted": true
+ }
+ ],
+ "count": 17,
+ "page_size": 50
+}
+```
+
+
+## `POST /api/pleroma/admin/oauth_app`
+
+### Create OAuth App
+
+- Params:
+ - `name`
+ - `redirect_uris`
+ - `scopes`
+ - *optional* `website`
+ - *optional* `trusted`
+
+- Response:
+
+```json
+{
+ "id": 1,
+ "name": "App name",
+ "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
+ "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
+ "redirect_uri": "https://example.com/oauth-callback",
+ "website": "https://example.com",
+ "trusted": true
+}
+```
+
+- On failure:
+```json
+{
+ "redirect_uris": "can't be blank",
+ "name": "can't be blank"
+}
+```
+
+## `PATCH /api/pleroma/admin/oauth_app/:id`
+
+### Update OAuth App
+
+- Params:
+ - *optional* `name`
+ - *optional* `redirect_uris`
+ - *optional* `scopes`
+ - *optional* `website`
+ - *optional* `trusted`
+
+- Response:
+
+```json
+{
+ "id": 1,
+ "name": "App name",
+ "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
+ "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
+ "redirect_uri": "https://example.com/oauth-callback",
+ "website": "https://example.com",
+ "trusted": true
+}
+```
+
+## `DELETE /api/pleroma/admin/oauth_app/:id`
+
+### Delete OAuth App
+
+- Params: None
+
+- Response:
+ - On success: `204`, empty response
+ - On failure:
+ - 400 Bad Request `"Invalid parameters"` when `status` is missing
+
+## `GET /api/pleroma/admin/media_proxy_caches`
+
+### Get a list of all banned MediaProxy URLs in Cachex
+
+- Authentication: required
+- Params:
+- *optional* `page`: **integer** page number
+- *optional* `page_size`: **integer** number of log entries per page (default is `50`)
+- *optional* `query`: **string** search term
+
+- Response:
+
+``` json
+{
+ "page_size": integer,
+ "count": integer,
+ "urls": [
+ "http://example.com/media/a688346.jpg",
+ "http://example.com/media/fb1f4d.jpg"
+ ]
+}
+
+```
+
+## `POST /api/pleroma/admin/media_proxy_caches/delete`
+
+### Remove a banned MediaProxy URL from Cachex
+
+- Authentication: required
+- Params:
+ - `urls` (array)
+
+- Response:
+
+``` json
+{ }
+
+```
+
+## `POST /api/pleroma/admin/media_proxy_caches/purge`
+
+### Purge a MediaProxy URL
+
+- Authentication: required
+- Params:
+ - `urls` (array)
+ - `ban` (boolean)
+
+- Response:
+
+``` json
+{ }
+
+```
diff --git a/docs/API/chats.md b/docs/API/chats.md
new file mode 100644
index 000000000..aa6119670
--- /dev/null
+++ b/docs/API/chats.md
@@ -0,0 +1,248 @@
+# Chats
+
+Chats are a way to represent an IM-style conversation between two actors. They are not the same as direct messages and they are not `Status`es, even though they have a lot in common.
+
+## Why Chats?
+
+There are no 'visibility levels' in ActivityPub, their definition is purely a Mastodon convention. Direct Messaging between users on the fediverse has mostly been modeled by using ActivityPub addressing following Mastodon conventions on normal `Note` objects. In this case, a 'direct message' would be a message that has no followers addressed and also does not address the special public actor, but just the recipients in the `to` field. It would still be a `Note` and is presented with other `Note`s as a `Status` in the API.
+
+This is an awkward setup for a few reasons:
+
+- As DMs generally still follow the usual `Status` conventions, it is easy to accidentally pull somebody into a DM thread by mentioning them. (e.g. "I hate @badguy so much")
+- It is possible to go from a publicly addressed `Status` to a DM reply, back to public, then to a 'followers only' reply, and so on. This can be become very confusing, as it is unclear which user can see which part of the conversation.
+- The standard `Status` format of implicit addressing also leads to rather ugly results if you try to display the messages as a chat, because all the recipients are always mentioned by name in the message.
+- As direct messages are posted with the same api call (and usually same frontend component) as public messages, accidentally making a public message private or vice versa can happen easily. Client bugs can also lead to this, accidentally making private messages public.
+
+As a measure to improve this situation, the `Conversation` concept and related Pleroma extensions were introduced. While it made it possible to work around a few of the issues, many of the problems remained and it didn't see much adoption because it was too complicated to use correctly.
+
+## Chats explained
+For this reasons, Chats are a new and different entity, both in the API as well as in ActivityPub. A quick overview:
+
+- Chats are meant to represent an instant message conversation between two actors. For now these are only 1-on-1 conversations, but the other actor can be a group in the future.
+- Chat messages have the ActivityPub type `ChatMessage`. They are not `Note`s. Servers that don't understand them will just drop them.
+- The only addressing allowed in `ChatMessage`s is one single ActivityPub actor in the `to` field.
+- There's always only one Chat between two actors. If you start chatting with someone and later start a 'new' Chat, the old Chat will be continued.
+- `ChatMessage`s are posted with a different api, making it very hard to accidentally send a message to the wrong person.
+- `ChatMessage`s don't show up in the existing timelines.
+- Chats can never go from private to public. They are always private between the two actors.
+
+## Caveats
+
+- Chats are NOT E2E encrypted (yet). Security is still the same as email.
+
+## API
+
+In general, the way to send a `ChatMessage` is to first create a `Chat`, then post a message to that `Chat`. `Group`s will later be supported by making them a sub-type of `Account`.
+
+This is the overview of using the API. The API is also documented via OpenAPI, so you can view it and play with it by pointing SwaggerUI or a similar OpenAPI tool to `https://yourinstance.tld/api/openapi`.
+
+### Creating or getting a chat.
+
+To create or get an existing Chat for a certain recipient (identified by Account ID)
+you can call:
+
+`POST /api/v1/pleroma/chats/by-account-id/:account_id`
+
+The account id is the normal FlakeId of the user
+```
+POST /api/v1/pleroma/chats/by-account-id/someflakeid
+```
+
+If you already have the id of a chat, you can also use
+
+```
+GET /api/v1/pleroma/chats/:id
+```
+
+There will only ever be ONE Chat for you and a given recipient, so this call
+will return the same Chat if you already have one with that user.
+
+Returned data:
+
+```json
+{
+ "account": {
+ "id": "someflakeid",
+ "username": "somenick",
+ ...
+ },
+ "id" : "1",
+ "unread" : 2,
+ "last_message" : {...}, // The last message in that chat
+ "updated_at": "2020-04-21T15:11:46.000Z"
+}
+```
+
+### Marking a chat as read
+
+To mark a number of messages in a chat up to a certain message as read, you can use
+
+`POST /api/v1/pleroma/chats/:id/read`
+
+
+Parameters:
+- last_read_id: Given this id, all chat messages until this one will be marked as read. Required.
+
+
+Returned data:
+
+```json
+{
+ "account": {
+ "id": "someflakeid",
+ "username": "somenick",
+ ...
+ },
+ "id" : "1",
+ "unread" : 0,
+ "updated_at": "2020-04-21T15:11:46.000Z"
+}
+```
+
+### Marking a single chat message as read
+
+To set the `unread` property of a message to `false`
+
+`POST /api/v1/pleroma/chats/:id/messages/:message_id/read`
+
+Returned data:
+
+The modified chat message
+
+### Getting a list of Chats
+
+`GET /api/v1/pleroma/chats`
+
+This will return a list of chats that you have been involved in, sorted by their
+last update (so new chats will be at the top).
+
+Returned data:
+
+```json
+[
+ {
+ "account": {
+ "id": "someflakeid",
+ "username": "somenick",
+ ...
+ },
+ "id" : "1",
+ "unread" : 2,
+ "last_message" : {...}, // The last message in that chat
+ "updated_at": "2020-04-21T15:11:46.000Z"
+ }
+]
+```
+
+The recipient of messages that are sent to this chat is given by their AP ID.
+No pagination is implemented for now.
+
+### Getting the messages for a Chat
+
+For a given Chat id, you can get the associated messages with
+
+`GET /api/v1/pleroma/chats/:id/messages`
+
+This will return all messages, sorted by most recent to least recent. The usual
+pagination options are implemented.
+
+Returned data:
+
+```json
+[
+ {
+ "account_id": "someflakeid",
+ "chat_id": "1",
+ "content": "Check this out :firefox:",
+ "created_at": "2020-04-21T15:11:46.000Z",
+ "emojis": [
+ {
+ "shortcode": "firefox",
+ "static_url": "https://dontbulling.me/emoji/Firefox.gif",
+ "url": "https://dontbulling.me/emoji/Firefox.gif",
+ "visible_in_picker": false
+ }
+ ],
+ "id": "13",
+ "unread": true
+ },
+ {
+ "account_id": "someflakeid",
+ "chat_id": "1",
+ "content": "Whats' up?",
+ "created_at": "2020-04-21T15:06:45.000Z",
+ "emojis": [],
+ "id": "12",
+ "unread": false
+ }
+]
+```
+
+### Posting a chat message
+
+Posting a chat message for given Chat id works like this:
+
+`POST /api/v1/pleroma/chats/:id/messages`
+
+Parameters:
+- content: The text content of the message. Optional if media is attached.
+- media_id: The id of an upload that will be attached to the message.
+
+Currently, no formatting beyond basic escaping and emoji is implemented.
+
+Returned data:
+
+```json
+{
+ "account_id": "someflakeid",
+ "chat_id": "1",
+ "content": "Check this out :firefox:",
+ "created_at": "2020-04-21T15:11:46.000Z",
+ "emojis": [
+ {
+ "shortcode": "firefox",
+ "static_url": "https://dontbulling.me/emoji/Firefox.gif",
+ "url": "https://dontbulling.me/emoji/Firefox.gif",
+ "visible_in_picker": false
+ }
+ ],
+ "id": "13",
+ "unread": false
+}
+```
+
+### Deleting a chat message
+
+Deleting a chat message for given Chat id works like this:
+
+`DELETE /api/v1/pleroma/chats/:chat_id/messages/:message_id`
+
+Returned data is the deleted message.
+
+### Notifications
+
+There's a new `pleroma:chat_mention` notification, which has this form. It is not given out in the notifications endpoint by default, you need to explicitly request it with `include_types[]=pleroma:chat_mention`:
+
+```json
+{
+ "id": "someid",
+ "type": "pleroma:chat_mention",
+ "account": { ... } // User account of the sender,
+ "chat_message": {
+ "chat_id": "1",
+ "id": "10",
+ "content": "Hello",
+ "account_id": "someflakeid",
+ "unread": false
+ },
+ "created_at": "somedate"
+}
+```
+
+### Streaming
+
+There is an additional `user:pleroma_chat` stream. Incoming chat messages will make the current chat be sent to this `user` stream. The `event` of an incoming chat message is `pleroma:chat_update`. The payload is the updated chat with the incoming chat message in the `last_message` field.
+
+### Web Push
+
+If you want to receive push messages for this type, you'll need to add the `pleroma:chat_mention` type to your alerts in the push subscription.
diff --git a/docs/API/differences_in_mastoapi_responses.md b/docs/API/differences_in_mastoapi_responses.md
index 06de90f71..38865dc68 100644
--- a/docs/API/differences_in_mastoapi_responses.md
+++ b/docs/API/differences_in_mastoapi_responses.md
@@ -4,16 +4,13 @@ A Pleroma instance can be identified by "<Mastodon version> (compatible; Pleroma
## Flake IDs
-Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings
-
-## Attachment cap
-
-Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting.
+Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are lexically sortable strings
## Timelines
Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users.
Adding the parameter `exclude_visibilities` to the timeline queries will exclude the statuses with the given visibilities. The parameter accepts an array of visibility types (`public`, `unlisted`, `private`, `direct`), e.g., `exclude_visibilities[]=direct&exclude_visibilities[]=private`.
+Adding the parameter `reply_visibility` to the public and home timelines queries will filter replies. Possible values: without parameter (default) shows all replies, `following` - replies directed to you or users you follow, `self` - replies directed to you.
## Statuses
@@ -30,13 +27,22 @@ Has these additional fields under the `pleroma` object:
- `expires_at`: a datetime (iso8601) that states when the post will expire (be deleted automatically), or empty if the post won't expire
- `thread_muted`: true if the thread the post belongs to is muted
- `emoji_reactions`: A list with emoji / reaction maps. The format is `{name: "☕", count: 1, me: true}`. Contains no information about the reacting users, for that use the `/statuses/:id/reactions` endpoint.
+- `parent_visible`: If the parent of this post is visible to the user or not.
-## Attachments
+## Media Attachments
Has these additional fields under the `pleroma` object:
- `mime_type`: mime type of the attachment.
+### Attachment cap
+
+Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting.
+
+### Limitations
+
+Pleroma does not process remote images and therefore cannot include fields such as `meta` and `blurhash`. It does not support focal points or aspect ratios. The frontend is expected to handle it.
+
## Accounts
The `id` parameter can also be the `nickname` of the user. This only works in these endpoints, not the deeper nested ones for following etc.
@@ -46,20 +52,27 @@ The `id` parameter can also be the `nickname` of the user. This only works in th
Has these additional fields under the `pleroma` object:
+- `ap_id`: nullable URL string, ActivityPub id of the user
+- `background_image`: nullable URL string, background image of the user
- `tags`: Lists an array of tags for the user
-- `relationship{}`: Includes fields as documented for Mastodon API https://docs.joinmastodon.org/entities/relationship/
+- `relationship` (object): Includes fields as documented for Mastodon API https://docs.joinmastodon.org/entities/relationship/
- `is_moderator`: boolean, nullable, true if user is a moderator
- `is_admin`: boolean, nullable, true if user is an admin
- `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated
+- `hide_favorites`: boolean, true when the user has hiding favorites enabled
- `hide_followers`: boolean, true when the user has follower hiding enabled
- `hide_follows`: boolean, true when the user has follow hiding enabled
- `hide_followers_count`: boolean, true when the user has follower stat hiding enabled
- `hide_follows_count`: boolean, true when the user has follow stat hiding enabled
-- `settings_store`: A generic map of settings for frontends. Opaque to the backend. Only returned in `verify_credentials` and `update_credentials`
-- `chat_token`: The token needed for Pleroma chat. Only returned in `verify_credentials`
+- `settings_store`: A generic map of settings for frontends. Opaque to the backend. Only returned in `/api/v1/accounts/verify_credentials` and `/api/v1/accounts/update_credentials`
+- `chat_token`: The token needed for Pleroma chat. Only returned in `/api/v1/accounts/verify_credentials`
- `deactivated`: boolean, true when the user is deactivated
- `allow_following_move`: boolean, true when the user allows automatically follow moved following accounts
- `unread_conversation_count`: The count of unread conversations. Only returned to the account owner.
+- `unread_notifications_count`: The count of unread notifications. Only returned to the account owner.
+- `notification_settings`: object, can be absent. See `/api/pleroma/notification_settings` for the parameters/keys returned.
+- `accepts_chat_messages`: boolean, but can be null if we don't have that information about a user
+- `favicon`: nullable URL string, Favicon image of the user's instance
### Source
@@ -117,7 +130,19 @@ The `type` value is `pleroma:emoji_reaction`. Has these fields:
Accepts additional parameters:
- `exclude_visibilities`: will exclude the notifications for activities with the given visibilities. The parameter accepts an array of visibility types (`public`, `unlisted`, `private`, `direct`). Usage example: `GET /api/v1/notifications?exclude_visibilities[]=direct&exclude_visibilities[]=private`.
-- `with_move`: boolean, when set to `true` will include Move notifications. `false` by default.
+- `include_types`: will include the notifications for activities with the given types. The parameter accepts an array of types (`mention`, `follow`, `reblog`, `favourite`, `move`, `pleroma:emoji_reaction`). Usage example: `GET /api/v1/notifications?include_types[]=mention&include_types[]=reblog`.
+
+## DELETE `/api/v1/notifications/destroy_multiple`
+
+An endpoint to delete multiple statuses by IDs.
+
+Required parameters:
+
+- `ids`: array of activity ids
+
+Usage example: `DELETE /api/v1/notifications/destroy_multiple/?ids[]=1&ids[]=2`.
+
+Returns on success: 200 OK `{}`
## POST `/api/v1/statuses`
@@ -144,7 +169,7 @@ Returns: array of Status.
The maximum number of statuses is limited to 100 per request.
-## PATCH `/api/v1/update_credentials`
+## PATCH `/api/v1/accounts/update_credentials`
Additional parameters can be added to the JSON body/Form data:
@@ -159,30 +184,107 @@ Additional parameters can be added to the JSON body/Form data:
- `pleroma_settings_store` - Opaque user settings to be saved on the backend.
- `skip_thread_containment` - if true, skip filtering out broken threads
- `allow_following_move` - if true, allows automatically follow moved following accounts
-- `pleroma_background_image` - sets the background image of the user.
+- `pleroma_background_image` - sets the background image of the user. Can be set to "" (an empty string) to reset.
- `discoverable` - if true, discovery of this account in search results and other services is allowed.
- `actor_type` - the type of this account.
+- `accepts_chat_messages` - if false, this account will reject all chat messages.
+
+All images (avatar, banner and background) can be reset to the default by sending an empty string ("") instead of a file.
### Pleroma Settings Store
+
Pleroma has mechanism that allows frontends to save blobs of json for each user on the backend. This can be used to save frontend-specific settings for a user that the backend does not need to know about.
The parameter should have a form of `{frontend_name: {...}}`, with `frontend_name` identifying your type of client, e.g. `pleroma_fe`. It will overwrite everything under this property, but will not overwrite other frontend's settings.
-This information is returned in the `verify_credentials` endpoint.
+This information is returned in the `/api/v1/accounts/verify_credentials` endpoint.
## Authentication
-*Pleroma supports refreshing tokens.
+*Pleroma supports refreshing tokens.*
`POST /oauth/token`
-Post here request with grant_type=refresh_token to obtain new access token. Returns an access token.
+
+Post here request with `grant_type=refresh_token` to obtain new access token. Returns an access token.
## Account Registration
+
`POST /api/v1/accounts`
-Has theses additionnal parameters (which are the same as in Pleroma-API):
- * `fullname`: optional
- * `bio`: optional
- * `captcha_solution`: optional, contains provider-specific captcha solution,
- * `captcha_token`: optional, contains provider-specific captcha token
- * `token`: invite token required when the registerations aren't public.
+Has theses additional parameters (which are the same as in Pleroma-API):
+
+- `fullname`: optional
+- `bio`: optional
+- `captcha_solution`: optional, contains provider-specific captcha solution,
+- `captcha_token`: optional, contains provider-specific captcha token
+- `captcha_answer_data`: optional, contains provider-specific captcha data
+- `token`: invite token required when the registrations aren't public.
+
+## Instance
+
+`GET /api/v1/instance` has additional fields
+
+- `max_toot_chars`: The maximum characters per post
+- `chat_limit`: The maximum characters per chat message
+- `description_limit`: The maximum characters per image description
+- `poll_limits`: The limits of polls
+- `upload_limit`: The maximum upload file size
+- `avatar_upload_limit`: The same for avatars
+- `background_upload_limit`: The same for backgrounds
+- `banner_upload_limit`: The same for banners
+- `background_image`: A background image that frontends can use
+- `pleroma.metadata.features`: A list of supported features
+- `pleroma.metadata.federation`: The federation restrictions of this instance
+- `pleroma.metadata.fields_limits`: A list of values detailing the length and count limitation for various instance-configurable fields.
+- `pleroma.metadata.post_formats`: A list of the allowed post format types
+- `vapid_public_key`: The public key needed for push messages
+
+## Markers
+
+Has these additional fields under the `pleroma` object:
+
+- `unread_count`: contains number unread notifications
+
+## Streaming
+
+There is an additional `user:pleroma_chat` stream. Incoming chat messages will make the current chat be sent to this `user` stream. The `event` of an incoming chat message is `pleroma:chat_update`. The payload is the updated chat with the incoming chat message in the `last_message` field.
+
+## Not implemented
+
+Pleroma is generally compatible with the Mastodon 2.7.2 API, but some newer features and non-essential features are omitted. These features usually return an HTTP 200 status code, but with an empty response. While they may be added in the future, they are considered low priority.
+
+### Suggestions
+
+*Added in Mastodon 2.4.3*
+
+- `GET /api/v1/suggestions`: Returns an empty array, `[]`
+
+### Trends
+
+*Added in Mastodon 3.0.0*
+
+- `GET /api/v1/trends`: Returns an empty array, `[]`
+
+### Identity proofs
+
+*Added in Mastodon 2.8.0*
+
+- `GET /api/v1/identity_proofs`: Returns an empty array, `[]`
+
+### Endorsements
+
+*Added in Mastodon 2.5.0*
+
+- `GET /api/v1/endorsements`: Returns an empty array, `[]`
+
+### Profile directory
+
+*Added in Mastodon 3.0.0*
+
+- `GET /api/v1/directory`: Returns HTTP 404
+
+### Featured tags
+
+*Added in Mastodon 3.0.0*
+
+- `GET /api/v1/featured_tags`: Returns HTTP 404
diff --git a/docs/API/pleroma_api.md b/docs/API/pleroma_api.md
index 12e63ef9f..4e97d26c0 100644
--- a/docs/API/pleroma_api.md
+++ b/docs/API/pleroma_api.md
@@ -50,7 +50,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi
* Authentication: not required
* Params: none
* Response: Provider specific JSON, the only guaranteed parameter is `type`
-* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}`
+* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint", "seconds_valid": 300}`
## `/api/pleroma/delete_account`
### Delete an account
@@ -70,7 +70,49 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi
* Response: JSON. Returns `{"status": "success"}` if the account was successfully disabled, `{"error": "[error message]"}` otherwise
* Example response: `{"error": "Invalid password."}`
-## `/api/pleroma/admin/`…
+## `/api/pleroma/accounts/mfa`
+#### Gets current MFA settings
+* method: `GET`
+* Authentication: required
+* OAuth scope: `read:security`
+* Response: JSON. Returns `{"enabled": "false", "totp": false }`
+
+## `/api/pleroma/accounts/mfa/setup/totp`
+#### Pre-setup the MFA/TOTP method
+* method: `GET`
+* Authentication: required
+* OAuth scope: `write:security`
+* Response: JSON. Returns `{"key": [secret_key], "provisioning_uri": "[qr code uri]" }` when successful, otherwise returns HTTP 422 `{"error": "error_msg"}`
+
+## `/api/pleroma/accounts/mfa/confirm/totp`
+#### Confirms & enables MFA/TOTP support for user account.
+* method: `POST`
+* Authentication: required
+* OAuth scope: `write:security`
+* Params:
+ * `password`: user's password
+ * `code`: token from TOTP App
+* Response: JSON. Returns `{}` if the enable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
+
+
+## `/api/pleroma/accounts/mfa/totp`
+#### Disables MFA/TOTP method for user account.
+* method: `DELETE`
+* Authentication: required
+* OAuth scope: `write:security`
+* Params:
+ * `password`: user's password
+* Response: JSON. Returns `{}` if the disable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
+* Example response: `{"error": "Invalid password."}`
+
+## `/api/pleroma/accounts/mfa/backup_codes`
+#### Generstes backup codes MFA for user account.
+* method: `GET`
+* Authentication: required
+* OAuth scope: `write:security`
+* Response: JSON. Returns `{"codes": codes}`when successful, otherwise HTTP 422 `{"error": "[error message]"}`
+
+## `/api/pleroma/admin/`
See [Admin-API](admin_api.md)
## `/api/v1/pleroma/notifications/read`
@@ -223,7 +265,7 @@ See [Admin-API](admin_api.md)
* Method `PUT`
* Authentication: required
* Params:
- * `image`: Multipart image
+ * `file`: Multipart image
* Response: JSON. Returns a mastodon media attachment entity
when successful, otherwise returns HTTP 415 `{"error": "error_msg"}`
* Example response:
@@ -245,11 +287,8 @@ See [Admin-API](admin_api.md)
* Method `PUT`
* Authentication: required
* Params:
- * `followers`: BOOLEAN field, receives notifications from followers
- * `follows`: BOOLEAN field, receives notifications from people the user follows
- * `remote`: BOOLEAN field, receives notifications from people on remote instances
- * `local`: BOOLEAN field, receives notifications from people on the local instance
- * `privacy_option`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
+ * `block_from_strangers`: BOOLEAN field, blocks notifications from accounts you do not follow
+ * `hide_notification_contents`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
* Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
## `/api/pleroma/healthcheck`
@@ -316,27 +355,61 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
* `recipients`: A list of ids of users that should receive posts to this conversation. This will replace the current list of recipients, so submit the full list. The owner of owner of the conversation will always be part of the set of recipients, though.
* Response: JSON, statuses (200 - healthy, 503 unhealthy)
-## `GET /api/v1/pleroma/conversations/read`
+## `POST /api/v1/pleroma/conversations/read`
### Marks all user's conversations as read.
* Method `POST`
* Authentication: required
* Params: None
* Response: JSON, returns a list of Mastodon Conversation entities that were marked as read (200 - healthy, 503 unhealthy).
-## `GET /api/pleroma/emoji/packs`
-### Lists the custom emoji packs on the server
+## `GET /api/pleroma/emoji/packs/import`
+### Imports packs from filesystem
* Method `GET`
-* Authentication: not required
+* Authentication: required
* Params: None
-* Response: JSON, "ok" and 200 status and the JSON hashmap of "pack name" to "pack contents"
+* Response: JSON, returns a list of imported packs.
-## `PUT /api/pleroma/emoji/packs/:name`
-### Creates an empty custom emoji pack
-* Method `PUT`
+## `GET /api/pleroma/emoji/packs/remote`
+### Make request to another instance for packs list
+* Method `GET`
+* Authentication: required
+* Params:
+ * `url`: url of the instance to get packs from
+* Response: JSON with the pack list, hashmap with pack name and pack contents
+
+## `POST /api/pleroma/emoji/packs/download`
+### Download pack from another instance
+* Method `POST`
+* Authentication: required
+* Params:
+ * `url`: url of the instance to download from
+ * `name`: pack to download from that instance
+ * `as`: (*optional*) name how to save pack
+* Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
+ errors downloading the pack
+
+## `POST /api/pleroma/emoji/packs/:name`
+### Creates an empty pack
+* Method `POST`
* Authentication: required
* Params: None
* Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
+## `PATCH /api/pleroma/emoji/packs/:name`
+### Updates (replaces) pack metadata
+* Method `PATCH`
+* Authentication: required
+* Params:
+ * `metadata`: metadata to replace the old one
+ * `license`: Pack license
+ * `homepage`: Pack home page url
+ * `description`: Pack description
+ * `fallback-src`: Fallback url to download pack from
+ * `fallback-src-sha256`: SHA256 encoded for fallback pack archive
+ * `share-files`: is pack allowed for sharing (boolean)
+* Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
+ problem with the new metadata (the error is specified in the "error" part of the response JSON)
+
## `DELETE /api/pleroma/emoji/packs/:name`
### Delete a custom emoji pack
* Method `DELETE`
@@ -344,53 +417,77 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
* Params: None
* Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
-## `POST /api/pleroma/emoji/packs/:name/update_file`
-### Update a file in a custom emoji pack
+## `POST /api/pleroma/emoji/packs/:name/files`
+### Add new file to the pack
* Method `POST`
* Authentication: required
* Params:
- * if the `action` is `add`, adds an emoji named `shortcode` to the pack `pack_name`,
- that means that the emoji file needs to be uploaded with the request
- (thus requiring it to be a multipart request) and be named `file`.
- There can also be an optional `filename` that will be the new emoji file name
- (if it's not there, the name will be taken from the uploaded file).
- * if the `action` is `update`, changes emoji shortcode
- (from `shortcode` to `new_shortcode` or moves the file (from the current filename to `new_filename`)
- * if the `action` is `remove`, removes the emoji named `shortcode` and it's associated file
-* Response: JSON, updated "files" section of the pack and 200 status, 409 if the trying to use a shortcode
- that is already taken, 400 if there was an error with the shortcode, filename or file (additional info
- in the "error" part of the response JSON)
-
-## `POST /api/pleroma/emoji/packs/:name/update_metadata`
-### Updates (replaces) pack metadata
-* Method `POST`
+ * `file`: file needs to be uploaded with the multipart request or link to remote file.
+ * `shortcode`: (*optional*) shortcode for new emoji, must be unique for all emoji. If not sended, shortcode will be taken from original filename.
+ * `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
+* Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
+
+## `PATCH /api/pleroma/emoji/packs/:name/files`
+### Update emoji file from pack
+* Method `PATCH`
* Authentication: required
* Params:
- * `new_data`: new metadata to replace the old one
-* Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
- problem with the new metadata (the error is specified in the "error" part of the response JSON)
-
-## `POST /api/pleroma/emoji/packs/download_from`
-### Requests the instance to download the pack from another instance
-* Method `POST`
+ * `shortcode`: emoji file shortcode
+ * `new_shortcode`: new emoji file shortcode
+ * `new_filename`: new filename for emoji file
+ * `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
+* Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
+
+## `DELETE /api/pleroma/emoji/packs/:name/files`
+### Delete emoji file from pack
+* Method `DELETE`
* Authentication: required
* Params:
- * `instance_address`: the address of the instance to download from
- * `pack_name`: the pack to download from that instance
-* Response: JSON, "ok" and 200 status if the pack was downloaded, or 500 if there were
- errors downloading the pack
+ * `shortcode`: emoji file shortcode
+* Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
-## `POST /api/pleroma/emoji/packs/list_from`
-### Requests the instance to list the packs from another instance
-* Method `POST`
-* Authentication: required
+## `GET /api/pleroma/emoji/packs`
+
+### Lists local custom emoji packs
+
+* Method `GET`
+* Authentication: not required
* Params:
- * `instance_address`: the address of the instance to download from
-* Response: JSON with the pack list, same as if the request was made to that instance's
- list endpoint directly + 200 status
+ * `page`: page number for packs (default 1)
+ * `page_size`: page size for packs (default 50)
+* Response: `packs` key with JSON hashmap of pack name to pack contents and `count` key for count of packs.
+
+```json
+{
+ "packs": {
+ "pack_name": {...}, // pack contents
+ ...
+ },
+ "count": 0 // packs count
+}
+```
+
+## `GET /api/pleroma/emoji/packs/:name`
+
+### Get pack.json for the pack
+
+* Method `GET`
+* Authentication: not required
+* Params:
+ * `page`: page number for files (default 1)
+ * `page_size`: page size for files (default 30)
+* Response: JSON, pack json with `files`, `files_count` and `pack` keys with 200 status or 404 if the pack does not exist.
+
+```json
+{
+ "files": {...},
+ "files_count": 0, // emoji count in pack
+ "pack": {...}
+}
+```
-## `GET /api/pleroma/emoji/packs/:name/download_shared`
-### Requests a local pack from the instance
+## `GET /api/pleroma/emoji/packs/:name/archive`
+### Requests a local pack archive from the instance
* Method `GET`
* Authentication: not required
* Params: None
@@ -431,7 +528,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
# Emoji Reactions
-Emoji reactions work a lot like favourites do. They make it possible to react to a post with a single emoji character.
+Emoji reactions work a lot like favourites do. They make it possible to react to a post with a single emoji character. To detect the presence of this feature, you can check `pleroma_emoji_reactions` entry in the features list of nodeinfo.
## `PUT /api/v1/pleroma/statuses/:id/reactions/:emoji`
### React to a post with a unicode emoji
@@ -462,7 +559,7 @@ Emoji reactions work a lot like favourites do. They make it possible to react to
```
## `GET /api/v1/pleroma/statuses/:id/reactions/:emoji`
-### Get an object of emoji to account mappings with accounts that reacted to the post for a specific emoji`
+### Get an object of emoji to account mappings with accounts that reacted to the post for a specific emoji
* Method: `GET`
* Authentication: optional
* Params: None
diff --git a/docs/administration/CLI_tasks/config.md b/docs/administration/CLI_tasks/config.md
index cc32bf859..0923004b5 100644
--- a/docs/administration/CLI_tasks/config.md
+++ b/docs/administration/CLI_tasks/config.md
@@ -11,14 +11,17 @@
config :pleroma, configurable_from_database: true
```
-```sh tab="OTP"
- ./bin/pleroma_ctl config migrate_to_db
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.config migrate_to_db
-```
+ ```sh
+ ./bin/pleroma_ctl config migrate_to_db
+ ```
+
+=== "From Source"
+ ```sh
+ mix pleroma.config migrate_to_db
+ ```
## Transfer config from DB to `config/env.exported_from_db.secret.exs`
@@ -31,10 +34,12 @@ mix pleroma.config migrate_to_db
To delete transfered settings from database optional flag `-d` can be used. `<env>` is `prod` by default.
-```sh tab="OTP"
- ./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d]
-```
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d]
+ ```
-```sh tab="From Source"
-mix pleroma.config migrate_from_db [--env=<env>] [-d]
-```
+=== "From Source"
+ ```sh
+ mix pleroma.config migrate_from_db [--env=<env>] [-d]
+ ```
diff --git a/docs/administration/CLI_tasks/database.md b/docs/administration/CLI_tasks/database.md
index ff400c8ed..6dca83167 100644
--- a/docs/administration/CLI_tasks/database.md
+++ b/docs/administration/CLI_tasks/database.md
@@ -9,13 +9,18 @@
Replaces embedded objects with references to them in the `objects` table. Only needs to be ran once if the instance was created before Pleroma 1.0.5. The reason why this is not a migration is because it could significantly increase the database size after being ran, however after this `VACUUM FULL` will be able to reclaim about 20% (really depends on what is in the database, your mileage may vary) of the db size before the migration.
-```sh tab="OTP"
-./bin/pleroma_ctl database remove_embedded_objects [option ...]
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database remove_embedded_objects [option ...]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.database remove_embedded_objects [option ...]
+ ```
-```sh tab="From Source"
-mix pleroma.database remove_embedded_objects [option ...]
-```
### Options
- `--vacuum` - run `VACUUM FULL` after the embedded objects are replaced with their references
@@ -27,13 +32,17 @@ This will prune remote posts older than 90 days (configurable with [`config :ple
!!! danger
The disk space will only be reclaimed after `VACUUM FULL`. You may run out of disk space during the execution of the task or vacuuming if you don't have about 1/3rds of the database size free.
-```sh tab="OTP"
-./bin/pleroma_ctl database prune_objects [option ...]
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database prune_objects [option ...]
+ ```
-```sh tab="From Source"
-mix pleroma.database prune_objects [option ...]
-```
+=== "From Source"
+
+ ```sh
+ mix pleroma.database prune_objects [option ...]
+ ```
### Options
- `--vacuum` - run `VACUUM FULL` after the objects are pruned
@@ -42,30 +51,93 @@ mix pleroma.database prune_objects [option ...]
Can be safely re-run
-```sh tab="OTP"
-./bin/pleroma_ctl database bump_all_conversations
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database bump_all_conversations
+ ```
-```sh tab="From Source"
-mix pleroma.database bump_all_conversations
-```
+=== "From Source"
+
+ ```sh
+ mix pleroma.database bump_all_conversations
+ ```
## Remove duplicated items from following and update followers count for all users
-```sh tab="OTP"
-./bin/pleroma_ctl database update_users_following_followers_counts
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database update_users_following_followers_counts
+ ```
-```sh tab="From Source"
-mix pleroma.database update_users_following_followers_counts
-```
+=== "From Source"
+
+ ```sh
+ mix pleroma.database update_users_following_followers_counts
+ ```
## Fix the pre-existing "likes" collections for all objects
-```sh tab="OTP"
-./bin/pleroma_ctl database fix_likes_collections
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database fix_likes_collections
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.database fix_likes_collections
+ ```
+
+## Vacuum the database
+
+### Analyze
+
+Running an `analyze` vacuum job can improve performance by updating statistics used by the query planner. **It is safe to cancel this.**
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database vacuum analyze
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.database vacuum analyze
+ ```
+
+### Full
+
+Running a `full` vacuum job rebuilds your entire database by reading all of the data and rewriting it into smaller
+and more compact files with an optimized layout. This process will take a long time and use additional disk space as
+it builds the files side-by-side the existing database files. It can make your database faster and use less disk space,
+but should only be run if necessary. **It is safe to cancel this.**
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database vacuum full
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.database vacuum full
+ ```
+
+## Add expiration to all local statuses
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl database ensure_expiration
+ ```
+
+=== "From Source"
-```sh tab="From Source"
-mix pleroma.database fix_likes_collections
-```
+ ```sh
+ mix pleroma.database ensure_expiration
+ ```
diff --git a/docs/administration/CLI_tasks/digest.md b/docs/administration/CLI_tasks/digest.md
index 2eb31379e..a590581e3 100644
--- a/docs/administration/CLI_tasks/digest.md
+++ b/docs/administration/CLI_tasks/digest.md
@@ -4,22 +4,30 @@
## Send digest email since given date (user registration date by default) ignoring user activity status.
-```sh tab="OTP"
- ./bin/pleroma_ctl digest test <nickname> [since_date]
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.digest test <nickname> [since_date]
-```
+ ```sh
+ ./bin/pleroma_ctl digest test <nickname> [since_date]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.digest test <nickname> [since_date]
+ ```
Example:
-```sh tab="OTP"
-./bin/pleroma_ctl digest test donaldtheduck 2019-05-20
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl digest test donaldtheduck 2019-05-20
+ ```
+
+=== "From Source"
-```sh tab="From Source"
-mix pleroma.digest test donaldtheduck 2019-05-20
-```
+ ```sh
+ mix pleroma.digest test donaldtheduck 2019-05-20
+ ```
diff --git a/docs/administration/CLI_tasks/email.md b/docs/administration/CLI_tasks/email.md
index 7b7a8457a..00d2e74f8 100644
--- a/docs/administration/CLI_tasks/email.md
+++ b/docs/administration/CLI_tasks/email.md
@@ -4,21 +4,29 @@
## Send test email (instance email by default)
-```sh tab="OTP"
- ./bin/pleroma_ctl email test [--to <destination email address>]
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.email test [--to <destination email address>]
-```
+ ```sh
+ ./bin/pleroma_ctl email test [--to <destination email address>]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.email test [--to <destination email address>]
+ ```
Example:
-```sh tab="OTP"
-./bin/pleroma_ctl email test --to root@example.org
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl email test --to root@example.org
+ ```
+
+=== "From Source"
-```sh tab="From Source"
-mix pleroma.email test --to root@example.org
-```
+ ```sh
+ mix pleroma.email test --to root@example.org
+ ```
diff --git a/docs/administration/CLI_tasks/emoji.md b/docs/administration/CLI_tasks/emoji.md
index efec8222c..e3d1b210e 100644
--- a/docs/administration/CLI_tasks/emoji.md
+++ b/docs/administration/CLI_tasks/emoji.md
@@ -4,13 +4,15 @@
## Lists emoji packs and metadata specified in the manifest
-```sh tab="OTP"
-./bin/pleroma_ctl emoji ls-packs [option ...]
-```
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl emoji ls-packs [option ...]
+ ```
-```sh tab="From Source"
-mix pleroma.emoji ls-packs [option ...]
-```
+=== "From Source"
+ ```sh
+ mix pleroma.emoji ls-packs [option ...]
+ ```
### Options
@@ -18,29 +20,42 @@ mix pleroma.emoji ls-packs [option ...]
## Fetch, verify and install the specified packs from the manifest into `STATIC-DIR/emoji/PACK-NAME`
-```sh tab="OTP"
-./bin/pleroma_ctl emoji get-packs [option ...] <pack ...>
-```
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl emoji get-packs [option ...] <pack ...>
+ ```
-```sh tab="From Source"
-mix pleroma.emoji get-packs [option ...] <pack ...>
-```
+=== "From Source"
+ ```sh
+ mix pleroma.emoji get-packs [option ...] <pack ...>
+ ```
### Options
- `-m, --manifest PATH/URL` - same as [`ls-packs`](#ls-packs)
## Create a new manifest entry and a file list from the specified remote pack file
-```sh tab="OTP"
-./bin/pleroma_ctl emoji gen-pack PACK-URL
-```
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl emoji gen-pack PACK-URL
+ ```
-```sh tab="From Source"
-mix pleroma.emoji gen-pack PACK-URL
-```
+=== "From Source"
+ ```sh
+ mix pleroma.emoji gen-pack PACK-URL
+ ```
-Currently, only .zip archives are recognized as remote pack files and packs are therefore assumed to be zip archives. This command is intended to run interactively and will first ask you some basic questions about the pack, then download the remote file and generate an SHA256 checksum for it, then generate an emoji file list for you.
+Currently, only .zip archives are recognized as remote pack files and packs are therefore assumed to be zip archives. This command is intended to run interactively and will first ask you some basic questions about the pack, then download the remote file and generate an SHA256 checksum for it, then generate an emoji file list for you.
- The manifest entry will either be written to a newly created `index.json` file or appended to the existing one, *replacing* the old pack with the same name if it was in the file previously.
+ The manifest entry will either be written to a newly created `pack_name.json` file (pack name is asked in questions) or appended to the existing one, *replacing* the old pack with the same name if it was in the file previously.
The file list will be written to the file specified previously, *replacing* that file. You _should_ check that the file list doesn't contain anything you don't need in the pack, that is, anything that is not an emoji (the whole pack is downloaded, but only emoji files are extracted).
+
+## Reload emoji packs
+
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl emoji reload
+ ```
+
+This command only works with OTP releases.
diff --git a/docs/administration/CLI_tasks/frontend.md b/docs/administration/CLI_tasks/frontend.md
new file mode 100644
index 000000000..7d1c1e937
--- /dev/null
+++ b/docs/administration/CLI_tasks/frontend.md
@@ -0,0 +1,69 @@
+# Managing frontends
+
+`mix pleroma.frontend install <frontend> [--ref <ref>] [--file <file>] [--build-url <build-url>] [--path <path>] [--build-dir <build-dir>]`
+
+Frontend can be installed either from local zip file, or automatically downloaded from the web.
+
+You can give all the options directly on the command like, but missing information will be filled out by looking at the data configured under `frontends.available` in the config files.
+
+Currently known `<frontend>` values are:
+- [admin-fe](https://git.pleroma.social/pleroma/admin-fe)
+- [kenoma](http://git.pleroma.social/lambadalambda/kenoma)
+- [pleroma-fe](http://git.pleroma.social/pleroma/pleroma-fe)
+- [fedi-fe](https://git.pleroma.social/pleroma/fedi-fe)
+- [soapbox-fe](https://gitlab.com/soapbox-pub/soapbox-fe)
+
+You can still install frontends that are not configured, see below.
+
+## Example installations for a known frontend
+
+For a frontend configured under the `available` key, it's enough to install it by name.
+
+```sh tab="OTP"
+./bin/pleroma_ctl frontend install pleroma
+```
+
+```sh tab="From Source"
+mix pleroma.frontend install pleroma
+```
+
+This will download the latest build for the the pre-configured `ref` and install it. It can then be configured as the one of the served frontends in the config file (see `primary` or `admin`).
+
+You can override any of the details. To install a pleroma build from a different url, you could do this:
+
+```sh tab="OPT"
+./bin/pleroma_ctl frontend install pleroma --ref 2hu_edition --build-url https://example.org/raymoo.zip
+```
+
+```sh tab="From Source"
+mix pleroma.frontend install pleroma --ref 2hu_edition --build-url https://example.org/raymoo.zip
+```
+
+Similarly, you can also install from a local zip file.
+
+```sh tab="OTP"
+./bin/pleroma_ctl frontend install pleroma --ref mybuild --file ~/Downloads/doomfe.zip
+```
+
+```sh tab="From Source"
+mix pleroma.frontend install pleroma --ref mybuild --file ~/Downloads/doomfe.zip
+```
+
+The resulting frontend will always be installed into a folder of this template: `${instance_static}/frontends/${name}/${ref}`
+
+Careful: This folder will be completely replaced on installation
+
+## Example installation for an unknown frontend
+
+The installation process is the same, but you will have to give all the needed options on the commond line. For example:
+
+```sh tab="OTP"
+./bin/pleroma_ctl frontend install gensokyo --ref master --build-url https://gensokyo.2hu/builds/marisa.zip
+```
+
+```sh tab="From Source"
+mix pleroma.frontend install gensokyo --ref master --build-url https://gensokyo.2hu/builds/marisa.zip
+```
+
+If you don't have a zip file but just want to install a frontend from a local path, you can simply copy the files over a folder of this template: `${instance_static}/frontends/${name}/${ref}`
+
diff --git a/docs/administration/CLI_tasks/instance.md b/docs/administration/CLI_tasks/instance.md
index 52e264bb1..989ecc55d 100644
--- a/docs/administration/CLI_tasks/instance.md
+++ b/docs/administration/CLI_tasks/instance.md
@@ -3,13 +3,17 @@
{! backend/administration/CLI_tasks/general_cli_task_info.include !}
## Generate a new configuration file
-```sh tab="OTP"
- ./bin/pleroma_ctl instance gen [option ...]
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.instance gen [option ...]
-```
+ ```sh
+ ./bin/pleroma_ctl instance gen [option ...]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.instance gen [option ...]
+ ```
If any of the options are left unspecified, you will be prompted interactively.
diff --git a/docs/administration/CLI_tasks/oauth_app.md b/docs/administration/CLI_tasks/oauth_app.md
new file mode 100644
index 000000000..f0568491e
--- /dev/null
+++ b/docs/administration/CLI_tasks/oauth_app.md
@@ -0,0 +1,20 @@
+# Creating trusted OAuth App
+
+{! backend/administration/CLI_tasks/general_cli_task_info.include !}
+
+## Create trusted OAuth App.
+
+Optional params:
+ * `-s SCOPES` - scopes for app, e.g. `read,write,follow,push`.
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl app create -n APP_NAME -r REDIRECT_URI
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.app create -n APP_NAME -r REDIRECT_URI
+ ``` \ No newline at end of file
diff --git a/docs/administration/CLI_tasks/relay.md b/docs/administration/CLI_tasks/relay.md
index c4f078f4d..bdd7e8be4 100644
--- a/docs/administration/CLI_tasks/relay.md
+++ b/docs/administration/CLI_tasks/relay.md
@@ -4,30 +4,42 @@
## Follow a relay
-```sh tab="OTP"
-./bin/pleroma_ctl relay follow <relay_url>
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.relay follow <relay_url>
-```
+ ```sh
+ ./bin/pleroma_ctl relay follow <relay_url>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.relay follow <relay_url>
+ ```
## Unfollow a remote relay
-```sh tab="OTP"
-./bin/pleroma_ctl relay unfollow <relay_url>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl relay unfollow <relay_url>
+ ```
-```sh tab="From Source"
-mix pleroma.relay unfollow <relay_url>
-```
+=== "From Source"
+
+ ```sh
+ mix pleroma.relay unfollow <relay_url>
+ ```
## List relay subscriptions
-```sh tab="OTP"
-./bin/pleroma_ctl relay list
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl relay list
+ ```
+
+=== "From Source"
-```sh tab="From Source"
-mix pleroma.relay list
-```
+ ```sh
+ mix pleroma.relay list
+ ```
diff --git a/docs/administration/CLI_tasks/robots_txt.md b/docs/administration/CLI_tasks/robots_txt.md
new file mode 100644
index 000000000..7eeedf571
--- /dev/null
+++ b/docs/administration/CLI_tasks/robots_txt.md
@@ -0,0 +1,21 @@
+# Managing robots.txt
+
+{! backend/administration/CLI_tasks/general_cli_task_info.include !}
+
+## Generate a new robots.txt file and add it to the static directory
+
+The `robots.txt` that ships by default is permissive. It allows well-behaved search engines to index all of your instance's URIs.
+
+If you want to generate a restrictive `robots.txt`, you can run the following mix task. The generated `robots.txt` will be written in your instance [static directory](../../../configuration/static_dir/).
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl robots_txt disallow_all
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.robots_txt disallow_all
+ ```
diff --git a/docs/administration/CLI_tasks/uploads.md b/docs/administration/CLI_tasks/uploads.md
index 6a15d22f6..8585ec76b 100644
--- a/docs/administration/CLI_tasks/uploads.md
+++ b/docs/administration/CLI_tasks/uploads.md
@@ -3,13 +3,17 @@
{! backend/administration/CLI_tasks/general_cli_task_info.include !}
## Migrate uploads from local to remote storage
-```sh tab="OTP"
- ./bin/pleroma_ctl uploads migrate_local <target_uploader> [option ...]
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.uploads migrate_local <target_uploader> [option ...]
-```
+ ```sh
+ ./bin/pleroma_ctl uploads migrate_local <target_uploader> [option ...]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.uploads migrate_local <target_uploader> [option ...]
+ ```
### Options
- `--delete` - delete local uploads after migrating them to the target uploader
diff --git a/docs/administration/CLI_tasks/user.md b/docs/administration/CLI_tasks/user.md
index f535dad82..3e7f028ba 100644
--- a/docs/administration/CLI_tasks/user.md
+++ b/docs/administration/CLI_tasks/user.md
@@ -4,13 +4,17 @@
## Create a user
-```sh tab="OTP"
-./bin/pleroma_ctl user new <nickname> <email> [option ...]
-```
+=== "OTP"
-```sh tab="From Source"
-mix pleroma.user new <nickname> <email> [option ...]
-```
+ ```sh
+ ./bin/pleroma_ctl user new <nickname> <email> [option ...]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user new <nickname> <email> [option ...]
+ ```
### Options
@@ -22,23 +26,33 @@ mix pleroma.user new <nickname> <email> [option ...]
- `-y`, `--assume-yes`/`--no-assume-yes` - whether to assume yes to all questions
## List local users
-```sh tab="OTP"
- ./bin/pleroma_ctl user list
-```
-```sh tab="From Source"
-mix pleroma.user list
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user list
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user list
+ ```
## Generate an invite link
-```sh tab="OTP"
- ./bin/pleroma_ctl user invite [option ...]
-```
-```sh tab="From Source"
-mix pleroma.user invite [option ...]
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user invite [option ...]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user invite [option ...]
+ ```
### Options
@@ -46,103 +60,168 @@ mix pleroma.user invite [option ...]
- `--max-use NUMBER` - maximum numbers of token uses
## List generated invites
-```sh tab="OTP"
- ./bin/pleroma_ctl user invites
-```
-```sh tab="From Source"
-mix pleroma.user invites
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user invites
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user invites
+ ```
## Revoke invite
-```sh tab="OTP"
- ./bin/pleroma_ctl user revoke_invite <token_or_id>
-```
-```sh tab="From Source"
-mix pleroma.user revoke_invite <token_or_id>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user revoke_invite <token>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user revoke_invite <token>
+ ```
## Delete a user
-```sh tab="OTP"
- ./bin/pleroma_ctl user rm <nickname>
-```
-```sh tab="From Source"
-mix pleroma.user rm <nickname>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user rm <nickname>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user rm <nickname>
+ ```
## Delete user's posts and interactions
-```sh tab="OTP"
- ./bin/pleroma_ctl user delete_activities <nickname>
-```
-```sh tab="From Source"
-mix pleroma.user delete_activities <nickname>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user delete_activities <nickname>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user delete_activities <nickname>
+ ```
## Sign user out from all applications (delete user's OAuth tokens and authorizations)
-```sh tab="OTP"
- ./bin/pleroma_ctl user sign_out <nickname>
-```
-```sh tab="From Source"
-mix pleroma.user sign_out <nickname>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user sign_out <nickname>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user sign_out <nickname>
+ ```
+
+
+## Deactivate or activate a user
+
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl user toggle_activated <nickname>
+ ```
-## Deactivate or activate a user
-```sh tab="OTP"
- ./bin/pleroma_ctl user toggle_activated <nickname>
-```
+=== "From Source"
-```sh tab="From Source"
-mix pleroma.user toggle_activated <nickname>
-```
+ ```sh
+ mix pleroma.user toggle_activated <nickname>
+ ```
-## Unsubscribe local users from a user and deactivate the user
-```sh tab="OTP"
- ./bin/pleroma_ctl user unsubscribe NICKNAME
-```
+## Deactivate a user and unsubscribes local users from the user
-```sh tab="From Source"
-mix pleroma.user unsubscribe NICKNAME
-```
+=== "OTP"
+ ```sh
+ ./bin/pleroma_ctl user deactivate NICKNAME
+ ```
-## Unsubscribe local users from an instance and deactivate all accounts on it
-```sh tab="OTP"
- ./bin/pleroma_ctl user unsubscribe_all_from_instance <instance>
-```
+=== "From Source"
-```sh tab="From Source"
-mix pleroma.user unsubscribe_all_from_instance <instance>
-```
+ ```sh
+ mix pleroma.user deactivate NICKNAME
+ ```
+
+
+## Deactivate all accounts from an instance and unsubscribe local users on it
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user deactivate_all_from_instance <instance>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user deactivate_all_from_instance <instance>
+ ```
## Create a password reset link for user
-```sh tab="OTP"
- ./bin/pleroma_ctl user reset_password <nickname>
-```
-```sh tab="From Source"
-mix pleroma.user reset_password <nickname>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user reset_password <nickname>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user reset_password <nickname>
+ ```
+
+
+## Disable Multi Factor Authentication (MFA/2FA) for a user
+
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user reset_mfa <nickname>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user reset_mfa <nickname>
+ ```
## Set the value of the given user's settings
-```sh tab="OTP"
- ./bin/pleroma_ctl user set <nickname> [option ...]
-```
-```sh tab="From Source"
-mix pleroma.user set <nickname> [option ...]
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user set <nickname> [option ...]
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user set <nickname> [option ...]
+ ```
### Options
- `--locked`/`--no-locked` - whether the user should be locked
@@ -150,31 +229,45 @@ mix pleroma.user set <nickname> [option ...]
- `--admin`/`--no-admin` - whether the user should be an admin
## Add tags to a user
-```sh tab="OTP"
- ./bin/pleroma_ctl user tag <nickname> <tags>
-```
-```sh tab="From Source"
-mix pleroma.user tag <nickname> <tags>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user tag <nickname> <tags>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user tag <nickname> <tags>
+ ```
## Delete tags from a user
-```sh tab="OTP"
- ./bin/pleroma_ctl user untag <nickname> <tags>
-```
-```sh tab="From Source"
-mix pleroma.user untag <nickname> <tags>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user untag <nickname> <tags>
+ ```
+
+=== "From Source"
+
+ ```sh
+ mix pleroma.user untag <nickname> <tags>
+ ```
## Toggle confirmation status of the user
-```sh tab="OTP"
- ./bin/pleroma_ctl user toggle_confirmed <nickname>
-```
-```sh tab="From Source"
-mix pleroma.user toggle_confirmed <nickname>
-```
+=== "OTP"
+
+ ```sh
+ ./bin/pleroma_ctl user toggle_confirmed <nickname>
+ ```
+
+=== "From Source"
+ ```sh
+ mix pleroma.user toggle_confirmed <nickname>
+ ```
diff --git a/docs/administration/backup.md b/docs/administration/backup.md
index 692aa7368..be57bf74a 100644
--- a/docs/administration/backup.md
+++ b/docs/administration/backup.md
@@ -18,9 +18,8 @@
6. Run `sudo -Hu postgres pg_restore -d <pleroma_db> -v -1 </path/to/backup_location/pleroma.pgdump>`
7. If you installed a newer Pleroma version, you should run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any.
8. Restart the Pleroma service.
-9. After you've restarted Pleroma, you will notice that postgres will take up more cpu resources than usual. A lot in fact. To fix this you must do a VACUUM ANLAYZE. This can also be done while the instance is still running like so:
- $ sudo -u postgres psql pleroma_database_name
- pleroma=# VACUUM ANALYZE;
+9. Run `sudo -Hu postgres vacuumdb --all --analyze-in-stages`. This will quickly generate the statistics so that postgres can properly plan queries.
+
[^1]: Prefix with `MIX_ENV=prod` to run it using the production config file.
## Remove
diff --git a/docs/administration/updating.md b/docs/administration/updating.md
index 2a08dac1f..c994f3f16 100644
--- a/docs/administration/updating.md
+++ b/docs/administration/updating.md
@@ -1,6 +1,6 @@
# Updating your instance
-You should **always check the release notes/changelog** in case there are config deprecations, special update special update steps, etc.
+You should **always check the [release notes/changelog](https://git.pleroma.social/pleroma/pleroma/-/releases)** in case there are config deprecations, special update steps, etc.
Besides that, doing the following is generally enough:
diff --git a/docs/ap_extensions.md b/docs/ap_extensions.md
new file mode 100644
index 000000000..c4550a1ac
--- /dev/null
+++ b/docs/ap_extensions.md
@@ -0,0 +1,35 @@
+# ChatMessages
+
+ChatMessages are the messages sent in 1-on-1 chats. They are similar to
+`Note`s, but the addresing is done by having a single AP actor in the `to`
+field. Addressing multiple actors is not allowed. These messages are always
+private, there is no public version of them. They are created with a `Create`
+activity.
+
+Example:
+
+```json
+{
+ "actor": "http://2hu.gensokyo/users/raymoo",
+ "id": "http://2hu.gensokyo/objects/1",
+ "object": {
+ "attributedTo": "http://2hu.gensokyo/users/raymoo",
+ "content": "You expected a cute girl? Too bad.",
+ "id": "http://2hu.gensokyo/objects/2",
+ "published": "2020-02-12T14:08:20Z",
+ "to": [
+ "http://2hu.gensokyo/users/marisa"
+ ],
+ "type": "ChatMessage"
+ },
+ "published": "2018-02-12T14:08:20Z",
+ "to": [
+ "http://2hu.gensokyo/users/marisa"
+ ],
+ "type": "Create"
+}
+```
+
+This setup does not prevent multi-user chats, but these will have to go through
+a `Group`, which will be the recipient of the messages and then `Announce` them
+to the users in the `Group`.
diff --git a/docs/clients.md b/docs/clients.md
index 8ac9ad3de..f84295b1f 100644
--- a/docs/clients.md
+++ b/docs/clients.md
@@ -1,16 +1,16 @@
# Pleroma Clients
-Note: Additionnal clients may be working but theses are officially supporting Pleroma.
+Note: Additional clients may be working but theses are officially supporting Pleroma.
Feel free to contact us to be added to this list!
## Desktop
### Roma for Desktop
- Homepage: <https://www.pleroma.com/#desktopApp>
- Source Code: <https://github.com/roma-apps/roma-desktop>
-- Platforms: Windows, Mac, (Linux?)
+- Platforms: Windows, Mac, Linux
- Features: Streaming Ready
### Social
-- Source Code: <https://gitlab.gnome.org/BrainBlasted/Social>
+- Source Code: <https://gitlab.gnome.org/World/Social>
- Contact: [@brainblasted@social.libre.fi](https://social.libre.fi/users/brainblasted)
- Platforms: Linux (GNOME)
- Note(2019-01-28): Not at a pre-alpha stage yet
@@ -35,25 +35,24 @@ Feel free to contact us to be added to this list!
- Source Code: <https://framagit.org/tom79/fedilab/>
- Contact: [@fedilab@framapiaf.org](https://framapiaf.org/users/fedilab)
- Platforms: Android
-- Features: Streaming Ready, Moderation, Text Formatting
+- Features: Streaming Ready, Moderation, Text Formatting
### Kyclos
- Source Code: <https://git.pleroma.social/pleroma/harbour-kyclos>
- Platforms: SailfishOS
- Features: No Streaming
-### Nekonium
-- Homepage: [F-Droid Repository](https://repo.gdgd.jp.net/), [Google Play](https://play.google.com/store/apps/details?id=com.apps.nekonium), [Amazon](https://www.amazon.co.jp/dp/B076FXPRBC/)
-- Source: <https://gogs.gdgd.jp.net/lin/nekonium>
-- Contact: [@lin@pleroma.gdgd.jp.net](https://pleroma.gdgd.jp.net/users/lin)
+### Husky
+- Source code: <https://git.mentality.rip/FWGS/Husky>
+- Contact: [@Husky@enigmatic.observer](https://enigmatic.observer/users/Husky)
- Platforms: Android
-- Features: Streaming Ready
+- Features: No Streaming, Emoji Reactions, Text Formatting, FE Stickers
-### Roma
-- Homepage: <https://www.pleroma.com/#mobileApps>
-- Source Code: [iOS](https://github.com/roma-apps/roma-ios), [Android](https://github.com/roma-apps/roma-android)
+### Fedi
+- Homepage: <https://www.fediapp.com/>
+- Source Code: Proprietary, but gratis
- Platforms: iOS, Android
-- Features: No Streaming
+- Features: Pleroma-specific features like Reactions
### Tusky
- Homepage: <https://tuskyapp.github.io/>
@@ -64,9 +63,16 @@ Feel free to contact us to be added to this list!
### Twidere
- Homepage: <https://twidere.mariotaku.org/>
-- Source Code: <https://github.com/TwidereProject/Twidere-Android/>, <https://github.com/TwidereProject/Twidere-iOS/>
+- Source Code: <https://github.com/TwidereProject/Twidere-Android/>
- Contact: <me@mariotaku.org>
-- Platform: Android, iOS
+- Platform: Android
+- Features: No Streaming
+
+### Indigenous
+- Homepage: <https://indigenous.realize.be/>
+- Source Code: <https://github.com/swentel/indigenous-android/>
+- Contact: [@realize.be@realize.be](@realize.be@realize.be)
+- Platforms: Android
- Features: No Streaming
## Alternative Web Interfaces
@@ -76,11 +82,6 @@ Feel free to contact us to be added to this list!
- Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc)
- Features: No Streaming
-### Feather
-- Source Code: <https://github.com/kaniini/feather>
-- Contact: [@kaniini@pleroma.site](https://pleroma.site/kaniini)
-- Features: No Streaming
-
### Halcyon
- Source Code: <https://notabug.org/halcyon-suite/halcyon>
- Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon)
@@ -94,6 +95,15 @@ Feel free to contact us to be added to this list!
- Features: No Streaming
### Sengi
+- Homepage: <https://nicolasconstant.github.io/sengi/>
- Source Code: <https://github.com/NicolasConstant/sengi>
- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app)
-- Note(2019-01-28): The development is currently in a early stage.
+
+### DashFE
+- Source Code: <https://notabug.org/daisuke/DashboardFE>
+- Contact: [@dashfe@stereophonic.space](https://stereophonic.space/users/dashfe)
+
+### BloatFE
+- Source Code: <https://git.freesoftwareextremist.com/bloat/>
+- Contact: [@r@freesoftwareextremist.com](https://freesoftwareextremist.com/users/r)
+- Features: Does not requires JavaScript
diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md
index 5d3f49401..2f440adf4 100644
--- a/docs/configuration/cheatsheet.md
+++ b/docs/configuration/cheatsheet.md
@@ -8,12 +8,17 @@ For from source installations Pleroma configuration works by first importing the
To add configuration to your config file, you can copy it from the base config. The latest version of it can be viewed [here](https://git.pleroma.social/pleroma/pleroma/blob/develop/config/config.exs). You can also use this file if you don't know how an option is supposed to be formatted.
+## :chat
+
+* `enabled` - Enables the backend chat. Defaults to `true`.
+
## :instance
* `name`: The instance’s name.
* `email`: Email used to reach an Administrator/Moderator of the instance.
* `notify_email`: Email used for notifications.
* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance``.
* `limit`: Posts character limit (CW/Subject included in the counter).
+* `discription_limit`: The character limit for image descriptions.
* `chat_limit`: Character limit of the instance chat messages.
* `remote_limit`: Hard character limit beyond which remote posts will be dropped.
* `upload_limit`: File size limit of uploads (except for avatar, background, banner).
@@ -28,36 +33,20 @@ To add configuration to your config file, you can copy it from the base config.
* `registrations_open`: Enable registrations for anyone, invitations can be enabled when false.
* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`).
* `account_activation_required`: Require users to confirm their emails before signing in.
+* `account_approval_required`: Require users to be manually approved by an admin before signing in.
* `federating`: Enable federation with other instances.
* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.
* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
* `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance.
-* `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default:
- * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesn’t modify activities (default).
- * `Pleroma.Web.ActivityPub.MRF.DropPolicy`: Drops all activities. It generally doesn’t makes sense to use in production.
- * `Pleroma.Web.ActivityPub.MRF.SimplePolicy`: Restrict the visibility of activities from certains instances (See [`:mrf_simple`](#mrf_simple)).
- * `Pleroma.Web.ActivityPub.MRF.TagPolicy`: Applies policies to individual users based on tags, which can be set using pleroma-fe/admin-fe/any other app that supports Pleroma Admin API. For example it allows marking posts from individual users nsfw (sensitive).
- * `Pleroma.Web.ActivityPub.MRF.SubchainPolicy`: Selectively runs other MRF policies when messages match (See [`:mrf_subchain`](#mrf_subchain)).
- * `Pleroma.Web.ActivityPub.MRF.RejectNonPublic`: Drops posts with non-public visibility settings (See [`:mrf_rejectnonpublic`](#mrf_rejectnonpublic)).
- * `Pleroma.Web.ActivityPub.MRF.EnsureRePrepended`: Rewrites posts to ensure that replies to posts with subjects do not have an identical subject and instead begin with re:.
- * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links.
- * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed.
- * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (See [`:mrf_mention`](#mrf_mention)).
- * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)).
- * `Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy`: Rejects or delists posts based on their age when received. (See [`:mrf_object_age`](#mrf_object_age)).
-* `public`: Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network.
-* `quarantined_instances`: List of ActivityPub instances where private(DMs, followers-only) activities will not be send.
+* `public`: Makes the client API in authenticated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network. Note that there is a dependent setting restricting or allowing unauthenticated access to specific resources, see `restrict_unauthenticated` for more details.
+* `quarantined_instances`: List of ActivityPub instances where private (DMs, followers-only) activities will not be send.
* `managed_config`: Whenether the config for pleroma-fe is configured in [:frontend_configurations](#frontend_configurations) or in ``static/config.json``.
* `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML).
-* `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
-* `mrf_transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
* `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscores/dashes). This will break federation with
older software for theses nicknames.
* `max_pinned_statuses`: The maximum number of pinned statuses. `0` will disable the feature.
* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow.
-* `no_attachment_links`: Set to true to disable automatically adding attachment link text to statuses.
-* `welcome_message`: A message that will be send to a newly registered users as a direct message.
-* `welcome_user_nickname`: The nickname of the local user that sends the welcome message.
+* `attachment_links`: Set to true to enable automatically adding attachment link text to statuses.
* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`).
* `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). Default: `false`.
* `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``.
@@ -70,14 +59,70 @@ To add configuration to your config file, you can copy it from the base config.
* `max_remote_account_fields`: The maximum number of custom fields in the remote user profile (default: `20`).
* `account_field_name_length`: An account field name maximum length (default: `512`).
* `account_field_value_length`: An account field value maximum length (default: `2048`).
+* `registration_reason_length`: Maximum registration reason length (default: `500`).
* `external_user_synchronization`: Enabling following/followers counters synchronization for external users.
* `cleanup_attachments`: Remove attachments along with statuses. Does not affect duplicate files and attachments without status. Enabling this will increase load to database when deleting statuses on larger instances.
+* `show_reactions`: Let favourites and emoji reactions be viewed through the API (default: `true`).
+
+## Welcome
+* `direct_message`: - welcome message sent as a direct message.
+ * `enabled`: Enables the send a direct message to a newly registered user. Defaults to `false`.
+ * `sender_nickname`: The nickname of the local user that sends the welcome message.
+ * `message`: A message that will be send to a newly registered users as a direct message.
+* `chat_message`: - welcome message sent as a chat message.
+ * `enabled`: Enables the send a chat message to a newly registered user. Defaults to `false`.
+ * `sender_nickname`: The nickname of the local user that sends the welcome message.
+ * `message`: A message that will be send to a newly registered users as a chat message.
+* `email`: - welcome message sent as a email.
+ * `enabled`: Enables the send a welcome email to a newly registered user. Defaults to `false`.
+ * `sender`: The email address or tuple with `{nickname, email}` that will use as sender to the welcome email.
+ * `subject`: A subject of welcome email.
+ * `html`: A html that will be send to a newly registered users as a email.
+ * `text`: A text that will be send to a newly registered users as a email.
+
+ Example:
+
+ ```elixir
+ config :pleroma, :welcome,
+ direct_message: [
+ enabled: true,
+ sender_nickname: "lain",
+ message: "Hi! Welcome on board!"
+ ],
+ email: [
+ enabled: true,
+ sender: {"Pleroma App", "welcome@pleroma.app"},
+ subject: "Welcome to <%= instance_name %>",
+ html: "Welcome to <%= instance_name %>",
+ text: "Welcome to <%= instance_name %>"
+ ]
+ ```
+
+## Message rewrite facility
+
+### :mrf
+* `policies`: Message Rewrite Policy, either one or a list. Here are the ones available by default:
+ * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesn’t modify activities (default).
+ * `Pleroma.Web.ActivityPub.MRF.DropPolicy`: Drops all activities. It generally doesn’t makes sense to use in production.
+ * `Pleroma.Web.ActivityPub.MRF.SimplePolicy`: Restrict the visibility of activities from certains instances (See [`:mrf_simple`](#mrf_simple)).
+ * `Pleroma.Web.ActivityPub.MRF.TagPolicy`: Applies policies to individual users based on tags, which can be set using pleroma-fe/admin-fe/any other app that supports Pleroma Admin API. For example it allows marking posts from individual users nsfw (sensitive).
+ * `Pleroma.Web.ActivityPub.MRF.SubchainPolicy`: Selectively runs other MRF policies when messages match (See [`:mrf_subchain`](#mrf_subchain)).
+ * `Pleroma.Web.ActivityPub.MRF.RejectNonPublic`: Drops posts with non-public visibility settings (See [`:mrf_rejectnonpublic`](#mrf_rejectnonpublic)).
+ * `Pleroma.Web.ActivityPub.MRF.EnsureRePrepended`: Rewrites posts to ensure that replies to posts with subjects do not have an identical subject and instead begin with re:.
+ * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links.
+ * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed.
+ * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (See [`:mrf_mention`](#mrf_mention)).
+ * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)).
+ * `Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy`: Rejects or delists posts based on their age when received. (See [`:mrf_object_age`](#mrf_object_age)).
+ * `Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy`: Sets a default expiration on all posts made by users of the local instance. Requires `Pleroma.ActivityExpiration` to be enabled for processing the scheduled delections.
+* `transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
+* `transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
## Federation
### MRF policies
!!! note
- Configuring MRF policies is not enough for them to take effect. You have to enable them by specifying their module in `rewrite_policy` under [:instance](#instance) section.
+ Configuring MRF policies is not enough for them to take effect. You have to enable them by specifying their module in `policies` under [:mrf](#mrf) section.
#### :mrf_simple
* `media_removal`: List of instances to remove media from.
@@ -85,6 +130,7 @@ To add configuration to your config file, you can copy it from the base config.
* `federated_timeline_removal`: List of instances to remove from Federated (aka The Whole Known Network) Timeline.
* `reject`: List of instances to reject any activities from.
* `accept`: List of instances to accept any activities from.
+* `followers_only`: List of instances to decrease post visibility to only the followers, including for DM mentions.
* `report_removal`: List of instances to reject reports from.
* `avatar_removal`: List of instances to strip avatars from.
* `banner_removal`: List of instances to strip banners from.
@@ -146,6 +192,15 @@ config :pleroma, :mrf_user_allowlist, %{
* `:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines
* `:reject` rejects the message entirely
+#### :mrf_steal_emoji
+* `hosts`: List of hosts to steal emojis from
+* `rejected_shortcodes`: Regex-list of shortcodes to reject
+* `size_limit`: File size limit (in bytes), checked before an emoji is saved to the disk
+
+#### :mrf_activity_expiration
+
+* `days`: Default global expiration time for all local Create activities (in days)
+
### :activitypub
* `unfollow_blocked`: Whether blocks result in people getting unfollowed
* `outgoing_blocks`: Whether to federate blocks to other instances
@@ -153,6 +208,11 @@ config :pleroma, :mrf_user_allowlist, %{
* `sign_object_fetches`: Sign object fetches with HTTP signatures
* `authorized_fetch_mode`: Require HTTP signatures for AP fetches
+## Pleroma.User
+
+* `restricted_nicknames`: List of nicknames users may not register with.
+* `email_blacklist`: List of email domains users may not register with.
+
## Pleroma.ScheduledActivity
* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day (Default: `25`)
@@ -161,6 +221,8 @@ config :pleroma, :mrf_user_allowlist, %{
## Pleroma.ActivityExpiration
+Enables the worker which processes posts scheduled for deletion. Pinned posts are exempt from expiration.
+
* `enabled`: whether expired activities will be sent to the job queue to be deleted
## Frontends
@@ -234,6 +296,7 @@ This section describe PWA manifest instance-specific values. Currently this opti
* `background_color`: Describe the background color of the app. (Example: `"#191b22"`, `"aliceblue"`).
## :emoji
+
* `shortcode_globs`: Location of custom emoji files. `*` can be used as a wildcard. Example `["/emoji/custom/**/*.png"]`
* `pack_extensions`: A list of file extensions for emojis, when no emoji.txt for a pack is present. Example `[".png", ".gif"]`
* `groups`: Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname and the value the location or array of locations. `*` can be used as a wildcard. Example `[Custom: ["/emoji/*.png", "/emoji/custom/*.png"]]`
@@ -242,10 +305,46 @@ This section describe PWA manifest instance-specific values. Currently this opti
memory for this amount of seconds multiplied by the number of files.
## :media_proxy
+
* `enabled`: Enables proxying of remote media to the instance’s proxy
* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.
* `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`.
-* `whitelist`: List of domains to bypass the mediaproxy
+* `whitelist`: List of hosts with scheme to bypass the mediaproxy (e.g. `https://example.com`)
+* `invalidation`: options for remove media from cache after delete object:
+ * `enabled`: Enables purge cache
+ * `provider`: Which one of the [purge cache strategy](#purge-cache-strategy) to use.
+
+### Purge cache strategy
+
+#### Pleroma.Web.MediaProxy.Invalidation.Script
+
+This strategy allow perform external shell script to purge cache.
+Urls of attachments pass to script as arguments.
+
+* `script_path`: path to external script.
+
+Example:
+
+```elixir
+config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script,
+ script_path: "./installation/nginx-cache-purge.example"
+```
+
+#### Pleroma.Web.MediaProxy.Invalidation.Http
+
+This strategy allow perform custom http request to purge cache.
+
+* `method`: http method. default is `purge`
+* `headers`: http headers.
+* `options`: request options.
+
+Example:
+```elixir
+config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http,
+ method: :purge,
+ headers: [],
+ options: []
+```
## Link previews
@@ -370,8 +469,7 @@ Available caches:
* `proxy_url`: an upstream proxy to fetch posts and/or media with, (default: `nil`)
* `send_user_agent`: should we include a user agent with HTTP requests? (default: `true`)
* `user_agent`: what user agent should we use? (default: `:default`), must be string or `:default`
-* `adapter`: array of hackney options
-
+* `adapter`: array of adapter options
### :hackney_pools
@@ -390,6 +488,37 @@ For each pool, the options are:
* `timeout` - retention duration for connections
+### :connections_pool
+
+*For `gun` adapter*
+
+Settings for HTTP connection pool.
+
+* `:connection_acquisition_wait` - Timeout to acquire a connection from pool.The total max time is this value multiplied by the number of retries.
+* `connection_acquisition_retries` - Number of attempts to acquire the connection from the pool if it is overloaded. Each attempt is timed `:connection_acquisition_wait` apart.
+* `:max_connections` - Maximum number of connections in the pool.
+* `:await_up_timeout` - Timeout to connect to the host.
+* `:reclaim_multiplier` - Multiplied by `:max_connections` this will be the maximum number of idle connections that will be reclaimed in case the pool is overloaded.
+
+### :pools
+
+*For `gun` adapter*
+
+Settings for request pools. These pools are limited on top of `:connections_pool`.
+
+There are four pools used:
+
+* `:federation` for the federation jobs. You may want this pool's max_connections to be at least equal to the number of federator jobs + retry queue jobs.
+* `:media` - for rich media, media proxy.
+* `:upload` - for proxying media when a remote uploader is used and `proxy_remote: true`.
+* `:default` - for other requests.
+
+For each pool, the options are:
+
+* `:size` - limit to how much requests can be concurrently executed.
+* `:timeout` - timeout while `gun` will wait for response
+* `:max_waiting` - limit to how much requests can be waiting for others to finish, after this is reached, subsequent requests will be dropped.
+
## Captcha
### Pleroma.Captcha
@@ -407,7 +536,7 @@ A built-in captcha provider. Enabled by default.
#### Pleroma.Captcha.Kocaptcha
Kocaptcha is a very simple captcha service with a single API endpoint,
-the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint
+the source code is here: [kocaptcha](https://github.com/koto-bank/kocaptcha). The default endpoint
`https://captcha.kotobank.ch` is hosted by the developer.
* `endpoint`: the Kocaptcha endpoint to use.
@@ -415,21 +544,29 @@ the source code is here: https://github.com/koto-bank/kocaptcha. The default end
## Uploads
### Pleroma.Upload
+
* `uploader`: Which one of the [uploaders](#uploaders) to use.
* `filters`: List of [upload filters](#upload-filters) to use.
* `link_name`: When enabled Pleroma will add a `name` parameter to the url of the upload, for example `https://instance.tld/media/corndog.png?name=corndog.png`. This is needed to provide the correct filename in Content-Disposition headers when using filters like `Pleroma.Upload.Filter.Dedupe`
* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host.
* `proxy_remote`: If you're using a remote uploader, Pleroma will proxy media requests instead of redirecting to it.
* `proxy_opts`: Proxy options, see `Pleroma.ReverseProxy` documentation.
+* `filename_display_max_length`: Set max length of a filename to display. 0 = no limit. Default: 30.
+* `default_description`: Sets which default description an image has if none is set explicitly. Options: nil (default) - Don't set a default, :filename - use the filename of the file, a string (e.g. "attachment") - Use this string
!!! warning
`strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`.
### Uploaders
+
#### Pleroma.Uploaders.Local
+
* `uploads`: Which directory to store the user-uploads in, relative to pleroma’s working directory.
#### Pleroma.Uploaders.S3
+
+Don't forget to configure [Ex AWS S3](#ex-aws-s3-settings)
+
* `bucket`: S3 bucket name.
* `bucket_namespace`: S3 bucket namespace.
* `public_endpoint`: S3 endpoint that the user finally accesses(ex. "https://s3.dualstack.ap-northeast-1.amazonaws.com")
@@ -438,16 +575,22 @@ For example, when using CDN to S3 virtual host format, set "".
At this time, write CNAME to CDN in public_endpoint.
* `streaming_enabled`: Enable streaming uploads, when enabled the file will be sent to the server in chunks as it's being read. This may be unsupported by some providers, try disabling this if you have upload problems.
+#### Ex AWS S3 settings
-### Upload filters
+* `access_key_id`: Access key ID
+* `secret_access_key`: Secret access key
+* `host`: S3 host
-#### Pleroma.Upload.Filter.Mogrify
-
-* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"implode", "1"}]`.
+Example:
-#### Pleroma.Upload.Filter.Dedupe
+```elixir
+config :ex_aws, :s3,
+ access_key_id: "xxxxxxxxxx",
+ secret_access_key: "yyyyyyyyyy",
+ host: "s3.eu-central-1.amazonaws.com"
+```
-No specific configuration.
+### Upload filters
#### Pleroma.Upload.Filter.AnonymizeFilename
@@ -456,6 +599,20 @@ This filter replaces the filename (not the path) of an upload. For complete obfu
* `text`: Text to replace filenames in links. If empty, `{random}.extension` will be used. You can get the original filename extension by using `{extension}`, for example `custom-file-name.{extension}`.
+#### Pleroma.Upload.Filter.Dedupe
+
+No specific configuration.
+
+#### Pleroma.Upload.Filter.Exiftool
+
+This filter only strips the GPS and location metadata with Exiftool leaving color profiles and attributes intact.
+
+No specific configuration.
+
+#### Pleroma.Upload.Filter.Mogrify
+
+* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"implode", "1"}]`.
+
## Email
### Pleroma.Emails.Mailer
@@ -516,8 +673,7 @@ Email notifications settings.
Configuration options described in [Oban readme](https://github.com/sorentwo/oban#usage):
* `repo` - app's Ecto repo (`Pleroma.Repo`)
-* `verbose` - logs verbosity
-* `prune` - non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning) (`:disabled` / `{:maxlen, value}` / `{:maxage, value}`)
+* `log` - logs verbosity
* `queues` - job queues (see below)
* `crontab` - periodic jobs, see [`Oban.Cron`](#obancron)
@@ -581,24 +737,6 @@ config :pleroma, :workers,
* `enabled: false` corresponds to `config :pleroma, :workers, retries: [federator_outgoing: 1]`
* deprecated options: `max_jobs`, `initial_timeout`
-### Pleroma.Scheduler
-
-Configuration for [Quantum](https://github.com/quantum-elixir/quantum-core) jobs scheduler.
-
-See [Quantum readme](https://github.com/quantum-elixir/quantum-core#usage) for the list of supported options.
-
-Example:
-
-```elixir
-config :pleroma, Pleroma.Scheduler,
- global: true,
- overlap: true,
- timezone: :utc,
- jobs: [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}]
-```
-
-The above example defines a single job which invokes `Pleroma.Web.Websub.refresh_subscriptions()` every 6 hours ("0 */6 * * * *", [crontab format](https://en.wikipedia.org/wiki/Cron)).
-
## :web_push_encryption, :vapid_details
Web Push Notifications configuration. You can use the mix task `mix web_push.gen.keypair` to generate it.
@@ -720,10 +858,9 @@ or
curl -H "X-Admin-Token: somerandomtoken" "http://localhost:4000/api/pleroma/admin/users/invites"
```
-### :auth
+Warning: it's discouraged to use this feature because of the associated security risk: static / rarely changed instance-wide token is much weaker compared to email-password pair of a real admin user; consider using HTTP Basic Auth or OAuth-based authentication instead.
-* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator.
-* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication.
+### :auth
Authentication / authorization settings.
@@ -754,6 +891,9 @@ Pleroma account will be created with the same name as the LDAP user name.
* `base`: LDAP base, e.g. "dc=example,dc=com"
* `uid`: LDAP attribute name to authenticate the user, e.g. when "cn", the filter will be "cn=username,base"
+Note, if your LDAP server is an Active Directory server the correct value is commonly `uid: "cn"`, but if you use an
+OpenLDAP server the value may be `uid: "uid"`.
+
### OAuth consumer mode
OAuth consumer mode allows sign in / sign up via external OAuth providers (e.g. Twitter, Facebook, Google, Microsoft, etc.).
@@ -839,37 +979,115 @@ Configure OAuth 2 provider capabilities:
### :uri_schemes
* `valid_schemes`: List of the scheme part that is considered valid to be an URL.
-### :auto_linker
+### Pleroma.Formatter
-Configuration for the `auto_linker` library:
+Configuration for Pleroma's link formatter which parses mentions, hashtags, and URLs.
-* `class: "auto-linker"` - specify the class to be added to the generated link. false to clear.
-* `rel: "noopener noreferrer"` - override the rel attribute. false to clear.
-* `new_window: true` - set to false to remove `target='_blank'` attribute.
-* `scheme: false` - Set to true to link urls with schema `http://google.com`.
-* `truncate: false` - Set to a number to truncate urls longer then the number. Truncated urls will end in `..`.
-* `strip_prefix: true` - Strip the scheme prefix.
-* `extra: false` - link urls with rarely used schemes (magnet, ipfs, irc, etc.).
+* `class` - specify the class to be added to the generated link (default: `false`)
+* `rel` - specify the rel attribute (default: `ugc`)
+* `new_window` - adds `target="_blank"` attribute (default: `false`)
+* `truncate` - Set to a number to truncate URLs longer then the number. Truncated URLs will end in `...` (default: `false`)
+* `strip_prefix` - Strip the scheme prefix (default: `false`)
+* `extra` - link URLs with rarely used schemes (magnet, ipfs, irc, etc.) (default: `true`)
+* `validate_tld` - Set to false to disable TLD validation for URLs/emails. Can be set to :no_scheme to validate TLDs only for urls without a scheme (e.g `example.com` will be validated, but `http://example.loki` won't) (default: `:no_scheme`)
Example:
```elixir
-config :auto_linker,
- opts: [
- scheme: true,
- extra: true,
- class: false,
- strip_prefix: false,
- new_window: false,
- rel: "ugc"
- ]
+config :pleroma, Pleroma.Formatter,
+ class: false,
+ rel: "ugc",
+ new_window: false,
+ truncate: false,
+ strip_prefix: false,
+ extra: true,
+ validate_tld: :no_scheme
```
## Custom Runtime Modules (`:modules`)
* `runtime_dir`: A path to custom Elixir modules (such as MRF policies).
-
## :configurable_from_database
Boolean, enables/disables in-database configuration. Read [Transfering the config to/from the database](../administration/CLI_tasks/config.md) for more information.
+
+## :database_config_whitelist
+
+List of valid configuration sections which are allowed to be configured from the
+database. Settings stored in the database before the whitelist is configured are
+still applied, so it is suggested to only use the whitelist on instances that
+have not migrated the config to the database.
+
+Example:
+```elixir
+config :pleroma, :database_config_whitelist, [
+ {:pleroma, :instance},
+ {:pleroma, Pleroma.Web.Metadata},
+ {:auto_linker}
+]
+```
+
+### Multi-factor authentication - :two_factor_authentication
+* `totp` - a list containing TOTP configuration
+ - `digits` - Determines the length of a one-time pass-code in characters. Defaults to 6 characters.
+ - `period` - a period for which the TOTP code will be valid in seconds. Defaults to 30 seconds.
+* `backup_codes` - a list containing backup codes configuration
+ - `number` - number of backup codes to generate.
+ - `length` - backup code length. Defaults to 16 characters.
+
+## Restrict entities access for unauthenticated users
+
+### :restrict_unauthenticated
+
+Restrict access for unauthenticated users to timelines (public and federated), user profiles and statuses.
+
+* `timelines`: public and federated timelines
+ * `local`: public timeline
+ * `federated`: federated timeline (includes public timeline)
+* `profiles`: user profiles
+ * `local`
+ * `remote`
+* `activities`: statuses
+ * `local`
+ * `remote`
+
+Note: when `:instance, :public` is set to `false`, all `:restrict_unauthenticated` items be effectively set to `true` by default. If you'd like to allow unauthenticated access to specific API endpoints on a private instance, please explicitly set `:restrict_unauthenticated` to non-default value in `config/prod.secret.exs`.
+
+Note: setting `restrict_unauthenticated/timelines/local` to `true` has no practical sense if `restrict_unauthenticated/timelines/federated` is set to `false` (since local public activities will still be delivered to unauthenticated users as part of federated timeline).
+
+## Pleroma.Web.ApiSpec.CastAndValidate
+
+* `:strict` a boolean, enables strict input validation (useful in development, not recommended in production). Defaults to `false`.
+
+## :instances_favicons
+
+Control favicons for instances.
+
+* `enabled`: Allow/disallow displaying and getting instances favicons
+
+## Frontend management
+
+Frontends in Pleroma are swappable - you can specify which one to use here.
+
+You can set a frontends for the key `primary` and `admin` and the options of `name` and `ref`. This will then make Pleroma serve the frontend from a folder constructed by concatenating the instance static path, `frontends` and the name and ref.
+
+The key `primary` refers to the frontend that will be served by default for general requests. The key `admin` refers to the frontend that will be served at the `/pleroma/admin` path.
+
+If you don't set anything here, the bundled frontends will be used.
+
+Example:
+
+```
+config :pleroma, :frontends,
+ primary: %{
+ "name" => "pleroma",
+ "ref" => "stable"
+ },
+ admin: %{
+ "name" => "admin",
+ "ref" => "develop"
+ }
+```
+
+This would serve the frontend from the the folder at `$instance_static/frontends/pleroma/stable`. You have to copy the frontend into this folder yourself. You can choose the name and ref any way you like, but they will be used by mix tasks to automate installation in the future, the name referring to the project and the ref referring to a commit.
diff --git a/docs/configuration/howto_database_config.md b/docs/configuration/howto_database_config.md
new file mode 100644
index 000000000..9ed4d6cdd
--- /dev/null
+++ b/docs/configuration/howto_database_config.md
@@ -0,0 +1,153 @@
+# How to activate Pleroma in-database configuration
+## Explanation
+
+The configuration of Pleroma has traditionally been managed with a config file, e.g. `config/prod.secret.exs`. This method requires a restart of the application for any configuration changes to take effect. We have made it possible to control most settings in the AdminFE interface after running a migration script.
+
+## Migration to database config
+
+1. Run the mix task to migrate to the database. You'll receive some debugging output and a few messages informing you of what happened.
+
+ **Source:**
+
+ ```
+ $ mix pleroma.config migrate_to_db
+ ```
+
+ or
+
+ **OTP:**
+
+ *Note: OTP users need Pleroma to be running for `pleroma_ctl` commands to work*
+
+ ```
+ $ ./bin/pleroma_ctl config migrate_to_db
+ ```
+
+ ```
+ 10:04:34.155 [debug] QUERY OK source="config" db=1.6ms decode=2.0ms queue=33.5ms idle=0.0ms
+ SELECT c0."id", c0."key", c0."group", c0."value", c0."inserted_at", c0."updated_at" FROM "config" AS c0 []
+ Migrating settings from file: /home/pleroma/config/dev.secret.exs
+
+ 10:04:34.240 [debug] QUERY OK db=4.5ms queue=0.3ms idle=92.2ms
+ TRUNCATE config; []
+
+ 10:04:34.244 [debug] QUERY OK db=2.8ms queue=0.3ms idle=97.2ms
+ ALTER SEQUENCE config_id_seq RESTART; []
+
+ 10:04:34.256 [debug] QUERY OK source="config" db=0.8ms queue=1.4ms idle=109.8ms
+ SELECT c0."id", c0."key", c0."group", c0."value", c0."inserted_at", c0."updated_at" FROM "config" AS c0 WHERE ((c0."group" = $1) AND (c0."key" = $2)) [":pleroma", ":instance"]
+
+ 10:04:34.292 [debug] QUERY OK db=2.6ms queue=1.7ms idle=137.7ms
+ INSERT INTO "config" ("group","key","value","inserted_at","updated_at") VALUES ($1,$2,$3,$4,$5) RETURNING "id" [":pleroma", ":instance", <<131, 108, 0, 0, 0, 1, 104, 2, 100, 0, 4, 110, 97, 109, 101, 109, 0, 0, 0, 7, 66, 108, 101, 114, 111, 109, 97, 106>>, ~N[2020-07-12 15:04:34], ~N[2020-07-12 15:04:34]]
+ Settings for key instance migrated.
+ Settings for group :pleroma migrated.
+ ```
+
+2. It is recommended to backup your config file now.
+
+ ```
+ cp config/dev.secret.exs config/dev.secret.exs.orig
+ ```
+
+3. Edit your Pleroma config to enable database configuration:
+
+ ```
+ config :pleroma, configurable_from_database: true
+ ```
+
+4. ⚠️ **THIS IS NOT REQUIRED** ⚠️
+
+ Now you can edit your config file and strip it down to the only settings which are not possible to control in the database. e.g., the Postgres (Repo) and webserver (Endpoint) settings cannot be controlled in the database because the application needs the settings to start up and access the database.
+
+ Any settings in the database will override those in the config file, but you may find it less confusing if the setting is only declared in one place.
+
+ A non-exhaustive list of settings that are only possible in the config file include the following:
+
+ * config :pleroma, Pleroma.Web.Endpoint
+ * config :pleroma, Pleroma.Repo
+ * config :pleroma, configurable\_from\_database
+ * config :pleroma, :database, rum_enabled
+ * config :pleroma, :connections_pool
+
+ Here is an example of a server config stripped down after migration:
+
+ ```
+ use Mix.Config
+
+ config :pleroma, Pleroma.Web.Endpoint,
+ url: [host: "cool.pleroma.site", scheme: "https", port: 443]
+
+ config :pleroma, Pleroma.Repo,
+ adapter: Ecto.Adapters.Postgres,
+ username: "pleroma",
+ password: "MySecretPassword",
+ database: "pleroma_prod",
+ hostname: "localhost"
+
+ config :pleroma, configurable_from_database: true
+ ```
+
+5. Restart your instance and you can now access the Settings tab in AdminFE.
+
+
+## Reverting back from database config
+
+1. Run the mix task to migrate back from the database. You'll receive some debugging output and a few messages informing you of what happened.
+
+ **Source:**
+
+ ```
+ $ mix pleroma.config migrate_from_db
+ ```
+
+ or
+
+ **OTP:**
+
+ ```
+ $ ./bin/pleroma_ctl config migrate_from_db
+ ```
+
+ ```
+ 10:26:30.593 [debug] QUERY OK source="config" db=9.8ms decode=1.2ms queue=26.0ms idle=0.0ms
+ SELECT c0."id", c0."key", c0."group", c0."value", c0."inserted_at", c0."updated_at" FROM "config" AS c0 []
+
+ 10:26:30.659 [debug] QUERY OK source="config" db=1.1ms idle=80.7ms
+ SELECT c0."id", c0."key", c0."group", c0."value", c0."inserted_at", c0."updated_at" FROM "config" AS c0 []
+ Database configuration settings have been saved to config/dev.exported_from_db.secret.exs
+ ```
+
+2. Remove `config :pleroma, configurable_from_database: true` from your config. The in-database configuration still exists, but it will not be used. Future migrations will erase the database config before importing your config file again.
+
+3. Restart your instance.
+
+## Debugging
+
+### Clearing database config
+You can clear the database config by truncating the `config` table in the database. e.g.,
+
+```
+psql -d pleroma_dev
+pleroma_dev=# TRUNCATE config;
+TRUNCATE TABLE
+```
+
+Additionally, every time you migrate the configuration to the database the config table is automatically truncated to ensure a clean migration.
+
+### Manually removing a setting
+If you encounter a situation where the server cannot run properly because of an invalid setting in the database and this is preventing you from accessing AdminFE, you can manually remove the offending setting if you know which one it is.
+
+e.g., here is an example showing a minimal configuration in the database. Only the `config :pleroma, :instance` settings are in the table:
+
+```
+psql -d pleroma_dev
+pleroma_dev=# select * from config;
+ id | key | value | inserted_at | updated_at | group
+----+-----------+------------------------------------------------------------+---------------------+---------------------+----------
+ 1 | :instance | \x836c0000000168026400046e616d656d00000007426c65726f6d616a | 2020-07-12 15:33:29 | 2020-07-12 15:33:29 | :pleroma
+(1 row)
+pleroma_dev=# delete from config where key = ':instance' and group = ':pleroma';
+DELETE 1
+```
+
+Now the `config :pleroma, :instance` settings have been removed from the database.
diff --git a/docs/configuration/howto_theming_your_instance.md b/docs/configuration/howto_theming_your_instance.md
index d0daf5b25..cfa00f538 100644
--- a/docs/configuration/howto_theming_your_instance.md
+++ b/docs/configuration/howto_theming_your_instance.md
@@ -60,7 +60,7 @@ Example of `my-awesome-theme.json` where we add the name "My Awesome Theme"
### Set as default theme
-Now we can set the new theme as default in the [Pleroma FE configuration](General-tips-for-customizing-Pleroma-FE.md).
+Now we can set the new theme as default in the [Pleroma FE configuration](../../../frontend/CONFIGURATION).
Example of adding the new theme in the back-end config files
```elixir
diff --git a/docs/configuration/mrf.md b/docs/configuration/mrf.md
index c3957c255..31c66e098 100644
--- a/docs/configuration/mrf.md
+++ b/docs/configuration/mrf.md
@@ -34,18 +34,22 @@ config :pleroma, :instance,
To use `SimplePolicy`, you must enable it. Do so by adding the following to your `:instance` config object, so that it looks like this:
```elixir
-config :pleroma, :instance,
+config :pleroma, :mrf,
[...]
- rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy
+ policies: Pleroma.Web.ActivityPub.MRF.SimplePolicy
```
Once `SimplePolicy` is enabled, you can configure various groups in the `:mrf_simple` config object. These groups are:
-* `media_removal`: Servers in this group will have media stripped from incoming messages.
-* `media_nsfw`: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media.
* `reject`: Servers in this group will have their messages rejected.
-* `federated_timeline_removal`: Servers in this group will have their messages unlisted from the public timelines by flipping the `to` and `cc` fields.
+* `accept`: If not empty, only messages from these instances will be accepted (whitelist federation).
+* `media_nsfw`: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media.
+* `media_removal`: Servers in this group will have media stripped from incoming messages.
+* `avatar_removal`: Avatars from these servers will be stripped from incoming messages.
+* `banner_removal`: Banner images from these servers will be stripped from incoming messages.
* `report_removal`: Servers in this group will have their reports (flags) rejected.
+* `federated_timeline_removal`: Servers in this group will have their messages unlisted from the public timelines by flipping the `to` and `cc` fields.
+* `reject_deletes`: Deletion requests will be rejected from these servers.
Servers should be configured as lists.
@@ -54,8 +58,8 @@ Servers should be configured as lists.
This example will enable `SimplePolicy`, block media from `illegalporn.biz`, mark media as NSFW from `porn.biz` and `porn.business`, reject messages from `spam.com`, remove messages from `spam.university` from the federated timeline and block reports (flags) from `whiny.whiner`:
```elixir
-config :pleroma, :instance,
- rewrite_policy: [Pleroma.Web.ActivityPub.MRF.SimplePolicy]
+config :pleroma, :mrf,
+ policies: [Pleroma.Web.ActivityPub.MRF.SimplePolicy]
config :pleroma, :mrf_simple,
media_removal: ["illegalporn.biz"],
@@ -71,7 +75,7 @@ The effects of MRF policies can be very drastic. It is important to use this fun
## Writing your own MRF Policy
-As discussed above, the MRF system is a modular system that supports pluggable policies. This means that an admin may write a custom MRF policy in Elixir or any other language that runs on the Erlang VM, by specifying the module name in the `rewrite_policy` config setting.
+As discussed above, the MRF system is a modular system that supports pluggable policies. This means that an admin may write a custom MRF policy in Elixir or any other language that runs on the Erlang VM, by specifying the module name in the `policies` config setting.
For example, here is a sample policy module which rewrites all messages to "new message content":
@@ -113,7 +117,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.RewritePolicy do
@impl true
def describe do
- {:ok, %{mrf_sample: %{content: "new message content"}}}`
+ {:ok, %{mrf_sample: %{content: "new message content"}}}
end
end
```
@@ -121,8 +125,8 @@ end
If you save this file as `lib/pleroma/web/activity_pub/mrf/rewrite_policy.ex`, it will be included when you next rebuild Pleroma. You can enable it in the configuration like so:
```elixir
-config :pleroma, :instance,
- rewrite_policy: [
+config :pleroma, :mrf,
+ policies: [
Pleroma.Web.ActivityPub.MRF.SimplePolicy,
Pleroma.Web.ActivityPub.MRF.RewritePolicy
]
diff --git a/docs/configuration/postgresql.md b/docs/configuration/postgresql.md
new file mode 100644
index 000000000..6983fb459
--- /dev/null
+++ b/docs/configuration/postgresql.md
@@ -0,0 +1,31 @@
+# Optimizing your PostgreSQL performance
+
+Pleroma performance depends to a large extent on good database performance. The default PostgreSQL settings are mostly fine, but often you can get better performance by changing a few settings.
+
+You can use [PGTune](https://pgtune.leopard.in.ua) to get recommendations for your setup. If you do, set the "Number of Connections" field to 20, as Pleroma will only use 10 concurrent connections anyway. If you don't, it will give you advice that might even hurt your performance.
+
+We also recommend not using the "Network Storage" option.
+
+## Example configurations
+
+Here are some configuration suggestions for PostgreSQL 10+.
+
+### 1GB RAM, 1 CPU
+```
+shared_buffers = 256MB
+effective_cache_size = 768MB
+maintenance_work_mem = 64MB
+work_mem = 13107kB
+```
+
+### 2GB RAM, 2 CPU
+```
+shared_buffers = 512MB
+effective_cache_size = 1536MB
+maintenance_work_mem = 128MB
+work_mem = 26214kB
+max_worker_processes = 2
+max_parallel_workers_per_gather = 1
+max_parallel_workers = 2
+```
+
diff --git a/docs/configuration/static_dir.md b/docs/configuration/static_dir.md
index 5fb38c3de..8ac07b725 100644
--- a/docs/configuration/static_dir.md
+++ b/docs/configuration/static_dir.md
@@ -1,45 +1,61 @@
# Static Directory
-Static frontend files are shipped in `priv/static/` and tracked by version control in this repository. If you want to overwrite or update these without the possibility of merge conflicts, you can write your custom versions to `instance/static/`.
+Static frontend files are shipped with pleroma. If you want to overwrite or update these without problems during upgrades, you can write your custom versions to the static directory.
-```
-config :pleroma, :instance,
- static_dir: "instance/static/",
-```
+You can find the location of the static directory in the [configuration](../cheatsheet/#instance).
+
+=== "OTP"
-For example, edit `instance/static/instance/panel.html` .
+ ```elixir
+ config :pleroma, :instance,
+ static_dir: "/var/lib/pleroma/static/"
+ ```
+
+=== "From Source"
+
+ ```elixir
+ config :pleroma, :instance,
+ static_dir: "instance/static/"
+ ```
Alternatively, you can overwrite this value in your configuration to use a different static instance directory.
-This document is written assuming `instance/static/`.
+This document is written using `$static_dir` as the value of the `config :pleroma, :instance, static_dir` setting.
-Or, if you want to manage your custom file in git repository, basically remove the `instance/` entry from `.gitignore`.
+If you use a From Source installation and want to manage your custom files in the git repository, you can remove the `instance/` entry from `.gitignore`.
## robots.txt
-By default, the `robots.txt` that ships in `priv/static/` is permissive. It allows well-behaved search engines to index all of your instance's URIs.
+There's a mix tasks to [generate a new robot.txt](../../administration/CLI_tasks/robots_txt/).
+
+For more complex things, you can write your own robots.txt to `$static_dir/robots.txt`.
-If you want to generate a restrictive `robots.txt`, you can run the following mix task. The generated `robots.txt` will be written in your instance static directory.
+E.g. if you want to block all crawlers except for [fediverse.network](https://fediverse.network/about) you can use
```
-mix pleroma.robots_txt disallow_all
+User-Agent: *
+Disallow: /
+
+User-Agent: crawler-us-il-1.fediverse.network
+Allow: /
+
+User-Agent: makhnovtchina.random.sh
+Allow: /
```
## Thumbnail
-Put on `instance/static/instance/thumbnail.jpeg` with your selfie or other neat picture. It will appear in [Pleroma Instances](http://distsn.org/pleroma-instances.html).
+Add `$static_dir/instance/thumbnail.jpeg` with your selfie or other neat picture. It will be available on `http://your-domain.tld/instance/thumbnail.jpeg` and can be used by external applications.
## Instance-specific panel
-![instance-specific panel demo](/uploads/296b19ec806b130e0b49b16bfe29ce8a/image.png)
-
-Create and Edit your file on `instance/static/instance/panel.html`.
+Create and Edit your file at `$static_dir/instance/panel.html`.
## Background
-You can change the background of your Pleroma instance by uploading it to `instance/static/`, and then changing `background` in `config/prod.secret.exs` accordingly.
+You can change the background of your Pleroma instance by uploading it to `$static_dir/`, and then changing `background` in [your configuration](../cheatsheet/#frontend_configurations) accordingly.
-If you put `instance/static/images/background.jpg`
+E.g. if you put `$static_dir/images/background.jpg`
```
config :pleroma, :frontend_configurations,
@@ -50,12 +66,14 @@ config :pleroma, :frontend_configurations,
## Logo
-![logo modification demo](/uploads/c70b14de60fa74245e7f0dcfa695ebff/image.png)
+!!! important
+ Note the extra `static` folder for the default logo.png location
-If you want to give a brand to your instance, You can change the logo of your instance by uploading it to `instance/static/`.
+If you want to give a brand to your instance, You can change the logo of your instance by uploading it to the static directory `$static_dir/static/logo.png`.
-Alternatively, you can specify the path with config.
-If you put `instance/static/static/mylogo-file.png`
+Alternatively, you can specify the path to your logo in [your configuration](../cheatsheet/#frontend_configurations).
+
+E.g. if you put `$static_dir/static/mylogo-file.png`
```
config :pleroma, :frontend_configurations,
@@ -66,4 +84,7 @@ config :pleroma, :frontend_configurations,
## Terms of Service
-Terms of Service will be shown to all users on the registration page. It's the best place where to write down the rules for your instance. You can modify the rules by changing `instance/static/static/terms-of-service.html`.
+!!! important
+ Note the extra `static` folder for the terms-of-service.html
+
+Terms of Service will be shown to all users on the registration page. It's the best place where to write down the rules for your instance. You can modify the rules by adding and changing `$static_dir/static/terms-of-service.html`.
diff --git a/docs/configuration/storing_remote_media.md b/docs/configuration/storing_remote_media.md
new file mode 100644
index 000000000..c01985d25
--- /dev/null
+++ b/docs/configuration/storing_remote_media.md
@@ -0,0 +1,38 @@
+# Storing Remote Media
+
+Pleroma does not store remote/federated media by default. The best way to achieve this is to change Nginx to keep its reverse proxy cache
+for a year and to activate the `MediaProxyWarmingPolicy` MRF policy in Pleroma which will automatically fetch all media through the proxy
+as soon as the post is received by your instance.
+
+## Nginx
+
+```
+ proxy_cache_path /long/term/storage/path/pleroma-media-cache levels=1:2
+ keys_zone=pleroma_media_cache:10m inactive=1y use_temp_path=off;
+
+ location ~ ^/(media|proxy) {
+ proxy_cache pleroma_media_cache;
+ slice 1m;
+ proxy_cache_key $host$uri$is_args$args$slice_range;
+ proxy_set_header Range $slice_range;
+ proxy_http_version 1.1;
+ proxy_cache_valid 206 301 302 304 1h;
+ proxy_cache_valid 200 1y;
+ proxy_cache_use_stale error timeout invalid_header updating;
+ proxy_ignore_client_abort on;
+ proxy_buffering on;
+ chunked_transfer_encoding on;
+ proxy_ignore_headers Cache-Control Expires;
+ proxy_hide_header Cache-Control Expires;
+ proxy_pass http://127.0.0.1:4000;
+ }
+```
+
+## Pleroma
+
+Add to your `prod.secret.exs`:
+
+```
+config :pleroma, :mrf,
+ policies: [Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy]
+```
diff --git a/docs/dev.md b/docs/dev.md
new file mode 100644
index 000000000..9c749c17c
--- /dev/null
+++ b/docs/dev.md
@@ -0,0 +1,23 @@
+This document contains notes and guidelines for Pleroma developers.
+
+# Authentication & Authorization
+
+## OAuth token-based authentication & authorization
+
+* Pleroma supports hierarchical OAuth scopes, just like Mastodon but with added granularity of admin scopes. For a reference, see [Mastodon OAuth scopes](https://docs.joinmastodon.org/api/oauth-scopes/).
+
+* It is important to either define OAuth scope restrictions or explicitly mark OAuth scope check as skipped, for every controller action. To define scopes, call `plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: [...]})`. To explicitly set OAuth scopes check skipped, call `plug(:skip_plug, Pleroma.Plugs.OAuthScopesPlug <when ...>)`.
+
+* In controllers, `use Pleroma.Web, :controller` will result in `action/2` (see `Pleroma.Web.controller/0` for definition) be called prior to actual controller action, and it'll perform security / privacy checks before passing control to actual controller action.
+
+ For routes with `:authenticated_api` pipeline, authentication & authorization are expected, thus `OAuthScopesPlug` will be run unless explicitly skipped (also `EnsureAuthenticatedPlug` will be executed immediately before action even if there was an early run to give an early error, since `OAuthScopesPlug` supports `:proceed_unauthenticated` option, and other plugs may support similar options as well).
+
+ For `:api` pipeline routes, it'll be verified whether `OAuthScopesPlug` was called or explicitly skipped, and if it was not then auth information will be dropped for request. Then `EnsurePublicOrAuthenticatedPlug` will be called to ensure that either the instance is not private or user is authenticated (unless explicitly skipped). Such automated checks help to prevent human errors and result in higher security / privacy for users.
+
+## [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)
+
+* With HTTP Basic Auth, OAuth scopes check is _not_ performed for any action (since password is provided during the auth, requester is able to obtain a token with full permissions anyways). `Pleroma.Plugs.AuthenticationPlug` and `Pleroma.Plugs.LegacyAuthenticationPlug` both call `Pleroma.Plugs.OAuthScopesPlug.skip_plug(conn)` when password is provided.
+
+## Auth-related configuration, OAuth consumer mode etc.
+
+See `Authentication` section of [the configuration cheatsheet](configuration/cheatsheet.md#authentication).
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 000000000..1a90d0a8d
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,26 @@
+# Introduction to Pleroma
+## What is Pleroma?
+Pleroma is a federated social networking platform, compatible with Mastodon and other ActivityPub implementations. It is free software licensed under the AGPLv3.
+It actually consists of two components: a backend, named simply Pleroma, and a user-facing frontend, named Pleroma-FE. It also includes the Mastodon frontend, if that's your thing.
+It's part of what we call the fediverse, a federated network of instances which speak common protocols and can communicate with each other.
+One account on an instance is enough to talk to the entire fediverse!
+
+## How can I use it?
+
+Pleroma instances are already widely deployed, a list can be found at <https://the-federation.info/pleroma> and <https://fediverse.network/pleroma>.
+
+If you don't feel like joining an existing instance, but instead prefer to deploy your own instance, that's easy too!
+Installation instructions can be found in the installation section of these docs.
+
+## I got an account, now what?
+Great! Now you can explore the fediverse! Open the login page for your Pleroma instance (e.g. <https://pleroma.soykaf.com>) and login with your username and password. (If you don't have an account yet, click on Register)
+
+### Pleroma-FE
+The default front-end used by Pleroma is Pleroma-FE. You can find more information on what it is and how to use it in the [Introduction to Pleroma-FE](../frontend).
+
+### Mastodon interface
+If the Pleroma interface isn't your thing, or you're just trying something new but you want to keep using the familiar Mastodon interface, we got that too!
+Just add a "/web" after your instance url (e.g. <https://pleroma.soycaf.com/web>) and you'll end on the Mastodon web interface, but with a Pleroma backend! MAGIC!
+The Mastodon interface is from the Glitch-soc fork. For more information on the Mastodon interface you can check the [Mastodon](https://docs.joinmastodon.org/) and [Glitch-soc](https://glitch-soc.github.io/docs/) documentation.
+
+Remember, what you see is only the frontend part of Mastodon, the backend is still Pleroma.
diff --git a/docs/installation/alpine_linux_en.md b/docs/installation/alpine_linux_en.md
index 2a9b8f6ff..a5683f18c 100644
--- a/docs/installation/alpine_linux_en.md
+++ b/docs/installation/alpine_linux_en.md
@@ -14,6 +14,7 @@ It assumes that you have administrative rights, either as root or a user with [s
* `erlang-xmerl`
* `git`
* Development Tools
+* `cmake`
#### Optional packages used in this guide
@@ -39,7 +40,7 @@ sudo apk upgrade
* Install some tools, which are needed later:
```shell
-sudo apk add git build-base
+sudo apk add git build-base cmake
```
### Install Elixir and Erlang
@@ -225,10 +226,7 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
#### Further reading
-* [Backup your instance](../administration/backup.md)
-* [Hardening your instance](../configuration/hardening.md)
-* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
-* [Updating your instance](../administration/updating.md)
+{! backend/installation/further_reading.include !}
## Questions
diff --git a/docs/installation/arch_linux_en.md b/docs/installation/arch_linux_en.md
index 8370986ad..7fb69dd60 100644
--- a/docs/installation/arch_linux_en.md
+++ b/docs/installation/arch_linux_en.md
@@ -9,6 +9,7 @@ This guide will assume that you have administrative rights, either as root or a
* `elixir`
* `git`
* `base-devel`
+* `cmake`
#### Optional packages used in this guide
@@ -26,7 +27,7 @@ sudo pacman -Syu
* Install some of the above mentioned programs:
```shell
-sudo pacman -S git base-devel elixir
+sudo pacman -S git base-devel elixir cmake
```
### Install PostgreSQL
@@ -200,10 +201,7 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
#### Further reading
-* [Backup your instance](../administration/backup.md)
-* [Hardening your instance](../configuration/hardening.md)
-* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
-* [Updating your instance](../administration/updating.md)
+{! backend/installation/further_reading.include !}
## Questions
diff --git a/docs/installation/debian_based_en.md b/docs/installation/debian_based_en.md
index fe2dbb92d..60c2f47e5 100644
--- a/docs/installation/debian_based_en.md
+++ b/docs/installation/debian_based_en.md
@@ -7,15 +7,12 @@ This guide will assume you are on Debian Stretch. This guide should also work wi
* `postgresql` (9.6+, Ubuntu 16.04 comes with 9.5, you can get a newer version from [here](https://www.postgresql.org/download/linux/ubuntu/))
* `postgresql-contrib` (9.6+, same situtation as above)
-* `elixir` (1.5+, [install from here, Debian and Ubuntu ship older versions](https://elixir-lang.org/install.html#unix-and-unix-like) or use [asdf](https://github.com/asdf-vm/asdf) as the pleroma user)
+* `elixir` (1.8+, Follow the guide to install from the Erlang Solutions repo or use [asdf](https://github.com/asdf-vm/asdf) as the pleroma user)
* `erlang-dev`
-* `erlang-tools`
-* `erlang-parsetools`
-* `erlang-eldap`, if you want to enable ldap authenticator
-* `erlang-ssh`
-* `erlang-xmerl`
+* `erlang-nox`
* `git`
* `build-essential`
+* `cmake`
#### Optional packages used in this guide
@@ -34,7 +31,7 @@ sudo apt full-upgrade
* Install some of the above mentioned programs:
```shell
-sudo apt install git build-essential postgresql postgresql-contrib
+sudo apt install git build-essential postgresql postgresql-contrib cmake
```
### Install Elixir and Erlang
@@ -42,15 +39,15 @@ sudo apt install git build-essential postgresql postgresql-contrib
* Download and add the Erlang repository:
```shell
-wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
-sudo dpkg -i /tmp/erlang-solutions_1.0_all.deb
+wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
+sudo dpkg -i /tmp/erlang-solutions_2.0_all.deb
```
* Install Elixir and Erlang:
```shell
sudo apt update
-sudo apt install elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools erlang-ssh
+sudo apt install elixir erlang-dev erlang-nox
```
### Install PleromaBE
@@ -190,10 +187,7 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
#### Further reading
-* [Backup your instance](../administration/backup.md)
-* [Hardening your instance](../configuration/hardening.md)
-* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
-* [Updating your instance](../administration/updating.md)
+{! backend/installation/further_reading.include !}
## Questions
diff --git a/docs/installation/debian_based_jp.md b/docs/installation/debian_based_jp.md
index 7aa0bcc24..c2dd840d3 100644
--- a/docs/installation/debian_based_jp.md
+++ b/docs/installation/debian_based_jp.md
@@ -10,21 +10,18 @@
### 必要なソフトウェア
- PostgreSQL 9.6以上 (Ubuntu16.04では9.5しか提供されていないので,[](https://www.postgresql.org/download/linux/ubuntu/)こちらから新しいバージョンを入手してください)
-- postgresql-contrib 9.6以上 (同上)
-- Elixir 1.5 以上 ([Debianのリポジトリからインストールしないこと!!! ここからインストールすること!](https://elixir-lang.org/install.html#unix-and-unix-like)。または [asdf](https://github.com/asdf-vm/asdf) をpleromaユーザーでインストールしてください)
- - erlang-dev
-- erlang-tools
-- erlang-parsetools
-- erlang-eldap (LDAP認証を有効化するときのみ必要)
-- erlang-ssh
-- erlang-xmerl
-- git
-- build-essential
+- `postgresql-contrib` 9.6以上 (同上)
+- Elixir 1.8 以上 ([Debianのリポジトリからインストールしないこと!!! ここからインストールすること!](https://elixir-lang.org/install.html#unix-and-unix-like)。または [asdf](https://github.com/asdf-vm/asdf) をpleromaユーザーでインストールしてください)
+- `erlang-dev`
+- `erlang-nox`
+- `git`
+- `build-essential`
+- `cmake`
#### このガイドで利用している追加パッケージ
-- nginx (おすすめです。他のリバースプロキシを使う場合は、参考となる設定をこのリポジトリから探してください)
-- certbot (または何らかのLet's Encrypt向けACMEクライアント)
+- `nginx` (おすすめです。他のリバースプロキシを使う場合は、参考となる設定をこのリポジトリから探してください)
+- `certbot` (または何らかのLet's Encrypt向けACMEクライアント)
### システムを準備する
@@ -36,7 +33,7 @@ sudo apt full-upgrade
* 上記に挙げたパッケージをインストールしておきます。
```
-sudo apt install git build-essential postgresql postgresql-contrib
+sudo apt install git build-essential postgresql postgresql-contrib cmake
```
@@ -44,14 +41,14 @@ sudo apt install git build-essential postgresql postgresql-contrib
* Erlangのリポジトリをダウンロードおよびインストールします。
```
-wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
-sudo dpkg -i /tmp/erlang-solutions_1.0_all.deb
+wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
+sudo dpkg -i /tmp/erlang-solutions_2.0_all.deb
```
* ElixirとErlangをインストールします、
```
sudo apt update
-sudo apt install elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools erlang-ssh
+sudo apt install elixir erlang-dev erlang-nox
```
### Pleroma BE (バックエンド) をインストールします
@@ -179,10 +176,7 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
#### その他の設定とカスタマイズ
-* [Backup your instance](../administration/backup.md)
-* [Hardening your instance](../configuration/hardening.md)
-* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
-* [Updating your instance](../administration/updating.md)
+{! backend/installation/further_reading.include !}
## 質問ある?
diff --git a/docs/installation/freebsd_en.md b/docs/installation/freebsd_en.md
new file mode 100644
index 000000000..130d68766
--- /dev/null
+++ b/docs/installation/freebsd_en.md
@@ -0,0 +1,210 @@
+# Installing on FreeBSD
+
+This document was written for FreeBSD 12.1, but should be work on future releases.
+
+## Required software
+
+This assumes the target system has `pkg(8)`.
+
+```
+# pkg install elixir postgresql12-server postgresql12-client postgresql12-contrib git-lite sudo nginx gmake acme.sh
+```
+
+Copy the rc.d scripts to the right directory:
+
+Setup the required services to automatically start at boot, using `sysrc(8)`.
+
+```
+# sysrc nginx_enable=YES
+# sysrc postgresql_enable=YES
+```
+
+## Initialize postgres
+
+```
+# service postgresql initdb
+# service postgresql start
+```
+
+## Configuring Pleroma
+
+Create a user for Pleroma:
+
+```
+# pw add user pleroma -m
+# echo 'export LC_ALL="en_US.UTF-8"' >> /home/pleroma/.profile
+# su -l pleroma
+```
+
+Clone the repository:
+
+```
+$ cd $HOME # Should be the same as /home/pleroma
+$ git clone -b stable https://git.pleroma.social/pleroma/pleroma.git
+```
+
+Configure Pleroma. Note that you need a domain name at this point:
+
+```
+$ cd /home/pleroma/pleroma
+$ mix deps.get # Enter "y" when asked to install Hex
+$ mix pleroma.instance gen # You will be asked a few questions here.
+$ cp config/generated_config.exs config/prod.secret.exs
+```
+
+Since Postgres is configured, we can now initialize the database. There should
+now be a file in `config/setup_db.psql` that makes this easier. Edit it, and
+*change the password* to a password of your choice. Make sure it is secure, since
+it'll be protecting your database. As root, you can now initialize the database:
+
+```
+# cd /home/pleroma/pleroma
+# sudo -Hu postgres -g postgres psql -f config/setup_db.psql
+```
+
+Postgres allows connections from all users without a password by default. To
+fix this, edit `/var/db/postgres/data12/pg_hba.conf`. Change every `trust` to
+`password`.
+
+Once this is done, restart Postgres with:
+```
+# service postgresql restart
+```
+
+Run the database migrations.
+
+Back as the pleroma user, run the following to implement any database migrations.
+
+```
+# su -l pleroma
+$ cd /home/pleroma/pleroma
+$ MIX_ENV=prod mix ecto.migrate
+```
+
+You will need to do this whenever you update with `git pull`:
+
+## Configuring acme.sh
+
+We'll be using acme.sh in Stateless Mode for TLS certificate renewal.
+
+First, as root, allow the user `acme` to have access to the acme log file, as follows:
+
+```
+# touch /var/log/acme.sh.log
+# chown acme:acme /var/log/acme.sh.log
+# chmod 600 /var/log/acme.sh.log
+```
+
+Next, obtain your account fingerprint:
+
+```
+# sudo -Hu acme -g acme acme.sh --register-account
+```
+
+You need to add the following to your nginx configuration for the server
+running on port 80:
+
+```
+ location ~ ^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$ {
+ default_type text/plain;
+ return 200 "$1.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd";
+ }
+```
+
+Replace the string after after `$1.` with your fingerprint.
+
+Start nginx:
+
+```
+# service nginx start
+```
+
+It should now be possible to issue a cert (replace `example.com`
+with your domain name):
+
+```
+# sudo -Hu acme -g acme acme.sh --issue -d example.com --stateless
+```
+
+Let's add auto-renewal to `/etc/crontab`
+(replace `example.com` with your domain):
+
+```
+/usr/local/bin/sudo -Hu acme -g acme /usr/local/sbin/acme.sh -r -d example.com --stateless
+```
+
+### Configuring nginx
+
+FreeBSD's default nginx configuration does not contain an include directive, which is
+typically used for multiple sites. Therefore, you will need to first create the required
+directory as follows:
+
+
+```
+# mkdir -p /usr/local/etc/nginx/sites-available
+```
+
+Next, add an `include` directive to `/usr/local/etc/nginx/nginx.conf`, within the `http {}`
+block, as follows:
+
+
+```
+http {
+...
+ include /usr/local/etc/nginx/sites-available/*;
+}
+```
+
+As root, copy `/home/pleroma/pleroma/installation/pleroma.nginx` to
+`/usr/local/etc/nginx/sites-available/pleroma.nginx`.
+
+Edit the defaults of `/usr/local/etc/nginx/sites-available/pleroma.nginx`:
+
+* Change `ssl_trusted_certificate` to `/var/db/acme/certs/example.tld/example.tld.cer`.
+* Change `ssl_certificate` to `/var/db/acme/certs/example.tld/fullchain.cer`.
+* Change `ssl_certificate_key` to `/var/db/acme/certs/example.tld/example.tld.key`.
+* Change all references of `example.tld` to your instance's domain name.
+
+## Creating a startup script for Pleroma
+
+Pleroma will need to compile when it initially starts, which typically takes a longer
+period of time. Therefore, it is good practice to initially run pleroma from the
+command-line before utilizing the rc.d script. That is done as follows:
+
+```
+# su -l pleroma
+$ cd $HOME/pleroma
+$ MIX_ENV=prod mix phx.server
+```
+
+Copy the startup script to the correct location and make sure it's executable:
+
+```
+# cp /home/pleroma/pleroma/installation/freebsd/rc.d/pleroma /usr/local/etc/rc.d/pleroma
+# chmod +x /usr/local/etc/rc.d/pleroma
+```
+
+Update the `/etc/rc.conf` and start pleroma with the following commands:
+
+```
+# sysrc pleroma_enable=YES
+# service pleroma start
+```
+
+#### Create your first user
+
+If your instance is up and running, you can create your first user with administrative rights with the following task:
+
+```shell
+sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress> --admin
+```
+## Conclusion
+
+Restart nginx with `# service nginx restart` and you should be up and running.
+
+Make sure your time is in sync, or other instances will receive your posts with
+incorrect timestamps. You should have ntpd running.
+
+## Questions
+
+Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
diff --git a/docs/installation/further_reading.include b/docs/installation/further_reading.include
new file mode 100644
index 000000000..46752c722
--- /dev/null
+++ b/docs/installation/further_reading.include
@@ -0,0 +1,5 @@
+* [How Federation Works/Why is my Federated Timeline empty?](https://blog.soykaf.com/post/how-federation-works/)
+* [Backup your instance](../administration/backup.md)
+* [Updating your instance](../administration/updating.md)
+* [Hardening your instance](../configuration/hardening.md)
+* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
diff --git a/docs/installation/gentoo_en.md b/docs/installation/gentoo_en.md
index 1e61373cc..5a676380c 100644
--- a/docs/installation/gentoo_en.md
+++ b/docs/installation/gentoo_en.md
@@ -28,6 +28,7 @@ Gentoo quite pointedly does not come with a cron daemon installed, and as such i
* `dev-db/postgresql`
* `dev-lang/elixir`
* `dev-vcs/git`
+* `dev-util/cmake`
#### Optional ebuilds used in this guide
@@ -46,7 +47,7 @@ Gentoo quite pointedly does not come with a cron daemon installed, and as such i
* Emerge all required the required and suggested software in one go:
```shell
- # emerge --ask dev-db/postgresql dev-lang/elixir dev-vcs/git www-servers/nginx app-crypt/certbot app-crypt/certbot-nginx
+ # emerge --ask dev-db/postgresql dev-lang/elixir dev-vcs/git www-servers/nginx app-crypt/certbot app-crypt/certbot-nginx dev-util/cmake
```
If you would not like to install the optional packages, remove them from this line.
@@ -283,10 +284,7 @@ If you opted to allow sudo for the `pleroma` user but would like to remove the a
#### Further reading
-* [Backup your instance](../administration/backup.md)
-* [Hardening your instance](../configuration/hardening.md)
-* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
-* [Updating your instance](../administration/updating.md)
+{! backend/installation/further_reading.include !}
## Questions
diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md
index 31c2f1294..d303a6daf 100644
--- a/docs/installation/migrating_from_source_otp_en.md
+++ b/docs/installation/migrating_from_source_otp_en.md
@@ -8,13 +8,15 @@ You will be running commands as root. If you aren't root already, please elevate
The system needs to have `curl` and `unzip` installed for downloading and unpacking release builds.
-```sh tab="Alpine"
-apk add curl unzip
-```
+=== "Alpine"
+ ```sh
+ apk add curl unzip
+ ```
-```sh tab="Debian/Ubuntu"
-apt install curl unzip
-```
+=== "Debian/Ubuntu"
+ ```sh
+ apt install curl unzip
+ ```
## Moving content out of the application directory
When using OTP releases the application directory changes with every version so it would be a bother to keep content there (and also dangerous unless `--no-rm` option is used when updating). Fortunately almost all paths in Pleroma are configurable, so it is possible to move them out of there.
@@ -110,27 +112,29 @@ OTP releases have different service files than from-source installs so they need
**Warning:** The service files assume pleroma user's home directory is `/opt/pleroma`, please make sure all paths fit your installation.
-```sh tab="Alpine"
-# Copy the service into a proper directory
-cp -f ~pleroma/installation/init.d/pleroma /etc/init.d/pleroma
+=== "Alpine"
+ ```sh
+ # Copy the service into a proper directory
+ cp -f ~pleroma/installation/init.d/pleroma /etc/init.d/pleroma
-# Start pleroma
-rc-service pleroma start
-```
+ # Start pleroma
+ rc-service pleroma start
+ ```
-```sh tab="Debian/Ubuntu"
-# Copy the service into a proper directory
-cp ~pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
+=== "Debian/Ubuntu"
+ ```sh
+ # Copy the service into a proper directory
+ cp ~pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
-# Reload service files
-systemctl daemon-reload
+ # Reload service files
+ systemctl daemon-reload
-# Reenable pleroma to start on boot
-systemctl reenable pleroma
+ # Reenable pleroma to start on boot
+ systemctl reenable pleroma
-# Start pleroma
-systemctl start pleroma
-```
+ # Start pleroma
+ systemctl start pleroma
+ ```
## Running mix tasks
Refer to [Running mix tasks](otp_en.md#running-mix-tasks) section from OTP release installation guide.
diff --git a/docs/installation/netbsd_en.md b/docs/installation/netbsd_en.md
index 6a922a27e..6ad0de2f6 100644
--- a/docs/installation/netbsd_en.md
+++ b/docs/installation/netbsd_en.md
@@ -19,6 +19,7 @@ databases/postgresql11-client
databases/postgresql11-server
devel/git-base
devel/git-docs
+devel/cmake
lang/elixir
security/acmesh
security/sudo
@@ -196,3 +197,11 @@ incorrect timestamps. You should have ntpd running.
## Instances running NetBSD
* <https://catgirl.science>
+
+#### Further reading
+
+{! backend/installation/further_reading.include !}
+
+## Questions
+
+Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
diff --git a/docs/installation/openbsd_en.md b/docs/installation/openbsd_en.md
index e8c5d844c..eee452845 100644
--- a/docs/installation/openbsd_en.md
+++ b/docs/installation/openbsd_en.md
@@ -14,11 +14,12 @@ The following packages need to be installed:
* git
* postgresql-server
* postgresql-contrib
+ * cmake
To install them, run the following command (with doas or as root):
```
-pkg_add elixir gmake ImageMagick git postgresql-server postgresql-contrib
+pkg_add elixir gmake ImageMagick git postgresql-server postgresql-contrib cmake
```
Pleroma requires a reverse proxy, OpenBSD has relayd in base (and is used in this guide) and packages/ports are available for nginx (www/nginx) and apache (www/apache-httpd). Independently of the reverse proxy, [acme-client(1)](https://man.openbsd.org/acme-client) can be used to get a certificate from Let's Encrypt.
@@ -242,3 +243,11 @@ If your instance is up and running, you can create your first user with administ
```
LC_ALL=en_US.UTF-8 MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress> --admin
```
+
+#### Further reading
+
+{! backend/installation/further_reading.include !}
+
+## Questions
+
+Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
diff --git a/docs/installation/openbsd_fi.md b/docs/installation/openbsd_fi.md
index 272273cff..b5b5056a9 100644
--- a/docs/installation/openbsd_fi.md
+++ b/docs/installation/openbsd_fi.md
@@ -16,7 +16,7 @@ Matrix-kanava #freenode_#pleroma:matrix.org ovat hyviä paikkoja löytää apua
Asenna tarvittava ohjelmisto:
-`# pkg_add git elixir gmake postgresql-server-10.3 postgresql-contrib-10.3`
+`# pkg_add git elixir gmake postgresql-server-10.3 postgresql-contrib-10.3 cmake`
Luo postgresql-tietokanta:
diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md
index fb99af699..b7e3bb2ac 100644
--- a/docs/installation/otp_en.md
+++ b/docs/installation/otp_en.md
@@ -28,15 +28,17 @@ Other than things bundled in the OTP release Pleroma depends on:
* nginx (could be swapped with another reverse proxy but this guide covers only it)
* certbot (for Let's Encrypt certificates, could be swapped with another ACME client, but this guide covers only it)
-```sh tab="Alpine"
-echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
-apk update
-apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot
-```
-
-```sh tab="Debian/Ubuntu"
-apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot
-```
+=== "Alpine"
+ ```
+ echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
+ apk update
+ apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot
+ ```
+
+=== "Debian/Ubuntu"
+ ```
+ apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot
+ ```
## Setup
### Configuring PostgreSQL
@@ -47,31 +49,35 @@ apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot
RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. You can read more about them on the [Configuration page](../configuration/cheatsheet.md#rum-indexing-for-full-text-search). They are completely optional and most of the time are not worth it, especially if you are running a single user instance (unless you absolutely need ordered search results).
-```sh tab="Alpine"
-apk add git build-base postgresql-dev
-git clone https://github.com/postgrespro/rum /tmp/rum
-cd /tmp/rum
-make USE_PGXS=1
-make USE_PGXS=1 install
-cd
-rm -r /tmp/rum
-```
-
-```sh tab="Debian/Ubuntu"
-# Available only on Buster/19.04
-apt install postgresql-11-rum
-```
+=== "Alpine"
+ ```
+ apk add git build-base postgresql-dev
+ git clone https://github.com/postgrespro/rum /tmp/rum
+ cd /tmp/rum
+ make USE_PGXS=1
+ make USE_PGXS=1 install
+ cd
+ rm -r /tmp/rum
+ ```
+
+=== "Debian/Ubuntu"
+ ```
+ # Available only on Buster/19.04
+ apt install postgresql-11-rum
+ ```
#### (Optional) Performance configuration
-For optimal performance, you may use [PGTune](https://pgtune.leopard.in.ua), don't forget to restart postgresql after editing the configuration
+It is encouraged to check [Optimizing your PostgreSQL performance](../configuration/postgresql.md) document, for tips on PostgreSQL tuning.
-```sh tab="Alpine"
-rc-service postgresql restart
-```
+=== "Alpine"
+ ```
+ rc-service postgresql restart
+ ```
-```sh tab="Debian/Ubuntu"
-systemctl restart postgresql
-```
+=== "Debian/Ubuntu"
+ ```
+ systemctl restart postgresql
+ ```
If you are using PostgreSQL 12 or higher, add this to your Ecto database configuration
@@ -151,14 +157,16 @@ certbot certonly --standalone --preferred-challenges http -d yourinstance.tld
The location of nginx configs is dependent on the distro
-```sh tab="Alpine"
-cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf
-```
+=== "Alpine"
+ ```
+ cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf
+ ```
-```sh tab="Debian/Ubuntu"
-cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.conf
-ln -s /etc/nginx/sites-available/pleroma.conf /etc/nginx/sites-enabled/pleroma.conf
-```
+=== "Debian/Ubuntu"
+ ```
+ cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.conf
+ ln -s /etc/nginx/sites-available/pleroma.conf /etc/nginx/sites-enabled/pleroma.conf
+ ```
If your distro does not have either of those you can append `include /etc/nginx/pleroma.conf` to the end of the http section in /etc/nginx/nginx.conf and
```sh
@@ -175,35 +183,39 @@ nginx -t
```
#### Start nginx
-```sh tab="Alpine"
-rc-service nginx start
-```
+=== "Alpine"
+ ```
+ rc-service nginx start
+ ```
-```sh tab="Debian/Ubuntu"
-systemctl start nginx
-```
+=== "Debian/Ubuntu"
+ ```
+ systemctl start nginx
+ ```
At this point if you open your (sub)domain in a browser you should see a 502 error, that's because Pleroma is not started yet.
### Setting up a system service
-```sh tab="Alpine"
-# Copy the service into a proper directory
-cp /opt/pleroma/installation/init.d/pleroma /etc/init.d/pleroma
+=== "Alpine"
+ ```
+ # Copy the service into a proper directory
+ cp /opt/pleroma/installation/init.d/pleroma /etc/init.d/pleroma
-# Start pleroma and enable it on boot
-rc-service pleroma start
-rc-update add pleroma
-```
+ # Start pleroma and enable it on boot
+ rc-service pleroma start
+ rc-update add pleroma
+ ```
-```sh tab="Debian/Ubuntu"
-# Copy the service into a proper directory
-cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
+=== "Debian/Ubuntu"
+ ```
+ # Copy the service into a proper directory
+ cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
-# Start pleroma and enable it on boot
-systemctl start pleroma
-systemctl enable pleroma
-```
+ # Start pleroma and enable it on boot
+ systemctl start pleroma
+ systemctl enable pleroma
+ ```
If everything worked, you should see Pleroma-FE when visiting your domain. If that didn't happen, try reviewing the installation steps, starting Pleroma in the foreground and seeing if there are any errrors.
@@ -223,43 +235,45 @@ $EDITOR path-to-nginx-config
nginx -t
```
-```sh tab="Alpine"
-# Restart nginx
-rc-service nginx restart
+=== "Alpine"
+ ```
+ # Restart nginx
+ rc-service nginx restart
-# Start the cron daemon and make it start on boot
-rc-service crond start
-rc-update add crond
+ # Start the cron daemon and make it start on boot
+ rc-service crond start
+ rc-update add crond
-# Ensure the webroot menthod and post hook is working
-certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'rc-service nginx reload'
+ # Ensure the webroot menthod and post hook is working
+ certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'rc-service nginx reload'
-# Add it to the daily cron
-echo '#!/bin/sh
-certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --post-hook "rc-service nginx reload"
-' > /etc/periodic/daily/renew-pleroma-cert
-chmod +x /etc/periodic/daily/renew-pleroma-cert
+ # Add it to the daily cron
+ echo '#!/bin/sh
+ certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --post-hook "rc-service nginx reload"
+ ' > /etc/periodic/daily/renew-pleroma-cert
+ chmod +x /etc/periodic/daily/renew-pleroma-cert
-# If everything worked the output should contain /etc/cron.daily/renew-pleroma-cert
-run-parts --test /etc/periodic/daily
-```
+ # If everything worked the output should contain /etc/cron.daily/renew-pleroma-cert
+ run-parts --test /etc/periodic/daily
+ ```
-```sh tab="Debian/Ubuntu"
-# Restart nginx
-systemctl restart nginx
+=== "Debian/Ubuntu"
+ ```
+ # Restart nginx
+ systemctl restart nginx
-# Ensure the webroot menthod and post hook is working
-certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'systemctl reload nginx'
+ # Ensure the webroot menthod and post hook is working
+ certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'systemctl reload nginx'
-# Add it to the daily cron
-echo '#!/bin/sh
-certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --post-hook "systemctl reload nginx"
-' > /etc/cron.daily/renew-pleroma-cert
-chmod +x /etc/cron.daily/renew-pleroma-cert
+ # Add it to the daily cron
+ echo '#!/bin/sh
+ certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --post-hook "systemctl reload nginx"
+ ' > /etc/cron.daily/renew-pleroma-cert
+ chmod +x /etc/cron.daily/renew-pleroma-cert
-# If everything worked the output should contain /etc/cron.daily/renew-pleroma-cert
-run-parts --test /etc/cron.daily
-```
+ # If everything worked the output should contain /etc/cron.daily/renew-pleroma-cert
+ run-parts --test /etc/cron.daily
+ ```
## Create your first user and set as admin
```sh
@@ -270,10 +284,7 @@ This will create an account withe the username of 'joeuser' with the email addre
## Further reading
-* [Backup your instance](../administration/backup.md)
-* [Hardening your instance](../configuration/hardening.md)
-* [How to activate mediaproxy](../configuration/howto_mediaproxy.md)
-* [Updating your instance](../administration/updating.md)
+{! backend/installation/further_reading.include !}
## Questions
diff --git a/docs/introduction.md b/docs/introduction.md
deleted file mode 100644
index a915c143c..000000000
--- a/docs/introduction.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Introduction to Pleroma
-## What is Pleroma?
-Pleroma is a federated social networking platform, compatible with GNU social, Mastodon and other OStatus and ActivityPub implementations. It is free software licensed under the AGPLv3.
-It actually consists of two components: a backend, named simply Pleroma, and a user-facing frontend, named Pleroma-FE. It also includes the Mastodon frontend, if that's your thing.
-It's part of what we call the fediverse, a federated network of instances which speak common protocols and can communicate with each other.
-One account on an instance is enough to talk to the entire fediverse!
-
-## How can I use it?
-
-Pleroma instances are already widely deployed, a list can be found at <http://distsn.org/pleroma-instances.html>. Information on all existing fediverse instances can be found at <https://fediverse.network/>.
-
-If you don't feel like joining an existing instance, but instead prefer to deploy your own instance, that's easy too!
-Installation instructions can be found in the installation section of these docs.
-
-## I got an account, now what?
-Great! Now you can explore the fediverse! Open the login page for your Pleroma instance (e.g. <https://pleroma.soykaf.com>) and login with your username and password. (If you don't have an account yet, click on Register)
-
-At this point you will have two columns in front of you.
-
-### Left column
-
-- first block: here you can see your avatar, your nickname and statistics (Statuses, Following, Followers). Clicking your profile pic will open your profile.
-Under that you have a text form which allows you to post new statuses. The number on the bottom of the text form is a character counter, every instance can have a different character limit (the default is 5000).
-If you want to mention someone, type @ + name of the person. A drop-down menu will help you in finding the right person.
-Under the text form there are also several visibility options and there is the option to use rich text.
-Under that the icon on the left is for uploading media files and attach them to your post. There is also an emoji-picker and an option to post a poll.
-To post your status, simply press Submit.
-On the top right you will also see a wrench icon. This opens your personal settings.
-
-- second block: Here you can switch between the different timelines:
- - Timeline: all the people that you follow
- - Interactions: here you can switch between different timelines where there was interaction with your account. There is Mentions, Repeats and Favorites, and New follows
- - Direct Messages: these are the Direct Messages sent to you
- - Public Timeline: all the statutes from the local instance
- - The Whole Known Network: all public posts the instance knows about, both local and remote!
- - About: This isn't a Timeline but shows relevant info about the instance. You can find a list of the moderators and admins, Terms of Service, MRF policies and enabled features.
-- Optional third block: This is the Instance panel that can be activated, but is deactivated by default. It's fully customisable and by default has links to the pleroma-fe and Mastodon-fe.
-- fourth block: This is the Notifications block, here you will get notified whenever somebody mentions you, follows you, repeats or favorites one of your statuses.
-
-### Right column
-This is where the interesting stuff happens!
-Depending on the timeline you will see different statuses, but each status has a standard structure:
-
-- Profile pic, name and link to profile. An optional left-arrow if it's a reply to another status (hovering will reveal the reply-to status). Clicking on the profile pic will uncollapse the user's profile.
-- A `+` button on the right allows you to Expand/Collapse an entire discussion thread. It also updates in realtime!
-- An arrow icon allows you to open the status on the instance where it's originating from.
-- The text of the status, including mentions and attachements. If you click on a mention, it will automatically open the profile page of that person.
-- Three buttons (left to right): Reply, Repeat, Favorite. There is also a forth button, this is a dropdown menu for simple moderation like muting the conversation or, if you have moderation rights, delete the status from the server.
-
-### Top right
-
-- The magnifier icon opens the search screen where you can search for statuses, people and hashtags. It's also possible to import statusses from remote servers by pasting the url to the post in the search field.
-- The gear icon gives you general settings
-- If you have admin rights, you'll see an icon that opens the admin interface
-- The last icon is to log out
-
-### Bottom right
-On the bottom right you have a chatbox. Here you can communicate with people on the same instance in realtime. It is local-only, for now, but there are plans to make it extendable to the entire fediverse!
-
-### Mastodon interface
-If the Pleroma interface isn't your thing, or you're just trying something new but you want to keep using the familiar Mastodon interface, we got that too!
-Just add a "/web" after your instance url (e.g. <https://pleroma.soycaf.com/web>) and you'll end on the Mastodon web interface, but with a Pleroma backend! MAGIC!
-The Mastodon interface is from the Glitch-soc fork. For more information on the Mastodon interface you can check the [Mastodon](https://docs.joinmastodon.org/) and [Glitch-soc](https://glitch-soc.github.io/docs/) documentation.
-
-Remember, what you see is only the frontend part of Mastodon, the backend is still Pleroma.