diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-25 19:04:29 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-25 19:04:29 +0100 |
commit | 7ded0f89080275d9a59e5155e1459ad7bf28509b (patch) | |
tree | 92cc7d92e8c1635fb2f5a4f4dab64d0ab9805a15 /doc | |
parent | cd6b484d24b638f08221ff1388564d8369d37126 (diff) | |
download | jellything-7ded0f89080275d9a59e5155e1459ad7bf28509b.tar jellything-7ded0f89080275d9a59e5155e1459ad7bf28509b.tar.bz2 jellything-7ded0f89080275d9a59e5155e1459ad7bf28509b.tar.zst |
more doc + api
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.md | 8 | ||||
-rw-r--r-- | doc/SUMMARY.md | 1 | ||||
-rw-r--r-- | doc/api.md | 55 | ||||
-rw-r--r-- | doc/getting-started/installation.md | 16 | ||||
-rw-r--r-- | doc/getting-started/launch.md | 1 | ||||
-rw-r--r-- | doc/getting-started/setup.md | 1 |
6 files changed, 80 insertions, 2 deletions
diff --git a/doc/README.md b/doc/README.md index 978fa48..213100c 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,3 +1,9 @@ # Introduction -Jellything is a server software to serve media like movies, videos and music through a website. +Jellything is a free server software to serve media like movies, videos and +music through a website. + +## Source Code + +- [Main Source Repo](https://codeberg.org/metamuffin/jellything) +- [Assets Repo](https://codeberg.org/metamuffin/jellything-assets) diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md index 9e8f4ab..9ce623e 100644 --- a/doc/SUMMARY.md +++ b/doc/SUMMARY.md @@ -10,3 +10,4 @@ - [Paths](paths.md) - [Import Guide](import/README.md) - [Metadata Providers](import/providers.md) +- [API](api.md) diff --git a/doc/api.md b/doc/api.md new file mode 100644 index 0000000..0b89be5 --- /dev/null +++ b/doc/api.md @@ -0,0 +1,55 @@ +# Jellything API + +Most endpoints require the `Accept` header to be present and set to +`application/json` and `image/avif` respectively. Any endpoint returning JSON, will report errors with an +object containing error string in the `error` key. Routes marked with `*` +require authentification. + +The `jellyclient` crate already implements most API functionality. The +`jellycommon` crate provides useful structs for deserializing data (also +reexported in jellyclient). + +```toml +# Cargo.toml +[depedencies] +jellyclient = { git = "https://codeberg.org/metamuffin/jellything.git" } +``` + +## General + +### GET `/api/version` +Returns API version number. + +### POST `/api/create_session` +Request body contains JSON with keys `username`, `password`, `expire` (in +seconds) and `drop_permissions` (a list of permissions, that this session cannot +use). The Response contains the session cookie as a string in JSON. + +### GET* `/n/<id>` +Request a library node (either a directory or item). Returns it as `NodePublic`. + +### GET* `/n/<id>/extended` +Request extended informationf for library node. Returns it as `ExtendedNode`. + +## Assets + +All asset endpoints redirect to the asset that you need. Returned images are +coded with AVIF. The `width` parameter is the width of the resolution you want to image to be. + +> [!WARNING] +> The actual returned resolution must not be exactly what you requested. + +### GET* `/n/<id>/asset?<role>&<width>` +Where `role` is one of `backdrop` or `poster` and + +### GET* `/n/<id>/thumbnail?<t>&<width>` +Returns a single frame from some track video of the media at a given time `t`. + +### GET* `/n/<id>/person/<index>/asset?<group>&<width>` +Returns headshot of a person from that node. + +## Stream + +### GET* `/stream/<id>?<format>&<index>&<profile>&<index>&<tracks>&<webm>` +Responds with the stream directly or a redirect to the actual source in case of +federation. diff --git a/doc/getting-started/installation.md b/doc/getting-started/installation.md index 7496b16..ee59ee7 100644 --- a/doc/getting-started/installation.md +++ b/doc/getting-started/installation.md @@ -13,6 +13,20 @@ makepkg -si ## From source +Requirements: + +- rustup +- esbuild +- nasm +- meson +- ninja +- cmake +- dav1d +- ffmpeg (only if you use transcoding) + +Jellything was only tested on `x86_64-unknown-linux-gnu` and +`aarch64-unknown-linux-gnu`. Others _might_ work. + ```sh git clone --recursive https://codeberg.org/metamuffin/jellything.git cd jellything @@ -21,4 +35,4 @@ cargo build --release cp target/release/{jellything,jellytool} /usr/local/bin # User installation cp target/release/{jellything,jellytool} ~/.local/bin -```
\ No newline at end of file +``` diff --git a/doc/getting-started/launch.md b/doc/getting-started/launch.md index d1d502f..8cabcf6 100644 --- a/doc/getting-started/launch.md +++ b/doc/getting-started/launch.md @@ -17,3 +17,4 @@ JELLYTHING_CONFIG=/etc/jellything.yaml jellything It is also advised to use jellything with a reverse proxy. Configure the network interface with the environment variables `BIND_ADDR` and `PORT`. Stderr logging can be configured with `LOG`. + diff --git a/doc/getting-started/setup.md b/doc/getting-started/setup.md index 24182fc..a189cf6 100644 --- a/doc/getting-started/setup.md +++ b/doc/getting-started/setup.md @@ -10,6 +10,7 @@ First write your configuration files whereever you want. The AUR package uses hostname: example.org brand: "Jellything" slogan: "" +admin_username: admin # All of these paths can be customized. See "Paths" media_path: "/srv/media" |