# 完全重新配置 systemctl stop syncthing rm -rf /var/lib/syncthing/config/* # 重新生成配置并指定监听地址 sudo -u syncthing /usr/local/bin/syncthing -generate="/var/lib/syncthing/config" # 手动修改配置 cat > /var/lib/syncthing/config/config.xml << 'EOF' basic 1 0 0 0 random false 0 0 0 false false false 25 .stfolder false false false false false false standard standard 0
dynamic
0.0.0.0:8384
$(cat /var/lib/syncthing/config/config.xml | grep apikey | sed -n 's/.*\(.*\)<\/apikey>.*/\1/p') default
default default true true 0 0 60 true 10 false true 60 30 10 0 3 $(cat /var/lib/syncthing/config/config.xml | grep urUniqueID | sed -n 's/.*\(.*\)<\/urUniqueID>.*/\1/p') https://data.syncthing.net/ false 1800 true 12 false 24 false 5 false 1 https://upgrades.syncthing.net/meta.json false 10 authenticationUserAndPassword 0 /var/lib/syncthing/sync true 1 false 0 0 default auto 0 true false 0 0 false
EOF chown -R syncthing:syncthing /var/lib/syncthing/config systemctl start syncthing