From: Steven Baltakatei Sandoval Date: Mon, 27 Apr 2020 17:59:38 +0000 (+0000) Subject: feat(doc): Describe syncthing config steps X-Git-Tag: 0.1.0~20 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/17d7b80328e653a7d65c4aac24c4f8173409c321?hp=-c feat(doc): Describe syncthing config steps Add instructions for how to configure syncthing via webUI and/or ssh tunnel if necessary. Specific instructions include: 1. How to connect via web browser 2. How to connect via SSH Tunnel 3. How to obtain a Device ID 4. How to add a Remote Device 5. How to create a Shared Folder --- 17d7b80328e653a7d65c4aac24c4f8173409c321 diff --git a/config-shared/syncthing/INSTRUCTIONS.md b/config-shared/syncthing/INSTRUCTIONS.md index 81842be..7ff3f6c 100644 --- a/config-shared/syncthing/INSTRUCTIONS.md +++ b/config-shared/syncthing/INSTRUCTIONS.md @@ -3,7 +3,9 @@ # Install and configure `syncthing` -Created by [Steven Baltakatei Sandoval][bktei_2020_homepage] on 2020-04-27T14:37Z under a [CC BY-SA 4.0][cc_20131125_bysa] license and last updated on 2020-04-27T16:28Z. +Created by [Steven Baltakatei Sandoval][bktei_2020_homepage] on +2020-04-27T14:37Z under a [CC BY-SA 4.0][cc_20131125_bysa] license and +last updated on 2020-04-27T17:59Z. ## 1. Summary @@ -13,7 +15,8 @@ configured to trust one another. ## 2. Instructions -The following are instructions for installing Syncthing onto a GNU/Linux Debian 10 machine. +The following are instructions for installing Syncthing onto a +GNU/Linux Debian 10 machine. ### 2.1. Install `syncthing` via `apt-get` @@ -107,6 +110,105 @@ The resulting status data will resemble: CGroup: /user.slice/user-1000.slice/user@1000.service/syncthing.service └─3284 /usr/bin/syncthing -no-browser -no-restart -logflags=0 +### 2.3. Configure `syncthing` + +Some initial tasks should be performed with a new `syncthing` instance +in order to configure it to work with other `syncthing` instances. + +a. Connect to the Syncthing **WebUI** +b. Determine the instance's **Device ID**. +c. Add a **remote device**. +d. Create a **shared folder**. + +#### 2.3.a. Connect to the **WebUI** + +Syncthing may be configured via a "WebUI", which is a configuration +page accessible by a web browser such as Firefox. The address that +must be entered into a web browser's address bar may be: + + http://localhost:8384 + http://127.0.0.1:8384 + +If the `syncthing` instance is running on a headless machine +accessible only via `ssh`, then the WebUI may be accessed by setting +up an "SSH tunnel". One end of the tunnel will be the headless machine +and the other end will be a machine equipped with a keyboard, monitor, +and a web browser. In order to establish an `ssh` tunnel with a remote +headless machine's `syncthing` isntance, run one of the following +commands (both are equivalent). + + $ ssh -L 9999:localhost:8384 username@yourserver + $ ssh -L 127.0.0.1:9999:127.0.0.1:8384 username@yourserver + +Then, open your web browser and enter `http://localhost:9999` into the +address bar. This will cause the WebUI of the `syncthing` instance +running on the remote machine `yourserver` to appear. + +NOTE: The details of setting up machines to connect via `ssh` are not +described here. + +#### 2.3.b. Determine the **Device ID** + +Upon setting up a new `syncthing` instance on a new device, a unique +identifier is generated (derived from the hash of the instance's +public key). This identifier is called a "**Device ID**". This ID is +what one `syncthing` instance uses to connect to another. The ID may +be found by selecting the "Actions" menu at the top right of the WebUI +webpage and selecting "Show ID" from the dropdown menu. A 64-character +string of numbers and capitalized letters will appear as well as a QR +code encoding this same string. + +#### 2.3.c. Add a **remote device** + +Once you have a `syncthing` instance's Device ID, then you can enter +it into another instance in order to establish a connection between +the two instances through which files in shared folders may be +synchronized. + +A "Remote Device" (a remote `syncthing` instance) may be added via the +WebUI by clicking on the "Add Remote Device" button and entering the +Device ID in the "General" tab. Shared folders may be specified in the +"Sharing" tab. The Device IDs of `syncthing` instances already +detected on the local network may already be populated in the General +tab but if you care about the security of your data you should +double-check that the Device ID matches before clicking "Save". + +#### 2.3.d. Create a **shared folder**. + +The "Shared Folder" fulfills the primary function of `syncthing`: +synchronizing file changes of specified directories between different +machines across the internet. + +You may create a "Shared Folder" by clicking the "Add Folder" +button. A window called "Add Folder" should appear with four tabs: +"General", "Sharing", "File Versioning", and "Ignore Patterns". + +The following fields of the "General" tab should be populated as +follows: + +* **Folder Label**: A label that appears in the WebUI. I would suggest + something like `username_PURPOSE` since this label is suggested to + Remote Devices when a folder is first shared. + +* **Folder ID**: A unique alphanumeric string that is automatically + generated by `syncthing`. You shouldn't have to change this. + +* **Folder Path**: The path within the file system of the machine in + which `syncthing` is running. For GNU/Linux Debian machines, I would + suggest something like: `~/Sync/username_PURPOSE` which should + auto-expand into `/home/username/Sync/username_PURPOSE`. + +You may also specify with which Remote Devices to share this new +Shared Folder by clicking on the "Sharing" tab. + +In the "File Versioning" tab, you may specify rules for keeping local +versions of files in this sparticular Shared Folder. By default, no +versions are kept. + +In the "Ignore Patterns" tab, you may specify rules for ignoring files +based upon their file names. By default, no ignore patterns are +specified. + ## 3. References - 1. ["Starting Syncthing Automatically"][1]. Date: 2020-03-31. [syncthing.net](https://syncthing.net). Date Accessed: 2020-04-27. [Archive link](https://web.archive.org/web/20200414114635/https://docs.syncthing.net/users/autostart.html). Archive date: 2017-04-14.