安裝 syncthing 在 Raspiberry or Debian 上
1 第一步Update pi
sudo apt-get update && sudo apt-get -y upgrade && sudo apt -y full-upgrade2 之後要安裝 apt-transport-https
sudo apt-get install -y apt-transport-https curl3 Download Syncthing GPG keys
curl -s https://syncthing.net/release-key.txt | gpg --dearmor | sudo tee /usr/share/keyrings/syncthing-archive-keyring.gpg >/dev/null4 加 key 到 repository 內
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list5 安裝 syncthing 前 update
sudo apt-get update6 安裝 syncthing
sudo apt-get -y install syncthingSyncthing 開始
1 找出 IP
hostname -I2 第一次運作
syncthing3 可以改成 0.0.0.0 IP 可以
Add System Service
1 產生個 syncthing service file
sudo nano /lib/systemd/system/syncthing.service2 加進這些容
如 User=pi 不同請改名字
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
After=network.target
[Service]
User=pi
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
Restart=on-failure
RestartSec=5
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target3 Enable Service
sudo systemctl enable syncthing4 Start Service
sudo systemctl start syncthing5 Check Serice Status
sudo systemctl status syncthing6 如出現Active , 就無問題了。
Enjoy!!