跳至正文
Wener Notes

Syncthing

约 1 分钟阅读
bash
brew install syncthing # macOS brew

ST_HOME=$PWD/syncthing
syncthing -generate=$ST_HOME
syncthing -home=$ST_HOME -paths
syncthing -home=$ST_HOME -logfile=$ST_HOME/syncthing.log

# 可以考虑 --network=host
# http://localhost:8384/
docker run --rm -it \
  -p 8384:8384 \
  -p 22000:22000/tcp \
  -p 22000:22000/udp \
  -p 21027:21027/udp \
  -v $PWD/syncthing:/var/syncthing \
  --hostname=my-syncthing \
  --name syncthing syncthing/syncthing:latest
docker-compose.yml
---
version: '3'
services:
  syncthing:
    image: syncthing/syncthing
    container_name: syncthing
    hostname: my-syncthing
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - ./syncthing:/var/syncthing
    network_mode: host
    restart: unless-stopped
    healthcheck:
      test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
      interval: 1m
      timeout: 10s
      retries: 3

配置

  • 位置
    • $XDG_STATE_HOME/syncthing
    • $HOME/.local/state/syncthing
    • $HOME/Library/Application Support/Syncthing
    • %LOCALAPPDATA%\Syncthing
  • 配置文件
    • config.xml
    • cert.pem, key.pem
    • https-cert.pem, https-key.pem
    • index-*
    • syncthing.log
    • audit-*.log
    • panic-*.log
xml
<configuration version="37">
  <folder></folder>
  <device></device>
  <gui></gui>
  <ldap></ldap>
  <options></options>
  <remoteIgnoredDevice></remoteIgnoredDevice>
  <defaults></defaults>
</configuration>

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub2 条
其他外链3 条
最近更新commit 2569524编辑