PitchHut logo
Syncthing4Swarm
Automate deployment of Syncthing in Docker Swarm clusters.
Pitch

Syncthing4Swarm streamlines the deployment of Syncthing within Docker Swarm environments. With features like automatic peer discovery and zero-touch configuration, it simplifies the complexities of distributed file synchronization, making it ideal for modern containerized infrastructures.

Description

syncthing4swarm is an automated deployment solution designed for running Syncthing within Docker Swarm clusters. This project streamlines the installation and management of distributed file synchronization across containerized infrastructures, enhancing the capabilities of real-time file sharing.

Key Features

  • Global Deployment: Operates a dedicated Syncthing instance on every node within the Swarm cluster.
  • Automatic Discovery: Effortlessly scans the overlay network to identify other running Syncthing instances, ensuring seamless connectivity.
  • Auto-Configuration: Facilitates mutual device pairing and folder sharing without requiring manual setup, therefore saving time and reducing errors.
  • Private Mode: Optimizes security by disabling relays and global discovery, thus limiting traffic to internal communications only.

How It Works

Each time a container is initiated, the following process occurs:

  1. The system waits for Syncthing to become fully operational.
  2. It disables all global features, including relays, NAT, and external discovery, to maintain a secure environment.
  3. If a shared folder does not already exist, it will be created automatically.
  4. A scan of the overlay subnet is conducted to locate other Syncthing devices.
  5. All discovered devices are mutually added using their static IP addresses, ensuring that each node is synchronized.
  6. The device list is updated across the shared folder, promoting efficient file management.

Configuration Options

The system offers several configurable environment variables:

  • STGUIAPIKEY: required API key for Syncthing interface.
  • SYNCTHING_PORT: Defines the REST API port, default is 8384.
  • SYNCTHING_SYNC_PORT: Port designated for file synchronization, default is 22000.
  • SYNCTHING_FOLDER_ID: Identifier for the shared folder, default is shared.
  • SYNCTHING_FOLDER_PATH: Path of the folder to be synchronized, default is /var/syncthing/data.
  • SYNCTHING_FOLDER_LABEL: Display name for the folder, default is Shared.
  • SYNCTHING_DISABLE_GLOBAL: Boolean to disable relays and global discovery, default is true.

System Architecture

The architecture of syncthing4swarm involves an interconnected setup of Syncthing instances across multiple Docker Swarm nodes, linked via an overlay network that supports internal traffic.

Requirements

To run this project, the following prerequisites are necessary:

  • An initialized Docker Swarm (using docker swarm init).
  • A properly configured overlay network.
  • Consistent STGUIAPIKEY across all nodes to enable synchronization.

This project is built on the foundation of Syncthing, a powerful open-source file synchronization system, and acknowledges the contributions from the Syncthing community.

0 comments

No comments yet.

Sign in to be the first to comment.