Updated README.md

This commit is contained in:
jdoe0 2013-08-02 01:06:51 +07:00
parent 654240abca
commit f17ccd954c

View File

@ -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