{"id":14139280,"url":"https://github.com/ankicommunity/ankicommunity-sync-server","last_synced_at":"2025-08-05T04:31:17.331Z","repository":{"id":37492944,"uuid":"183618761","full_name":"ankicommunity/ankicommunity-sync-server","owner":"ankicommunity","description":"A personal Anki sync server (so you can sync against your own server rather than AnkiWeb)","archived":false,"fork":false,"pushed_at":"2024-09-25T12:28:20.000Z","size":1363,"stargazers_count":918,"open_issues_count":48,"forks_count":84,"subscribers_count":18,"default_branch":"develop","last_synced_at":"2025-07-30T14:48:07.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankicommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-26T11:43:21.000Z","updated_at":"2025-07-27T16:09:18.000Z","dependencies_parsed_at":"2024-04-17T13:38:05.668Z","dependency_job_id":"d6ea229f-3a24-4193-a04e-cd9325894519","html_url":"https://github.com/ankicommunity/ankicommunity-sync-server","commit_stats":null,"previous_names":["ankicommunity/anki-sync-server"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/ankicommunity/ankicommunity-sync-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankicommunity%2Fankicommunity-sync-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankicommunity%2Fankicommunity-sync-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankicommunity%2Fankicommunity-sync-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankicommunity%2Fankicommunity-sync-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankicommunity","download_url":"https://codeload.github.com/ankicommunity/ankicommunity-sync-server/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankicommunity%2Fankicommunity-sync-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268835993,"owners_count":24314949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-16T17:00:55.056Z","updated_at":"2025-08-05T04:31:16.921Z","avatar_url":"https://github.com/ankicommunity.png","language":"Python","funding_links":["https://github.com/sponsors/ankicommunity"],"categories":["Python"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# ankicommunity-sync-server\n\n\n[![Python version](https://img.shields.io/pypi/pyversions/anki-sync-server)](https://github.com/ankicommunity/anki-sync-server/blob/develop/pyproject.toml)\n[![License](https://img.shields.io/github/license/ankicommunity/anki-sync-server)](https://github.com/ankicommunity/anki-sync-server/blob/develop/COPYING)\n[![Last commit](https://img.shields.io/github/last-commit/ankicommunity/anki-sync-server)](https://github.com/ankicommunity/anki-sync-server/commits/develop)\n\u003cbr /\u003e\n[![Github status](https://img.shields.io/github/checks-status/ankicommunity/anki-sync-server/develop?label=github%20status)](https://github.com/ankicommunity/anki-sync-server/actions)\n[![Github version](https://img.shields.io/github/v/tag/ankicommunity/anki-sync-server?label=github%20version)](https://github.com/ankicommunity/anki-sync-server/releases)\n[![Github contributors](https://img.shields.io/github/contributors/ankicommunity/anki-sync-server?label=github%20contributors)](https://github.com/ankicommunity/anki-sync-server/graphs/contributors)\n[![Github sponsors](https://img.shields.io/github/sponsors/ankicommunity?label=github%20sponsors)](https://github.com/sponsors/ankicommunity)\n\u003cbr /\u003e\n[![PyPI version](https://img.shields.io/pypi/v/anki-sync-server?label=pypi%20version)](https://pypi.org/project/anki-sync-server)\n[![PyPI downloads](https://img.shields.io/pypi/dm/anki-sync-server?label=pypi%20downloads)](https://pypi.org/project/anki-sync-server)\n\u003cbr /\u003e\n[![DockerHub version](https://img.shields.io/docker/v/ankicommunity/anki-sync-server?label=dockerhub%20version\u0026sort=date)](https://hub.docker.com/repository/docker/ankicommunity/anki-sync-server)\n[![DockerHub pulls](https://img.shields.io/docker/pulls/ankicommunity/anki-sync-server)](https://hub.docker.com/repository/docker/ankicommunity/anki-sync-server)\n[![DockerHub stars](https://img.shields.io/docker/stars/ankicommunity/anki-sync-server)](https://hub.docker.com/repository/docker/ankicommunity/anki-sync-server)\n\u003cbr /\u003e\n[![Readthedocs status](https://img.shields.io/readthedocs/anki-sync-server?label=readthedocs%20status)](https://anki-sync-server.readthedocs.io/?badge=latest)\n[![Gitter](https://badges.gitter.im/ankicommunity/community.svg)](https://gitter.im/ankicommunity/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n\u003c/div\u003e\n\n------------\n\nKnown Issues\n------------\n\n**⚠️ This project is incompatible with Anki Desktop \u003e=2.1.57 ⚠️**\n\nWe're working hard to update to the new syncing protocol.\n\nIn the mean time, we recommend you check out the official sync server here:\n- [Documentation](https://docs.ankiweb.net/sync-server.html)\n- [Repository](https://github.com/ankitects/anki)\n- [WIP Docker Image](https://github.com/ankitects/anki/pull/2798#issuecomment-1812839066)\n\nOr reach out to see how you can help support our development [here](https://github.com/ankicommunity/anki-sync-server/issues/158).\n\nThank you for your understanding.\n\n------------\n\n\n[Anki][] is a powerful open source flashcard application, which helps you\nquickly and easily memorize facts over the long term utilizing a spaced\nrepetition algorithm. Anki's main form is a desktop application (for Windows,\nLinux and macOS) which can sync to a web version (AnkiWeb) and mobile\nversions for Android and iOS.\n\nThis is a personal Anki server, which you can sync against instead of\nAnkiWeb.\n\n[Anki]: https://apps.ankiweb.net/\n\n\n\u003cdetails open\u003e\u003csummary\u003eContents\u003c/summary\u003e\n\n - [Installing](#installing)\n - [Installing (Docker)](#installing-docker)\n - [Setting up Anki](#setting-up-anki)\n    - [Anki 2.1.28 and above](#anki-2128-and-above)\n    - [Anki 2.1](#anki-21)\n    - [Anki 2.0](#anki-20)\n    - [AnkiDroid](#ankidroid)\n - [Development](#development)\n    - [Testing](#testing)\n - [Configuration](#configuration)\n    - [Environment Variables](#environment-variables-preferred)\n    - [Config File](#config-file-ankisyncdconf)\n - [Support for other database backends](#support-for-other-database-backends)\n\u003c/details\u003e\n\n\nInstalling\n----------\n\n1. Install the dependencies:\n\n        $ pip install -r src/requirements.txt\n        $ pip install -e src\n\n2. Copy the default config file ([ankisyncd.conf](src/ankisyncd.conf)) to configure the server using the command below. Environment variables can be used instead, see: [Configuration](#configuration).\n\n        $ cp src/ankisyncd.conf src/ankisyncd/.\n\n3. Create user:\n\n        $ python -m ankisyncd_cli adduser \u003cusername\u003e\n\n4. Ankisyncd can serve the requests directly. However, if you want better\n   security and SSL encryption, a proxy can be set up.\n\n   For example, you can use Nginx. First, obtain the SSL certificate from\n   [Let's Encrypt](https://letsencrypt.org) via\n   [certbot](https://certbot.eff.org/). Nginx will accept the requests at\n   standard HTTPS port 443 and forward the traffic to ankisyncd which runs by\n   default on port `27701` ([configuration](#configuration)).\n\n   An example of configuration for domain `example.com`:\n\n    ```nginx\n    server {\n        listen        443 ssl;\n        server_name   example.com;\n\n        # Configuration managed by Certbot\n        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;\n        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;\n        include /etc/letsencrypt/options-ssl-nginx.conf;\n\n        location / {\n            proxy_http_version   1.0;\n            proxy_pass           http://127.0.0.1:27702/;\n            client_max_body_size 222M;\n        }\n    }\n    ```\n\n    Adding the line `client_max_body_size 222M;` to Nginx prevents bigger\n    collections from not being able to sync due to size limitations.\n\n5. Run ankisyncd:\n\n```\n$ python -m ankisyncd\n```\n\n---\n\nInstalling (Docker)\n-------------------\n\nFollow [these instructions](https://github.com/ankicommunity/anki-devops-services#about-this-docker-image).\n\n\nSetting up Anki\n---------------\n\n### Install addon from ankiweb (support 2.1)\n\n1.on add-on window,click `Get Add-ons` and fill in the textbox with the code  `358444159`\n\n2.there,you get add-on `custom sync server redirector`,choose it.Then click `config`  below right\n\n3.apply your server ip address\n\nif this step is taken,the following instructions regarding addon setting 2.1( including 2.1.28 and above) can be skipped.\n\n### Anki 2.1.28 and above\n\nCreate a new directory in [the add-ons folder][addons21] (name it something\nlike ankisyncd), create a file named `__init__.py` containing the code below\nand put it in the `ankisyncd` directory.\n\n    import os\n\n    addr = \"http://127.0.0.1:27701/\" # put your server address here\n    os.environ[\"SYNC_ENDPOINT\"] = addr + \"sync/\"\n    os.environ[\"SYNC_ENDPOINT_MEDIA\"] = addr + \"msync/\"\n\n### Anki 2.1\n\nCreate a new directory in [the add-ons folder][addons21] (name it something\nlike ankisyncd), create a file named `__init__.py` containing the code below\nand put it in the `ankisyncd` directory.\n\n    import anki.sync, anki.hooks, aqt\n\n    addr = \"http://127.0.0.1:27701/\" # put your server address here\n    anki.sync.SYNC_BASE = \"%s\" + addr\n    def resetHostNum():\n        aqt.mw.pm.profile['hostNum'] = None\n    anki.hooks.addHook(\"profileLoaded\", resetHostNum)\n\n### Anki 2.0\n\nCreate a file (name it something like ankisyncd.py) containing the code below\nand put it in `~/Anki/addons`.\n\n    import anki.sync\n\n    addr = \"http://127.0.0.1:27701/\" # put your server address here\n    anki.sync.SYNC_BASE = addr\n    anki.sync.SYNC_MEDIA_BASE = addr + \"msync/\"\n\n[addons21]: https://addon-docs.ankiweb.net/addon-folders.html\n\n### AnkiDroid\n\nAdvanced → Custom sync server\n\nUnless you have set up a reverse proxy to handle encrypted connections, use\n`http` as the protocol. The port will be either the default, 27701, or\nwhatever you have specified in `ankisyncd.conf` (or, if using a reverse proxy,\nwhatever port you configured to accept the front-end connection).\n\nUse the same base url for both the `Sync url` and the `Media sync url`, but append `/msync` to\nthe `Media sync url`. Do **not** append `/sync` to the `Sync url`.\n\nEven though the AnkiDroid interface will request an email address, this is not\nrequired; it will simply be the username you configured with `ankisyncctl.py\nadduser`.\n\nDevelopment\n-----------\n\n### Testing\n\n0. Prerequites\n\nThis project uses [GNU Make](https://www.gnu.org/software/make/) to simplify the development commands. It also uses [Poetry](https://python-poetry.org/) to manage the Python dependencies. Ensure they are installed.\n\n1. Create a config for your local environment.\n\n```bash\n$ cp config/.env.example config/.env.local\n```\n\nSee [Configuration](#configuration) for more information.\n\n2. Download Python dependencies.\n\n```bash\n$ make init\n```\n\n3. Run unit tests.\n\n```bash\n$ make tests\n```\n\n## Configuration\n\n### Environment Variables (preferred)\n\nConfiguration values can be set via environment variables using `ANKISYNCD_` prepended\nto the uppercase form of the configuration value. E.g. the environment variable,\n`ANKISYNCD_AUTH_DB_PATH` will set the configuration value `auth_db_path`\n\nEnvironment variables override the values set in the `ankisyncd.conf`.\n\n* The environment variables can be found here: config/.env.example.\n* The file also includes other development variables, but the notable ones are the ones with the prefix ANKISYNCD_\n* Environment variables will override the config files values (which is why I recommend you use them)\n* This is what we use in the Docker images (see: https://github.com/ankicommunity/anki-devops-services/blob/develop/services/anki-sync-server/examples/docker-compose.yml).\n* Copying the config file from config/.env.example to config/.env.local will allow you to configure the server when using the make commands\n* You can also set it when running the server e.g. ANKISYNCD_PORT=5001 make run\n* The above two options are useful for development. But if you're only going for usage, you can also set it globally by adding it to your ~/.bashrc file e.g. export ANKISYNCD_PORT=50001\n\n### Config File: ankisyncd.conf\n\nA config file can be used to configuring the server. It can be found here: [src/ankisyncd.conf](src/ankisyncd.conf).\n\n\nSupport for other database backends\n-----------------------------------\n\nsqlite3 is used by default for user data, authentication and session persistence.\n\n`ankisyncd` supports loading classes defined via config that manage most\npersistence requirements (the media DB and files are being worked on). All that is\nrequired is to extend one of the existing manager classes and then reference those\nclasses in the config file. See ankisyncd.conf for example config.\n\n## Acknowledgment\n\n- This server was originally developed by [David Snopek](https://github.com/dsnopek)\nto support the flashcard functionality on Bibliobird, a web application for\nlanguage learning.\n- It was then forked by `jdoe0` to add supports Python 3 and Anki 2.1.\n- It was then forked by [tsudoko](https://github.com/tsudoko) which was the base for this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankicommunity%2Fankicommunity-sync-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankicommunity%2Fankicommunity-sync-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankicommunity%2Fankicommunity-sync-server/lists"}