agentofuser / anki-devops-services

Anki Sync Server with Docker - and it works!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anki Sync Server with Docker

Easy-to-use container configurations brought to you by Anki Community

Repository contents

Services Description
djankiserv An self-hosted Anki server with a complete API.
anki-sync-server An self-hosted Anki server with basic Sync functionality.

*Instructions: these notes describe the options of the particular setup. For a generic tutorial on how to use Docker, you may follow [our guide for beginners at ankicommunity.github.io](https://ankicommunity.github.io/Tutorials/Docker/Howto/).

Configuration files

You may find various files under the config/ directory:

  • Environment variables to source before using the images. Our shell scripts are going to remind you which of these are needed for a particular setup. You may inspect the contents of such a file before sourcing.

  • Example configurations of the setup will require you to copy and customize.

Community support

For detailed tutorials and news, visit us at ankicommunity.github.io!

We're also happy to help you on Gitter.

Limitation of responsibility

*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*

Tested and works on

Date AnkiDesktop version AnkiDroid version ankisyncd version Tester
2020-02-06 2.1.19 2.9.1 2.1.0 + 2bfccf7f kuklinistvan

Learn more about what "tested" means here.

About this Docker image

An example setup with docker-compose:

version: "3"

services:
    anki-container:
        image: kuklinistvan/anki-sync-server:latest
        container_name: anki-container

        restart: always
        ports:
        - "27701:27701"
        volumes:
        - data:/app/data

volumes:
data:

Rebuilding the image

First to clone the repository and update the anki-sync-server:

git clone https://github.com/ankicommunity/docker-anki-sync-server
cd docker-anki-sync-server
git submodule update --init --recursive

Then apply the following patch to anki-sync-server/Docker/anki-sync-server:

diff --git a/src/requirements.txt b/src/requirements.txt
index 77ba117346c8..f78905c62e23 100644
--- a/src/requirements.txt
+++ b/src/requirements.txt
@@ -1,8 +1,5 @@
-THE FILE WAS GENERATED BY POETRY, DO NOT EDIT!
-
-Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.
-anki==2.1.36; python_version >= "3.7"
-ankirspy==2.1.36; python_version >= "3.7"
+anki==2.1.35; python_version >= "3.7"
+ankirspy==2.1.35; python_version >= "3.7"
 beautifulsoup4==4.9.1
 certifi==2020.6.20; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
 chardet==3.0.4; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"

Enter the Docker directory and alter build.sh to suit your use case. Run it to build the image on the current platform.

cd Docker
vi build.sh
./build.sh

Tested client downloads

Main Mirror Size SHA256
AnkiDesktop for GNU/Linux 2.1.19 2.1.19 127.7 MB ada59237b8b3774712d6309821db4b6cb1d2c625284302aa09bc7313ada76fc0
AnkiDroid APK for Android 2.9.1 2.9.1 10.7 MB 511ef65b8dcb65a7f99f9942c4fcee5134f137ce23c677cf1ea3b26c7c3f34c5
AnkiDesktop for Windows 2.1.19 2.1.19 97,3 MB 90be6a3e5a6f4373ba3342bd3dfbe61e9013bb2a4acced2fcdd594b4c651a665
AnkiDesktop for Mac OS X 2.1.19 2.1.19 127,5 MB 9be3e3bdf884f865e15f308e72b1ed0213c061d27102f80d01897d5355eef8e7

Administration interface is reachable through the container shell

# docker exec -it anki-container /bin/sh
/app/anki-sync-server # ./ankisyncctl.py --help
usage: ./ankisyncctl.py <command> [<args>]

Commands:
  adduser <username> - add a new user
  deluser <username> - delete a user
  lsuser             - list users
  passwd <username>  - change password of a user
/app/anki-sync-server # ./ankisyncctl.py adduser kuklinistvan
Enter password for kuklinistvan:
/app/anki-sync-server #

Does not work? Submit an issue!

I highly encourage you contacting me if you feel it is "broken again" - it frustrates me too and I'd like to take the effort to fix the bugs on my side.

Even if it is not a bug but rather something to be clarified, I'm happy to answer questions (if I can), so if you have one, just submit an issue.

About

Anki Sync Server with Docker - and it works!

License:GNU General Public License v3.0


Languages

Language:Python 44.1%Language:Shell 34.1%Language:Dockerfile 16.2%Language:Makefile 5.6%