Go to file
2023-09-10 09:00:13 +00:00
anki-sync Changed to docker image that builds from source 2023-09-07 10:52:31 +00:00
service Added README.md and refactored install.sh 2023-09-10 08:53:27 +00:00
.gitignore Initial commit 2023-09-06 17:09:19 +00:00
docker-compose.yml Changed to docker image that builds from source 2023-09-07 10:52:31 +00:00
install.sh Added README.md and refactored install.sh 2023-09-10 08:53:27 +00:00
README.md removed the (now defunct) ankictl.sh 2023-09-10 09:00:13 +00:00
sample.env updated sample.env 2023-09-10 08:56:06 +00:00

Anki Sync Server

This project sets up an Anki synchronization server in a Docker environment, making it easy to host your own Anki synchronization service.

Features

  • Dockerized Anki Sync Server.
  • Entry point script for the server to facilitate user configuration.
  • systemd service file for ease of management and auto-start of the Anki sync service.
  • Installation script for automated setup.
  • Sample environment file to set configurations.

Prerequisites

  • Docker
  • Docker Compose
  • Git

Installation

  1. Clone this repository:

    git clone https://git.rudefox.io/bj/anki-sync-server.git /var/lib/anki-server
    cd /var/lib/anki-server
    
  2. Run the installation script (with root privileges):

    sudo ./install.sh
    
  3. Remember to set up the necessary environment variables in the .env file.

    • For a quick start, a sample.env file has been provided.
  4. Ensure that the data directory is created and has the appropriate permissions:

    mkdir data
    
  5. Start the service:

    systemctl start anki-sync-server
    

    To enable auto-start on boot:

    systemctl enable anki-sync-server
    

Configuration

Most of the server's configurations are managed through the .env file. After the initial setup, ensure to modify this file according to your requirements.

Here are some key environment variables:

  • ANKISYNCD_DATA_ROOT: Path to the data root directory inside the container.
  • ANKISYNCD_AUTH_DB_PATH: Path to the authentication database.
  • ANKISYNCD_SESSION_DB_PATH: Path to the session database.
  • SYNC_USERS: Users for the synchronization server.
  • ANKI_PORT: Port on which the Anki server should run.
  • ANKI_VOLUME_PATH: Local path for the volume storage.

Username and Password Configuration

  1. Inside the .env file, locate the SYNC_USERS variable.
  2. Enter the desired usernames and passwords in the format: username:password.
    • For multiple users, separate them with a comma: user1:pass1,user2:pass2.
  3. Save the changes and restart the Anki sync service.

Maintenance

  • Backup: Ensure to backup your data directory regularly.
  • Updates: To update the service, pull the latest changes from the repository and restart the service.