Syncthing provides a way to share arbitrary numbers of files between any number of people without the need for a central server. It is a peer-to-peer (P2P) application that automagically syncs files in the background. This deployment app launches a Syncthing "device" (Persistent Peer) that offers a high-availability peer for members of a team to include in their file shares.
For example, imagine there are three people in a team who want to share various folders with each other during the course of their work. They can accomplish this with Syncthing using only their three workstations, by exchanging Device IDs and sharing the folders. However, what if one person modifies or adds a file while the other two are offline, and then that person goes offline before the other two come online? In that event, they would not receive the update. This is where a Persistent Peer is helpful, because in this situation, it is always online to receive updates and then sync them with the other team members when they come online again.
Team members can add the Persistent Peer Device ID to their individual Syncthing apps on their workstations. Then they will need to login to the web GUI at https://example.com/syncthing
and allow the Persistent Peer to accept this connection.
Note
When accepting their offered Device, team members can select "Introducer" and "Auto Accept" so that the Persistent Peer will automatically accept any folder they share with it.
There are two deployments. The first uses a custom-built image from a Dockerfile that essentially just downloads a particular version of Syncthing. The second deployment is an NGINX webserver for use as a reverse-proxy, allowing the web GUI to be accessible at some path of an existing domain (which already has a TLS cert) such as https://example.com/syncthing
.
The Persistent Peer configuration files include a config.xml
and two files needed for the Persistent Peer identity certificate. The config file was generated automatically in an initial deployment, then customized, and then stored as a ConfigMap that is mounted as a Volume in the init container so that it can be copied in as a file where Syncthing expects it.
The Syncthing GUI is protected at the ingress controller level using Kubernetes annotations on the Ingress defined for the app. The authentication credentials for this HTTP basic auth are stored as a standard Secret.