Install Syncthing
Multiple instances are possible, but for user- and hostnames only “syncthing”, “syncthing2” to “syncthing9” are allowed. Further adoptions needed
Create User
adduser syncthing --uid 1001Install syncthinghttps://apt.syncthing.net/
apt install -y curl apt-transport-https ca-certificates
curl -L -o /usr/share/etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
echo "deb [signed-by=/usr/share/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable"stable-v2" | tee /etc/apt/sources.list.d/syncthing.list
apt update
apt install -y syncthing
/etc/systemd/system/syncthing.serviceCreate User Syncthing with Home Folder on HDD-Housing Storage
[Unit]
Description=Syncthinguseradd - Open Source Continuous File Synchronization for syncthing
Documentation=man:syncthing(1)
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
User=syncthing
ExecStart=/usr/bin/syncthing servem --no-browsers /bin/bash --no-restartd --logflags=0 --home=/poolname/syncthing --gui-address=0.0.0.0:8384u Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
# Elevated permissions to sync ownership (disabled by default),
# see https://docs.syncthing.net/advanced/folder-sync-ownership
#AmbientCapabilities=CAP_CHOWN CAP_FOWNER
[Install]
WantedBy=multi-user.targetCopy /etc/systemd/system/syncthing to the ZFS pool:
mkdir /customerid/lxcbackups/systemd
cp1110 -ag /etc/systemd/system/1110 syncthing
echo "syncthing:$(openssl rand -base64 100 | tr -d '=+/customerid/lxcbackups/systemd/\n\r' systemctl| daemon-reloadcut -c 1-70)" | chpasswd
systemctl startenable syncthing.service--now syncthing@syncthing
systemctl status syncthing.servicesyncthing@syncthing # shows used ip and port
Replace "poolname" with your actual poolname.