2013-10-20 14:07:36 +08:00
|
|
|
ankisyncd
|
|
|
|
|
=========
|
2013-07-18 09:22:21 +08:00
|
|
|
|
2013-10-20 13:36:27 +08:00
|
|
|
A personal Anki sync server (so you can sync against your own server rather than
|
|
|
|
|
AnkiWeb). This version has been simplified to remove some dependencies.
|
2013-07-18 09:22:21 +08:00
|
|
|
|
|
|
|
|
Installing
|
|
|
|
|
----------
|
2013-04-03 21:31:44 +08:00
|
|
|
|
2013-10-20 14:07:36 +08:00
|
|
|
### Manual installation
|
2013-04-03 21:31:44 +08:00
|
|
|
|
|
|
|
|
1. First, you need to install "virtualenv". If your system has easy_install, this is
|
|
|
|
|
just a matter of:
|
|
|
|
|
|
|
|
|
|
$ easy_install virtualenv
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
the dependencies we need there:
|
|
|
|
|
|
2013-10-20 14:07:36 +08:00
|
|
|
$ virtualenv ankisyncd.env
|
2013-08-02 12:00:03 +08:00
|
|
|
|
2013-10-20 14:07:36 +08:00
|
|
|
$ ankisyncd.env/bin/easy_install webob simplejson
|
2013-04-03 21:31:44 +08:00
|
|
|
|
|
|
|
|
3. Download and install libanki. You can find the latest release of Anki here:
|
|
|
|
|
|
2013-08-02 02:06:51 +08:00
|
|
|
http://code.google.com/p/anki/downloads/list
|
2013-04-03 21:31:44 +08:00
|
|
|
|
|
|
|
|
Look for a *.tgz file with a Summary of "Anki Source". At the time of this writing
|
2013-07-13 05:08:16 +08:00
|
|
|
that is anki-2.0.11.tgz.
|
2013-04-03 21:31:44 +08:00
|
|
|
|
2013-07-13 05:08:16 +08:00
|
|
|
Download this file and extract.
|
2013-08-02 02:06:51 +08:00
|
|
|
|
2013-07-13 05:08:16 +08:00
|
|
|
Then either:
|
2013-04-03 21:31:44 +08:00
|
|
|
|
2013-07-13 05:08:16 +08:00
|
|
|
a. Run the 'make install', or
|
|
|
|
|
|
|
|
|
|
b. Copy the entire directory to /usr/share/anki
|
2013-04-03 21:31:44 +08:00
|
|
|
|
2013-08-14 19:26:30 +08:00
|
|
|
4. Copy the example.ini to production.ini and edit for your needs.
|
2013-07-13 05:08:16 +08:00
|
|
|
|
2013-08-14 19:26:30 +08:00
|
|
|
5. Create authentication database:
|
2013-08-02 02:06:51 +08:00
|
|
|
|
2013-08-02 12:00:03 +08:00
|
|
|
$ sqlite3 auth.db 'CREATE TABLE auth (user VARCHAR PRIMARY KEY, hash VARCHAR)'
|
2013-08-02 02:06:51 +08:00
|
|
|
|
2013-08-14 19:26:30 +08:00
|
|
|
6. Create user:
|
2013-08-02 02:06:51 +08:00
|
|
|
|
|
|
|
|
Enter username and password when prompted.
|
|
|
|
|
|
|
|
|
|
$ read -p "Username: " USER && read -sp "Password: " PASS
|
|
|
|
|
|
|
|
|
|
$ SALT=$(openssl rand -hex 8)
|
|
|
|
|
|
2013-08-02 12:00:03 +08:00
|
|
|
$ HASH=$(echo -n "$USER$PASS$SALT" | sha256sum | sed 's/[ ]*-$//')$SALT
|
2013-08-02 02:06:51 +08:00
|
|
|
|
2013-08-14 19:26:30 +08:00
|
|
|
$ sqlite3 auth.db "INSERT INTO auth VALUES ('$USER', '$HASH')"
|
2013-08-02 02:06:51 +08:00
|
|
|
|
2013-08-02 12:00:03 +08:00
|
|
|
$ mkdir -p "collections/$USER"
|
2013-08-02 02:06:51 +08:00
|
|
|
|
|
|
|
|
$ unset USER PASS SALT HASH
|
|
|
|
|
|
2013-08-14 19:26:30 +08:00
|
|
|
7. Then we can run AnkiServer like so:
|
2013-04-03 21:31:44 +08:00
|
|
|
|
2013-10-20 14:07:36 +08:00
|
|
|
$ ankisyncd.env/bin/python src/sync_app.py
|
|
|
|
|
|
|
|
|
|
### Via PKGBUILD
|
|
|
|
|
|
|
|
|
|
There's PKGBUILD available for Arch Linux. To install, simply run:
|
|
|
|
|
|
|
|
|
|
$ wget https://codeload.github.com/jdoe0/ankisyncd-pkgbuild/zip/master
|
|
|
|
|
|
|
|
|
|
$ unzip master
|
|
|
|
|
|
|
|
|
|
$ cd ankisyncd-pkgbuild-master
|
|
|
|
|
|
|
|
|
|
$ makepkg -s
|
|
|
|
|
|
|
|
|
|
$ sudo pacman -U *.xz
|