From e4e4862d782993a334de92da4bc87c9af5eebeee Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 16 Jun 2024 13:25:26 -0400 Subject: [PATCH] more docs --- docs/api.md | 12 +++++++----- docs/configuration.md | 3 +++ docs/internals/journal.md | 9 ++++----- neodb-takahe | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/api.md b/docs/api.md index 149f53d5..06d65e2f 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,5 +1,7 @@ # API +## Endpoints + NeoDB has a set of API endpoints mapping to its functions like marking a book or listing collections, they can be found in swagger based API documentation at `/developer/` of your running instance, [a version of it](https://neodb.social/developer/) is available on our flagship instance. NeoDB also supports a subset of Mastodon API, details can be found in [Mastodon API documentation](https://docs.joinmastodon.org/api/). @@ -8,7 +10,7 @@ Both set of APIs can be accessed by the same access token. ## How to authorize -0. Create an application +### Create an application you must have at least one URL included in the Redirect URIs field, e.g. `https://example.org/callback`, or use `urn:ietf:wg:oauth:2.0:oob` if you don't have a callback URL. @@ -33,19 +35,19 @@ and save of the `client_id` and `client_secret` returned in the response: ``` -1. Guide your user to open this URL +### Guide your user to open this URL ``` https://neodb.social/oauth/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=https://example.org/callback&scope=read+write ``` -2. Once authorizated by user, it will redirect to `https://example.org/callback` with a `code` parameter: +### Once authorizated by user, it will redirect to `https://example.org/callback` with a `code` parameter: ``` https://example.org/callback?code=AUTH_CODE ``` -3. Obtain access token with the following POST request: +### Obtain access token with the following POST request: ``` curl https://neodb.social/oauth/token \ @@ -66,7 +68,7 @@ and access token will be returned in the response: } ``` -4. Use the access token to access protected endpoints like `/api/me` +### Use the access token to access protected endpoints like `/api/me` ``` curl -H "Authorization: Bearer ACCESS_TOKEN" -X GET https://neodb.social/api/me diff --git a/docs/configuration.md b/docs/configuration.md index f1a97088..b228e079 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -16,6 +16,9 @@ if you are doing debug or development: - NEODB_DEBUG - True will turn on debug for both neodb and takahe, turn off relay, and reveal self as debug mode in nodeinfo (so peers won't try to run fedi search on you) - NEODB_IMAGE - the docker image to use, `neodb/neodb:edge` for the main branch +## Settings for Federating + + - `DISABLE_DEFAULT_RELAY` is set to `False` by default, the server will send and receive public posts from `relay.neodb.net`. `relay.neodb.net` is [open sourced](https://github.com/neodb-social/neodb-relay) and operated by NeoDB developers, it works like most ActivityPub relays except it only relays between NeoDB instances, it helps public information like catalogs and trends flow between NeoDB instances. You may set it to `True` if you don't want to relay public posts with other NeoDB instances. ## Settings for Scrapers diff --git a/docs/internals/journal.md b/docs/internals/journal.md index e1a016ff..d2785ac3 100644 --- a/docs/internals/journal.md +++ b/docs/internals/journal.md @@ -38,11 +38,10 @@ class Comment { } Content <|-- Note class Note { - +str text - +int position - +enum position_type - +str quotation - +Image image + +str title + +str content + +enum progress_type + +str progress_value } Content <|-- Reply diff --git a/neodb-takahe b/neodb-takahe index d280504f..3f3f1ee9 160000 --- a/neodb-takahe +++ b/neodb-takahe @@ -1 +1 @@ -Subproject commit d280504f93b0c0203a0d7a5ccea1004f39bc18f9 +Subproject commit 3f3f1ee9929f9086aecd15f5e023988f26d1ccef