mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
docs: 📝 Update installation documentation to match latest guidelines
This commit is contained in:
parent
7a6b93a36c
commit
844fbf7c9e
|
|
@ -34,19 +34,10 @@ export default defineConfig({
|
||||||
],
|
],
|
||||||
|
|
||||||
sidebar: [
|
sidebar: [
|
||||||
{
|
|
||||||
text: "Setup",
|
|
||||||
items: [
|
|
||||||
{
|
{
|
||||||
text: "Installation",
|
text: "Installation",
|
||||||
link: "/setup/installation",
|
link: "/setup/installation",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: "Database",
|
|
||||||
link: "/setup/database",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: "CLI",
|
text: "CLI",
|
||||||
link: "/cli",
|
link: "/cli",
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Versia Server includes a built-in CLI for managing the server. To use it, simply
|
||||||
```bash
|
```bash
|
||||||
# Docker
|
# Docker
|
||||||
# Replace `versia` with the name of your container
|
# Replace `versia` with the name of your container
|
||||||
docker compose exec -it versia /bin/sh /app/entrypoint.sh cli help
|
docker compose exec -it versia 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.
|
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.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# Installing the database
|
|
||||||
|
|
||||||
Versia Server uses a special PostgreSQL extension called `pg_uuidv7` to generate UUIDs. This extension is required for Versia Server to work properly. To install it, you can either use the pre-made Docker image or install it manually.
|
|
||||||
|
|
||||||
## Using the Docker image
|
|
||||||
|
|
||||||
Versia Server offers a pre-made Docker image for PostgreSQL with the extension already installed. Use `ghcr.io/versia-pub/postgres:main` as your Docker image name to use it.
|
|
||||||
|
|
@ -5,36 +5,40 @@
|
||||||
- A Linux-based operating system. Kernel version `6.1` or later is recommended.
|
- A Linux-based operating system. Kernel version `6.1` or later is recommended.
|
||||||
- Basic knowledge of Docker and Docker Compose.
|
- Basic knowledge of Docker and Docker Compose.
|
||||||
|
|
||||||
## Installation
|
Traditional "from-source" installation is not supported, as this software is designed to be run in a containerized environment. This guide will cover how to run the server using Docker.
|
||||||
|
|
||||||
> [!INFO]
|
## Installation
|
||||||
>
|
|
||||||
> Traditional "from-source" installation is not supported, as the server is designed to be run in a containerized environment. This guide will cover how to run the server using Docker.
|
|
||||||
>
|
|
||||||
> You may still run the server without Docker, but I can't guarantee that it will work properly.
|
|
||||||
|
|
||||||
1. Download the `docker-compose.yml` file from the repository
|
1. Download the `docker-compose.yml` file from the repository
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> You may need to change the image from `ghcr.io/versia-pub/server:latest` to `ghcr.io/versia-pub/server:main` if you want to use the latest changes from the `main` branch. Make sure to use the config template from the same branch as the server.
|
> You may need to change the image from `ghcr.io/versia-pub/server:latest` to `ghcr.io/versia-pub/server:main` if you want to use the latest changes from the `main` branch.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -o docker-compose.yml https://raw.githubusercontent.com/versia-pub/server/v0.7.0/docker-compose.yml
|
# Set this to "main" for the development build
|
||||||
|
TAG=v0.7.0
|
||||||
|
curl -o docker-compose.yml https://raw.githubusercontent.com/versia-pub/server/$TAG/docker-compose.yml
|
||||||
```
|
```
|
||||||
1. Edit the `docker-compose.yml` file to set up the database connection and other settings
|
|
||||||
2. Download the `config.example.toml` file from the repository
|
2. Edit the `docker-compose.yml` file to your liking, e.g removing the `db` service if you want to use an existing database.
|
||||||
|
|
||||||
|
3. Download the `config.example.toml` file from the repository
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -o config.example.toml https://raw.githubusercontent.com/versia-pub/server/v0.7.0/config/config.example.toml
|
# This should be the same as the TAG variable above
|
||||||
|
TAG=v0.7.0
|
||||||
|
curl -o config.example.toml https://raw.githubusercontent.com/versia-pub/server/$TAG/config/config.example.toml
|
||||||
```
|
```
|
||||||
4. Edit the `config.example.toml` file to set up the database connection and other settings, rename it to `config.toml`, then place it inside `config/` (create the `config/` directory if it does not exist)
|
|
||||||
5. Run the following command to start the server:
|
4. Edit the `config.example.toml` to your liking. You will at least need to change the `postgres`, `redis` and `http` sections to match your environment.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> The first time you start the server, it will complain about missing keys in the configuration file.
|
> The first time you start the server, it will complain about missing keys in the configuration file.
|
||||||
>
|
>
|
||||||
> These will be autogenerated and printed to the console, so you can copy them to your `config.toml` file.
|
> These will be autogenerated and printed to the console, so you can copy them to your `config.toml` file.
|
||||||
|
|
||||||
|
5. Run the following command to start the server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
@ -43,6 +47,44 @@ You may need root privileges to run Docker commands.
|
||||||
|
|
||||||
To check server logs, run `docker compose logs versia`. The server will likely stop if there is an error, so you can check the logs to see what went wrong.
|
To check server logs, run `docker compose logs versia`. The server will likely stop if there is an error, so you can check the logs to see what went wrong.
|
||||||
|
|
||||||
|
## Installing the frontend
|
||||||
|
|
||||||
|
The frontend is not included in the Docker image, so you will need to install it separately.
|
||||||
|
|
||||||
|
To do this, you may copy the static files from our frontend's Docker image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# The frontend does not have a stable tag, so we use the main branch
|
||||||
|
TAG=main
|
||||||
|
OUTDIR=./frontend
|
||||||
|
TEMP=$(sudo docker create ghcr.io/versia-pub/frontend:$TAG)
|
||||||
|
sudo docker cp $TEMP:/app/public $OUTDIR
|
||||||
|
sudo docker rm $TEMP
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
>
|
||||||
|
> This command can be re-run to update the frontend to the latest version.
|
||||||
|
|
||||||
|
Then, set the following bind mount in your `docker-compose.yml` file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
versia:
|
||||||
|
...
|
||||||
|
volumes:
|
||||||
|
# If you set OUTDIR to a different directory, change this to match
|
||||||
|
# e.g. - ./custom-frontend:/frontend
|
||||||
|
- ./frontend:/frontend
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, update the config to point to the frontend:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[frontend]
|
||||||
|
path = "/frontend"
|
||||||
|
```
|
||||||
|
|
||||||
## Running the Server
|
## Running the Server
|
||||||
|
|
||||||
Database migrations are run automatically on startup.
|
Database migrations are run automatically on startup.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue