diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Admin-API.md | 225 | ||||
-rw-r--r-- | docs/Differences-in-MastodonAPI-Responses.md | 4 | ||||
-rw-r--r-- | docs/config.md | 28 |
3 files changed, 193 insertions, 64 deletions
diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 016444d58..407647645 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -1,108 +1,207 @@ # Admin API + Authentication is required and the user must be an admin. +## `/api/pleroma/admin/users` + +### List users + +- Method `GET` +- Params: + - `page`: **integer** page number + - `page_size`: **integer** number of users per page (default is `50`) +- Response: + +```JSON +{ + "page_size": integer, + "count": integer, + "users": [ + { + "deactivated": bool, + "id": integer, + "nickname": string + }, + ... + ] +} +``` + +## `/api/pleroma/admin/users/search?query={query}&local={local}&page={page}&page_size={page_size}` + +### Search users by name or nickname + +- Method `GET` +- Params: + - `query`: **string** search term + - `local`: **bool** whether to return only local users + - `page`: **integer** page number + - `page_size`: **integer** number of users per page (default is `50`) +- Response: + +```JSON +{ + "page_size": integer, + "count": integer, + "users": [ + { + "deactivated": bool, + "id": integer, + "nickname": string + }, + ... + ] +} +``` + ## `/api/pleroma/admin/user` + ### Remove a user -* Method `DELETE` -* Params: - * `nickname` -* Response: User’s nickname + +- Method `DELETE` +- Params: + - `nickname` +- Response: User’s nickname + ### Create a user -* Method: `POST` -* Params: - * `nickname` - * `email` - * `password` -* Response: User’s nickname + +- Method: `POST` +- Params: + - `nickname` + - `email` + - `password` +- Response: User’s nickname + +## `/api/pleroma/admin/users/:nickname/toggle_activation` + +### Toggle user activation + +- Method: `PATCH` +- Params: + - `nickname` +- Response: User’s object + +```JSON +{ + "deactivated": bool, + "id": integer, + "nickname": string +} +``` ## `/api/pleroma/admin/users/tag` + ### Tag a list of users -* Method: `PUT` -* Params: - * `nickname` - * `tags` + +- Method: `PUT` +- Params: + - `nickname` + - `tags` + ### Untag a list of users -* Method: `DELETE` -* Params: - * `nickname` - * `tags` + +- Method: `DELETE` +- Params: + - `nickname` + - `tags` ## `/api/pleroma/admin/permission_group/:nickname` + ### Get user user permission groups membership -* Method: `GET` -* Params: none -* Response: + +- Method: `GET` +- Params: none +- Response: + ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` ## `/api/pleroma/admin/permission_group/:nickname/:permission_group` + Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. ### Get user user permission groups membership -* Method: `GET` -* Params: none -* Response: + +- Method: `GET` +- Params: none +- Response: + ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` + ### Add user in permission group -* Method: `POST` -* Params: none -* Response: - * On failure: ``{"error": "…"}`` - * On success: JSON of the ``user.info`` + +- Method: `POST` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` + ### Remove user from permission group -* Method: `DELETE` -* Params: none -* Response: - * On failure: ``{"error": "…"}`` - * On success: JSON of the ``user.info`` -* Note: An admin cannot revoke their own admin status. + +- Method: `DELETE` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` +- Note: An admin cannot revoke their own admin status. ## `/api/pleroma/admin/activation_status/:nickname` ### Active or deactivate a user -* Method: `PUT` -* Params: - * `nickname` - * `status` BOOLEAN field, false value means deactivation. + +- Method: `PUT` +- Params: + - `nickname` + - `status` BOOLEAN field, false value means deactivation. ## `/api/pleroma/admin/relay` + ### Follow a Relay -* Methods: `POST` -* Params: - * `relay_url` -* Response: - * On success: URL of the followed relay + +- Methods: `POST` +- Params: + - `relay_url` +- Response: + - On success: URL of the followed relay + ### Unfollow a Relay -* Methods: `DELETE` -* Params: - * `relay_url` -* Response: - * On success: URL of the unfollowed relay + +- Methods: `DELETE` +- Params: + - `relay_url` +- Response: + - On success: URL of the unfollowed relay ## `/api/pleroma/admin/invite_token` + ### Get a account registeration invite token -* Methods: `GET` -* Params: none -* Response: invite token (base64 string) + +- Methods: `GET` +- Params: none +- Response: invite token (base64 string) ## `/api/pleroma/admin/email_invite` + ### Sends registration invite via email -* Methods: `POST` -* Params: - * `email` - * `name`, optionnal + +- Methods: `POST` +- Params: + - `email` + - `name`, optionnal ## `/api/pleroma/admin/password_reset` + ### Get a password reset token for a given nickname -* Methods: `GET` -* Params: none -* Response: password reset token (base64 string) + +- Methods: `GET` +- Params: none +- Response: password reset token (base64 string) diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index f6a5b6461..3026e1173 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -9,3 +9,7 @@ Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mas ## 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. + +## Timelines + +Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users. diff --git a/docs/config.md b/docs/config.md index 6647549a2..d1bf2a6f4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -100,13 +100,14 @@ config :pleroma, Pleroma.Mailer, * `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. +* `max_report_size`: The maximum size of the report comment (Default: `1000`) ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed: ``` -config :logger, +config :logger, backends: [{ExSyslogger, :ex_syslogger}] config :logger, :ex_syslogger, @@ -300,3 +301,28 @@ For each pool, the options are: * `max_connections` - how much connections a pool can hold * `timeout` - retention duration for connections +## :auto_linker + +Configuration for the `auto_linker` library: + +* `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.) + +Example: + +```exs +config :auto_linker, + opts: [ + scheme: true, + extra: true, + class: false, + strip_prefix: false, + new_window: false, + rel: false + ] +``` |