diff --git a/README.md b/README.md index 1a5dff7..c44864a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ # 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 + - Rust toolchain for compilation - A running PostgreSQL server - Nginx (or Apache) webserver as a reverse proxy, since kosyncrs only listens locally and uses HTTP. ## Installation + 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. @@ -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. ### Database setup + First, create a new database user and set a password: + ``` $ createuser -P kosync ``` Then, create a new database which is owned by the newly created user: + ``` $ 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 CREATE TABLE users ( id BIGSERIAL PRIMARY KEY,