Update README.md

This commit is contained in:
jdoe0 2013-10-20 19:03:47 -05:00
parent 6805ca9936
commit 1fd9aa5e47

View File

@ -9,32 +9,31 @@ Installing
### Manual installation ### Manual installation
1. First, you need to install "virtualenv". If your system has easy_install, this is 1. First, you need to install "virtualenv". If your system has easy_install,
just a matter of: this is just a matter of:
$ easy_install virtualenv $ easy_install virtualenv
If your system doesn't have easy_install, I recommend getting it! If your system doesn't have easy_install, I recommend getting it!
2. Next, you need to create a Python environment for running AnkiServer and install some of 2. Next, you need to create a Python environment for running ankisyncd and
the dependencies we need there: install some of the dependencies we need there:
$ virtualenv ankisyncd.env $ virtualenv ankisyncd.env
$ ankisyncd.env/bin/easy_install webob simplejson $ ankisyncd.env/bin/easy_install webob simplejson
3. Download and install libanki. You can find the latest release of Anki here: 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 Look for a *.tgz file with a Summary of "Anki Source". At the time of this
that is anki-2.0.11.tgz. writing that is anki-2.0.11.tgz.
Download this file and extract. Download this file and extract.
Then either: Then either:
a. Run the 'make install', or a. Run ```make install```, or
b. Copy the entire directory to /usr/share/anki b. Copy the entire directory to /usr/share/anki
@ -46,21 +45,15 @@ Installing
6. Create user: 6. Create user:
Enter username and password when prompted. # Enter username and password when prompted.
$ read -p "Username: " USER && read -sp "Password: " PASS $ read -p "Username: " USER && read -sp "Password: " PASS
$ SALT=$(openssl rand -hex 8) $ SALT=$(openssl rand -hex 8)
$ HASH=$(echo -n "$USER$PASS$SALT" | sha256sum | sed 's/[ ]*-$//')$SALT $ HASH=$(echo -n "$USER$PASS$SALT" | sha256sum | sed 's/[ ]*-$//')$SALT
$ sqlite3 auth.db "INSERT INTO auth VALUES ('$USER', '$HASH')" $ sqlite3 auth.db "INSERT INTO auth VALUES ('$USER', '$HASH')"
$ mkdir -p "collections/$USER" $ mkdir -p "collections/$USER"
$ unset USER PASS SALT HASH $ unset USER PASS SALT HASH
7. Then we can run AnkiServer like so: 7. Then we can run ankisyncd like so:
$ ankisyncd.env/bin/python src/sync_app.py $ ankisyncd.env/bin/python src/sync_app.py
@ -69,13 +62,9 @@ Installing
There's PKGBUILD available for Arch Linux. To install, simply run: There's PKGBUILD available for Arch Linux. To install, simply run:
$ wget https://codeload.github.com/jdoe0/ankisyncd-pkgbuild/zip/master $ wget https://codeload.github.com/jdoe0/ankisyncd-pkgbuild/zip/master
$ unzip master $ unzip master
$ cd ankisyncd-pkgbuild-master $ cd ankisyncd-pkgbuild-master
$ makepkg -s $ makepkg -s
$ sudo pacman -U *.xz $ sudo pacman -U *.xz
Configuration file is at /etc/ankisyncd/ankisyncd.conf Configuration file is at /etc/ankisyncd/ankisyncd.conf
@ -87,12 +76,12 @@ To start the server run:
Setting up Anki Setting up Anki
--------------- ---------------
To make Anki use ankisyncd as its sync server, create a file (name it something like ankisyncd.py) To make Anki use ankisyncd as its sync server, create a file (name it something
containing the code below and put it in ~/Anki/addons. like ankisyncd.py) containing the code below and put it in ~/Anki/addons.
import anki.sync import anki.sync
anki.sync.SYNC_URL = 'http://127.0.0.1:27701/sync/' anki.sync.SYNC_URL = 'http://127.0.0.1:27701/sync/'
Replace 127.0.0.1 with the IP address or the domain name of your server if ankisyncd is not running Replace 127.0.0.1 with the IP address or the domain name of your server if
on the same machine as Anki. ankisyncd is not running on the same machine as Anki.