From 3d24ee60cb84fd2b3cc8194fbdc2de7f20679466 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 9 Oct 2023 00:43:25 -0400 Subject: [PATCH] [docs] dependency docs --- .../config_reference/_category_.json | 2 +- .../installing_trifid_api/_category_.json | 8 +++ .../installing_trifid_api/dependencies.mdx | 68 +++++++++++++++++++ docs/docs/trifid-api/intro.md | 2 +- 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 docs/docs/trifid-api/installing_trifid_api/_category_.json create mode 100644 docs/docs/trifid-api/installing_trifid_api/dependencies.mdx diff --git a/docs/docs/trifid-api/config_reference/_category_.json b/docs/docs/trifid-api/config_reference/_category_.json index 31958ef..cb933e2 100644 --- a/docs/docs/trifid-api/config_reference/_category_.json +++ b/docs/docs/trifid-api/config_reference/_category_.json @@ -1,6 +1,6 @@ { "label": "Configuration Reference", - "position": 2, + "position": 3, "link": { "type": "generated-index", "description": "Configuration options for trifid-api." diff --git a/docs/docs/trifid-api/installing_trifid_api/_category_.json b/docs/docs/trifid-api/installing_trifid_api/_category_.json new file mode 100644 index 0000000..89213e4 --- /dev/null +++ b/docs/docs/trifid-api/installing_trifid_api/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Installing trifid-api", + "position": 2, + "link": { + "type": "generated-index", + "description": "Directions on installing trifid-api." + } +} diff --git a/docs/docs/trifid-api/installing_trifid_api/dependencies.mdx b/docs/docs/trifid-api/installing_trifid_api/dependencies.mdx new file mode 100644 index 0000000..32c743b --- /dev/null +++ b/docs/docs/trifid-api/installing_trifid_api/dependencies.mdx @@ -0,0 +1,68 @@ +--- +sidebar_position: 1 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; + +# Dependencies + +trifid-api requires a few dependencies to compile and run. + +In short, you need: +- the Rust toolchain +- a PostgreSQL database + +More details and instructions follow. + +## Rust Toolchain + +trifid-api is a Rust application, and thus needs the Rust toolchain installed to compile it. Pre-built binaries for trifid-api are planned, but currently not available. It is reccomended that you use [rustup](https://rustup.rs) to install the Rust toolchain. + + + + trifid-api does not run very well on Windows. It is reccomended that you use macOS or Linux for a production deployment. + If you wish to continue anyway, download and run the rustup installer. + + + + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + + + + + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + + + + +## PostgreSQL + +PostgreSQL is the database that trifid-api uses, and you must have a functional PostgreSQL database to do this. +Instructions on how to install PostgreSQL is left up to the reader. Once Postgres is installed, come back here for database setup instructions. + +## Creating the database + +trifid-api must run on its own isolated database with its own isolated user, for security. Open a psql prompt with superuser access, and run the following commands to create your database and user: + +:::danger +Please use a secure password for your database. A good way to generate this is with `openssl rand -hex 32` if you have OpenSSL installed. +::: + +```sql +CREATE DATABASE trifid; +CREATE USER trifid WITH ENCRYPTED PASSWORD ''; +GRANT ALL PRIVILEGES ON DATABASE trifid TO trifid; +GRANT ALL PRIVILEGES ON SCHEMA public TO trifid; +\c trifid +GRANT ALL PRIVILEGES ON DATABASE trifid TO trifid; +GRANT ALL PRIVILEGES ON SCHEMA public TO trifid; +``` + +Once this is complete, your Postgres connection url will look like: + +``` +postgres://trifid:@/trifid +``` + +Once this is complete, you are ready to compile trifid-api! diff --git a/docs/docs/trifid-api/intro.md b/docs/docs/trifid-api/intro.md index 48a10e7..8d2004f 100644 --- a/docs/docs/trifid-api/intro.md +++ b/docs/docs/trifid-api/intro.md @@ -9,4 +9,4 @@ trifid-api is a complete reimplementation of the [Defined Networking](https://de :::caution Although trifid-api is battle-tested and has been used in production networks for months with no major issues, it should still be considered experimental software. Please, [report any bugs you find](https://git.e3t.cc/core/trifid/issues) to assist with further development of trifid-api. -::: \ No newline at end of file +:::