mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
docs: 📝 Updated documentation for Lysand 0.4
Updated outdated documentation in preparation for the release of Lysand 0.4
This commit is contained in:
parent
5e9e05826b
commit
2e2b91d7a5
6 changed files with 153 additions and 222 deletions
24
docs/cli.md
Normal file
24
docs/cli.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Lysand CLI
|
||||
|
||||
Lysand includes a built-in, scripting-compatible CLI that can be used to manage the server. This CLI can be used to create and delete users, manage the database and more. It can also output data in JSON or CSV format, making it easy to use in scripts.
|
||||
|
||||
## Using the CLI
|
||||
|
||||
Lysand includes a built-in CLI for managing the server. To use it, simply run the following command:
|
||||
|
||||
```bash
|
||||
# Development
|
||||
bun cli help
|
||||
# Source installs
|
||||
bun run dist/cli.js help
|
||||
# Docker
|
||||
docker compose exec -it lysand /bin/sh /app/entrypoint.sh cli help
|
||||
```
|
||||
|
||||
You can use the `help` command to see a list of available commands. These include creating users, deleting users and more. Each command also has a `--help,-h` flag that you can use to see more information about the command.
|
||||
|
||||
## Scripting with the CLI
|
||||
|
||||
Some CLI commands that return data as tables can be used in scripts. To convert them to JSON or CSV, some commands allow you to specify a `--format` flag that can be either `"json"` or `"csv"`. See `bun cli help` or `bun cli <command> -h` for more information.
|
||||
|
||||
Flags can be used in any order and anywhere in the script (except for the `bun cli` command itself). The command arguments themselves must be in the correct order, however.Z
|
||||
10
docs/database.md
Normal file
10
docs/database.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Installing the database
|
||||
|
||||
Lysand uses a special PostgreSQL extension called `pg_uuidv7` to generate UUIDs. This extension is required for Lysand to work properly. To install it, you can either use the pre-made Docker image or install it manually.
|
||||
|
||||
## Using the Docker image
|
||||
|
||||
Lysand offers a pre-made Docker image for PostgreSQL with the extension already installed. Use `ghcr.io/lysand-org/postgres:main` as your Docker image name to use it.
|
||||
|
||||
## Manual installation
|
||||
|
||||
84
docs/installation.md
Normal file
84
docs/installation.md
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
# Installation
|
||||
|
||||
### Requirements
|
||||
|
||||
- The [Bun Runtime](https://bun.sh), version 1.0.30 or later (usage of the latest version is recommended)
|
||||
- A PostgreSQL database
|
||||
- (Optional but recommended) A Linux-based operating system
|
||||
- (Optional if you want search) A working Meiliseach instance
|
||||
|
||||
> [!WARNING]
|
||||
> Lysand has not been tested on Windows or MacOS. It is recommended to use a Linux-based operating system to run Lysand.
|
||||
>
|
||||
> We will not be offerring support to Windows or MacOS users. If you are using one of these operating systems, please use a virtual machine or container to run Lysand.
|
||||
|
||||
### With Docker
|
||||
|
||||
Docker is the recommended way to run Lysand (podman should also work). To run Lysand with Docker, follow these steps:
|
||||
|
||||
1. Download the `docker-compose.yml` file from the repository
|
||||
|
||||
```bash
|
||||
curl -o docker-compose.yml https://raw.githubusercontent.com/lysand-org/lysand/main/docker-compose.yml
|
||||
```
|
||||
2. Edit the `docker-compose.yml` file to set up the database connection and other settings
|
||||
3. Download the `config.toml.example` file from the repository
|
||||
|
||||
```bash
|
||||
curl -o config.toml.example https://raw.githubusercontent.com/lysand-org/lysand/main/config.toml.example
|
||||
```
|
||||
4. Edit the `config.toml.example` file to set up the database connection and other settings, then place it inside `config/` (create the `config/` directory if it does not exist)
|
||||
5. Run the following command to start the server:
|
||||
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
You may need root privileges to run Docker commands.
|
||||
|
||||
### From Source
|
||||
|
||||
1. Clone this repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/lysand-org/lysand.git
|
||||
```
|
||||
|
||||
2. Install the dependencies
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
1. Set up a PostgreSQL database (you need a special extension, please look at [the database documentation](database.md))
|
||||
|
||||
2. (If you want search)
|
||||
Create a Meilisearch instance (using Docker is recommended). For a [`docker-compose`] file, copy the `meilisearch` service from the [`docker-compose.yml`](docker-compose.yml) file.
|
||||
|
||||
Set up Meiliseach's API key by passing the `MEILI_MASTER_KEY` environment variable to the server. Then, enable and configure search in the config file.
|
||||
|
||||
3. Build everything:
|
||||
|
||||
```bash
|
||||
bun prod-build
|
||||
```
|
||||
|
||||
4. Copy the `config.toml.example` file to `config.toml` inside `dist/config/` and fill in the values (you can leave most things to the default, but you will need to configure things such as the database connection)
|
||||
|
||||
You may now start the server with `bun start`. It lives in the `dist/` directory, all the other code can be removed from this point onwards.
|
||||
|
||||
### Running the Server
|
||||
|
||||
Database migrations are run automatically on startup.
|
||||
|
||||
You may use the environment variables `NO_COLORS=true` and `NO_FANCY_DATES=true` to disable colors and date formatting in the console logs: the file logs will never have colors or fancy dates.
|
||||
|
||||
Please see the [CLI documentation](cli.md) for more information on how to use the CLI.
|
||||
|
||||
### Updating the server
|
||||
|
||||
Updating the server is as simple as pulling the latest changes from the repository and running `bun prod-build` again. You may need to run `bun install` again if there are new dependencies.
|
||||
|
||||
For Docker, you can run `docker-compose pull` to update the Docker images.
|
||||
|
||||
Sometimes, new configuration options are added to `config.example.toml`. If you see a new option in the example file, you should add it to your `config.toml` file.
|
||||
Loading…
Add table
Add a link
Reference in a new issue