Syncthing¶
Syncthing is used to syncronize my keys across my containers so I don't need to manually copy them over.
This is preferred over Ansible so that I can more easily update them by updating the source.
Installation¶
(
mkdir -p /etc/apt/keyrings && \
curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable-v2" | tee /etc/apt/sources.list.d/syncthing.list && \
apt update && \
apt install syncthing -y
)
(
sudo mkdir -p /etc/apt/keyrings && \
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable-v2" | sudo tee /etc/apt/sources.list.d/syncthing.list && \
sudo apt update && \
sudo apt install syncthing
)
Service¶
(
curl -Lo /usr/lib/systemd/system/[email protected] https://github.com/syncthing/syncthing/raw/refs/heads/main/etc/linux-systemd/system/[email protected]
systemctl enable syncthing@${USER}.service
systemctl start syncthing@${USER}.service
)
(
sudo curl -Lo /usr/lib/systemd/system/[email protected] https://github.com/syncthing/syncthing/raw/refs/heads/main/etc/linux-systemd/system/[email protected]
sudo systemctl enable syncthing@${USER}.service
sudo systemctl start syncthing@${USER}.service
)
Update the host in config.xml.
Config¶
Control Node¶
- Add managed node.
- Add managed node to shared folders.
Managed Node¶
- Add control node.
- Remove shared folder.
- Accept shared folders from control node.
Troubleshooting¶
To fix a stopped Syncthing folder
Remote orphaned shared computer and then unshared folders, is needed in the GUI
Changed shared folders to Receive Only.
Reset and restart syncthing again.
Revert changes to folders if they say Local.