- Início
- Plugins
- Integrações e acesso remoto
- dsh-syncthing-pair
dsh-syncthing-pair
cccccccccccccy/dsh-syncthing-pair
Pairs one folder on this Mac with one folder on a remote Mac over SSH and creates the same two-way Syncthing folder on both sides, with a DSH Web panel and an agent tool. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Instalar
dsh plugin --profile web add github:cccccccccccccy/dsh-syncthing-pairREADME
Syncthing Folder Pair
A DeepSeek Harness (dsh) plugin that pairs one folder on this Mac with one folder on a remote Mac reachable over SSH, then creates the same two-way Syncthing folder on both sides.
Enter two paths in the sidebar panel; the plugin does the rest through each machine's local Syncthing REST API. It also registers a syncthing_sync tool so the agent can perform the same operation from chat.
English | 中文
What it does
- Reads the local Syncthing API key from
config.xmland talks to127.0.0.1:8384; it never editsconfig.xmldirectly. - Connects to the remote over SSH (key-based,
BatchMode) and runs the same small Python helper there. - Creates or updates one Syncthing folder on each side with the same ID,
sendreceivetype, file watcher enabled, and both device IDs in its device list. - Adds the two devices to each other's Syncthing configuration if they are not already there.
- Shows the state of both sides, plus a list of existing Syncthing folders on this Mac.
- If the remote is unreachable, still configures this Mac and returns a copy-paste command that completes the remote side when run there.
- Refuses to reuse a path already owned by another folder, or a folder ID that points at a different path. It does not delete files.
Requirements
- DSH
0.2.1-rc.2or newer. - Syncthing running on both machines, with its REST API on the default
127.0.0.1:8384. Tested with Syncthing 2.1.7. - SSH access from the DSH machine to the remote, using a key (no password prompt). The remote needs
python33.8+. - Remote macOS or Linux; the helper looks for Syncthing's
config.xmlat the standard macOS and Linux locations. - Both Syncthing instances must be able to reach each other (LAN, Tailscale, or relays).
Install
From GitHub:
dsh plugin --profile web add github:cccccccccccccy/dsh-syncthing-pair
Or from the prebuilt release tarball:
dsh plugin --profile web add https://github.com/cccccccccccccy/dsh-syncthing-pair/releases/download/v1.0.0/dsh-syncthing-pair-1.0.0.tgz
Restart dsh web if your host requires it, then refresh the page. The plugin adds a Syncthing 同步 entry to the left sidebar.
Use
- Open Syncthing 同步 in the sidebar.
- Enter the remote SSH host — an alias from
~/.ssh/configsuch asremote-mac, oruser@host. - Enter the absolute folder path on this Mac and on the remote.
- Optionally set a display name; it defaults to the local folder name.
- Click 开始同步.
The panel reports both sides and lists existing folders. If the remote was offline, copy the generated command and run it in a terminal on the remote, or accept the folder in the remote Syncthing UI and set the path shown in the panel. Then click 重试远端.
The agent tool takes the same inputs:
{
"sshHost": "remote-mac",
"localPath": "/Users/me/Documents/Shared",
"remotePath": "/Users/me/Documents/Shared",
"label": "Shared"
}
How it works
DSH plugin (this Mac)
├─ python3 syncthing_pair.py → local Syncthing REST API
└─ ssh <host> python3 - → remote Syncthing REST API
The helper computes a deterministic folder ID from the two paths (st-<local-folder>-<hash>), so re-running with the same paths updates the same pair, and changing only the display name does not create a second folder. The plugin preflights both sides before writing anything when both are reachable.
Safety
- No file deletion, no
config.xmledits, no telemetry. - The HTTP endpoint is same-origin only; requests without an
Originheader are accepted only from loopback. - SSH uses your existing key and host configuration; the plugin does not store credentials.
- A folder whose ID already exists with a different path is rejected rather than overwritten.
Limitations
- SSH password prompts are not supported; use a key or an SSH agent.
- The Syncthing GUI must listen on
127.0.0.1:8384; a custom GUI address is not discovered yet. - Windows remotes are not supported.
- The folder ID is path-derived: moving the local folder and re-running creates a new pair; remove the old folder in Syncthing first.
- Syncthing needs filesystem permission for the chosen folder on each machine (macOS may require Full Disk Access for protected locations).
Development
node --check index.js
node --check server.js
node --check client.js
python3 -c "compile(open('syncthing_pair.py').read(), 'syncthing_pair.py', 'exec')"
npm pack --dry-run
The plugin is plain JavaScript on the host and browser sides; there is no build step. The Python helper is the only runtime dependency beyond ssh and python3.
License
MIT
Plugins relacionados
dsh-purge
kingcharleslzy-ai/dsh-purge
dsh-web (dsh-ssh)
zhu1090093659/dsh-web
dsh-web (dsh-remote-web-ui)
zhu1090093659/dsh-web
dsh-web-ui (dsh-ssh)
zhu1090093659/dsh-web-ui