Update docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
1ee3ba5fd3
commit
45e70ca6ab
5 changed files with 77 additions and 7 deletions
|
@ -1751,3 +1751,70 @@ Note that this differs from the Mastodon API variant: Mastodon API only returns
|
||||||
```json
|
```json
|
||||||
{}
|
{}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `GET /api/v1/pleroma/admin/domains`
|
||||||
|
|
||||||
|
### List of domains
|
||||||
|
|
||||||
|
- Response: JSON, list of domains
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "1",
|
||||||
|
"domain": "example.org",
|
||||||
|
"public": false,
|
||||||
|
"resolves": true,
|
||||||
|
"last_checked_at": "2023-11-17T12:13:05"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
## `POST /api/v1/pleroma/admin/domains`
|
||||||
|
|
||||||
|
### Create a domain
|
||||||
|
|
||||||
|
- Params:
|
||||||
|
- `domain`: string, required, domain name
|
||||||
|
- `public`: boolean, optional, defaults to false, whether it is possible to register an account under the domain by everyone
|
||||||
|
|
||||||
|
- Response: JSON, created announcement
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "1",
|
||||||
|
"domain": "example.org",
|
||||||
|
"public": true,
|
||||||
|
"resolves": false,
|
||||||
|
"last_checked_at": null
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## `POST /api/v1/pleroma/admin/domains/:id`
|
||||||
|
|
||||||
|
### Change domain publicity
|
||||||
|
|
||||||
|
- Params:
|
||||||
|
- `public`: boolean, whether it is possible to register an account under the domain by everyone
|
||||||
|
|
||||||
|
- Response: JSON, updated domain
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "1",
|
||||||
|
"domain": "example.org",
|
||||||
|
"public": false,
|
||||||
|
"resolves": true,
|
||||||
|
"last_checked_at": "2023-11-17T12:13:05"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## `DELETE /api/v1/pleroma/admin/domains/:id`
|
||||||
|
|
||||||
|
### Delete a domain
|
||||||
|
|
||||||
|
- Response: JSON, empty object
|
||||||
|
|
||||||
|
```json
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
|
@ -298,6 +298,7 @@ Has these additional parameters (which are the same as in Pleroma-API):
|
||||||
- `captcha_answer_data`: optional, contains provider-specific captcha data
|
- `captcha_answer_data`: optional, contains provider-specific captcha data
|
||||||
- `token`: invite token required when the registrations aren't public.
|
- `token`: invite token required when the registrations aren't public.
|
||||||
- `language`: optional, user's preferred language for receiving emails (digest, confirmation, etc.), default to the language set in the `userLanguage` cookies or `Accept-Language` header.
|
- `language`: optional, user's preferred language for receiving emails (digest, confirmation, etc.), default to the language set in the `userLanguage` cookies or `Accept-Language` header.
|
||||||
|
- `domain`: optional, domain id, if multitenancy is enabled.
|
||||||
|
|
||||||
## Instance
|
## Instance
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,8 @@ test "it returns a json representation of the user with accept application/ld+js
|
||||||
test "it returns a json representation of a local user domain different from host", %{
|
test "it returns a json representation of a local user domain different from host", %{
|
||||||
conn: conn
|
conn: conn
|
||||||
} do
|
} do
|
||||||
user = insert(:user, %{
|
user =
|
||||||
|
insert(:user, %{
|
||||||
nickname: "nick@example.org"
|
nickname: "nick@example.org"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,7 @@ test "works for ap_ids" do
|
||||||
test "works for fqns with domains other than host" do
|
test "works for fqns with domains other than host" do
|
||||||
user = insert(:user, %{nickname: "nick@example.org"})
|
user = insert(:user, %{nickname: "nick@example.org"})
|
||||||
|
|
||||||
{:ok, result} =
|
{:ok, result} = WebFinger.webfinger("#{user.nickname})}", "XML")
|
||||||
WebFinger.webfinger("#{user.nickname})}", "XML")
|
|
||||||
|
|
||||||
assert is_binary(result)
|
assert is_binary(result)
|
||||||
end
|
end
|
||||||
|
@ -50,8 +49,7 @@ test "works for fqns with domains other than host" do
|
||||||
test "doesn't work for remote users" do
|
test "doesn't work for remote users" do
|
||||||
user = insert(:user, %{local: false})
|
user = insert(:user, %{local: false})
|
||||||
|
|
||||||
assert {:error, _} =
|
assert {:error, _} = WebFinger.webfinger("#{user.nickname})}", "XML")
|
||||||
WebFinger.webfinger("#{user.nickname})}", "XML")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
3
uploads/.gitignore
vendored
Normal file
3
uploads/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Git will ignore everything in this directory except this file.
|
||||||
|
*
|
||||||
|
!.gitignore
|
Loading…
Reference in a new issue