From 052d0a0fd2c6cf6b5cdc965a812ad22238d402e8 Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 13:17:41 +0300 Subject: Add instructions for running server locally --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31028ac..71b962d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is designed to sit behind nginx reverse proxy so running at 127.0.0.1:8080 It's currently live over at https://gradecoin.xyz. -``` +```sh # Test the project $ cargo test @@ -14,6 +14,34 @@ $ cargo doc --open The executable `main` needs the `/templates`, `users` and `blocks` folders. It also expects a `secrets/gradecoin.pem` file with the private key of the system. + +# Running Locally + +Create RSA keys: +```sh +$ mkdir secrets +$ cd secrets +$ openssl genrsa -out gradecoin.pem 2048 +$ openssl rsa -in gradecoin.pem -outform PEM -pubout -out gradecoin.pub +``` +Use `gradecoin.pub` file in your client program. + +Create students list: `students.csv` should be in the following form: +```sh +User ID, Password +e123456,register_password +e123456,register_password +``` +First line is ignored. + +Run the server: +```sh +$ cargo run +``` + +The server should be up on `localhost:8080`. + + # References - https://github.com/blurbyte/restful-rust - https://github.com/zupzup/warp-postgres-example -- cgit v1.2.3-70-g09d2