Markdown beautifying

This commit is contained in:
Martin Brodbeck 2025-03-18 14:39:44 +01:00
parent dfcd792f10
commit d1637f1fdc

View file

@ -1,12 +1,15 @@
# KOReader Sync Server # KOReader Sync Server
This is a KOreader sync server, implemented in Rust. It uses the crates *axum*, *sqlx*, *serde* and *serde_json*.
This is a KOreader sync server, implemented in Rust. It uses the crates _axum_, _sqlx_, _serde_ and _serde_json_.
## Requirements ## Requirements
- Rust toolchain for compilation - Rust toolchain for compilation
- A running PostgreSQL server - A running PostgreSQL server
- Nginx (or Apache) webserver as a reverse proxy, since kosyncrs only listens locally and uses HTTP. - Nginx (or Apache) webserver as a reverse proxy, since kosyncrs only listens locally and uses HTTP.
## Installation ## Installation
Just compile it with `cargo build --release`. You can then copy the executable for example to `/usr/local/bin/`. Just compile it with `cargo build --release`. You can then copy the executable for example to `/usr/local/bin/`.
If you want to start the service automatically, you can adapt the example systemd file for your needs. Please pay particularly attention to the PG_URL environment variable.You have to adjust the database username and password. If you want to start the service automatically, you can adapt the example systemd file for your needs. Please pay particularly attention to the PG_URL environment variable.You have to adjust the database username and password.
@ -14,17 +17,21 @@ If you want to start the service automatically, you can adapt the example system
You can also use nginx as a reverse proxy, so that the sync server listens on port 443. An example file is provided. You can also use nginx as a reverse proxy, so that the sync server listens on port 443. An example file is provided.
### Database setup ### Database setup
First, create a new database user and set a password: First, create a new database user and set a password:
``` ```
$ createuser -P kosync $ createuser -P kosync
``` ```
Then, create a new database which is owned by the newly created user: Then, create a new database which is owned by the newly created user:
``` ```
$ createdb -O kosync kosync $ createdb -O kosync kosync
``` ```
Connect to the database as user *kosync* (for example with psql) and create the database tables: Connect to the database as user _kosync_ (for example with psql) and create the database tables:
```sql ```sql
CREATE TABLE users ( CREATE TABLE users (
id BIGSERIAL PRIMARY KEY, id BIGSERIAL PRIMARY KEY,