Dockerized builtin Anki Sync Server (2.1.57+)
5.7K
Dockerized builtin Anki Sync Server (2.1.57+)
| Platform | Version | Release |
|---|---|---|
| Linux | 2.1.57-qt6 | 2.1.57 |
| AnkiDroid | 2.15.6 | 2.1.57 |
Reference the Anki manual on the builtin sync server for details on environment variables, adding multiple users, ect.
Security is your problem: this normally runs on an unencrypted port 8080. Setting up a reverse proxy with HTTPS is recommended. Sample configs below.
Set the Self-hosted sync server option under Preferences -> Syncing on Desktop. For AnkiDroid, use the same URL (with trailing slash) for the main sync URL and add /msync/ for the media URL (check the above documentation, this may change in the future). Make sure you set the protocol (http://) whenever you enter this address.
Note that 2.1.57 is not compatible with 2.1.57-1+ as the location of the virtual environment and data directory was separated (strongly recommend deleting the volume and re-syncing).
docker run --name anki-sync-server -p 8080:8080 zweizs/anki-sync-server:latest
/data in the container is used as a volume. If you change SYNC_BASE, you'll need to make sure to add a volume at the newly specified location.
| Variable | Default Value |
|---|---|
SYNC_USER1 | user:password |
SYNC_BASE | /data |
SYNC_HOST | 0.0.0.0 |
SYNC_PORT | 8080 |
MAX_SYNC_UPLOAD_MEGS | 100 |
VENV_ROOT | /venv |
labels:
traefik.http.services.anki.loadbalancer.server.port: "8080"
This would allow connecting to the Anki server through your main entrypoint (normally port 80/443).
This has not been tested
Set VIRTUAL_PORT environment variable to 8080.
If it doesn't work, it's possible it needs HTTP 1.0 support (as the older community Anki sync servers did) in which case try placing the following in /etc/nginx/proxy.conf:
# HTTP 1.0 support
proxy_http_version 1.0;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header X-Forwarded-Path $request_uri;
# Mitigate httpoxy attack
proxy_set_header Proxy "";
anki-sync-server/v2.1.57I'm available for freelance, contracts, and consulting both remotely and in the Hudson Valley, NY (USA) area. Some more about me and what I can do for you.
Feel free to drop me a message at:
hi [a+] zweisolutions {●} com
Anki is licensed under GPLv3
This repo is MIT
Content type
Image
Digest
sha256:63f191db1…
Size
82.4 MB
Last updated
almost 2 years ago
docker pull zweizs/anki-sync-server