MCPcopy
hub / github.com/syncthing/syncthing

github.com/syncthing/syncthing @v2.1.1 sqlite

repository ↗ · DeepWiki ↗ · release v2.1.1 ↗
6,406 symbols 26,439 edges 567 files 864 documented · 13%
README

Docker Container for Syncthing

Use the Dockerfile in this repo, or pull the syncthing/syncthing image from Docker Hub.

Use the /var/syncthing volume to have the synchronized files available on the host. You can add more folders and map them as you prefer.

Note that Syncthing runs as UID 1000 and GID 1000 by default. These may be altered with the PUID and PGID environment variables. In addition the name of the Syncthing instance can be optionally defined by using --hostname=syncthing parameter.

To grant Syncthing additional capabilities without running as root, use the PCAP environment variable with the same syntax as that for setcap(8). For example, PCAP=cap_chown,cap_fowner+ep.

To set a different umask value, use the UMASK environment variable. For example UMASK=002.

Example Usage

Docker cli

$ docker pull syncthing/syncthing
$ docker run --network=host  -e STGUIADDRESS= \
    -v /wherever/st-sync:/var/syncthing \
    syncthing/syncthing:latest

Docker compose

---
version: "3"
services:
  syncthing:
    image: syncthing/syncthing
    container_name: syncthing
    hostname: my-syncthing
    environment:
      - PUID=1000
      - PGID=1000
      - STGUIADDRESS=
    volumes:
      - /wherever/st-sync:/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

Discovery

Please note that Docker's default network mode prevents local IP addresses from being discovered, as Syncthing can only see the internal IP address of the container on the 172.17.0.0/16 subnet. This would likely break the ability for nodes to establish LAN connections properly, resulting in poor transfer rates unless local device addresses are configured manually.

It is therefore strongly recommended to stick to the host network mode, as shown above.

Be aware that syncthing alone is now in control of what interfaces and ports it listens on. You can edit the syncthing configuration to change the defaults if there are conflicts.

GUI Security

By default Syncthing inside the Docker image listens on 0.0.0.0:8384. This allows GUI connections when running without host network mode. The example above unsets the STGUIADDRESS environment variable to have Syncthing fall back to listening on what has been configured in the configuration file or the GUI settings dialog. By default this is the localhost IP address 127.0.0.1. If you configure your GUI to be externally reachable, make sure you set up authentication and enable TLS.

Extension points exported contracts — how you extend this code

Committer (Interface)
The Committer and Verifier interfaces are implemented by objects that need to know about or have a say in configuration [11 …
lib/config/wrapper.go
ServiceWithError (Interface)
(no doc) [24 implementers]
lib/svcutil/svcutil.go
Finder (Interface)
A Finder provides lookup services of some kind. [4 implementers]
lib/discover/discover.go
Counter (Interface)
(no doc) [10 implementers]
lib/scanner/blocks.go
Filesystem (Interface)
The Filesystem interface abstracts access to the file system. [4 implementers]
lib/fs/filesystem.go
Versioner (Interface)
(no doc) [5 implementers]
lib/versioner/versioner.go
ReadTransaction (Interface)
The ReadTransaction interface specifies the operations on read-only transactions. Every ReadTransaction must be released [3 …
internal/db/olddb/backend/backend.go
ChangeDetector (Interface)
The ChangeDetector is responsible for determining if files have changed on disk. It gets told to Remember() files (name [2 …
lib/ignore/ignore.go

Core symbols most depended-on inside this repo

Fatal
called by 1500
lib/model/testos_test.go
Unlock
called by 824
cmd/infra/stcrashreceiver/sourcecodeloader.go
Error
called by 743
lib/beacon/beacon.go
String
called by 311
lib/fs/types.go
New
called by 298
lib/connections/structs.go
Close
called by 291
lib/protocol/protocol.go
Log
called by 251
lib/events/events.go
Error
called by 209
internal/slogutil/slogvalues.go

Shape

Method 3,648
Function 2,003
Struct 577
TypeAlias 80
Interface 79
FuncType 19

Languages

Go99%
TypeScript1%

Modules by API surface

lib/model/mocks/model.go302 symbols
internal/gen/bep/bep.pb.go285 symbols
lib/model/model.go202 symbols
lib/config/mocks/mocked_wrapper.go147 symbols
lib/model/model_test.go106 symbols
internal/gen/dbproto/structs.pb.go104 symbols
lib/api/api.go103 symbols
lib/protocol/bep_fileinfo.go97 symbols
lib/protocol/mocks/connection.go96 symbols
lib/protocol/protocol.go90 symbols
internal/db/olddb/keyer.go76 symbols
lib/config/wrapper.go74 symbols

Dependencies from manifests, versioned

github.com/AudriusButkevicius/recliv0.0.7 · 1×
github.com/Azure/go-ntlmsspv0.1.0 · 1×
github.com/aws/aws-sdk-gov1.55.8 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/calmh/incontainerv1.0.0 · 1×
github.com/calmh/xdrv1.2.0 · 1×
github.com/ccding/go-stunv0.1.5 · 1×
github.com/certifi/gocertifiv0.0.0-2021050721183 · 1×
github.com/cespare/xxhash/v2v2.3.0 · 1×
github.com/coreos/go-semverv0.3.1 · 1×

For agents

$ claude mcp add syncthing \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact