diff --git a/README.md b/README.md index d671e39..c49873d 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,13 @@ Instructions for installing and running AnkiServer: 3. Download and install libanki. You can find the latest release of Anki here: - http://code.google.com/p/anki/downloads/list + http://code.google.com/p/anki/downloads/list Look for a *.tgz file with a Summary of "Anki Source". At the time of this writing that is anki-2.0.11.tgz. Download this file and extract. - + Then either: a. Run the 'make install', or @@ -44,7 +44,27 @@ Instructions for installing and running AnkiServer: 5. Copy the example.ini to production.ini and edit for your needs. - 6. Then we can run AnkiServer like so: + 6. Create authentication database: + + $ sqlite3 auth.db 'create table auth (user varchar primary key, hash varchar)' + + 7. Create user: + + Enter username and password when prompted. + + $ read -p "Username: " USER && read -sp "Password: " PASS + + $ SALT=$(openssl rand -hex 8) + + $ HASH=$(echo -n $USER$PASS$SALT | sha256sum | sed 's/[ ]*-$//')$SALT + + $ sqlite3 test.db "INSERT INTO auth VALUES ('$USER', '$HASH')" + + $ mkdir -p collections/$USER + + $ unset USER PASS SALT HASH + + 8. Then we can run AnkiServer like so: $ AnkiServer.env/bin/paster serve production.ini