Skip to content

PasteFerry (隔空贴): clipboard and file sync across macOS, Windows and Linux. Direct-first, end-to-end encrypted. Optional official access: no server to host. Independent self-hosting remains available.

docs: 官网新增局域网部署服务器教程,README 拆分精简;版本 1.3.3

baiyuzea3258908a78e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f81dbb..9430b8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# 更新记录 / Changelog
+## 1.3.3 — 2026-10-11
+
+- **服务器可以装在 Windows 上了**:新增 `copysync-server-windows-amd64.zip`,解压后双击 `install.cmd`,注册为开机自启的 Windows 服务(低权限的 LOCAL SERVICE 账户),并在 Windows 防火墙里只为它放行;双击 `uninstall.cmd` 卸载。
+ **The server now runs on Windows.** Extract `copysync-server-windows-amd64.zip` and double-click `install.cmd`: it registers a Windows service under LOCAL SERVICE that starts with Windows, and adds a firewall rule for the server only. `uninstall.cmd` removes it.
+- **Mac 上一条命令装好服务器**:`copysync-server-macos.tar.gz` 里新增 `install.sh`,注册为 LaunchAgent,登录后自动运行,不需要管理员权限。
+ **One-command server install on a Mac**: the macOS package now includes `install.sh`, which registers a LaunchAgent; no administrator rights needed.
+- 三个平台的安装脚本默认用本机的局域网地址启用 TURN 中转,也可以指定地址;重复运行即为升级,设置保留;都支持 `uninstall`。Linux 的 `sudo ./install.sh` 不带参数时也改为使用局域网地址(此前不启用中转)。
+ All install scripts default to the machine's LAN address for the TURN relay, accept an explicit address, upgrade in place and can uninstall. On Linux, `sudo ./install.sh` without an address now uses the LAN address instead of disabling the relay.
+- 服务器新增 `-log <文件>` 参数,日志写入文件,超过 10 MB 自动换新。
+ New `-log <file>` server option; the log rotates at 10 MB.
+- 官网新增[在局域网里部署服务器](https://baiyuze.github.io/copysync/server/)图文教程(中文、英文、日文),顶部导航可以直达。README 精简,工作原理、排障、从源码构建移到 `guide/`。
+ New [LAN server guide](https://baiyuze.github.io/copysync/en/server/) on the website, linked from the top bar. The README is shorter; how it works, troubleshooting and building moved to `guide/`.
+- 客户端没有变化,不需要升级;设备间协议不变。
+ No client changes and no protocol changes; clients don't need to upgrade.
+
## 1.3.2 — 2026-10-10
- 修复与 UU 远程同时使用时,`.uuremote_aeawv…` 临时占位文件不断进入复制记录并被转发的问题。发送前过滤占位文件,混合选择保留真实文件;接收端忽略旧版发来的纯占位记录与后续传输头。
diff --git a/README.md b/README.md
index 0caefb4..0fc4f87 100644
--- a/README.md
+++ b/README.md
@@ -33,14 +33,7 @@
## Why
-If you work on two computers, you move things between them all day: a snippet of text, a screenshot, a file.
-
-The built-in options each get in the way:
-
-- **Universal Clipboard** needs both Macs on the same Apple ID, close to each other, with Bluetooth and Wi‑Fi on. A work Mac and a personal Mac rarely share an Apple ID, and large files often fail halfway.
-- **AirDrop** makes you pick a device and accept on the other side every time, and it only moves files, not the clipboard.
-- **Messaging yourself** through a chat app means manual downloads, recompressed images, and your files sitting on someone else's server.
-- **With one Mac and one Windows PC**, none of the built-in options work at all.
+Universal Clipboard needs the same Apple ID and both Macs close by. AirDrop makes you accept every time and doesn't touch the clipboard. Messaging yourself means manual downloads and your files on someone else's server. With one Mac and one Windows PC, none of the built-in options work.
With CopySync you pair two computers once. After that, copy on one and paste on the other — Mac to Mac, Mac to Windows, or Windows to Windows. Data goes directly between the devices; when a direct connection can't be made, it is relayed through a server you run yourself. Everything is end-to-end encrypted and the server cannot read it.
@@ -57,290 +50,56 @@ With CopySync you pair two computers once. After that, copy on one and paste on
## Features
- **Text, rich text, images, files and folders.** What you copy is what comes out on the other side.
-- **Size-aware transfer.** Anything under 50 MB (adjustable) is pushed as soon as you copy, so the other Mac can paste immediately. Larger files sync as a record you can pull when you need them.
-- **History.** Everything copied on any of your computers in the last 3 days (adjustable), ready to put back on the clipboard. Click an image to preview and zoom it.
-- **Direct first, relay as fallback.** Devices connect peer-to-peer; behind symmetric NAT or a strict firewall, traffic switches to the TURN relay on your server automatically.
+- **Size-aware transfer.** Anything under 50 MB (adjustable) is pushed as soon as you copy; larger files sync as a record you pull when you need them.
+- **History** of the last 3 days (adjustable) across all your computers, with image preview.
+- **Direct first, relay as fallback**, including office networks with several uplinks.
- **Fingerprint check when pairing**, so neither the server nor anyone on the network can impersonate your device.
-- **Runs in the background.** Keeps syncing with the window closed, starts at login, recovers from crashes. On Windows it lives in the notification area.
-- **Mac and Windows.** Native on Intel and Apple silicon Macs; Windows 10 and 11. Pasted files are real files you can drop into Explorer, WeChat or Office. Light and dark appearance.
-- **English, Chinese and Japanese.** The interface follows your system language, and you can switch it in Settings.
-- **Passwords stay put** (Windows). Content that a password manager marks as "don't record" is skipped: not synced, not kept in the history.
+- **Runs in the background**, starts at login, recovers from crashes. English, Chinese and Japanese.
<table>
<tr>
<td><img src="docs/assets/screenshots/en/devices.png" alt="Devices: paired Macs and whether each is connected directly or through the relay"></td>
<td><img src="docs/assets/screenshots/en/verify.png" alt="Pairing: compare the fingerprint shown on both Macs before confirming"></td>
</tr>
- <tr>
- <td><img src="docs/assets/screenshots/en/settings.png" alt="Settings: server address, auto-sync size limit, content types"></td>
- <td><img src="docs/assets/screenshots/en/history-dark.png" alt="History in dark appearance"></td>
- </tr>
</table>
-## Supported systems
-
-| | Requirement |
-|---|---|
-| **Mac app** | macOS 13 Ventura or later; universal binary for Intel and Apple silicon, no Rosetta needed |
-| **Server** | Any Linux on x86_64 or ARM64 with systemd or Docker; it can also run on one of your Macs |
-| **Windows app** | Windows 10 (21H2 or later) and Windows 11, x64; runs under emulation on Windows on ARM |
-| **iPhone / iPad** | Not supported. iOS does not let apps watch the clipboard in the background, so copy-and-it's-there can't work the way it does on the Mac |
-
-## Install
-
-There are two parts: **the app on each computer**, and **a server both can reach**. If both computers are on the same LAN, the server can run on one of the Macs.
-
-### 1. Deploy the server
-
-On a Linux server, as root:
-
-```bash
-curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
-tar xzf copysync-server-linux-amd64.tar.gz
-cd copysync-server-linux-amd64
-sudo ./install.sh <public IP of the server>
-```
-
-The script registers a systemd service that starts on boot and prints the address to enter in the app. Use the `linux-arm64` package on ARM servers.
-
-Open these ports in your firewall or cloud security group:
-
-| Port | Protocol | Purpose |
-|---|---|---|
-| 8787 | TCP | Signaling (WebSocket) |
-| 3478 | UDP | STUN / TURN |
-| 32768–60999 | UDP | TURN relay ports, assigned by the OS |
-
-For Docker, or for LAN-only use, see the [server deployment guide](server/deploy/README.md).
-
-### 2. Install the app on each computer
-
-**Mac**
-
-1. Download [CopySync.dmg](https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg), open it and drag CopySync into Applications.
-2. Open CopySync from Applications.
-
- The first time, macOS says it can't verify the developer: CopySync isn't notarized by Apple yet (that requires a paid developer account). Go to **System Settings → Privacy & Security**, scroll down and click **Open Anyway**. You only need to do this once.
-
-3. Click **Turn on background sync**.
-4. In **Settings → Signaling server**, enter `ws://<server address>:8787/signal` and press Return.
-5. Recent versions of macOS ask whether CopySync Daemon may read the clipboard. Allow it; you can switch it to always allow under **System Settings → Privacy & Security → Paste from Other Apps**.
-
-**Windows**
-
-1. Download [CopySync-Setup.exe](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe) and run it. It installs for the current user and needs no administrator rights.
-
- CopySync isn't code-signed yet, so Windows says "Windows protected your PC": click **More info → Run anyway**. To skip the installer, download the [portable zip](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip), extract it and open CopySync.
-
-2. Open CopySync (it opens when setup finishes; there's also a desktop shortcut) and click **Turn on background sync**.
-3. In **Settings → Signaling server**, enter `ws://<server address>:8787/signal` and press Enter.
-4. If Windows Firewall asks about copysyncd, allow it.
-
-After you close the window, CopySync keeps running in the notification area; open it again from the tray icon or the desktop shortcut.
-
-### 3. Pair
-
-1. On one computer: **Devices → Add device → Show a code**.
-2. On the other: **Add device → Enter a code**, and type the 6 characters.
-3. Both screens show the same two lines of fingerprints, one for each device. **Confirm only if the two screens match line for line.**
-
-From then on, copy on either one and paste on the other.
-
-## How it works
-
-```mermaid
-flowchart LR
- subgraph A["Computer A (Mac or Windows)"]
- UA["CopySync app"] <-- "gRPC" --> DA["Background service"]
- end
- subgraph B["Computer B (Mac or Windows)"]
- DB["Background service"] <-- "gRPC" --> UB["CopySync app"]
- end
- S[("Your server\nsignaling + TURN")]
- DA -- "Signaling (WebSocket)" --> S
- DB -- "Signaling (WebSocket)" --> S
- DA <== "WebRTC direct (DTLS)" ==> DB
- DA <-. "Relayed via TURN when direct fails" .-> S
- S <-.-> DB
-```
-
-| Component | Role | Built with |
-|---|---|---|
-| Background service `copysyncd` | Watches the clipboard, connects to peers, sends, receives and stores | Go. The clipboard uses cgo and AppKit on Mac, and calls Win32 directly on Windows (pure Go, no C compiler) |
-| App `CopySync` | History, pairing, settings | Flutter, one codebase for Mac and Windows; talks to the service over local gRPC |
-| Server `copysync-server` | Device discovery, pairing codes, signaling, TURN relay | Go, a single static binary using about 15 MB of RAM |
-| Protocol `proto/` | Messages shared by all three | Protocol Buffers |
+## Get started
-**What happens when you copy:**
+You need **the app on each computer** and **a server both can reach**.
-1. The service notices the clipboard changed: on Mac it checks the change count at short intervals (reading the count and types needs no permission and never triggers a prompt); on Windows the system notifies it right away.
-2. On a change it reads the content and picks a transport: text is inlined in the message; images and files under 50 MB are streamed right away (tar + zstd); anything larger is announced as a record only.
-3. The receiving computer writes the data to a local cache and then onto its clipboard, so `⌘V` or `Ctrl+V` pastes real local files. File names that are fine on Mac but not on Windows (with a colon, say) get the matching full-width character on Windows.
+**1. Run the server.**
-**How the connection is made:**
+- *Same LAN* (home or office): run it on any always-on Windows, Mac or Linux computer. Download the package, run one install script, done. Step-by-step guide: **[Run the server on your LAN](https://baiyuze.github.io/copysync/en/server/)**.
+- *Across the internet*: a Linux machine with a public IP, as root:
-1. Devices connect to the signaling server over WebSocket and receive STUN and TURN addresses.
-2. All connections share one local UDP port. The background service probes several servers from that port to learn its public address, one per uplink on networks with several (see the next section).
-3. During the handshake each side sends its LAN addresses, its public address on every uplink, and its TURN relay address; both sides try each other with WebRTC ICE at the same time. One side holds back its uplink addresses until it has received the other's and sent packets to them, because some routers lock a port when the other side's packet arrives first (see the next section).
-4. A direct path wins if it works; relay paths must wait 5 seconds before they can be selected.
-5. Once connected, each side tells the other whether it is relayed, and both show "relay" if either is.
-6. If the connection still lands on the relay, the side that started it runs an ICE restart while idle to punch again, and moves to the direct path if that works (first after 10 seconds, then at intervals growing to 15 minutes).
+ ```bash
+ curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
+ tar xzf copysync-server-linux-amd64.tar.gz && cd copysync-server-linux-amd64
+ sudo ./install.sh <public IP of the server>
+ ```
-Data flows over WebRTC data channels, encrypted with DTLS.
+ Open TCP 8787, UDP 3478 and UDP 32768–60999. Docker and all options: [server deployment guide](server/deploy/README.md).
-### Hole punching on networks with several uplinks
+**2. Install the app** on each computer: [CopySync.dmg](https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg) for macOS 13+, [CopySync-Setup.exe](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe) for Windows 10/11 ([portable zip](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip)). The builds aren't notarized or code-signed yet: on Mac, allow it once under **System Settings → Privacy & Security → Open Anyway**; on Windows, click **More info → Run anyway**. Then click **Turn on background sync** and enter `ws://<server address>:8787/signal` under **Settings → Signaling server**.
-Office networks with two ISPs, or carriers with a pool of NAT addresses, have several uplinks and choose one per destination IP. One office network we measured had four:
+**3. Pair.** On one computer, **Devices → Add device → Show a code**; on the other, **Enter a code**. Confirm only if both screens show the same two fingerprint lines. From then on, copy on either one and paste on the other.
-| Uplink | Probe servers that landed on it | Public port |
-|---|---|---|
-| Uplink A | Our own server, Twilio | Unchanged |
-| Uplink B | Bilibili, Google, Nextcloud | Unchanged |
-| Uplink C | Cloudflare, FreeSWITCH | Rewritten, same for every destination |
-| Uplink D | A service on Alibaba Cloud | Rewritten |
-
-Asking one server reveals only one of these addresses. Packets to the peer may leave through another uplink, the peer sees an address it was never told about, and its router drops them. That is why CopySync 1.0 could only relay on such networks.
-
-What 1.1 does:
-
-- **One shared port.** pion used to open a new port for each STUN server, so each answer only applied to its own port. All connections now share one port, and every probe result applies to it.
-- **Probe every uplink.** CopySync queries IP-diverse servers from that port in parallel (your own server plus public STUN servers such as Bilibili and Cloudflare), deduplicates by IP and drops addresses poisoned by DNS.
-- **Tell the peer all of them.** Each uplink's address goes to the peer as a candidate; the peer checks each one, and the one matching the real uplink gets through. Uplinks that rewrite ports report their real mapping.
-- **Remember uplinks.** If a round misses an uplink that preserves ports, its address is filled in as uplink IP plus local port.
-
-A Mac behind that 4-uplink office network now connects directly to a home connection, about 3 seconds after reaching the server. The full design, measurements and validation are in [NAT traversal on multi-uplink networks](design/nat-traversal.md) (Chinese).
-
-The **NAT lab** (`tools/natlab`) builds real topologies with Linux network namespaces and iptables and runs CopySync's actual connection code through eleven scenarios on every commit:
-
-| Scenario | Result |
-|---|---|
-| Single uplink ↔ home router | Direct |
-| Two uplinks, previous version (control) | Relay |
-| Two uplinks ↔ home router | Direct |
-| Four uplinks ↔ home router | Direct |
-| Two uplinks, second one not probed: no history / with history | Relay / Direct |
-| Two uplinks ↔ two uplinks | Direct |
-| Two uplinks ↔ NAT that randomizes ports | Relay |
-| Blocked at first, network recovers later | Relay first, then direct |
-| Office router locks a port for unsolicited packets | Direct |
-| Home router locks a port for unsolicited packets | Relay, then direct after the first retry |
-
-### Security model
-
-- **The server keeps no accounts.** A device's identity is an Ed25519 key, and its ID is derived from the public key, so the server can verify that an ID belongs to a key without a user table.
-- **Fingerprints are compared by a person when pairing.** Both Macs show the same two lines: the fingerprint of each side's public key (the first 60 bits of its SHA-256, like `R8NF-2WTC-QL5J`), in a fixed order. The server could swap keys in transit, but then the two screens would no longer match — this step is what stops a man in the middle. The fingerprints are shown separately rather than combined into one short code: an attacker controlling both forged keys could find a matching combined code with a birthday attack, while separate fingerprints need a preimage attack per key, roughly a billion times harder.
-- **Every signaling message after that is signed**, so the server cannot forge a device. The DTLS certificate fingerprint of the direct channel is also sent signed and checked against the actual certificate after the handshake; a mismatch drops the connection.
-- **The relay can't read anything either.** TURN only forwards encrypted UDP packets. Relay credentials are issued per device and expire after 12 hours.
-- **Public STUN servers see only your public IP.** To find every uplink on multi-uplink networks, CopySync probes a few public STUN servers by default. They see your public IP, as with any WebRTC app, never content. Turn off **Probe with public servers** in Settings to use only your own server.
-- **Device key.** On Mac it's stored readable only by you; on Windows it's additionally encrypted with DPAPI, so another user or another computer can't decrypt a copied file.
-- **No App Sandbox**, because CopySync needs to read files at whatever path you copy them from.
-
-### Fallbacks
-
-| Situation | What happens |
+| | Requirement |
|---|---|
-| No direct path (symmetric NAT, corporate firewall) | Switches to the TURN relay on your server, still encrypted; the app shows "relay" |
-| Public STUN servers unreliable (common in mainland China) | The server runs its own STUN and clients prefer it |
-| Multi-uplink networks that pick an uplink per destination (common in offices) | All connections share one local port; CopySync probes several servers from it to learn its address on every uplink and sends them all to the peer, filling gaps from history. See `copysync-cli nat` |
-| Landed on the relay although a direct path works (the peer just started, its addresses arrived a moment late) | While idle, the side that started the connection runs an ICE restart to punch again and switches to direct if it works; never during a transfer. The connection stays up and only pauses for a few seconds |
-| The other Mac sleeps, loses its network or restarts, and the connection dies silently | The dead connection is closed and reconnected right away; if the other side rebuilt its connection, this side follows |
-| The other Mac can't be reached when you copy | The latest 20 items are kept and sent once the connection is back. They only go into the history and never overwrite what's on the other Mac's clipboard now |
-| Signaling connection drops | Reconnects with exponential backoff (1 s up to 30 s, with jitter); status is shown live |
-| Pairing confirmed on one side before the other | Early handshake messages are held and replayed once the other side confirms; the direct link is up within tens of milliseconds |
-| Large files | Above the limit only a record is synced; if the source file is gone when you pull, you get a clear message |
-| Apps that only accept plain text | Rich text is written as both HTML and plain text, so no markup leaks into the paste |
-| Clipboard access not granted yet | Content isn't read (it would block on a prompt a background process can't show); the app asks you to grant access |
-| Background service crashes | launchd restarts it, throttled to once every 10 seconds |
-| App updated in place, or moved | On launch the app re-points the login item and restarts the service on the new version |
-| History and cache grow | Expired items are removed automatically; 3 days by default |
-
-### Lessons learned
-
-Each of these was found by testing and has a regression test. The full investigation is in [spikes/results.md](spikes/results.md) (Chinese).
-
-- **macOS clipboard calls must run on the main thread.** With the privacy features on, the clipboard API talks to a system UI service through the run loop; calling it from a plain thread crashes. The service locks the main thread at startup and dedicates it to the clipboard.
-- **"Transfer only when the other side pastes" isn't possible on macOS.** The system resolves promised clipboard data about 0.1 s after it's written and caches it, and there is no notification that the clipboard was read. That's why small items are pushed ahead of time and large files are pulled on demand.
-- **Three pitfalls in the pion WebRTC library:** `DetachDataChannels()` is a global switch that breaks regular send/receive on every channel; `OnMessage` doesn't buffer, so messages arriving before the handler is set are dropped (202 bytes sent, 0 received); `OnBufferedAmountLow` is edge-triggered, so a waiter that arrives late never wakes up (a 20 MB transfer stalled at 786 KB).
-- **pion opens a separate port per STUN server**, so the answers don't apply to each other. Adding STUN servers can't fix multi-uplink networks; all connections now share one port and CopySync probes it itself.
-- **One side can't tell on its own whether a connection is relayed.** When one side sends through TURN, the other may just see an ordinary address; once one Mac showed "direct" and the other "relay". Both sides now tell each other after connecting.
-- **pion never switches paths once it has picked one.** The relay handshake is fast, and if it wins that race the whole connection stays relayed. We saw exactly that after the peer restarted: its addresses arrived after the relay wait had expired. The relay wait is now 5 seconds, probe hostnames resolve in parallel (a probe round went from about 1.6 s to under 0.2 s), and relayed connections retry the direct path with an ICE restart.
-- **Who sends first matters.** Some routers (the office one we measured) keep a connection entry for a packet that arrives before you've sent anything to its source, locking the port; your own packets then leave from a different port and punching fails. That's why restarting the office Mac always connected directly while restarting the home Mac fell back to the relay: a freshly started Mac probes its uplinks first, so its addresses went out late and it ended up sending first. A rule now decides who sends first, and retries alternate the order.
-- **A dead connection has to be cleaned up by hand.** When pion reports "failed" it doesn't close the connection; the control channel still looks open and whatever is written to it is lost, and the layer above thinks it's connected and never reconnects. In 1.1.0 this sent six files into a dead connection after the other Mac dropped off, and none arrived.
-- **Public STUN domains can be poisoned by DNS**, resolving to `192.0.2.42` in our tests. Reserved ranges and proxy fake-IP ranges are filtered before probing.
-- **Simulated routers need a firewall.** When both sides punch at once, a packet let through to the router itself leaves a Linux conntrack entry, the outgoing flow then gets a new port, and punching fails. Real routers drop such packets, and the lab does too.
-
-Measured on a LAN with a direct connection: a 20 MB file transfers in about 330 ms with matching checksums.
-
-## Limitations
-
-- **Not notarized by Apple, and the Windows build isn't code-signed**, so the first launch needs one manual approval.
-- **No "virtual files" on Windows.** Files copied straight out of an Outlook attachment or a zip have no real path on the clipboard and aren't synced. Save or extract them first.
-- **The Mac app doesn't skip password-manager content yet**; the Windows app does.
-- **Items aren't resent after a long absence.** The server stores nothing. While the other Mac is unreachable, this Mac keeps the latest 20 items (from the last 24 hours) in memory, and they're lost if its background service restarts.
-- **Relayed transfers are limited by your server's bandwidth.** Direct connections aren't.
-
-## Build from source
-
-The Mac app needs Go 1.26, Flutter 3.44 and Xcode:
-
-```bash
-./scripts/build.sh # build everything into dist/
-./scripts/package.sh # build the DMG and server packages into release/
-```
-
-The Windows app needs Go, Flutter, Visual Studio ("Desktop development with C++") and Inno Setup 6. On Windows:
-
-```powershell
-powershell -ExecutionPolicy Bypass -File scripts\build-windows.ps1 # installer and portable zip into dist\windows\
-```
-
-The background service is pure Go and also cross-compiles from a Mac: `GOOS=windows go build ./cmd/copysyncd`. CI builds the Windows installer on every commit.
-
-During development:
-
-```bash
-cd client-core && go test ./... # service tests
-./tools/natlab/docker.sh # NAT lab: direct vs relay across 11 network topologies
-cd ui && flutter test # app tests
-./scripts/install-macos.sh # install the service from dist/ as a login item
-./dist/copysync-cli status # service status
-./dist/copysync-cli watch # live event stream
-```
-
-After changing a `.proto` file, run `./scripts/gen-proto.sh` (uses buf; install with `go install`, no protoc needed). After changing the UI, run `./tools/screenshots/render.sh` to regenerate the screenshots from demo data.
-
-```
-client-core/ background service (Go)
- internal/clipboard clipboard (Mac: cgo + Objective-C; Windows: Win32; main thread only)
- internal/transport signaling (WebSocket) and P2P (WebRTC)
- internal/sync sync engine: routing, packing, transfer, storage
-ui/ app (Flutter)
-server/ signaling + TURN relay server (Go); deployment files in server/deploy/
-proto/ message definitions and device ID derivation, shared by all three
-docs/ website (GitHub Pages)
-spikes/ technical validation done before development
-design/ design documents
-tools/natlab/ NAT traversal lab
-tools/installer/ Windows installer (Inno Setup)
-```
-
-## Troubleshooting
-
-**`.uuremote_…` file records keep appearing while UU Remote is running**
-Upgrade both clients to 1.3.2. UU Remote puts temporary placeholder files on the system clipboard; older CopySync clients recorded and forwarded them as ordinary files. The new version filters the confirmed `.uuremote_aeawv` followed by digits before scanning, recording or sending, keeps ordinary files in mixed selections, ignores placeholder-only incoming offers, and removes placeholder-only history on startup without deleting UU's source files. Ordinary empty, hidden and large files are unaffected. The 50 MB threshold controls automatic transfer; there is no need to disable UU's UDP P2P. Other clipboard sync tools can still duplicate ordinary content; use one clipboard sync provider if needed. See the [investigation and validation notes](design/uu-remote-clipboard.md).
-
-**Nothing comes off the clipboard, and `pbpaste` is empty too**
-The system pasteboard service may be stuck: an app declared clipboard content and then crashed, leaving types without data. Run `killall pboard` and copy again.
-
-**A device stays offline**
-Check **Settings → Connection** on both computers. If it isn't connected, verify the server address and that port 8787 is reachable.
+| **Mac app** | macOS 13 Ventura or later; Intel and Apple silicon |
+| **Windows app** | Windows 10 (21H2 or later) and 11, x64 |
+| **Server** | Linux (x86_64, ARM64; systemd or Docker), macOS, or Windows 10/11 x64 |
+| **iPhone / iPad** | Not supported: iOS doesn't let apps watch the clipboard in the background |
-**Always "relay", never "direct"**
-Showing "relay" right after connecting and "direct" a little later is normal: the relay makes things work first, and the direct path takes over when the link is idle. If it stays "relay", NAT traversal didn't succeed, which is common with NATs that randomize ports or strict firewalls. Everything still works; speed is limited by the server's bandwidth. Run `copysync-cli nat` to see how many uplinks were found; zero means UDP is blocked.
+## Documentation
-**Logs**
-The background service logs to `~/Library/Logs/CopySync/daemon.log` on Mac and `%LOCALAPPDATA%\CopySync\logs\daemon.log` on Windows. On the server, use `journalctl -u copysync-server -f`.
+- [How it works](guide/how-it-works.md): architecture, NAT traversal, security model, fallbacks, lessons learned
+- [Troubleshooting](guide/troubleshooting.md) and known limitations
+- [Server deployment](server/deploy/README.md) · [LAN guide with screenshots](https://baiyuze.github.io/copysync/en/server/)
+- [Building from source](guide/building.md)
+- Design notes (Chinese): [NAT traversal on multi-uplink networks](design/nat-traversal.md), [Windows client](design/windows-client.md)
+- [Changelog](CHANGELOG.md)
## License
-CopySync is dual-licensed. It's free under the [GNU AGPL-3.0](LICENSE): anyone, companies included, can use and modify it, but distributing it or offering a modified version over a network means publishing your source under the same license. A [commercial license](LICENSING.md) is available for closed-source products, private modifications and hosted services; [open a "Commercial license" issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml) to ask. Versions 1.2.0 and earlier remain under the MIT License. Details are in [LICENSING.md](LICENSING.md).
+CopySync is dual-licensed. It's free under the [GNU AGPL-3.0](LICENSE): anyone, companies included, can use and modify it, but distributing it or offering a modified version over a network means publishing your source under the same license. A [commercial license](LICENSING.md) is available for closed-source products, private modifications and hosted services; [open a "Commercial license" issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml) to ask. Versions 1.2.0 and earlier remain under the MIT License.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 82c42ed..87a9e6b 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -33,14 +33,7 @@
## 它解决什么问题
-手边有两台电脑的人,每天都在做同一件事:这台上复制了一段文字、一张截图、一个文件,要拿到那台上用。
-
-现有的办法各有各的不顺手:
-
-- **系统自带的「通用剪贴板」**要求两台设备登录同一个 Apple ID、离得足够近、蓝牙和 Wi‑Fi 都开着。公司电脑和自己的电脑通常不是同一个 Apple ID;大文件经常复制到一半就没了。
-- **隔空投送**每次都要选设备、在另一台上点接收,而且只传文件,不管剪贴板。
-- **用聊天软件发给自己**要手动下载、图片会被压缩,文件还会留在第三方的服务器上。
-- **一台 Mac、一台 Windows** 时,上面这些系统自带的办法都用不了。
+通用剪贴板要同一个 Apple ID、两台离得近;隔空投送每次都要点接收,也不管剪贴板;发给自己要手动下载,文件还留在别人的服务器上。一台 Mac、一台 Windows 时,系统自带的办法一个都用不了。
CopySync 的做法是:两台电脑配对一次,之后在一台上复制,另一台上直接粘贴。Mac 与 Mac、Mac 与 Windows、Windows 与 Windows 都可以。数据在两台设备之间直接传输,打不通直连时经过你自己部署的服务器中转,全程端到端加密,服务器看不到内容。
@@ -57,290 +50,56 @@ CopySync 的做法是:两台电脑配对一次,之后在一台上复制,
## 功能
- **文本、带格式的文本、图片、文件、文件夹**都能同步。复制什么,对面粘贴出来就是什么。
-- **按大小分流**:50 MB 以内(可调)的内容复制时直接推送,对面立刻能粘贴;更大的文件只同步一条记录,需要时点「拉取到本机」,不会无谓地占用带宽和磁盘。
-- **复制记录**:最近 3 天(可调)在所有设备上复制过的内容都在这里,随时可以放回剪贴板;图片点开就能预览,可以缩放。
-- **直连优先,自动中转**:先尝试设备之间直连;在对称 NAT、公司防火墙后面打不通时,自动改走你服务器上的 TURN 中转。
-- **配对时核对安全指纹**:防止服务器或网络上的第三方冒充你的设备。
-- **后台常驻**:关掉窗口照常同步,开机自动启动,崩溃后自动恢复。Windows 上在任务栏右下角有托盘图标。
-- **Mac 与 Windows 互通**:Mac 上 Intel 与 Apple 芯片原生运行;Windows 10、11 均可,粘贴文件时得到的是真实文件,能直接粘进资源管理器、微信、Office。支持浅色与深色外观。
-- **中文、英文、日文界面**:默认跟随系统语言,也可以在设置里切换。
-- **不同步密码**(Windows):密码管理器复制的内容带着「不要记录」的标记,CopySync 跳过它们,不同步也不进复制记录。
+- **按大小分流**:50 MB 以内(可调)复制时直接推送;更大的文件只同步一条记录,需要时再拉取。
+- **复制记录**:所有设备上最近 3 天(可调)复制过的内容,图片可以预览。
+- **直连优先,自动中转**,公司双线这类多出口网络也能直连。
+- **配对时核对安全指纹**,防止服务器或网络上的第三方冒充你的设备。
+- **后台常驻**,开机自启,崩溃自动恢复。中文、英文、日文界面。
<table>
<tr>
<td><img src="docs/assets/screenshots/devices.png" alt="设备页:已配对的设备、直连或中转状态"></td>
<td><img src="docs/assets/screenshots/verify.png" alt="配对时核对两台设备上显示的安全指纹"></td>
</tr>
- <tr>
- <td><img src="docs/assets/screenshots/settings.png" alt="设置页:服务器地址、同步上限、同步的内容类型"></td>
- <td><img src="docs/assets/screenshots/history-dark.png" alt="深色外观下的复制记录"></td>
- </tr>
</table>
-## 支持哪些电脑
-
-| | 要求 |
-|---|---|
-| **Mac 客户端** | macOS 13 Ventura 及以上;Intel 与 Apple 芯片(M1–M4 等)通用,不需要 Rosetta |
-| **Windows 客户端** | Windows 10(21H2 及以上)与 Windows 11,x64;ARM 版 Windows 可以模拟运行 |
-| **服务器** | 任意 Linux(x86_64 或 ARM64),systemd 或 Docker 均可;也可以直接跑在其中一台 Mac 上 |
-| **iPhone / iPad** | 暂不支持。iOS 不允许 App 在后台监听剪贴板,做不到 Mac 上这种复制即同步的体验 |
-
-## 安装
-
-整套东西由两部分组成:**每台电脑装一个 App**,再加**一台两端都能访问到的服务器**。两台电脑在同一个局域网时,服务器直接放在其中一台 Mac 上就行。
-
-### 1. 部署服务器
-
-在 Linux 服务器上(需要 root):
-
-```bash
-curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
-tar xzf copysync-server-linux-amd64.tar.gz
-cd copysync-server-linux-amd64
-sudo ./install.sh <服务器公网IP>
-```
-
-脚本会注册一个开机自启的 systemd 服务,并在最后打印出客户端要填的地址。ARM 服务器下载 `linux-arm64` 版本。
-
-云服务器的安全组或防火墙需要放行:
-
-| 端口 | 协议 | 用途 |
-|---|---|---|
-| 8787 | TCP | 信令(WebSocket) |
-| 3478 | UDP | STUN / TURN |
-| 32768–60999 | UDP | TURN 中转端口,系统随机分配 |
-
-用 Docker 部署、或者只在局域网里用,见[服务器部署说明](server/deploy/README.md)。
-
-### 2. 在每台电脑上安装 App
-
-**Mac**
-
-1. 下载 [CopySync.dmg](https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg),打开后把 CopySync 拖进「应用程序」。
-2. 从「应用程序」里打开 CopySync。
-
- 第一次打开时 macOS 会提示「无法验证开发者」:CopySync 还没有经过 Apple 公证(需要付费开发者账号)。到 **系统设置 → 隐私与安全性**,在页面下方点 **仍要打开**。只需要这一次。
-
-3. 点 **启用后台同步**。
-4. 在 **设置 → 信令服务器地址** 填入 `ws://<服务器地址>:8787/signal`,按回车。
-5. 较新的 macOS 会询问是否允许 CopySync Daemon 读取剪贴板,选择允许。之后可以在 **系统设置 → 隐私与安全性 → 从其他 App 粘贴** 里改为始终允许,App 里也有直达按钮。
-
-**Windows**
-
-1. 下载 [CopySync-Setup.exe](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe) 并运行。装在当前用户目录下,不需要管理员权限。
-
- CopySync 还没有代码签名,Windows 会提示「Windows 已保护你的电脑」:点 **更多信息 → 仍要运行**。不想运行安装程序的话,可以下载[便携版 zip](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip),解压后直接打开。
-
-2. 打开 CopySync(安装完会自动打开,桌面和开始菜单里也有),点 **启用后台同步**。
-3. 在 **设置 → 信令服务器地址** 填入 `ws://<服务器地址>:8787/signal`,按回车。
-4. Windows 防火墙询问是否允许 copysyncd 通信时,选择允许。
-
-关掉窗口后,CopySync 在右下角的托盘里继续运行;从托盘图标或桌面快捷方式都能再打开它。
-
-### 3. 配对
-
-1. 在一台电脑上点 **设备 → 添加设备 → 生成配对码**。
-2. 在另一台上点 **添加设备 → 输入配对码**,输入那 6 位字符。
-3. 两台屏幕上会显示同样的两行安全指纹(这台的和对方的),**逐行核对两边完全一致后**再点确认。
-
-之后在任意一台上复制,另一台就能直接粘贴。
-
-## 工作原理
-
-```mermaid
-flowchart LR
- subgraph A["电脑 A(Mac 或 Windows)"]
- UA["CopySync 界面"] <-- "gRPC" --> DA["后台服务"]
- end
- subgraph B["电脑 B(Mac 或 Windows)"]
- DB["后台服务"] <-- "gRPC" --> UB["CopySync 界面"]
- end
- S[("你的服务器\n信令 + TURN")]
- DA -- "信令(WebSocket)" --> S
- DB -- "信令(WebSocket)" --> S
- DA <== "WebRTC 直连(DTLS 加密)" ==> DB
- DA <-. "打不通时经 TURN 中转" .-> S
- S <-.-> DB
-```
-
-| 组件 | 做什么 | 技术 |
-|---|---|---|
-| 后台服务 `copysyncd` | 监听剪贴板、与对端建立连接、收发与落盘 | Go。剪贴板部分在 Mac 上用 cgo 调用 AppKit,在 Windows 上直接调用 Win32(纯 Go,不需要 C 编译器) |
-| 界面 `CopySync` | 复制记录、设备配对、设置 | Flutter,经本机 gRPC 与后台服务通信;Mac 与 Windows 共用一套代码 |
-| 服务器 `copysync-server` | 设备发现、转达配对码、转发信令、TURN 中转 | Go,单个静态二进制,约 15 MB 内存 |
-| 协议 `proto/` | 三方共用的消息定义 | Protocol Buffers |
+## 开始使用
-**一次复制的经过:**
+需要**每台电脑装一个 App**,再加**一台两端都能访问到的服务器**。
-1. 后台服务发现剪贴板变了:Mac 上每隔一小段时间检查剪贴板的变更计数(只看计数和类型不需要授权,也不会触发系统提示);Windows 上由系统即时通知。
-2. 发现变化后读取内容,按类型和大小决定怎么传:文本直接内联在消息里;50 MB 以内的图片与文件打包成流(tar + zstd)立即推送;更大的只发一条记录。
-3. 对端收到后先写入本地缓存,再写入剪贴板。在那台电脑上 `⌘V` 或 `Ctrl+V` 粘贴出来的,就是本地的真实文件。Mac 上合法、Windows 上不合法的文件名(比如带冒号的)在 Windows 上换成对应的全角字符。
+**1. 部署服务器。**
-**连接是怎么建立的:**
+- *同一个局域网*(家里或办公室):放在任意一台常开的 Windows、Mac 或 Linux 电脑上,下载后运行一个安装脚本即可。图文教程:**[在局域网里部署服务器](https://baiyuze.github.io/copysync/server/)**。
+- *跨公网*:一台有公网 IP 的 Linux 服务器,需要 root:
-1. 设备通过 WebSocket 连上信令服务器,拿到 STUN 与 TURN 的地址。
-2. 所有连接共用一个本地 UDP 端口。后台服务在这个端口上向多台服务器探测本机的公网地址,网络有几个出口就能拿到几个地址(见下一节)。
-3. 握手时把局域网地址、每个出口的公网地址、TURN 中转地址都发给对端,两边用 WebRTC 的 ICE 同时互相尝试。其中一方先不公布出口地址,等收到对方的、先往那边发过包再公布:有的路由器会被对方先到的包占住端口(见下一节)。
-4. 直连打通就走直连;中转路径至少等 5 秒才允许被选中,给直连留出时间。
-5. 连上后两端互相告知自己是否经过中转,任一端经中转,两边都显示「中转」。
-6. 若还是先落到了中转,发起连接的一方会在空闲时用 ICE 重启再打一次洞,打通就换成直连(10 秒后第一次,之后间隔逐步拉长到 15 分钟)。
+ ```bash
+ curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
+ tar xzf copysync-server-linux-amd64.tar.gz && cd copysync-server-linux-amd64
+ sudo ./install.sh <服务器公网IP>
+ ```
-数据走 WebRTC 数据通道,DTLS 加密。
+ 放行 TCP 8787、UDP 3478 与 UDP 32768–60999。Docker 部署与全部参数见[服务器部署说明](server/deploy/README.md)。国内云服务器的域名没有备案时,客户端里请直接填 IP。
-### 多出口网络的打洞
+**2. 在每台电脑上安装 App**:macOS 13 以上用 [CopySync.dmg](https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg),Windows 10/11 用 [CopySync-Setup.exe](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe)(也有[便携版](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip))。还没有公证和代码签名:Mac 上第一次打开时到 **系统设置 → 隐私与安全性** 点 **仍要打开**;Windows 上点 **更多信息 → 仍要运行**。然后点 **启用后台同步**,在 **设置 → 信令服务器地址** 填入 `ws://<服务器地址>:8787/signal`。
-公司双线、运营商 NAT 地址池这类网络有多个出口,按目标 IP 选择走哪一个。实测一个公司网络有 4 个出口:
+**3. 配对。**一台点 **设备 → 添加设备 → 生成配对码**,另一台点 **输入配对码**。两边显示的两行安全指纹完全一致后再确认。之后在任意一台上复制,另一台就能直接粘贴。
-| 出口 | 落在这个出口上的探测服务器 | 公网端口 |
-|---|---|---|
-| 出口 A | 自己的服务器、Twilio | 不变 |
-| 出口 B | B 站、Google、Nextcloud | 不变 |
-| 出口 C | Cloudflare、FreeSWITCH | 改写,但对不同目标相同 |
-| 出口 D | 阿里云上的服务 | 改写 |
-
-只问一台服务器,就只知道其中一个出口的地址;发往对端的包按目标 IP 很可能从另一个出口出去,对端收到的源地址对不上,被它的路由器丢弃。CopySync 1.0 就是这样只能走中转。
-
-1.1 的做法:
-
-- **共用一个端口**:之前 pion 每问一台 STUN 服务器就开一个新端口,问到的地址只对那个端口成立。现在所有连接共用一个端口,探测结果对它全部成立。
-- **探测每个出口**:在这个端口上并发探测 IP 分散的服务器(自己的服务器,加上 B 站、Cloudflare 等公共 STUN),按 IP 去重,过滤被 DNS 污染的地址。
-- **全部告诉对端**:每个出口的地址都作为候选地址发给对端,对端逐个检查,与实际出口吻合的那个能打通。会改写端口的出口拿到的是真实映射。
-- **记住见过的出口**:某一轮漏掉的出口,若它不改端口,就按「出口 IP + 本地端口」推算补上。
-
-实测公司 4 个出口与家用宽带之间直连,连上服务器后约 3 秒建立。设计细节、测量过程与验证见 [多出口网络的 NAT 打洞](design/nat-traversal.md)。
-
-**NAT 打洞实验室**(`tools/natlab`)用 Linux 网络命名空间与 iptables 搭出真实拓扑,用 CopySync 真实的连接代码验证 11 种场景,每次提交都在 CI 里运行:
-
-| 场景 | 结果 |
-|---|---|
-| 单出口 ↔ 家用路由器 | 直连 |
-| 两个出口,旧版本(对照) | 中转 |
-| 两个出口 ↔ 家用路由器 | 直连 |
-| 四个出口 ↔ 家用路由器 | 直连 |
-| 两个出口,第二条没探测到:无历史 / 有历史 | 中转 / 直连 |
-| 两个出口 ↔ 两个出口 | 直连 |
-| 两个出口 ↔ 端口随机分配的 NAT | 中转 |
-| 一开始打不通,之后网络恢复 | 先中转,随后换成直连 |
-| 公司路由器会为外来的包占住端口 | 直连 |
-| 家用路由器会为外来的包占住端口 | 先中转,第一次重试后直连 |
-
-### 安全模型
-
-- **服务器不存账号**。设备身份是一把 Ed25519 密钥,设备 ID 由公钥派生,服务器据此就能验证"这个 ID 确实属于这把公钥",无需用户表。
-- **配对时人工核对指纹**。两台设备显示同样的两行:双方各自公钥的指纹(SHA-256 的前 60 位,形如 `R8NF-2WTC-QL5J`),按固定顺序排列。服务器可以在配对时替换转发中的公钥,但替换后两块屏幕上的内容就对不上了,这一步就是防中间人的闸门。两个指纹分开显示而不是合成一串短码,是因为攻击者同时控制两把伪造公钥时,凑出一串相同的短码只需生日攻击;分开显示则要为每把公钥各做一次原像攻击,难度高出约十亿倍。
-- **之后的每条信令都带签名**,服务器无法伪造设备。直连通道的 DTLS 证书指纹也经签名传递,握手后比对实际证书,不一致立即断开。
-- **中转也看不到内容**。TURN 只转发加密后的 UDP 包。中转凭证按设备单独签发,12 小时过期。
-- **公共 STUN 服务器只看到公网 IP**。为了在多出口网络里找到每个出口,默认会向几台公共 STUN 服务器探测,它们能看到你的公网 IP(与任何 WebRTC 应用一样),看不到内容。介意的话在设置里关掉「用公共服务器探测网络出口」,只用自己的服务器。
-- **设备私钥**:Mac 上以仅本人可读的权限存放;Windows 上另用系统的 DPAPI 加密,换个用户、或把文件拷到别的电脑上都解不开。
-- **不启用 App 沙盒**:需要访问你复制的任意路径下的文件。
-
-### 兜底:出问题时会发生什么
-
-| 情况 | 处理方式 |
+| | 要求 |
|---|---|
-| 两端打不通直连(对称 NAT、公司防火墙) | 自动改走服务器的 TURN 中转,内容依然加密;界面上显示「中转」 |
-| 公共 STUN 在国内时通时断 | 服务器自带 STUN,客户端优先用它 |
-| 公司双线等多出口网络(按目标地址选出口) | 所有连接共用一个本地端口,在这个端口上向多台服务器探测每个出口的地址,全部发给对端由它逐个尝试;探测漏掉的出口按历史推算。`copysync-cli nat` 可以看到探测结果 |
-| 先落到了中转,其实打得通(对端刚启动、出口地址晚到一步) | 发起方在空闲时用 ICE 重启再打一次洞,打通就换成直连;有传输在进行时不重启。重启期间连接不断,只停顿几秒 |
-| 对方睡眠、断网、重启,连接悄悄断了 | 发现连接失效立即关闭、重连;对方重建了连接,本端也随之换新 |
-| 复制时对方连不上 | 记下最近 20 条,连接恢复后补发。补发的只进复制记录,不写进对方的剪贴板,免得覆盖对方此刻正在用的内容 |
-| 信令服务器断开 | 指数退避自动重连(1 秒起,最长 30 秒,带随机抖动),界面实时显示连接状态 |
-| 配对时两端确认有先后 | 先确认一方发来的握手消息会被暂存,另一方确认后重放,配对完成几十毫秒内即可直连 |
-| 大文件 | 超过阈值只同步记录,按需拉取;拉取时源文件已被删除会明确提示,而不是失败得不明不白 |
-| 只认纯文本的输入框 | 带格式的文本同时写入 HTML 与纯文本两份,粘贴到哪里都不会出现标签 |
-| 还没有授权读取剪贴板 | 不去读内容(否则会卡在一个后台进程看不见的系统弹窗上),界面上提示去授权 |
-| 后台服务崩溃 | 由 launchd 自动拉起;10 秒节流,不会疯狂重启 |
-| 覆盖安装了新版、或 App 换了位置 | 打开 App 时自动校正登录项,并重启到新版本 |
-| 记录和缓存越来越多 | 到期自动清理,默认保留 3 天 |
-
-### 踩过的坑
-
-这些都是实测撞出来的,各自对应一个回归测试。完整的验证过程见 [spikes/results.md](spikes/results.md)。
-
-- **macOS 的剪贴板调用必须在主线程。**开启隐私机制后,剪贴板 API 要经系统 UI 服务通信,依赖 run loop,在普通线程上调用会直接崩溃。后台服务启动时就把主线程锁住,专门留给剪贴板,业务逻辑投递过去执行。
-- **"对方按下粘贴键才传输"在 macOS 上做不到。**系统在写入剪贴板后约 0.1 秒就会把延迟提供的数据兑现并缓存,真正按下 `⌘V` 时不再回调,也没有"剪贴板被读取"的通知。所以小文件是预先推送的,大文件改为手动拉取。
-- **WebRTC 库(pion)的三个坑**:`DetachDataChannels()` 是全局开关,开了以后所有通道的普通收发都失效;`OnMessage` 不缓冲,回调设置之前到达的消息直接丢弃(实测发 202 字节,收到 0 字节);`OnBufferedAmountLow` 是边沿触发,等待方晚一步进入等待就再也等不到唤醒(20 MB 传到 786 KB 卡死)。
-- **pion 为每台 STUN 服务器单独开端口**,问到的地址互相用不上。多出口网络里多配几台 STUN 也打不通,所以改为所有连接共用一个端口、由自己探测。
-- **单靠一端判断不了是否中转。**一端经 TURN 发送时,另一端看到的可能只是个普通地址,曾出现一台显示直连、一台显示中转。现在连接就绪后两端互相告知。
-- **pion 选定线路后就不再更换。**中转握手快,一旦赢了这场赛跑,整个连接期间都走中转。实测对端重启后的第一次握手,出口地址比中转的等待时限晚到,就这样一直中转。现在中转等待放宽到 5 秒、探测时并发解析域名(整轮从约 1.6 秒降到 0.2 秒以内),并在中转时用 ICE 重启再试直连。
-- **谁先发包很重要。**有的路由器(实测公司那台)收到对方先到的包,会留下一条连接记录、占住端口,本端随后往外发只好换端口,打洞就失败了。这解释了为什么本机重启时总能直连、家里那台一重启就中转:本机重启时出口要现探测,地址晚发出,本机反而先发包。现在由规则决定谁先发包,换直连的重试里两种顺序轮流用。
-- **连接失效后要自己清理。**pion 报告「失败」后不会关闭连接,控制通道看上去还是打开的,写进去的消息石沉大海;上层以为连接还在,也不会重连。1.1.0 曾因此在对方断线后,把 6 个文件「发」进了一条死连接,对方一个也没收到。
-- **公共 STUN 域名可能被 DNS 污染**,实测被解析到 `192.0.2.42`。这类保留地址和代理软件的 fake-ip 网段在探测前就过滤掉。
-- **测试用的模拟路由器要有防火墙。**两端同时打洞时,对方的包若被放行到路由器本机,Linux 会为它留下一条连接记录,本端随后往外发时只好换端口,打洞就失败了。真实路由器直接丢弃这类包,实验室也照此配置。
-
-局域网直连实测:20 MB 文件约 330 毫秒传完,校验和一致。
-
-## 已知限制
-
-- **没有经过 Apple 公证,Windows 版也没有代码签名**,第一次打开时需要手动放行一次。
-- **Windows 上不支持「虚拟文件」**:从 Outlook 附件、压缩包里直接复制的文件,剪贴板里没有真实路径,不会同步。先保存或解压出来再复制即可。
-- **Mac 版还不会跳过密码管理器复制的内容**,Windows 版已经会。
-- **对方离线太久的内容不会补发**。服务器不存数据;对方暂时连不上时,本机只在内存里记下最近 20 条(24 小时内的),本机的后台服务重启后就清空了。
-- **中转模式的速度取决于服务器带宽**。直连时不受影响。
-
-## 从源码构建
-
-Mac 版需要 Go 1.26、Flutter 3.44 和 Xcode:
-
-```bash
-./scripts/build.sh # 构建全部到 dist/
-./scripts/package.sh # 打出 DMG 与服务器发布包到 release/
-```
-
-Windows 版需要 Go、Flutter、Visual Studio(「使用 C++ 的桌面开发」)与 Inno Setup 6,在 Windows 上运行:
-
-```powershell
-powershell -ExecutionPolicy Bypass -File scripts\build-windows.ps1 # 安装程序与便携版到 dist\windows\
-```
-
-后台服务是纯 Go,也可以在 Mac 上交叉编译:`GOOS=windows go build ./cmd/copysyncd`。CI 在每次提交时构建 Windows 安装包。
-
-开发时可以单独运行各部分:
-
-```bash
-cd client-core && go test ./... # 后台服务的测试
-./tools/natlab/docker.sh # NAT 打洞实验室:11 种网络拓扑下的直连与中转
-cd ui && flutter test # 界面的测试
-./scripts/install-macos.sh # 把 dist/ 里的后台服务装成登录项
-./dist/copysync-cli status # 查看后台服务状态
-./dist/copysync-cli watch # 实时事件流
-```
-
-改了 `.proto` 之后运行 `./scripts/gen-proto.sh` 重新生成代码(用 buf,`go install` 即可安装,无需 protoc)。改了界面之后运行 `./tools/screenshots/render.sh` 重新生成截图,截图用演示数据渲染,不会带出本机的真实内容。
-
-```
-client-core/ 后台服务(Go)
- internal/clipboard 剪贴板(Mac:cgo + Objective-C;Windows:Win32;都必须跑在主线程)
- internal/transport 信令(WebSocket)与 P2P(WebRTC)
- internal/sync 同步引擎:分流、打包、传输、落盘
-ui/ 界面(Flutter)
-server/ 信令 + TURN 中转服务器(Go),部署文件在 server/deploy/
-proto/ 消息定义与设备 ID 派生规则,三方共用
-docs/ 项目主页(GitHub Pages)
-spikes/ 开工前的技术验证
-design/ 技术方案文档
-tools/natlab/ NAT 打洞实验室
-tools/installer/ Windows 安装程序(Inno Setup)
-```
-
-## 排障
-
-**UU 远程开启时不断新增 `.uuremote_…` 文件记录**
-升级两端客户端到 1.3.2。UU 远程会把临时占位文件写入系统剪贴板,旧版 CopySync 会把它们当成普通文件再次转发。新版在扫描、入库和发送之前过滤已确认的 `.uuremote_aeawv` 加数字命名;混合选择保留正常文件,接收端忽略纯占位记录,启动时清理历史里的纯占位记录(不删除 UU 的源文件)。普通空文件、隐藏文件和大文件不受这条规则影响。50 MB 是自动传输阈值,不是故障原因;无需关闭 UU 的 UDP P2P。其他剪贴板同步工具仍可能造成普通内容重复,可只保留一个工具负责剪贴板同步。技术与验证记录见 [UU 远程兼容修复](design/uu-remote-clipboard.md)。
-
-**剪贴板读不到内容,`pbpaste` 也是空的**
-系统的剪贴板服务可能卡住了:某个程序声明了剪贴板内容后异常退出,会留下一个"有类型声明、没有数据"的空壳。执行 `killall pboard`,再复制一次即可。
-
-**设备一直显示「离线」**
-检查两台电脑的 **设置 → 连接状态** 是否都是「已连接」。不是的话,确认服务器地址正确、8787 端口可以访问。
+| **Mac 客户端** | macOS 13 Ventura 及以上;Intel 与 Apple 芯片通用 |
+| **Windows 客户端** | Windows 10(21H2 及以上)与 11,x64 |
+| **服务器** | Linux(x86_64、ARM64;systemd 或 Docker)、macOS,或 Windows 10/11 x64 |
+| **iPhone / iPad** | 暂不支持:iOS 不允许 App 在后台监听剪贴板 |
-**一直显示「中转」而不是「直连」**
-刚连上时显示中转、过一会儿变成直连是正常的:先用中转保证能用,空闲时再换直连。一直是中转,说明 NAT 打洞没成功,常见于端口随机分配的 NAT 或严格的防火墙。功能不受影响,只是速度受服务器带宽限制。运行 `copysync-cli nat` 看本机探测到了几个出口:出口为 0 说明 UDP 被拦截了。
+## 文档
-**查看日志**
-后台服务的日志:Mac 上在 `~/Library/Logs/CopySync/daemon.log`,Windows 上在 `%LOCALAPPDATA%\CopySync\logs\daemon.log`。服务器的日志用 `journalctl -u copysync-server -f` 查看。
+- [工作原理](guide/how-it-works.zh-CN.md):架构、NAT 打洞、安全模型、兜底、踩过的坑
+- [排障](guide/troubleshooting.zh-CN.md)与已知限制
+- [服务器部署说明](server/deploy/README.md) · [局域网部署图文教程](https://baiyuze.github.io/copysync/server/)
+- [从源码构建](guide/building.zh-CN.md)
+- 技术方案:[多出口网络的 NAT 打洞](design/nat-traversal.md)、[Windows 客户端](design/windows-client.md)
+- [更新记录](CHANGELOG.md)
## 许可
-CopySync 采用双授权。按 [GNU AGPL-3.0](LICENSE) 免费使用:任何人(包括公司)都可以使用和修改,但分发它、或通过网络提供修改过的版本时,必须以同样的许可公开你的源码。闭源产品、不公开的修改、托管服务等情况可以购买[商业授权](LICENSING.md),请[提交「商业授权」issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml)。1.2.0 及更早的版本仍适用 MIT 许可。详见 [LICENSING.md](LICENSING.md)。
+CopySync 采用双授权。按 [GNU AGPL-3.0](LICENSE) 免费使用:任何人(包括公司)都可以使用和修改,但分发它、或通过网络提供修改过的版本时,必须以同样的许可公开你的源码。闭源产品、不公开的修改、托管服务等情况可以购买[商业授权](LICENSING.md),请[提交「商业授权」issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml)。1.2.0 及更早的版本仍适用 MIT 许可。
diff --git a/docs/assets/screenshots/en/settings-lan-dark.png b/docs/assets/screenshots/en/settings-lan-dark.png
new file mode 100644
index 0000000..f15b6d7
Binary files /dev/null and b/docs/assets/screenshots/en/settings-lan-dark.png differ
diff --git a/docs/assets/screenshots/ja/settings-lan-dark.png b/docs/assets/screenshots/ja/settings-lan-dark.png
new file mode 100644
index 0000000..50b5c9e
Binary files /dev/null and b/docs/assets/screenshots/ja/settings-lan-dark.png differ
diff --git a/docs/assets/screenshots/settings-lan-dark.png b/docs/assets/screenshots/settings-lan-dark.png
new file mode 100644
index 0000000..95b6512
Binary files /dev/null and b/docs/assets/screenshots/settings-lan-dark.png differ
diff --git a/docs/assets/site.css b/docs/assets/site.css
index 3f0aa6b..c22861a 100644
--- a/docs/assets/site.css
+++ b/docs/assets/site.css
@@ -1421,6 +1421,517 @@ td {
margin-top: 0.2rem;
}
+/* ── 在局域网里部署服务器(server/ 页面) ── */
+
+.bar nav a[aria-current] {
+ color: var(--ink);
+}
+
+.guide-hero .crumb {
+ margin: 0 0 1.25rem;
+ font-size: 0.9rem;
+ color: var(--dim);
+}
+
+.guide-hero .display {
+ font-size: clamp(2.3rem, 6.5vw, 4.6rem);
+}
+
+/* 页内目录:几个带序号的胶囊 */
+.guide-toc {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 0.5rem;
+ margin: 2.25rem auto 0;
+ padding: 0;
+ list-style: none;
+ counter-reset: toc;
+}
+
+.guide-toc li {
+ counter-increment: toc;
+}
+
+.guide-toc a {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.45rem;
+ padding: 0.35rem 0.95rem;
+ border-radius: 999px;
+ box-shadow: inset 0 0 0 1px var(--rule-strong);
+ color: var(--ink-2);
+ font-size: 0.9rem;
+}
+
+.guide-toc a::before {
+ content: counter(toc);
+ color: var(--faint);
+ font-size: 0.8rem;
+ font-variant-numeric: tabular-nums;
+}
+
+.guide-toc a:hover {
+ color: var(--ink);
+ text-decoration: none;
+ box-shadow: inset 0 0 0 1px var(--ink-2);
+}
+
+/* 示意图里的局域网边界与服务器地址 */
+.d-lan {
+ fill: none;
+ stroke: var(--rule-strong);
+ stroke-width: 1.5;
+ stroke-dasharray: 6 6;
+}
+
+.d-lan-label {
+ fill: var(--faint);
+ font: 14px var(--sans);
+}
+
+.d-ip {
+ fill: var(--blue-hi);
+ font: 600 17px var(--mono);
+}
+
+.ports {
+ margin: 2.5rem auto 0;
+ max-width: 48rem;
+}
+
+/* 按系统分页:有脚本时是一个分段控件,没有脚本时三个系统依次排开 */
+.os-tabs {
+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;
+ max-width: 70rem;
+}
+
+.tablist {
+ display: flex;
+ width: fit-content;
+ margin: 0 auto clamp(2rem, 5vw, 3rem);
+ padding: 4px;
+ border-radius: 999px;
+ background: var(--surface);
+ box-shadow: inset 0 0 0 1px var(--rule);
+}
+
+.tablist[hidden] {
+ display: none;
+}
+
+.tablist button {
+ padding: 0.45rem 1.35rem;
+ border: 0;
+ border-radius: 999px;
+ background: transparent;
+ color: var(--dim);
+ font: inherit;
+ font-size: 0.95rem;
+ font-weight: 500;
+ cursor: pointer;
+}
+
+.tablist button:hover {
+ color: var(--ink);
+}
+
+.tablist button[aria-selected="true"] {
+ background: var(--surface-2);
+ color: var(--ink);
+ box-shadow: inset 0 0 0 1px var(--rule-strong);
+}
+
+.os + .os {
+ margin-top: 4.5rem;
+ padding-top: 3rem;
+ border-top: 1px solid var(--rule);
+}
+
+.tabs-on .os + .os {
+ margin-top: 0;
+ padding-top: 0;
+ border-top: 0;
+}
+
+.os-title {
+ display: flex;
+ align-items: center;
+ gap: 0.6rem;
+ margin-bottom: 1.75rem;
+ font-size: 1.35rem;
+}
+
+.os-title svg {
+ width: 24px;
+ height: 24px;
+ color: var(--dim);
+}
+
+/* 分页时标题由分段控件代替,只留给读屏 */
+.tabs-on .os-title {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip-path: inset(50%);
+}
+
+.os-grid {
+ display: grid;
+ gap: 2.5rem;
+}
+
+.os-grid > * {
+ min-width: 0;
+}
+
+@media (min-width: 62rem) {
+ .os-grid {
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
+ gap: 3.5rem;
+ align-items: start;
+ }
+}
+
+/* 带圆圈序号的步骤 */
+.steps {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ counter-reset: step;
+}
+
+.steps > li {
+ position: relative;
+ padding-left: 2.6rem;
+ color: var(--ink-2);
+ counter-increment: step;
+}
+
+.steps > li + li {
+ margin-top: 1.4rem;
+}
+
+.steps > li::before {
+ content: counter(step);
+ position: absolute;
+ left: 0;
+ top: 0.1em;
+ display: grid;
+ place-items: center;
+ width: 1.75rem;
+ height: 1.75rem;
+ border-radius: 50%;
+ box-shadow: inset 0 0 0 1px var(--rule-strong);
+ color: var(--ink);
+ font-size: 0.85rem;
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
+}
+
+.steps .code {
+ margin-top: 0.75rem;
+}
+
+.os-steps > .button {
+ margin: 1.75rem 0 0 2.6rem;
+}
+
+.os-steps > .points {
+ margin-top: 2.25rem;
+ padding-top: 1.75rem;
+ border-top: 1px solid var(--rule);
+}
+
+.os-figures {
+ display: grid;
+ gap: 1.25rem;
+}
+
+/* 终端、文件夹、浏览器的示意窗口:照真实窗口画,但只保留轮廓 */
+.term,
+.explorer,
+.browser {
+ margin: 0;
+ border-radius: 12px;
+ overflow: hidden;
+ background: #0c0c0e;
+ box-shadow: 0 0 0 1px var(--rule-strong), 0 24px 60px rgba(0, 0, 0, 0.45);
+}
+
+.t-bar,
+.b-bar {
+ position: relative;
+ display: flex;
+ align-items: center;
+ height: 2.3rem;
+ padding: 0 0.85rem;
+ background: #232327;
+ border-bottom: 1px solid #2e2e33;
+ color: var(--dim);
+ font-size: 0.78rem;
+ white-space: nowrap;
+}
+
+.t-bar.mac .t-title {
+ position: absolute;
+ inset: 0 4.5rem;
+ display: grid;
+ place-items: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.t-lights {
+ display: flex;
+ gap: 8px;
+}
+
+.t-lights i {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: #ff5f57;
+}
+
+.t-lights i:nth-child(2) {
+ background: #febc2e;
+}
+
+.t-lights i:nth-child(3) {
+ background: #28c840;
+}
+
+.t-bar.win {
+ justify-content: space-between;
+ padding-right: 0;
+ background: #202020;
+}
+
+.t-tab {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ min-width: 0;
+ overflow: hidden;
+ color: var(--ink-2);
+}
+
+.t-tab svg {
+ width: 12px;
+ height: 12px;
+ flex: none;
+ color: var(--dim);
+}
+
+/* 文件夹窗口标题前的文件夹图标 */
+.t-tab.folder::before {
+ content: "";
+ flex: none;
+ width: 14px;
+ height: 11px;
+ border: 1.5px solid var(--dim);
+ border-radius: 2px;
+ border-top-width: 3px;
+}
+
+/* Windows 窗口右上角的最小化、最大化、关闭 */
+.t-ctl {
+ display: flex;
+ align-self: stretch;
+}
+
+.t-ctl i {
+ position: relative;
+ width: 2.75rem;
+}
+
+.t-ctl i::before,
+.t-ctl i::after {
+ content: "";
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ translate: -50% -50%;
+}
+
+.t-ctl i:nth-child(1)::before {
+ width: 10px;
+ height: 1px;
+ background: var(--dim);
+}
+
+.t-ctl i:nth-child(2)::before {
+ width: 9px;
+ height: 9px;
+ border: 1px solid var(--dim);
+}
+
+.t-ctl i:nth-child(3)::before,
+.t-ctl i:nth-child(3)::after {
+ width: 12px;
+ height: 1px;
+ background: var(--dim);
+ rotate: 45deg;
+}
+
+.t-ctl i:nth-child(3)::after {
+ rotate: -45deg;
+}
+
+.t-body {
+ margin: 0;
+ padding: 1rem 1.15rem 1.25rem;
+ color: var(--ink-2);
+ font: 0.74rem/1.7 var(--mono);
+ /* 和真的终端一样,太长的行折到下一行 */
+ white-space: pre-wrap;
+ overflow-wrap: anywhere;
+}
+
+.t-prompt,
+.t-step {
+ color: var(--dim);
+}
+
+.t-url {
+ color: var(--blue-hi);
+ font-weight: 600;
+}
+
+.explorer {
+ background: #191919;
+}
+
+.files {
+ margin: 0;
+ padding: 0.5rem;
+ list-style: none;
+ font-size: 0.85rem;
+}
+
+.files li {
+ display: flex;
+ align-items: center;
+ gap: 0.7rem;
+ padding: 0.4rem 0.65rem;
+ border-radius: 6px;
+ color: var(--ink-2);
+}
+
+.files li.hl {
+ background: var(--blue-wash);
+ box-shadow: inset 0 0 0 1px rgba(61, 139, 234, 0.5);
+ color: var(--ink);
+}
+
+.files em {
+ margin-left: auto;
+ font-style: normal;
+ font-size: 0.78rem;
+ color: var(--blue-hi);
+}
+
+/* 文件图标:程序是方框里一个窗口,脚本是带提示符的纸,其他是纸 */
+.f-icon {
+ position: relative;
+ flex: none;
+ width: 14px;
+ height: 17px;
+ border: 1.5px solid var(--dim);
+ border-radius: 2px;
+}
+
+.f-icon.exe {
+ width: 17px;
+ height: 14px;
+ border-top-width: 3.5px;
+}
+
+.f-icon.cmd::after {
+ content: "";
+ position: absolute;
+ left: 2px;
+ top: 3px;
+ width: 4px;
+ height: 4px;
+ border: solid var(--dim);
+ border-width: 1.5px 1.5px 0 0;
+ rotate: 45deg;
+}
+
+.browser {
+ max-width: 36rem;
+ margin: clamp(2rem, 5vw, 3rem) auto 0;
+}
+
+.b-bar {
+ gap: 1rem;
+ height: 2.6rem;
+}
+
+.b-url {
+ flex: 1;
+ min-width: 0;
+ padding: 0.2rem 0.8rem;
+ border-radius: 7px;
+ background: #141416;
+ color: var(--ink-2);
+ font-size: 0.8rem;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.b-body {
+ margin: 0;
+ padding: 1.25rem 1.3rem 1.5rem;
+ color: var(--ink-2);
+ font: 0.85rem/1.6 var(--mono);
+ overflow-x: auto;
+}
+
+/* 以后会用到的命令 */
+.manage {
+ margin-top: 3rem;
+ font-size: 0.9rem;
+}
+
+.manage caption {
+ padding-bottom: 0.5rem;
+ text-align: left;
+ font-weight: 600;
+ color: var(--ink);
+}
+
+.manage th {
+ width: 7.5rem;
+ color: var(--dim);
+ font-weight: 500;
+}
+
+@media (max-width: 34rem) {
+ .manage th,
+ .manage td {
+ display: block;
+ width: auto;
+ padding-inline: 0;
+ }
+
+ .manage th {
+ padding-bottom: 0;
+ border-bottom: 0;
+ }
+
+ .manage td {
+ padding-top: 0.25rem;
+ }
+
+ .os-steps > .button {
+ margin-left: 0;
+ }
+}
+
/* ── 404 ── */
.lost {
diff --git a/docs/assets/site.js b/docs/assets/site.js
index 9797e1e..64b1208 100644
--- a/docs/assets/site.js
+++ b/docs/assets/site.js
@@ -1,4 +1,4 @@
-// 首屏动画、代码块的「复制」按钮、记住选过的语言。没有脚本时页面照样完整:动画停在复制完成的样子。
+// 首屏动画、代码块的「复制」按钮、部署教程的系统分页、记住选过的语言。没有脚本时页面照样完整:动画停在复制完成的样子。
(function () {
var stage = document.querySelector("[data-play]");
@@ -72,6 +72,49 @@
});
});
+ // 部署教程按系统分页。链接里带了 #windows 之类就打开那一页,否则按访问者的系统;没有脚本时三个系统依次排开
+ document.querySelectorAll("[data-tabs]").forEach(function (box) {
+ var list = box.querySelector("[role=tablist]");
+ var tabs = Array.prototype.slice.call(list.querySelectorAll("[role=tab]"));
+ var panels = tabs.map(function (t) { return document.getElementById(t.getAttribute("aria-controls")); });
+
+ function select(i, focus) {
+ tabs.forEach(function (t, j) {
+ t.setAttribute("aria-selected", i === j ? "true" : "false");
+ t.tabIndex = i === j ? 0 : -1;
+ panels[j].hidden = i !== j;
+ });
+ if (focus) tabs[i].focus();
+ }
+
+ tabs.forEach(function (t, i) {
+ t.addEventListener("click", function () {
+ select(i);
+ history.replaceState(null, "", "#" + panels[i].id);
+ });
+ t.addEventListener("keydown", function (e) {
+ var step = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
+ if (step) {
+ e.preventDefault();
+ select((i + step + tabs.length) % tabs.length, true);
+ }
+ });
+ });
+
+ var ids = panels.map(function (p) { return p.id; });
+ var pick = ids.indexOf(location.hash.slice(1));
+ var linked = pick >= 0;
+ if (!linked) {
+ var ua = navigator.userAgent;
+ pick = /Windows/.test(ua) ? 0 : /Macintosh/.test(ua) ? 1 : /Linux|X11/.test(ua) && !/Android/.test(ua) ? 2 : 0;
+ }
+ list.hidden = false;
+ box.classList.add("tabs-on");
+ select(pick);
+ // 其他系统的内容收起来了,页面变短,重新对准链接指向的位置
+ if (linked) box.scrollIntoView();
+ });
+
// 点过语言链接,以后打开首页就直接是这种语言,不再按浏览器语言跳转
document.querySelectorAll("a[data-lang]").forEach(function (link) {
link.addEventListener("click", function () {
diff --git a/docs/design/nat-traversal.html b/docs/design/nat-traversal.html
index f37d18a..250dcf3 100644
--- a/docs/design/nat-traversal.html
+++ b/docs/design/nat-traversal.html
@@ -16,8 +16,9 @@
<div class="wrap">
<a class="brand" href="../" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="页面导航">
- <a href="https://github.com/baiyuze/copysync/blob/main/design/nat-traversal.md">在 GitHub 上查看</a>
- <a href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../server/">部署服务器</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync/blob/main/design/nat-traversal.md">在 GitHub 上查看</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
</nav>
</div>
</header>
diff --git a/docs/design/windows-client.html b/docs/design/windows-client.html
index f4ada60..1602149 100644
--- a/docs/design/windows-client.html
+++ b/docs/design/windows-client.html
@@ -16,8 +16,9 @@
<div class="wrap">
<a class="brand" href="../" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="页面导航">
- <a href="https://github.com/baiyuze/copysync/blob/main/design/windows-client.md">在 GitHub 上查看</a>
- <a href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../server/">部署服务器</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync/blob/main/design/windows-client.md">在 GitHub 上查看</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
</nav>
</div>
</header>
diff --git a/docs/en/index.html b/docs/en/index.html
index 627d848..210c60d 100644
--- a/docs/en/index.html
+++ b/docs/en/index.html
@@ -38,8 +38,8 @@
"description": "Open-source app that syncs the clipboard and files between Mac and Windows computers. Copy text, images, files or folders on one computer and paste on the other. Devices connect directly over WebRTC with end-to-end DTLS encryption, falling back to a TURN relay on a server the user hosts.",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "macOS 13 or later (Intel and Apple silicon); Windows 10, Windows 11 (x64)",
- "softwareVersion": "1.3.2",
- "datePublished": "2026-10-10",
+ "softwareVersion": "1.3.3",
+ "datePublished": "2026-10-11",
"inLanguage": "en",
"license": "https://www.gnu.org/licenses/agpl-3.0.html",
"isAccessibleForFree": true,
@@ -107,7 +107,7 @@
"name": "Do I need my own server?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough."
+ "text": "Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on any always-on Windows, Mac or Linux computer; see the LAN guide. Across networks you need a machine with a public IP; the smallest cloud VM is enough."
}
},
{
@@ -158,7 +158,8 @@
<a class="wide" href="#how">How it works</a>
<a class="wide" href="#install">Install</a>
<a class="wide" href="#faq">FAQ</a>
- <a href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="server/">Self-host</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
</nav>
@@ -174,7 +175,7 @@
<a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download for Mac</a>
<a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download for Windows</a>
</div>
- <p class="note">Version 1.3.2, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>
+ <p class="note">Version 1.3.3, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>
<div class="stage" data-play role="img" aria-label="Demo: Command C on a MacBook turns a file into a sheet that flies over a direct connection to a Windows laptop, where Ctrl V pastes it">
<figure class="device mac">
<div class="screen"><div class="desk">
@@ -372,7 +373,7 @@
<section class="section" id="install" aria-labelledby="install-title">
<div class="wrap">
<h2 id="install-title">Install</h2>
- <p class="intro">Install the app on each computer, and set up a server both of them can reach. If both share a LAN, the server can run on one of your Macs.</p>
+ <p class="intro">Install the app on each computer, and set up a server both of them can reach. If both share a LAN, the server can run on one of your Windows, Mac or Linux computers; see the <a href="server/">LAN guide</a>.</p>
<div class="install">
<div>
<h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>Mac</h3>
@@ -395,7 +396,7 @@
</div>
<div>
<h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>Server</h3>
- <p class="small">Any Linux, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.</p>
+ <p class="small">To use it across networks: a Linux server with a public IP, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.</p>
<div class="code">
<button class="copy" type="button" data-done="Copied">Copy</button>
<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
@@ -413,6 +414,7 @@ sudo ./install.sh YOUR_PUBLIC_IP</code></pre>
</tbody>
</table>
<p class="small">Docker works too; see the <a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">server deployment guide</a>.</p>
+ <a class="button quiet" href="server/">LAN setup guide</a>
</div>
</div>
<p class="pairing"><strong>Pairing:</strong> on one computer, choose Devices → Add device to show a 6-character code; enter it on the other, and confirm once both screens show the same two fingerprints. Mac with Windows, or two Windows PCs, works the same way.</p>
@@ -425,10 +427,10 @@ sudo ./install.sh YOUR_PUBLIC_IP</code></pre>
<div class="table-scroll">
<table class="specs">
<tbody>
- <tr><th scope="row">Version</th><td>1.3.2, released <time datetime="2026-10-10">October 10, 2026</time></td></tr>
+ <tr><th scope="row">Version</th><td>1.3.3, released <time datetime="2026-10-11">October 11, 2026</time></td></tr>
<tr><th scope="row">Mac app</th><td>macOS 13 Ventura or later; universal binary for Intel and Apple silicon, no Rosetta; about 47 MB download</td></tr>
<tr><th scope="row">Windows app</th><td>Windows 10 (21H2 or later) and Windows 11, x64; installs per user, no administrator rights; about 23 MB download</td></tr>
- <tr><th scope="row">Server</th><td>Linux on x86_64 or ARM64 (systemd or Docker), or macOS; about 15 MB of RAM</td></tr>
+ <tr><th scope="row">Server</th><td>Linux on x86_64 or ARM64 (systemd or Docker), macOS (Intel and Apple silicon), Windows 10 and 11 x64 (as a service); about 15 MB of RAM</td></tr>
<tr><th scope="row">Languages</th><td>English, Simplified Chinese and Japanese; follows the system by default, switchable in Settings</td></tr>
<tr><th scope="row">Content</th><td>Plain text, rich text, images and screenshots, files, folders; each type can be turned off</td></tr>
<tr><th scope="row">Transport</th><td>WebRTC data channels, direct first with TURN relay fallback; every uplink probed on multi-uplink networks; files streamed as tar + zstd</td></tr>
@@ -467,7 +469,7 @@ sudo ./install.sh YOUR_PUBLIC_IP</code></pre>
</details>
<details>
<summary>Do I need my own server?</summary>
- <div class="answer"><p>Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough.</p></div>
+ <div class="answer"><p>Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on any always-on Windows, Mac or Linux computer; see the <a href="server/">LAN guide</a>. Across networks you need a machine with a public IP; the smallest cloud VM is enough.</p></div>
</details>
<details>
<summary>Windows? iPhone?</summary>
@@ -496,7 +498,7 @@ sudo ./install.sh YOUR_PUBLIC_IP</code></pre>
<a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download for Mac</a>
<a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download for Windows</a>
</div>
- <p class="note">Version 1.3.2, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>
+ <p class="note">Version 1.3.3, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>
<a class="source" href="https://github.com/baiyuze/copysync">View the source on GitHub</a>
</div>
</section>
diff --git a/docs/en/server/index.html b/docs/en/server/index.html
new file mode 100644
index 0000000..e75cae4
--- /dev/null
+++ b/docs/en/server/index.html
@@ -0,0 +1,399 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Run a CopySync server on your LAN: Windows, Mac and Linux</title>
+ <meta name="description" content="When your computers share a network you don&#x27;t need a cloud server. Run CopySync&#x27;s signaling and TURN server on any always-on Windows, Mac or Linux machine with one script; it starts on boot. Includes app setup and troubleshooting.">
+ <link rel="canonical" href="https://baiyuze.github.io/copysync/en/server/">
+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/server/">
+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/server/">
+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/server/">
+ <meta name="theme-color" content="#141416">
+ <meta property="og:type" content="article">
+ <meta property="og:site_name" content="CopySync">
+ <meta property="og:title" content="Run a CopySync server on your LAN: Windows, Mac and Linux">
+ <meta property="og:description" content="When your computers share a network you don&#x27;t need a cloud server. Run CopySync&#x27;s signaling and TURN server on any always-on Windows, Mac or Linux machine with one script; it starts on boot. Includes app setup and troubleshooting.">
+ <meta property="og:url" content="https://baiyuze.github.io/copysync/en/server/">
+ <meta property="og:image" content="https://baiyuze.github.io/copysync/assets/og-en.png">
+ <meta property="og:locale" content="en_US">
+ <meta name="twitter:card" content="summary_large_image">
+ <link rel="icon" href="../../assets/favicon.svg" type="image/svg+xml">
+ <link rel="icon" href="../../assets/favicon-32.png" sizes="32x32" type="image/png">
+ <link rel="apple-touch-icon" href="../../assets/apple-touch-icon.png">
+ <link rel="stylesheet" href="../../assets/site.css">
+</head>
+<body>
+ <a class="skip" href="#main">Skip to content</a>
+
+ <header class="bar">
+ <div class="wrap">
+ <a class="brand" href="../../en/" aria-label="CopySync home"><img src="../../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
+ <nav aria-label="Page">
+ <a class="wide" href="../../en/#how">How it works</a>
+ <a class="wide" href="../../en/#install">Install</a>
+ <a href="./" aria-current="page">Self-host</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../ja/server/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
+ </nav>
+ </div>
+ </header>
+
+ <main id="main">
+ <section class="hero guide-hero">
+ <div class="wrap">
+ <p class="crumb"><a href="../../en/">CopySync</a> / Self-host</p>
+ <h1 class="display">Run the server on your LAN</h1>
+ <p class="lede">If your computers are on the same home or office network, you don't need a cloud server. Pick a computer that stays on, download and run one script, then enter the address it prints into CopySync on each computer.</p>
+ <ol class="guide-toc">
+ <li><a href="#prepare">Before you start</a></li>
+ <li><a href="#install">Install</a></li>
+ <li><a href="#check">Check</a></li>
+ <li><a href="#clients">Set up the apps</a></li>
+ <li><a href="#faq">Questions</a></li>
+ </ol>
+ </div>
+ </section>
+
+ <section class="section" id="overview" aria-labelledby="overview-title">
+ <div class="wrap">
+ <h2 id="overview-title">The server only introduces devices</h2>
+ <p class="intro">Each computer stays connected to the server, which is how they find each other and exchange connection details. Once connected, what you copy goes straight between the two computers. Only when that fails does it pass through the server, still encrypted.</p>
+ <figure class="diagram">
+ <svg viewBox="0 0 960 440" role="img" aria-labelledby="lan-title lan-desc">
+ <title id="lan-title">CopySync on a LAN</title>
+ <desc id="lan-desc">On one LAN, a Mac and a Windows PC connect to the server at 192.168.1.20 for signaling. Copied content travels directly between the two computers, and through the server's TURN relay only if a direct connection fails.</desc>
+ <rect class="d-lan" x="8" y="8" width="944" height="384" rx="22"/>
+ <text class="d-lan-label" x="32" y="42">Your LAN: the same Wi‑Fi or wired network</text>
+ <rect class="d-box" x="340" y="64" width="280" height="104" rx="14"/>
+ <text class="d-title" x="480" y="106" text-anchor="middle">Server</text>
+ <text class="d-ip" x="480" y="138" text-anchor="middle">192.168.1.20</text>
+ <path class="d-sig" d="M150 250V96H340"/>
+ <path class="d-sig" d="M810 250V96H620"/>
+ <path class="d-relay" d="M206 250V140H340"/>
+ <path class="d-relay" d="M754 250V140H620"/>
+ <text class="d-note" x="164" y="86">Signaling, TCP 8787</text>
+ <text class="d-note" x="220" y="200">Relay, UDP 3478, if direct fails</text>
+ <rect class="d-box" x="40" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="160" y="300" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="160" y="328" text-anchor="middle">Running CopySync</text>
+ <rect class="d-box" x="680" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="800" y="300" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="800" y="328" text-anchor="middle">Running CopySync</text>
+ <path class="d-direct" d="M280 306H680"/>
+ <text class="d-label" x="480" y="292" text-anchor="middle">Direct, end-to-end encrypted</text>
+ <text class="d-note" x="480" y="336" text-anchor="middle">Content stays between the two computers</text>
+ <g class="d-legend" transform="translate(40 424)">
+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">Data (direct)</text>
+ <path class="d-relay" d="M250 0H278"/><text x="288" y="5">Data (relay, fallback)</text>
+ <path class="d-sig" d="M560 0H588"/><text x="598" y="5">Signaling</text>
+ </g>
+ </svg>
+ </figure>
+ <ul class="points ports">
+ <li><strong>Signaling, TCP 8787.</strong> Every computer stays connected to it to find the others, pair and exchange connection details.</li>
+ <li><strong>Direct.</strong> On a LAN, content almost always goes straight between the two computers, at the speed of your network.</li>
+ <li><strong>Relay, UDP 3478.</strong> Only used when devices can't reach each other: guest networks, Wi‑Fi with client isolation, separate subnets.</li>
+ </ul>
+ </div>
+ </section>
+
+ <section class="section" id="prepare" aria-labelledby="prepare-title">
+ <div class="wrap">
+ <h2 id="prepare-title">Before you start</h2>
+ <dl class="fallbacks">
+ <div><dt>A computer that stays on</dt><dd>Windows 10 or 11, macOS 13 or later, or any Linux, including one of the two computers you sync. Sync pauses while it's off or asleep and resumes when it wakes. A NAS, home router or Mac mini is ideal; the server uses about 15 MB of RAM.</dd></div>
+ <div><dt>A fixed address</dt><dd>Reserve an address for it in your router's DHCP settings (often called DHCP reservation or static lease). Otherwise, when the router hands out a new address, every computer has to be updated.</dd></div>
+ <div><dt>The same network</dt><dd>Devices just need to be on the same Wi‑Fi or wired network. Guest networks and Wi‑Fi with client (AP) isolation block devices from reaching each other; use another network or turn isolation off.</dd></div>
+ <div><dt>No sync away from it</dt><dd>The server is only reachable on your LAN, so a laptop taken elsewhere catches up when it's back. To sync from anywhere you need a server with a public IP; see Install on the home page.</dd></div>
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <h2 id="install-title">Install the server</h2>
+ <p class="intro">Choose the system of the computer that will run the server. The script finds the computer's LAN address, sets the server to start automatically, and prints the address to enter in the apps.</p>
+ <div class="os-tabs" data-tabs>
+ <div class="tablist" role="tablist" aria-label="System of the server computer" hidden>
+ <button type="button" role="tab" id="tab-windows" aria-controls="windows">Windows</button>
+ <button type="button" role="tab" id="tab-macos" aria-controls="macos">macOS</button>
+ <button type="button" role="tab" id="tab-linux" aria-controls="linux">Linux</button>
+ </div>
+
+ <section class="os" id="windows" role="tabpanel" aria-labelledby="tab-windows">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>Download <a href="https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-windows-amd64.zip">copysync-server-windows-amd64.zip</a> and choose Extract All.</li>
+ <li>Open the extracted folder and double-click <code>install.cmd</code>.<span class="aside">If you see "Windows protected your PC", click More info, then Run anyway; when User Account Control asks, click Yes. The server isn't code-signed yet, which is why Windows asks once.</span></li>
+ <li>Installation continues in a new window. The <code>ws://…/signal</code> address at the end is what you enter in the apps.</li>
+ </ol>
+ <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-windows-amd64.zip"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download the Windows server</a>
+ <ul class="points">
+ <li><strong>Runs as a Windows service:</strong> starts with Windows, no sign-in needed, no window. It appears as CopySync Server in Services.</li>
+ <li><strong>Firewall already allowed:</strong> the script adds an inbound rule for copysync-server.exe only, so there are no ports to open.</li>
+ <li><strong>Wrong address picked</strong> (several network adapters, say from a VM or VPN): type <code>cmd</code> in the address bar of the extracted folder, press Enter and run <code>install.cmd 192.168.1.20</code> with your address.</li>
+ <li>Windows 10 and 11, x64.</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="explorer" role="img" aria-label="The extracted folder holds copysync-server.exe, install.cmd, install.ps1, README.md and uninstall.cmd; double-click install.cmd">
+ <div class="t-bar win"><span class="t-tab folder">copysync-server-windows-amd64</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+ <ul class="files">
+ <li><span class="f-icon exe" aria-hidden="true"></span><span class="f-name">copysync-server.exe</span></li>
+ <li class="hl"><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">install.cmd</span><em>Double-click</em></li>
+ <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">install.ps1</span></li>
+ <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">README.md</span></li>
+ <li><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">uninstall.cmd</span></li>
+ </ul>
+ </figure>
+ <figure class="term" role="img" aria-label="The window after install.cmd finishes: it stops the old version, installs, registers the service, allows it through the firewall and starts it, then prints the address ws://192.168.1.20:8787/signal">
+ <div class="t-bar win"><span class="t-tab"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3 5.5 10.5 4.5v7H3zM11.5 4.4 21 3v8.5h-9.5zM3 12.5h7.5v7L3 18.5zM11.5 12.5H21V21l-9.5-1.4z"/></svg>Administrator: Windows PowerShell</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+<pre class="t-body"><span class="t-step">&gt; Stopping the running version</span>
+<span class="t-step">&gt; Installing to C:\Program Files\CopySync Server</span>
+<span class="t-step">&gt; Registering the service CopySyncServer (relay address 192.168.1.20)</span>
+<span class="t-step">&gt; Allowing it through Windows Firewall</span>
+<span class="t-step">&gt; Starting</span>
+ √ Running
+
+Installed: copysync-server 1.3.3. It runs as a Windows service and starts with Windows.
+In CopySync on each computer, set Settings &gt; Signaling server to:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ Program C:\Program Files\CopySync Server
+ Logs C:\ProgramData\CopySync Server\server.log
+ Restart Restart-Service CopySyncServer (in an administrator PowerShell)
+ Uninstall double-click uninstall.cmd</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>For later</caption>
+ <tbody>
+ <tr><th scope="row">Status</th><td><code>Get-Service CopySyncServer</code> in an administrator PowerShell, or find CopySync Server in Services</td></tr>
+ <tr><th scope="row">Logs</th><td><code>C:\ProgramData\CopySync Server\server.log</code></td></tr>
+ <tr><th scope="row">Restart</th><td><code>Restart-Service CopySyncServer</code> in an administrator PowerShell</td></tr>
+ <tr><th scope="row">Upgrade</th><td>Download the new version, extract it and double-click <code>install.cmd</code> again; your settings are kept</td></tr>
+ <tr><th scope="row">Uninstall</th><td>Double-click <code>uninstall.cmd</code>; it removes the service, the firewall rule and the files</td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section class="os" id="macos" role="tabpanel" aria-labelledby="tab-macos">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>macOS</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>Open Terminal and run these lines:
+ <div class="code">
+ <button class="copy" type="button" data-done="Copied">Copy</button>
+<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-macos.tar.gz
+tar xzf copysync-server-macos.tar.gz
+cd copysync-server-macos
+./install.sh</code></pre>
+ </div></li>
+ <li>The <code>ws://…/signal</code> address at the end is what you enter in the apps.</li>
+ </ol>
+ <ul class="points">
+ <li><strong>No administrator rights needed.</strong> It runs in the background whenever you're logged in, and macOS restarts it if it exits.</li>
+ <li><strong>Keep this Mac awake:</strong> in System Settings → Energy (Battery → Options on a laptop), turn on the option that prevents automatic sleep.</li>
+ <li><strong>If the macOS firewall is on,</strong> the script ends with the command to allow copysync-server.</li>
+ <li>Intel and Apple silicon, macOS 13 or later.</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="Output of ./install.sh in Terminal: it installs, writes the LaunchAgent and starts the server, then prints the address ws://192.168.1.20:8787/signal">
+ <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">copysync-server-macos — zsh</span></div>
+<pre class="t-body"><span class="t-prompt">%</span> ./install.sh
+<span class="t-step">▶ Stopping the running version</span>
+<span class="t-step">▶ Installing to /Users/me/Library/Application Support/CopySync Server</span>
+<span class="t-step">▶ Writing the LaunchAgent (relay address 192.168.1.20)</span>
+<span class="t-step">▶ Starting</span>
+ ✓ Running
+
+Installed: copysync-server 1.3.3. It starts whenever you log in to this Mac.
+In CopySync on each computer, set Settings → Signaling server to:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ Logs /Users/me/Library/Logs/CopySync/server.log
+ Restart launchctl kickstart -k gui/501/com.copysync.server
+ Uninstall ./install.sh uninstall</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>For later</caption>
+ <tbody>
+ <tr><th scope="row">Logs</th><td><code>~/Library/Logs/CopySync/server.log</code></td></tr>
+ <tr><th scope="row">Restart</th><td><code>launchctl kickstart -k gui/$(id -u)/com.copysync.server</code></td></tr>
+ <tr><th scope="row">Upgrade</th><td>Download the new version, extract it and run <code>./install.sh</code> again; your settings are kept</td></tr>
+ <tr><th scope="row">Uninstall</th><td><code>./install.sh uninstall</code></td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section class="os" id="linux" role="tabpanel" aria-labelledby="tab-linux">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>Linux</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>On the machine itself, or over ssh, run these lines:<span class="aside">On ARM, such as a Raspberry Pi with a 64-bit OS, replace <code>amd64</code> with <code>arm64</code>.</span>
+ <div class="code">
+ <button class="copy" type="button" data-done="Copied">Copy</button>
+<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
+tar xzf copysync-server-linux-amd64.tar.gz
+cd copysync-server-linux-amd64
+sudo ./install.sh</code></pre>
+ </div></li>
+ <li>The <code>ws://…/signal</code> address at the end is what you enter in the apps.</li>
+ </ol>
+ <ul class="points">
+ <li><strong>Registers a systemd service</strong> that starts on boot. Needs root.</li>
+ <li><strong>If ufw or firewalld is active,</strong> the script ends with the commands to open the ports.</li>
+ <li><strong>Docker works too:</strong> copy <code>env.example</code> to <code>.env</code>, set <code>TURN_IP</code> to the machine's LAN address and run <code>docker compose up -d</code>. It needs host networking, so Linux only.</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="Output of sudo ./install.sh: it installs, writes the systemd unit and config and starts the server, then prints the address ws://192.168.1.20:8787/signal">
+ <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">ssh 192.168.1.20</span></div>
+<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh
+<span class="t-step">▶ Installing the binary to /usr/local/bin</span>
+<span class="t-step">▶ Writing the systemd unit</span>
+<span class="t-step">▶ Writing /etc/copysync/server.env (relay address 192.168.1.20)</span>
+<span class="t-step">▶ Starting</span>
+ ✓ Running
+
+Installed: copysync-server 1.3.3
+In CopySync on each computer, set Settings → Signaling server to:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ Config /etc/copysync/server.env
+ Logs journalctl -u copysync-server -f
+ Restart systemctl restart copysync-server
+ Uninstall sudo ./install.sh uninstall
+
+Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768-60999 (relay ports, assigned by the OS)</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>For later</caption>
+ <tbody>
+ <tr><th scope="row">Status</th><td><code>systemctl status copysync-server</code></td></tr>
+ <tr><th scope="row">Logs</th><td><code>journalctl -u copysync-server -f</code></td></tr>
+ <tr><th scope="row">Restart</th><td><code>sudo systemctl restart copysync-server</code></td></tr>
+ <tr><th scope="row">Config</th><td><code>/etc/copysync/server.env</code>; restart the service after editing</td></tr>
+ <tr><th scope="row">Upgrade</th><td>Download the new version, extract it and run <code>sudo ./install.sh</code> again; your config is kept</td></tr>
+ <tr><th scope="row">Uninstall</th><td><code>sudo ./install.sh uninstall</code></td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <h2 id="check-title">Check that other computers can reach it</h2>
+ <p class="intro">On another computer, open <code>http://192.168.1.20:8787/healthz</code> in a browser (with your address). If you see this line, the network path works.</p>
+ <figure class="browser" role="img" aria-label="A browser showing http://192.168.1.20:8787/healthz, with the server&#x27;s status ok and its version">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">http://192.168.1.20:8787/healthz</span></div>
+ <pre class="b-body">{"status":"ok","version":"1.3.3"}</pre>
+ </figure>
+ <p class="note">If it doesn't load, see the <a href="#faq">questions</a> below.</p>
+ </div>
+ </section>
+
+ <section class="section" id="clients" aria-labelledby="clients-title">
+ <div class="wrap">
+ <h2 id="clients-title">Enter the address on each computer</h2>
+ <ol class="flow">
+ <li><h3>Open Settings</h3><p>Open CopySync on each computer, including the one running the server, and go to Settings.</p></li>
+ <li><h3>Enter the address</h3><p>Under Signaling server, enter <code>ws://192.168.1.20:8787/signal</code> with your address and press Return or Enter.</p></li>
+ <li><h3>Check the status</h3><p>When Connection shows a green Connected, you're set. Pair your devices under Devices and copying starts syncing.</p></li>
+ </ol>
+ <figure class="shot">
+ <img src="../../assets/screenshots/en/settings-lan-dark.png" width="2112" height="1472" loading="lazy" alt="CopySync Settings: the signaling server is ws://192.168.1.20:8787/signal and the connection status shows Connected">
+ </figure>
+ <p class="note">Haven't installed the app yet? See <a href="../../en/#install">Install</a> on the home page.</p>
+ </div>
+ </section>
+
+ <section class="section" id="faq" aria-labelledby="faq-title">
+ <div class="wrap">
+ <h2 id="faq-title">Questions</h2>
+ <div class="faq">
+ <details>
+ <summary>The status stays at Not connected</summary>
+ <div class="answer"><p>Check the address first: it starts with <code>ws://</code>, uses port 8787, ends in <code>/signal</code>, and you pressed Return after typing it.</p><p>Then open <code>http://server-address:8787/healthz</code> in a browser on that computer. If it doesn't load, the network path is broken: the server isn't running, its computer is asleep, a firewall blocks it, or its address changed.</p><p>The Windows script already allows the server through the firewall. On a Mac with the firewall on, run the command the script printed at the end; the same goes for ufw and firewalld on Linux.</p></div>
+ </details>
+ <details>
+ <summary>Devices show Relay instead of Direct</summary>
+ <div class="answer"><p>On a LAN connections are almost always direct. Relay means UDP can't get between the two computers, usually because of a guest network, Wi‑Fi client isolation, or separate subnets with a firewall in between. Relayed content is still encrypted; it's just limited by the server computer's network.</p></div>
+ </details>
+ <details>
+ <summary>The server's address changed</summary>
+ <div class="answer"><p>Run the script again with the new address: <code>install.cmd new-address</code> on Windows, <code>./install.sh new-address</code> on a Mac. On Linux, edit <code>-turn-ip</code> in <code>/etc/copysync/server.env</code> and restart the service. Then update the address on each computer.</p><p>Reserving the address in your router avoids this.</p></div>
+ </details>
+ <details>
+ <summary>Does it sync away from the LAN?</summary>
+ <div class="answer"><p>No, the server is only reachable on your LAN. To sync from anywhere, deploy the server on a machine with a public IP (steps under Install on the home page), or join your devices with a mesh VPN such as Tailscale or ZeroTier and enter the server's address on that network.</p></div>
+ </details>
+ <details>
+ <summary>A cloud server in mainland China works by IP but not by domain</summary>
+ <div class="answer"><p>Cloud providers in mainland China intercept plain HTTP requests for domains without an ICP filing and answer with a redirect to a block page; in our tests that included non-standard ports such as 8787. The WebSocket handshake is an HTTP request too, so it is intercepted and the app shows Not connected.</p><p>Enter the server's IP instead, as in <code>ws://server-ip:8787/signal</code>, or file the domain.</p></div>
+ </details>
+ <details>
+ <summary>The server computer also runs CopySync. Which address?</summary>
+ <div class="answer"><p>The same LAN address works, and so does <code>ws://127.0.0.1:8787/signal</code>. The server and the app don't interfere.</p></div>
+ </details>
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">One computer that stays on is enough.</h2>
+ <div class="cta">
+ <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download for Mac</a>
+ <a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Download for Windows</a>
+ </div>
+ <p class="note">Version 1.3.3, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>
+ <a class="source" href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">Full server guide, including public servers and Docker</a>
+ </div>
+ </section>
+ </main>
+
+ <footer class="footer">
+ <div class="wrap">
+ <p>CopySync is open source under the GNU AGPL-3.0, with commercial licenses available.</p>
+ <nav aria-label="Footer">
+ <a href="https://github.com/baiyuze/copysync/releases">All releases</a>
+ <a href="https://github.com/baiyuze/copysync/blob/main/CHANGELOG.md">Changelog</a>
+ <a href="https://baiyuze.github.io/copysync/design/nat-traversal.html">Design notes (Chinese)</a>
+ <a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">Commercial license</a>
+ <a href="https://github.com/baiyuze/copysync/issues">Report an issue</a>
+ </nav>
+ <nav aria-label="Language">
+ <a href="../../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../en/server/" hreflang="en" lang="en" data-lang="en" aria-current="page">English</a>
+ <a href="../../ja/server/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
+ </nav>
+ </div>
+ </footer>
+
+ <script src="../../assets/site.js" defer></script>
+</body>
+</html>
diff --git a/docs/index.html b/docs/index.html
index 4bc9e58..38101fd 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -58,8 +58,8 @@
"description": "在 Mac 与 Windows 电脑之间同步剪贴板与文件的开源工具。复制文本、图片、文件或文件夹后,另一台电脑可直接粘贴。设备间 WebRTC 直连、DTLS 端到端加密,打不通时经用户自建服务器的 TURN 中转。",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "macOS 13 及以上(Intel 与 Apple 芯片);Windows 10、Windows 11(x64)",
- "softwareVersion": "1.3.2",
- "datePublished": "2026-10-10",
+ "softwareVersion": "1.3.3",
+ "datePublished": "2026-10-11",
"inLanguage": "zh-CN",
"license": "https://www.gnu.org/licenses/agpl-3.0.html",
"isAccessibleForFree": true,
@@ -127,7 +127,7 @@
"name": "必须自己准备服务器吗?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。"
+ "text": "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台常开的 Windows、Mac 或 Linux 电脑上运行服务器即可,见局域网部署教程;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。"
}
},
{
@@ -178,7 +178,8 @@
<a class="wide" href="#how">工作原理</a>
<a class="wide" href="#install">安装</a>
<a class="wide" href="#faq">常见问题</a>
- <a href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="server/">部署服务器</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="en/" hreflang="en" lang="en" data-lang="en">English</a>
<a href="ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
</nav>
@@ -194,7 +195,7 @@
<a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Mac 版</a>
<a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Windows 版</a>
</div>
- <p class="note">版本 1.3.2,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>
+ <p class="note">版本 1.3.3,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>
<div class="stage" data-play role="img" aria-label="演示:在 MacBook 上按下 Command C,文件化作一张纸,经直连飞到 Windows 笔记本,在那里按下 Ctrl V 粘贴出来">
<figure class="device mac">
<div class="screen"><div class="desk">
@@ -392,7 +393,7 @@
<section class="section" id="install" aria-labelledby="install-title">
<div class="wrap">
<h2 id="install-title">安装</h2>
- <p class="intro">每台电脑装一个 App,再准备一台两边都能访问到的服务器。两台电脑在同一个局域网的话,服务器直接跑在其中一台 Mac 上就行。</p>
+ <p class="intro">每台电脑装一个 App,再准备一台两边都能访问到的服务器。两台电脑在同一个局域网的话,服务器放在其中一台 Windows、Mac 或 Linux 电脑上就行,见<a href="server/">局域网部署教程</a>。</p>
<div class="install">
<div>
<h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>Mac</h3>
@@ -415,7 +416,7 @@
</div>
<div>
<h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>服务器</h3>
- <p class="small">任意 Linux,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。</p>
+ <p class="small">跨公网使用时,一台有公网 IP 的 Linux 服务器,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。</p>
<div class="code">
<button class="copy" type="button" data-done="已复制">复制</button>
<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
@@ -433,6 +434,7 @@ sudo ./install.sh 你的公网IP</code></pre>
</tbody>
</table>
<p class="small">也可以用 Docker 部署,见<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">服务器部署说明</a>。</p>
+ <a class="button quiet" href="server/">局域网部署教程</a>
</div>
</div>
<p class="pairing"><strong>配对:</strong>一台点「设备 → 添加设备」生成 6 位配对码,另一台输入它;两块屏幕上的两行安全指纹完全一致后确认。Mac 与 Windows 之间、两台 Windows 之间都一样。</p>
@@ -445,10 +447,10 @@ sudo ./install.sh 你的公网IP</code></pre>
<div class="table-scroll">
<table class="specs">
<tbody>
- <tr><th scope="row">版本</th><td>1.3.2,<time datetime="2026-10-10">2026 年 10 月 10 日</time>发布</td></tr>
+ <tr><th scope="row">版本</th><td>1.3.3,<time datetime="2026-10-11">2026 年 10 月 11 日</time>发布</td></tr>
<tr><th scope="row">Mac 客户端</th><td>macOS 13 Ventura 及以上;Intel 与 Apple 芯片通用,不需要 Rosetta;安装包约 47 MB</td></tr>
<tr><th scope="row">Windows 客户端</th><td>Windows 10(21H2 及以上)与 Windows 11,x64;按用户安装,不需要管理员权限;安装包约 23 MB</td></tr>
- <tr><th scope="row">服务器</th><td>Linux x86_64 或 ARM64(systemd 或 Docker),也可以运行在 macOS 上;约 15 MB 内存</td></tr>
+ <tr><th scope="row">服务器</th><td>Linux x86_64 或 ARM64(systemd 或 Docker)、macOS(Intel 与 Apple 芯片)、Windows 10 与 11 x64(系统服务);约 15 MB 内存</td></tr>
<tr><th scope="row">界面语言</th><td>简体中文、English、日本語,默认跟随系统,可在设置里切换</td></tr>
<tr><th scope="row">同步的内容</th><td>纯文本、带格式的文本、图片与截图、文件、文件夹,可以按类型关闭</td></tr>
<tr><th scope="row">传输</th><td>WebRTC 数据通道,直连优先,打不通时经 TURN 中转;多出口网络逐个探测每个出口;文件以 tar + zstd 流式打包</td></tr>
@@ -487,7 +489,7 @@ sudo ./install.sh 你的公网IP</code></pre>
</details>
<details>
<summary>必须自己准备服务器吗?</summary>
- <div class="answer"><p>是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。</p></div>
+ <div class="answer"><p>是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台常开的 Windows、Mac 或 Linux 电脑上运行服务器即可,见<a href="server/">局域网部署教程</a>;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。</p></div>
</details>
<details>
<summary>支持 Windows 吗?iPhone 呢?</summary>
@@ -516,7 +518,7 @@ sudo ./install.sh 你的公网IP</code></pre>
<a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Mac 版</a>
<a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Windows 版</a>
</div>
- <p class="note">版本 1.3.2,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>
+ <p class="note">版本 1.3.3,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>
<a class="source" href="https://github.com/baiyuze/copysync">在 GitHub 上查看源码</a>
</div>
</section>
diff --git a/docs/ja/index.html b/docs/ja/index.html
index 684b1f2..ce16985 100644
--- a/docs/ja/index.html
+++ b/docs/ja/index.html
@@ -38,8 +38,8 @@
"description": "Mac と Windows のコンピューター間でクリップボードとファイルを同期するオープンソースのアプリ。テキスト、画像、ファイル、フォルダを一台でコピーし、もう一台で貼り付けられる。デバイス間は WebRTC で直接つながり DTLS でエンドツーエンド暗号化、つながらないときはユーザーが用意したサーバーの TURN で中継する。",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "macOS 13 以降(Intel と Apple シリコン)、Windows 10、Windows 11(x64)",
- "softwareVersion": "1.3.2",
- "datePublished": "2026-10-10",
+ "softwareVersion": "1.3.3",
+ "datePublished": "2026-10-11",
"inLanguage": "ja",
"license": "https://www.gnu.org/licenses/agpl-3.0.html",
"isAccessibleForFree": true,
@@ -107,7 +107,7 @@
"name": "サーバーは自分で用意する必要がありますか?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるならどちらかの Mac でサーバーを動かせば十分で、ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。"
+ "text": "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるなら、電源を入れたままの Windows・Mac・Linux のどれか 1 台でサーバーを動かせば十分で(LAN での設置手順)、ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。"
}
},
{
@@ -158,7 +158,8 @@
<a class="wide" href="#how">しくみ</a>
<a class="wide" href="#install">インストール</a>
<a class="wide" href="#faq">よくある質問</a>
- <a href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="server/">サーバーの設置</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../en/" hreflang="en" lang="en" data-lang="en">English</a>
</nav>
@@ -174,7 +175,7 @@
<a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Mac 版をダウンロード</a>
<a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Windows 版をダウンロード</a>
</div>
- <p class="note">バージョン 1.3.2、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>
+ <p class="note">バージョン 1.3.3、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>
<div class="stage" data-play role="img" aria-label="デモ:MacBook で Command C を押すと、ファイルが一枚の紙になって直接接続で Windows ノートへ飛び、そこで Ctrl V を押して貼り付けます">
<figure class="device mac">
<div class="screen"><div class="desk">
@@ -372,7 +373,7 @@
<section class="section" id="install" aria-labelledby="install-title">
<div class="wrap">
<h2 id="install-title">インストール</h2>
- <p class="intro">それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。2 台が同じ LAN にあるなら、サーバーはどちらかの Mac で動かせば十分です。</p>
+ <p class="intro">それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。2 台が同じ LAN にあるなら、サーバーはどれか 1 台の Windows・Mac・Linux で動かせば十分です。<a href="server/">LAN での設置手順</a>をご覧ください。</p>
<div class="install">
<div>
<h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>Mac</h3>
@@ -395,7 +396,7 @@
</div>
<div>
<h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>サーバー</h3>
- <p class="small">Linux なら何でも可、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。</p>
+ <p class="small">ネットワークをまたいで使う場合:グローバル IP を持つ Linux サーバー、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。</p>
<div class="code">
<button class="copy" type="button" data-done="コピーしました">コピー</button>
<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
@@ -413,6 +414,7 @@ sudo ./install.sh グローバルIP</code></pre>
</tbody>
</table>
<p class="small">Docker でも動かせます。<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">サーバーの構築手順</a>(英語)をご覧ください。</p>
+ <a class="button quiet" href="server/">LAN での設置手順</a>
</div>
</div>
<p class="pairing"><strong>ペアリング:</strong>一台で「デバイス → デバイスを追加」を開いて 6 桁のコードを表示し、もう一台で入力します。両方の画面に同じ 2 行の指紋が表示されたら確定します。Mac と Windows、Windows 同士でも同じ手順です。</p>
@@ -425,10 +427,10 @@ sudo ./install.sh グローバルIP</code></pre>
<div class="table-scroll">
<table class="specs">
<tbody>
- <tr><th scope="row">バージョン</th><td>1.3.2(<time datetime="2026-10-10">2026 年 10 月 10 日</time>公開)</td></tr>
+ <tr><th scope="row">バージョン</th><td>1.3.3(<time datetime="2026-10-11">2026 年 10 月 11 日</time>公開)</td></tr>
<tr><th scope="row">Mac アプリ</th><td>macOS 13 Ventura 以降。Intel と Apple シリコンのユニバーサルバイナリで Rosetta 不要。ダウンロードは約 47 MB</td></tr>
<tr><th scope="row">Windows アプリ</th><td>Windows 10(21H2 以降)と Windows 11、x64。ユーザーごとのインストールで管理者権限不要。ダウンロードは約 23 MB</td></tr>
- <tr><th scope="row">サーバー</th><td>Linux(x86_64 または ARM64、systemd または Docker)、macOS でも動作。メモリは約 15 MB</td></tr>
+ <tr><th scope="row">サーバー</th><td>Linux(x86_64 または ARM64、systemd または Docker)、macOS(Intel と Apple シリコン)、Windows 10・11 x64(サービスとして動作)。メモリは約 15 MB</td></tr>
<tr><th scope="row">表示言語</th><td>日本語、英語、簡体字中国語。初期設定はシステムに合わせ、「設定」で切り替え可能</td></tr>
<tr><th scope="row">同期する内容</th><td>プレーンテキスト、書式付きテキスト、画像とスクリーンショット、ファイル、フォルダ。種類ごとにオフにできる</td></tr>
<tr><th scope="row">転送</th><td>WebRTC データチャネル。直接接続を優先し、つながらなければ TURN で中継。複数の出口があるネットワークでは出口ごとに調査。ファイルは tar + zstd でストリーム転送</td></tr>
@@ -467,7 +469,7 @@ sudo ./install.sh グローバルIP</code></pre>
</details>
<details>
<summary>サーバーは自分で用意する必要がありますか?</summary>
- <div class="answer"><p>はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるならどちらかの Mac でサーバーを動かせば十分で、ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。</p></div>
+ <div class="answer"><p>はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるなら、電源を入れたままの Windows・Mac・Linux のどれか 1 台でサーバーを動かせば十分で(<a href="server/">LAN での設置手順</a>)、ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。</p></div>
</details>
<details>
<summary>Windows に対応していますか?iPhone は?</summary>
@@ -496,7 +498,7 @@ sudo ./install.sh グローバルIP</code></pre>
<a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Mac 版をダウンロード</a>
<a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Windows 版をダウンロード</a>
</div>
- <p class="note">バージョン 1.3.2、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>
+ <p class="note">バージョン 1.3.3、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>
<a class="source" href="https://github.com/baiyuze/copysync">GitHub でソースコードを見る</a>
</div>
</section>
diff --git a/docs/ja/server/index.html b/docs/ja/server/index.html
new file mode 100644
index 0000000..aa1247b
--- /dev/null
+++ b/docs/ja/server/index.html
@@ -0,0 +1,399 @@
+<!doctype html>
+<html lang="ja">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>LAN に CopySync サーバーを置く:Windows・Mac・Linux の手順</title>
+ <meta name="description" content="コンピューターが同じネットワークにあれば、クラウドサーバーは要りません。常に電源が入っている Windows・Mac・Linux のコンピューターで、CopySync のシグナリング兼 TURN サーバーをスクリプトひとつで動かせます。起動時に自動で立ち上がります。アプリの設定とトラブル対処つき。">
+ <link rel="canonical" href="https://baiyuze.github.io/copysync/ja/server/">
+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/server/">
+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/server/">
+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/server/">
+ <meta name="theme-color" content="#141416">
+ <meta property="og:type" content="article">
+ <meta property="og:site_name" content="CopySync">
+ <meta property="og:title" content="LAN に CopySync サーバーを置く:Windows・Mac・Linux の手順">
+ <meta property="og:description" content="コンピューターが同じネットワークにあれば、クラウドサーバーは要りません。常に電源が入っている Windows・Mac・Linux のコンピューターで、CopySync のシグナリング兼 TURN サーバーをスクリプトひとつで動かせます。起動時に自動で立ち上がります。アプリの設定とトラブル対処つき。">
+ <meta property="og:url" content="https://baiyuze.github.io/copysync/ja/server/">
+ <meta property="og:image" content="https://baiyuze.github.io/copysync/assets/og-en.png">
+ <meta property="og:locale" content="ja_JP">
+ <meta name="twitter:card" content="summary_large_image">
+ <link rel="icon" href="../../assets/favicon.svg" type="image/svg+xml">
+ <link rel="icon" href="../../assets/favicon-32.png" sizes="32x32" type="image/png">
+ <link rel="apple-touch-icon" href="../../assets/apple-touch-icon.png">
+ <link rel="stylesheet" href="../../assets/site.css">
+</head>
+<body>
+ <a class="skip" href="#main">本文へ移動</a>
+
+ <header class="bar">
+ <div class="wrap">
+ <a class="brand" href="../../ja/" aria-label="CopySync ホーム"><img src="../../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
+ <nav aria-label="ページ内の移動">
+ <a class="wide" href="../../ja/#how">しくみ</a>
+ <a class="wide" href="../../ja/#install">インストール</a>
+ <a href="./" aria-current="page">サーバーの設置</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../en/server/" hreflang="en" lang="en" data-lang="en">English</a>
+ </nav>
+ </div>
+ </header>
+
+ <main id="main">
+ <section class="hero guide-hero">
+ <div class="wrap">
+ <p class="crumb"><a href="../../ja/">CopySync</a> / サーバーの設置</p>
+ <h1 class="display">LAN にサーバーを置く</h1>
+ <p class="lede">家や会社のコンピューターが同じネットワークにあるなら、クラウドサーバーは要りません。電源を入れたままのコンピューターを 1 台選び、スクリプトをダウンロードして実行し、表示されたアドレスを各コンピューターの CopySync に入力します。</p>
+ <ol class="guide-toc">
+ <li><a href="#prepare">準備</a></li>
+ <li><a href="#install">インストール</a></li>
+ <li><a href="#check">確認</a></li>
+ <li><a href="#clients">アドレスの入力</a></li>
+ <li><a href="#faq">よくある質問</a></li>
+ </ol>
+ </div>
+ </section>
+
+ <section class="section" id="overview" aria-labelledby="overview-title">
+ <div class="wrap">
+ <h2 id="overview-title">サーバーは引き合わせるだけ</h2>
+ <p class="intro">各コンピューターはサーバーにつながったままで、それを通じて相手を見つけ、接続情報を交換します。つながったあと、コピーした内容は 2 台のあいだを直接流れます。直接つながらないときだけサーバーを中継し、その場合も暗号化されたままです。</p>
+ <figure class="diagram">
+ <svg viewBox="0 0 960 440" role="img" aria-labelledby="lan-title lan-desc">
+ <title id="lan-title">LAN での CopySync</title>
+ <desc id="lan-desc">同じ LAN の Mac と Windows PC が、アドレス 192.168.1.20 のサーバーにシグナリングで接続します。コピーした内容は 2 台のあいだを直接流れ、直接つながらないときだけサーバーの TURN 中継を通ります。</desc>
+ <rect class="d-lan" x="8" y="8" width="944" height="384" rx="22"/>
+ <text class="d-lan-label" x="32" y="42">LAN:同じ Wi‑Fi または有線ネットワーク</text>
+ <rect class="d-box" x="340" y="64" width="280" height="104" rx="14"/>
+ <text class="d-title" x="480" y="106" text-anchor="middle">サーバー</text>
+ <text class="d-ip" x="480" y="138" text-anchor="middle">192.168.1.20</text>
+ <path class="d-sig" d="M150 250V96H340"/>
+ <path class="d-sig" d="M810 250V96H620"/>
+ <path class="d-relay" d="M206 250V140H340"/>
+ <path class="d-relay" d="M754 250V140H620"/>
+ <text class="d-note" x="164" y="86">シグナリング TCP 8787</text>
+ <text class="d-note" x="220" y="200">中継 UDP 3478(直接不可のとき)</text>
+ <rect class="d-box" x="40" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="160" y="300" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="160" y="328" text-anchor="middle">CopySync を使用</text>
+ <rect class="d-box" x="680" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="800" y="300" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="800" y="328" text-anchor="middle">CopySync を使用</text>
+ <path class="d-direct" d="M280 306H680"/>
+ <text class="d-label" x="480" y="292" text-anchor="middle">直接接続、エンドツーエンド暗号化</text>
+ <text class="d-note" x="480" y="336" text-anchor="middle">内容は 2 台のあいだだけを流れる</text>
+ <g class="d-legend" transform="translate(40 424)">
+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">データ(直接)</text>
+ <path class="d-relay" d="M250 0H278"/><text x="288" y="5">データ(中継、予備)</text>
+ <path class="d-sig" d="M560 0H588"/><text x="598" y="5">シグナリング</text>
+ </g>
+ </svg>
+ </figure>
+ <ul class="points ports">
+ <li><strong>シグナリング、TCP 8787。</strong>各コンピューターが常に接続し、相手の発見、ペアリング、接続情報の交換に使います。</li>
+ <li><strong>直接接続。</strong>LAN 内ではほぼ必ず 2 台のあいだで直接やりとりし、速度は LAN の速度そのままです。</li>
+ <li><strong>中継、UDP 3478。</strong>ゲストネットワーク、AP アイソレーションが有効な Wi‑Fi、別のサブネットなど、互いに届かないときだけ使います。</li>
+ </ul>
+ </div>
+ </section>
+
+ <section class="section" id="prepare" aria-labelledby="prepare-title">
+ <div class="wrap">
+ <h2 id="prepare-title">始める前に</h2>
+ <dl class="fallbacks">
+ <div><dt>電源を入れたままのコンピューター</dt><dd>Windows 10・11、macOS 13 以降、または Linux なら何でも可。同期する 2 台のうちの 1 台でもかまいません。電源が切れたりスリープしたりすると同期は止まり、復帰すると再開します。NAS、ルーター、Mac mini などが最適で、メモリは約 15 MB です。</dd></div>
+ <div><dt>固定のアドレス</dt><dd>ルーターの DHCP 設定(「固定割り当て」「アドレス予約」など)で、このコンピューターのアドレスを固定します。そうしないと、アドレスが変わるたびに全部のコンピューターで入れ直すことになります。</dd></div>
+ <div><dt>同じネットワークに</dt><dd>同じ Wi‑Fi か有線ネットワークにつながっていれば十分です。ゲストネットワークや AP アイソレーションが有効な Wi‑Fi ではデバイスどうしが通信できないので、別のネットワークを使うか、アイソレーションをオフにしてください。</dd></div>
+ <div><dt>ネットワークの外では同期しない</dt><dd>サーバーには LAN の中からしか届きません。持ち出したノートパソコンは、戻ってきてから同期を再開します。どこからでも同期したい場合は、グローバル IP を持つサーバーが必要です(トップページの「インストール」)。</dd></div>
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <h2 id="install-title">サーバーをインストール</h2>
+ <p class="intro">サーバーを動かすコンピューターの OS を選んでください。スクリプトが LAN のアドレスを見つけ、サーバーを自動起動に設定し、最後にアプリへ入力するアドレスを表示します。</p>
+ <div class="os-tabs" data-tabs>
+ <div class="tablist" role="tablist" aria-label="サーバーを動かすコンピューターの OS" hidden>
+ <button type="button" role="tab" id="tab-windows" aria-controls="windows">Windows</button>
+ <button type="button" role="tab" id="tab-macos" aria-controls="macos">macOS</button>
+ <button type="button" role="tab" id="tab-linux" aria-controls="linux">Linux</button>
+ </div>
+
+ <section class="os" id="windows" role="tabpanel" aria-labelledby="tab-windows">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li><a href="https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-windows-amd64.zip">copysync-server-windows-amd64.zip</a> をダウンロードし、右クリックで「すべて展開」します。</li>
+ <li>展開したフォルダーを開き、<code>install.cmd</code> をダブルクリックします。<span class="aside">「Windows によって PC が保護されました」と出たら「詳細情報」から「実行」を、ユーザーアカウント制御が出たら「はい」を押します。サーバーはまだコード署名していないため、一度だけ確認されます。</span></li>
+ <li>インストールは新しく開くウィンドウで進みます。最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。</li>
+ </ol>
+ <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-windows-amd64.zip"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Windows 版サーバーをダウンロード</a>
+ <ul class="points">
+ <li><strong>Windows サービスとして動作:</strong>Windows の起動とともに立ち上がり、サインイン不要で、ウィンドウも出ません。「サービス」では CopySync Server と表示されます。</li>
+ <li><strong>ファイアウォールは設定済み:</strong>copysync-server.exe だけを対象にした受信規則をスクリプトが追加するので、ポートを開ける必要はありません。</li>
+ <li><strong>アドレスが違うものになった</strong>(仮想マシンや VPN でネットワークアダプターが複数あるなど):展開したフォルダーのアドレスバーに <code>cmd</code> と入力して Enter を押し、<code>install.cmd 192.168.1.20</code> のようにアドレスを指定して実行します。</li>
+ <li>Windows 10・11、x64 に対応。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="explorer" role="img" aria-label="展開したフォルダーには copysync-server.exe、install.cmd、install.ps1、README.md、uninstall.cmd があり、install.cmd をダブルクリックする">
+ <div class="t-bar win"><span class="t-tab folder">copysync-server-windows-amd64</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+ <ul class="files">
+ <li><span class="f-icon exe" aria-hidden="true"></span><span class="f-name">copysync-server.exe</span></li>
+ <li class="hl"><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">install.cmd</span><em>ダブルクリック</em></li>
+ <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">install.ps1</span></li>
+ <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">README.md</span></li>
+ <li><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">uninstall.cmd</span></li>
+ </ul>
+ </figure>
+ <figure class="term" role="img" aria-label="install.cmd の実行後のウィンドウ:旧バージョンの停止、インストール、サービス登録、ファイアウォール許可、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示">
+ <div class="t-bar win"><span class="t-tab"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3 5.5 10.5 4.5v7H3zM11.5 4.4 21 3v8.5h-9.5zM3 12.5h7.5v7L3 18.5zM11.5 12.5H21V21l-9.5-1.4z"/></svg>管理者: Windows PowerShell</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+<pre class="t-body"><span class="t-step">&gt; Stopping the running version</span>
+<span class="t-step">&gt; Installing to C:\Program Files\CopySync Server</span>
+<span class="t-step">&gt; Registering the service CopySyncServer (relay address 192.168.1.20)</span>
+<span class="t-step">&gt; Allowing it through Windows Firewall</span>
+<span class="t-step">&gt; Starting</span>
+ √ Running
+
+Installed: copysync-server 1.3.3. It runs as a Windows service and starts with Windows.
+In CopySync on each computer, set Settings &gt; Signaling server to:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ Program C:\Program Files\CopySync Server
+ Logs C:\ProgramData\CopySync Server\server.log
+ Restart Restart-Service CopySyncServer (in an administrator PowerShell)
+ Uninstall double-click uninstall.cmd</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>あとで使うもの</caption>
+ <tbody>
+ <tr><th scope="row">状態</th><td>管理者の PowerShell で <code>Get-Service CopySyncServer</code>、または「サービス」で CopySync Server を確認</td></tr>
+ <tr><th scope="row">ログ</th><td><code>C:\ProgramData\CopySync Server\server.log</code></td></tr>
+ <tr><th scope="row">再起動</th><td>管理者の PowerShell で <code>Restart-Service CopySyncServer</code></td></tr>
+ <tr><th scope="row">更新</th><td>新しいバージョンをダウンロードして展開し、もう一度 <code>install.cmd</code> をダブルクリック。設定は引き継がれます</td></tr>
+ <tr><th scope="row">アンインストール</th><td><code>uninstall.cmd</code> をダブルクリック。サービス、ファイアウォール規則、ファイルをすべて削除します</td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section class="os" id="macos" role="tabpanel" aria-labelledby="tab-macos">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>macOS</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>「ターミナル」を開き、次の行を順に実行します:
+ <div class="code">
+ <button class="copy" type="button" data-done="コピーしました">コピー</button>
+<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-macos.tar.gz
+tar xzf copysync-server-macos.tar.gz
+cd copysync-server-macos
+./install.sh</code></pre>
+ </div></li>
+ <li>最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。</li>
+ </ol>
+ <ul class="points">
+ <li><strong>管理者権限は不要です。</strong>ログインしているあいだバックグラウンドで動き、終了しても macOS が再起動します。</li>
+ <li><strong>この Mac はスリープさせないでください:</strong>「システム設定 → エネルギー」(ノートは「バッテリー → オプション」)で自動スリープを防ぐ項目をオンにします。</li>
+ <li><strong>macOS のファイアウォールがオンなら、</strong>スクリプトの最後に copysync-server を許可するコマンドが表示されます。</li>
+ <li>Intel と Apple シリコンの両方に対応、macOS 13 以降。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="ターミナルで ./install.sh を実行した出力:インストール、LaunchAgent の作成、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示">
+ <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">copysync-server-macos — zsh</span></div>
+<pre class="t-body"><span class="t-prompt">%</span> ./install.sh
+<span class="t-step">▶ Stopping the running version</span>
+<span class="t-step">▶ Installing to /Users/me/Library/Application Support/CopySync Server</span>
+<span class="t-step">▶ Writing the LaunchAgent (relay address 192.168.1.20)</span>
+<span class="t-step">▶ Starting</span>
+ ✓ Running
+
+Installed: copysync-server 1.3.3. It starts whenever you log in to this Mac.
+In CopySync on each computer, set Settings → Signaling server to:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ Logs /Users/me/Library/Logs/CopySync/server.log
+ Restart launchctl kickstart -k gui/501/com.copysync.server
+ Uninstall ./install.sh uninstall</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>あとで使うもの</caption>
+ <tbody>
+ <tr><th scope="row">ログ</th><td><code>~/Library/Logs/CopySync/server.log</code></td></tr>
+ <tr><th scope="row">再起動</th><td><code>launchctl kickstart -k gui/$(id -u)/com.copysync.server</code></td></tr>
+ <tr><th scope="row">更新</th><td>新しいバージョンをダウンロードして展開し、もう一度 <code>./install.sh</code> を実行。設定は引き継がれます</td></tr>
+ <tr><th scope="row">アンインストール</th><td><code>./install.sh uninstall</code></td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section class="os" id="linux" role="tabpanel" aria-labelledby="tab-linux">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>Linux</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>そのマシン上で(または ssh でログインして)次の行を順に実行します:<span class="aside">ARM(64 ビット OS の Raspberry Pi など)では <code>amd64</code> を <code>arm64</code> に置き換えます。</span>
+ <div class="code">
+ <button class="copy" type="button" data-done="コピーしました">コピー</button>
+<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
+tar xzf copysync-server-linux-amd64.tar.gz
+cd copysync-server-linux-amd64
+sudo ./install.sh</code></pre>
+ </div></li>
+ <li>最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。</li>
+ </ol>
+ <ul class="points">
+ <li><strong>systemd サービスとして登録</strong>され、起動時に立ち上がります。root 権限が必要です。</li>
+ <li><strong>ufw や firewalld が有効なら、</strong>スクリプトの最後にポートを開けるコマンドが表示されます。</li>
+ <li><strong>Docker でも動かせます:</strong><code>env.example</code> を <code>.env</code> にコピーし、<code>TURN_IP</code> にこのマシンの LAN アドレスを入れて <code>docker compose up -d</code> を実行します。ホストネットワークが必要なので Linux 専用です。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="sudo ./install.sh の出力:インストール、systemd ユニットと設定の作成、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示">
+ <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">ssh 192.168.1.20</span></div>
+<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh
+<span class="t-step">▶ Installing the binary to /usr/local/bin</span>
+<span class="t-step">▶ Writing the systemd unit</span>
+<span class="t-step">▶ Writing /etc/copysync/server.env (relay address 192.168.1.20)</span>
+<span class="t-step">▶ Starting</span>
+ ✓ Running
+
+Installed: copysync-server 1.3.3
+In CopySync on each computer, set Settings → Signaling server to:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ Config /etc/copysync/server.env
+ Logs journalctl -u copysync-server -f
+ Restart systemctl restart copysync-server
+ Uninstall sudo ./install.sh uninstall
+
+Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768-60999 (relay ports, assigned by the OS)</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>あとで使うもの</caption>
+ <tbody>
+ <tr><th scope="row">状態</th><td><code>systemctl status copysync-server</code></td></tr>
+ <tr><th scope="row">ログ</th><td><code>journalctl -u copysync-server -f</code></td></tr>
+ <tr><th scope="row">再起動</th><td><code>sudo systemctl restart copysync-server</code></td></tr>
+ <tr><th scope="row">設定</th><td><code>/etc/copysync/server.env</code>。編集したらサービスを再起動</td></tr>
+ <tr><th scope="row">更新</th><td>新しいバージョンをダウンロードして展開し、もう一度 <code>sudo ./install.sh</code> を実行。設定は引き継がれます</td></tr>
+ <tr><th scope="row">アンインストール</th><td><code>sudo ./install.sh uninstall</code></td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <h2 id="check-title">ほかのコンピューターから届くか確認</h2>
+ <p class="intro">別のコンピューターのブラウザーで <code>http://192.168.1.20:8787/healthz</code>(あなたのアドレスに置き換え)を開きます。次の 1 行が表示されれば、ネットワークはつながっています。</p>
+ <figure class="browser" role="img" aria-label="ブラウザーで http://192.168.1.20:8787/healthz を開くと、サーバーの状態 ok とバージョンが表示される">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">http://192.168.1.20:8787/healthz</span></div>
+ <pre class="b-body">{"status":"ok","version":"1.3.3"}</pre>
+ </figure>
+ <p class="note">開けない場合は、下の<a href="#faq">よくある質問</a>をご覧ください。</p>
+ </div>
+ </section>
+
+ <section class="section" id="clients" aria-labelledby="clients-title">
+ <div class="wrap">
+ <h2 id="clients-title">各コンピューターにアドレスを入力</h2>
+ <ol class="flow">
+ <li><h3>設定を開く</h3><p>各コンピューターで CopySync を開き、「設定」に進みます。サーバーを動かしているコンピューターも同じです。</p></li>
+ <li><h3>アドレスを入力</h3><p>「シグナリングサーバー」に <code>ws://192.168.1.20:8787/signal</code>(あなたのアドレス)を入力し、Return か Enter を押します。</p></li>
+ <li><h3>状態を確認</h3><p>「接続状態」が緑の「接続済み」になれば完了です。「デバイス」でペアリングすれば、コピーが同期されるようになります。</p></li>
+ </ol>
+ <figure class="shot">
+ <img src="../../assets/screenshots/ja/settings-lan-dark.png" width="2112" height="1472" loading="lazy" alt="CopySync の設定画面:シグナリングサーバーは ws://192.168.1.20:8787/signal、接続状態は接続済み">
+ </figure>
+ <p class="note">アプリがまだなら、トップページの<a href="../../ja/#install">インストール</a>をご覧ください。</p>
+ </div>
+ </section>
+
+ <section class="section" id="faq" aria-labelledby="faq-title">
+ <div class="wrap">
+ <h2 id="faq-title">よくある質問</h2>
+ <div class="faq">
+ <details>
+ <summary>接続状態が「未接続」のまま</summary>
+ <div class="answer"><p>まずアドレスを確認します。<code>ws://</code> で始まり、ポートは 8787、末尾は <code>/signal</code>、入力後に Return を押しているか。</p><p>次に、そのコンピューターのブラウザーで <code>http://サーバーのアドレス:8787/healthz</code> を開きます。開けなければネットワークの経路の問題です。サーバーが動いていない、そのコンピューターがスリープしている、ファイアウォールに止められている、アドレスが変わった、のいずれかです。</p><p>Windows のスクリプトはファイアウォールを設定済みです。Mac でファイアウォールがオンなら、スクリプトの最後に表示されたコマンドを実行してください。Linux の ufw、firewalld も同様です。</p></div>
+ </details>
+ <details>
+ <summary>デバイスが「直接」ではなく「中継」になる</summary>
+ <div class="answer"><p>LAN 内ではほとんどの場合直接つながります。中継になるのは 2 台のあいだで UDP が通らないからで、ゲストネットワーク、Wi‑Fi の AP アイソレーション、ファイアウォールを挟んだ別のサブネットなどが原因です。中継でも内容は暗号化されたままで、速度がサーバー側のネットワークに左右されるだけです。</p></div>
+ </details>
+ <details>
+ <summary>サーバーのアドレスが変わった</summary>
+ <div class="answer"><p>新しいアドレスを付けてスクリプトをもう一度実行します。Windows は <code>install.cmd 新しいアドレス</code>、Mac は <code>./install.sh 新しいアドレス</code>。Linux では <code>/etc/copysync/server.env</code> の <code>-turn-ip</code> を書き換えてサービスを再起動します。そのあと各コンピューターのアドレスも変更してください。</p><p>ルーターでアドレスを固定しておけば、こうしたことは起きません。</p></div>
+ </details>
+ <details>
+ <summary>LAN の外でも同期できますか?</summary>
+ <div class="answer"><p>できません。サーバーには LAN の中からしか届かないためです。どこでも使いたい場合は、グローバル IP を持つマシンにサーバーを置くか(トップページの「インストール」)、Tailscale や ZeroTier などでデバイスを同じ仮想ネットワークに参加させ、その中でのサーバーのアドレスを入力します。</p></div>
+ </details>
+ <details>
+ <summary>中国本土のクラウドサーバーで、ドメインではつながらず IP ならつながる</summary>
+ <div class="answer"><p>ICP 登録(备案)のないドメインへの平文 HTTP リクエストは、中国本土のクラウド事業者に横取りされ、ブロックページへのリダイレクトが返されます。テストでは 8787 のような一般的でないポートでも同じでした。WebSocket のハンドシェイクも HTTP リクエストなので同じく止められ、アプリは未接続になります。</p><p>アドレスには <code>ws://サーバーのIP:8787/signal</code> のように IP を直接入力するか、ドメインを登録してください。</p></div>
+ </details>
+ <details>
+ <summary>サーバーを動かすコンピューターでも CopySync を使う場合のアドレスは?</summary>
+ <div class="answer"><p>同じ LAN のアドレスで大丈夫です。<code>ws://127.0.0.1:8787/signal</code> でもかまいません。サーバーとアプリは互いに影響しません。</p></div>
+ </details>
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">電源を入れたままの<br>コンピューターが 1 台あれば十分。</h2>
+ <div class="cta">
+ <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Mac 版をダウンロード</a>
+ <a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Windows 版をダウンロード</a>
+ </div>
+ <p class="note">バージョン 1.3.3、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>
+ <a class="source" href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">サーバーの詳しい構築手順(グローバル IP、Docker を含む、英語・中国語)</a>
+ </div>
+ </section>
+ </main>
+
+ <footer class="footer">
+ <div class="wrap">
+ <p>CopySync は GNU AGPL-3.0 のオープンソースです。商用ライセンスもあります。</p>
+ <nav aria-label="フッターのリンク">
+ <a href="https://github.com/baiyuze/copysync/releases">すべてのリリース</a>
+ <a href="https://github.com/baiyuze/copysync/blob/main/CHANGELOG.md">更新履歴</a>
+ <a href="https://baiyuze.github.io/copysync/design/nat-traversal.html">技術資料(中国語)</a>
+ <a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">商用ライセンス</a>
+ <a href="https://github.com/baiyuze/copysync/issues">問題を報告</a>
+ </nav>
+ <nav aria-label="言語">
+ <a href="../../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../en/server/" hreflang="en" lang="en" data-lang="en">English</a>
+ <a href="../../ja/server/" hreflang="ja" lang="ja" data-lang="ja" aria-current="page">日本語</a>
+ </nav>
+ </div>
+ </footer>
+
+ <script src="../../assets/site.js" defer></script>
+</body>
+</html>
diff --git a/docs/llms.txt b/docs/llms.txt
index 9b9a682..1bb615a 100644
--- a/docs/llms.txt
+++ b/docs/llms.txt
@@ -6,10 +6,10 @@
Key facts:
-- Current version: 1.3.1, released 2026-10-09. Click a history item to preview images, including copied image files (PNG, JPEG, GIF, WebP, BMP; HEIC and TIFF on Mac), with arrows to step through several. 1.3.0 added an English and Japanese interface (follows the system language, switchable in Settings) and moves to the GNU AGPL-3.0 with an optional commercial license. 1.2.0 added the Windows client.
+- Current version: 1.3.3, released 2026-10-11. The server now installs on Windows (as a service) and on a Mac (as a LaunchAgent) as well as Linux, and the website has a step-by-step guide for running it on a LAN. 1.3.2 stopped UU Remote placeholder files from looping through the history. 1.3.1: click a history item to preview images, including copied image files (PNG, JPEG, GIF, WebP, BMP; HEIC and TIFF on Mac), with arrows to step through several. 1.3.0 added an English and Japanese interface (follows the system language, switchable in Settings) and moves to the GNU AGPL-3.0 with an optional commercial license. 1.2.0 added the Windows client.
- Mac client: macOS 13 Ventura or later, universal binary for Intel and Apple silicon. Distributed as a DMG; not notarized by Apple, so the first launch needs "Open Anyway" in System Settings → Privacy & Security.
- Windows client: Windows 10 (21H2+) and Windows 11, x64. Per-user installer (CopySync-Setup.exe, no admin rights) or portable zip; not code-signed, so SmartScreen needs "More info → Run anyway" once. Runs in the notification area; pasted files are real files usable in Explorer, WeChat and Office. Skips content that password managers mark as sensitive.
-- Server: a single static Go binary for Linux (x86_64, ARM64) or macOS, installed via systemd script or Docker Compose. Ports: 8787/tcp (signaling), 3478/udp (STUN/TURN), 32768–60999/udp (relay).
+- Server: a single static Go binary for Linux (x86_64, ARM64), macOS or Windows 10/11 x64. Install scripts register it as a systemd service (Linux), a LaunchAgent (macOS) or a Windows service with a firewall rule (Windows), and default to the machine's LAN address; Docker Compose also works on Linux. On a LAN, any always-on computer can run it. Ports: 8787/tcp (signaling), 3478/udp (STUN/TURN), plus OS-assigned UDP relay ports. In mainland China, cloud providers intercept plain HTTP (including the WebSocket handshake) for domains without an ICP filing, so clients should use the server's IP.
- Content synced: plain text, rich text (HTML plus a plain-text copy), images, files, folders.
- Works on multi-uplink networks (e.g. offices with two ISPs) that pick an uplink per destination: the client probes several STUN servers from one shared port to learn its address on every uplink and sends all of them to the peer. Diagnose with `copysync-cli nat`. If a connection lands on the relay first, the client retries the direct path with an ICE restart while idle.
- Items under 50 MB (adjustable 1 MB–1 GB) are pushed on copy; larger files sync as a record and are pulled on demand.
@@ -21,9 +21,11 @@ Key facts:
## Docs
- [Website (English)](https://baiyuze.github.io/copysync/en/), [简体中文](https://baiyuze.github.io/copysync/), [日本語](https://baiyuze.github.io/copysync/ja/)
-- [README (English)](https://github.com/baiyuze/copysync/blob/main/README.md): features, installation, architecture, security model, fallbacks
-- [README (中文)](https://github.com/baiyuze/copysync/blob/main/README.zh-CN.md): the same in Simplified Chinese
-- [Server deployment](https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md): systemd, Docker and manual setup
+- [Run the server on your LAN](https://baiyuze.github.io/copysync/en/server/): step-by-step guide for Windows, macOS and Linux ([中文](https://baiyuze.github.io/copysync/server/), [日本語](https://baiyuze.github.io/copysync/ja/server/))
+- [README (English)](https://github.com/baiyuze/copysync/blob/main/README.md): features and getting started ([中文](https://github.com/baiyuze/copysync/blob/main/README.zh-CN.md))
+- [How it works](https://github.com/baiyuze/copysync/blob/main/guide/how-it-works.md): architecture, NAT traversal, security model, fallbacks, lessons learned
+- [Troubleshooting](https://github.com/baiyuze/copysync/blob/main/guide/troubleshooting.md) and known limitations
+- [Server deployment](https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md): Windows, macOS, Linux (systemd), Docker and manual setup
- [Licensing](https://github.com/baiyuze/copysync/blob/main/LICENSING.md): AGPL-3.0 terms and the commercial license; versions 1.2.0 and earlier remain MIT
- [Windows client design (中文)](https://baiyuze.github.io/copysync/design/windows-client.html): clipboard formats, file-name compatibility, background process, installer
- [NAT traversal design (中文)](https://baiyuze.github.io/copysync/design/nat-traversal.html): multi-uplink probing, relay-to-direct upgrade, measurements and the NAT lab
@@ -31,5 +33,5 @@ Key facts:
## Download
-- [Latest release](https://github.com/baiyuze/copysync/releases/latest): CopySync.dmg for macOS, CopySync-Setup.exe and a portable zip for Windows, and server packages for Linux and macOS
+- [Latest release](https://github.com/baiyuze/copysync/releases/latest): CopySync.dmg for macOS, CopySync-Setup.exe and a portable zip for Windows, and server packages for Linux, macOS and Windows
- [Source code](https://github.com/baiyuze/copysync)
diff --git a/docs/server/index.html b/docs/server/index.html
new file mode 100644
index 0000000..4b32549
--- /dev/null
+++ b/docs/server/index.html
@@ -0,0 +1,399 @@
+<!doctype html>
+<html lang="zh-CN">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>在局域网里部署 CopySync 服务器:Windows、Mac、Linux 教程</title>
+ <meta name="description" content="两台电脑在同一个网络里时,不需要云服务器:在一台常开的 Windows、Mac 或 Linux 电脑上运行 CopySync 的信令与 TURN 服务器,下载后运行一个脚本即可,开机自动运行。附客户端设置与排错。">
+ <link rel="canonical" href="https://baiyuze.github.io/copysync/server/">
+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/server/">
+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/server/">
+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/server/">
+ <meta name="theme-color" content="#141416">
+ <meta property="og:type" content="article">
+ <meta property="og:site_name" content="CopySync">
+ <meta property="og:title" content="在局域网里部署 CopySync 服务器:Windows、Mac、Linux 教程">
+ <meta property="og:description" content="两台电脑在同一个网络里时,不需要云服务器:在一台常开的 Windows、Mac 或 Linux 电脑上运行 CopySync 的信令与 TURN 服务器,下载后运行一个脚本即可,开机自动运行。附客户端设置与排错。">
+ <meta property="og:url" content="https://baiyuze.github.io/copysync/server/">
+ <meta property="og:image" content="https://baiyuze.github.io/copysync/assets/og.png">
+ <meta property="og:locale" content="zh_CN">
+ <meta name="twitter:card" content="summary_large_image">
+ <link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">
+ <link rel="icon" href="../assets/favicon-32.png" sizes="32x32" type="image/png">
+ <link rel="apple-touch-icon" href="../assets/apple-touch-icon.png">
+ <link rel="stylesheet" href="../assets/site.css">
+</head>
+<body>
+ <a class="skip" href="#main">跳到正文</a>
+
+ <header class="bar">
+ <div class="wrap">
+ <a class="brand" href=".././" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
+ <nav aria-label="页面导航">
+ <a class="wide" href=".././#how">工作原理</a>
+ <a class="wide" href=".././#install">安装</a>
+ <a href="./" aria-current="page">部署服务器</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../en/server/" hreflang="en" lang="en" data-lang="en">English</a>
+ <a href="../ja/server/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
+ </nav>
+ </div>
+ </header>
+
+ <main id="main">
+ <section class="hero guide-hero">
+ <div class="wrap">
+ <p class="crumb"><a href=".././">CopySync</a> / 部署服务器</p>
+ <h1 class="display">在局域网里部署服务器</h1>
+ <p class="lede">家里或办公室的电脑在同一个网络里,就不需要云服务器。找一台常开的电脑,下载、运行一个脚本,再把它显示的地址填进每台电脑的 CopySync 里。</p>
+ <ol class="guide-toc">
+ <li><a href="#prepare">准备</a></li>
+ <li><a href="#install">安装服务器</a></li>
+ <li><a href="#check">检查</a></li>
+ <li><a href="#clients">填地址</a></li>
+ <li><a href="#faq">常见问题</a></li>
+ </ol>
+ </div>
+ </section>
+
+ <section class="section" id="overview" aria-labelledby="overview-title">
+ <div class="wrap">
+ <h2 id="overview-title">服务器只负责牵线</h2>
+ <p class="intro">每台电脑一直连着服务器,靠它找到对方、交换连接信息。连上之后,复制的内容在两台电脑之间直接传输;只有直连打不通时,才经过它中转,内容依然加密。</p>
+ <figure class="diagram">
+ <svg viewBox="0 0 960 440" role="img" aria-labelledby="lan-title lan-desc">
+ <title id="lan-title">局域网里的 CopySync</title>
+ <desc id="lan-desc">同一个局域网里,Mac 与 Windows 电脑通过信令连接到地址为 192.168.1.20 的服务器,复制的内容在两台电脑之间直连传输;直连不通时经服务器的 TURN 中转。</desc>
+ <rect class="d-lan" x="8" y="8" width="944" height="384" rx="22"/>
+ <text class="d-lan-label" x="32" y="42">局域网:同一个 Wi‑Fi 或有线网络</text>
+ <rect class="d-box" x="340" y="64" width="280" height="104" rx="14"/>
+ <text class="d-title" x="480" y="106" text-anchor="middle">服务器</text>
+ <text class="d-ip" x="480" y="138" text-anchor="middle">192.168.1.20</text>
+ <path class="d-sig" d="M150 250V96H340"/>
+ <path class="d-sig" d="M810 250V96H620"/>
+ <path class="d-relay" d="M206 250V140H340"/>
+ <path class="d-relay" d="M754 250V140H620"/>
+ <text class="d-note" x="164" y="86">信令 TCP 8787</text>
+ <text class="d-note" x="220" y="200">中转 UDP 3478,直连不通时</text>
+ <rect class="d-box" x="40" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="160" y="300" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="160" y="328" text-anchor="middle">装着 CopySync</text>
+ <rect class="d-box" x="680" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="800" y="300" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="800" y="328" text-anchor="middle">装着 CopySync</text>
+ <path class="d-direct" d="M280 306H680"/>
+ <text class="d-label" x="480" y="292" text-anchor="middle">直连,端到端加密</text>
+ <text class="d-note" x="480" y="336" text-anchor="middle">复制的内容只在两台电脑之间传输</text>
+ <g class="d-legend" transform="translate(40 424)">
+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">数据(直连)</text>
+ <path class="d-relay" d="M250 0H278"/><text x="288" y="5">数据(中转,备用)</text>
+ <path class="d-sig" d="M560 0H588"/><text x="598" y="5">信令</text>
+ </g>
+ </svg>
+ </figure>
+ <ul class="points ports">
+ <li><strong>信令,TCP 8787。</strong>每台电脑一直连着它,用来发现对方、配对、交换连接信息。</li>
+ <li><strong>直连。</strong>在同一个局域网里,内容几乎总是在两台电脑之间直接传输,速度就是局域网的速度。</li>
+ <li><strong>中转,UDP 3478。</strong>访客网络、开了 AP 隔离的 Wi‑Fi、不同网段之间互相访问不到时才会用到。</li>
+ </ul>
+ </div>
+ </section>
+
+ <section class="section" id="prepare" aria-labelledby="prepare-title">
+ <div class="wrap">
+ <h2 id="prepare-title">开始之前</h2>
+ <dl class="fallbacks">
+ <div><dt>一台常开的电脑</dt><dd>Windows 10、11,macOS 13 及以上,或者任意 Linux 都行,两台电脑中的一台也可以。它关机或睡眠时同步会暂停,醒来后自动恢复。NAS、软路由、Mac mini 这类一直开着的设备最合适,内存只占约 15 MB。</dd></div>
+ <div><dt>一个固定的地址</dt><dd>在路由器的「DHCP 静态分配」(也叫「地址保留」「IP 与 MAC 绑定」)里给这台电脑固定一个地址。不然路由器换了地址,每台电脑都要重新填。</dd></div>
+ <div><dt>在同一个网络里</dt><dd>设备连同一个 Wi‑Fi 或有线网络就行。访客网络、开了「AP 隔离」的 Wi‑Fi 不让设备互相访问,需要换个网络或关掉隔离。</dd></div>
+ <div><dt>离开这个网络就不同步</dt><dd>服务器只在局域网里访问得到,笔记本带出门后,回来才会继续同步。想在任何地方都能同步,需要一台有公网 IP 的服务器,见首页的「安装」。</dd></div>
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <h2 id="install-title">安装服务器</h2>
+ <p class="intro">选服务器所在电脑的系统。安装脚本会自动找到本机的局域网地址,把服务器设成开机自动运行,最后显示客户端要填的地址。</p>
+ <div class="os-tabs" data-tabs>
+ <div class="tablist" role="tablist" aria-label="服务器所在电脑的系统" hidden>
+ <button type="button" role="tab" id="tab-windows" aria-controls="windows">Windows</button>
+ <button type="button" role="tab" id="tab-macos" aria-controls="macos">macOS</button>
+ <button type="button" role="tab" id="tab-linux" aria-controls="linux">Linux</button>
+ </div>
+
+ <section class="os" id="windows" role="tabpanel" aria-labelledby="tab-windows">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>下载 <a href="https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-windows-amd64.zip">copysync-server-windows-amd64.zip</a>,右键选「全部解压缩」。</li>
+ <li>打开解压出的文件夹,双击 <code>install.cmd</code>。<span class="aside">提示「Windows 已保护你的电脑」时,点「更多信息」,再点「仍要运行」;弹出用户账户控制时点「是」。服务器还没有代码签名,所以会这样问一次。</span></li>
+ <li>安装在新打开的窗口里进行。最后显示的 <code>ws://…/signal</code> 就是客户端要填的地址。</li>
+ </ol>
+ <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-windows-amd64.zip"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Windows 版服务器</a>
+ <ul class="points">
+ <li><strong>作为 Windows 服务运行:</strong>开机就启动,不用登录,也没有窗口。在「服务」里叫 CopySync Server。</li>
+ <li><strong>防火墙已经放行:</strong>脚本添加了一条只针对 copysync-server.exe 的入站规则,不用自己开端口。</li>
+ <li><strong>地址认错了</strong>(比如装了虚拟机或 VPN,有好几块网卡):在解压出的文件夹的地址栏里输入 <code>cmd</code> 回车,运行 <code>install.cmd 192.168.1.20</code>,换成你的地址。</li>
+ <li>支持 Windows 10、11,x64。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="explorer" role="img" aria-label="解压出的文件夹里有 copysync-server.exe、install.cmd、install.ps1、README.md、uninstall.cmd,双击其中的 install.cmd">
+ <div class="t-bar win"><span class="t-tab folder">copysync-server-windows-amd64</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+ <ul class="files">
+ <li><span class="f-icon exe" aria-hidden="true"></span><span class="f-name">copysync-server.exe</span></li>
+ <li class="hl"><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">install.cmd</span><em>双击</em></li>
+ <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">install.ps1</span></li>
+ <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">README.md</span></li>
+ <li><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">uninstall.cmd</span></li>
+ </ul>
+ </figure>
+ <figure class="term" role="img" aria-label="install.cmd 运行完的窗口:依次停止旧版本、安装、注册服务、放行防火墙、启动,最后显示客户端要填的地址 ws://192.168.1.20:8787/signal">
+ <div class="t-bar win"><span class="t-tab"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3 5.5 10.5 4.5v7H3zM11.5 4.4 21 3v8.5h-9.5zM3 12.5h7.5v7L3 18.5zM11.5 12.5H21V21l-9.5-1.4z"/></svg>管理员: Windows PowerShell</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+<pre class="t-body"><span class="t-step">&gt; 停止旧版本</span>
+<span class="t-step">&gt; 安装到 C:\Program Files\CopySync Server</span>
+<span class="t-step">&gt; 注册服务 CopySyncServer(中转地址 192.168.1.20)</span>
+<span class="t-step">&gt; 在 Windows 防火墙里放行</span>
+<span class="t-step">&gt; 启动</span>
+ √ 已启动
+
+安装完成:copysync-server 1.3.3,作为 Windows 服务开机自动运行
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ 程序 C:\Program Files\CopySync Server
+ 日志 C:\ProgramData\CopySync Server\server.log
+ 重启 Restart-Service CopySyncServer(管理员 PowerShell)
+ 卸载 双击 uninstall.cmd</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>以后会用到的</caption>
+ <tbody>
+ <tr><th scope="row">状态</th><td>管理员 PowerShell 里运行 <code>Get-Service CopySyncServer</code>,或者在「服务」里找 CopySync Server</td></tr>
+ <tr><th scope="row">日志</th><td><code>C:\ProgramData\CopySync Server\server.log</code></td></tr>
+ <tr><th scope="row">重启</th><td>管理员 PowerShell 里运行 <code>Restart-Service CopySyncServer</code></td></tr>
+ <tr><th scope="row">升级</th><td>下载新版本,解压后再双击 <code>install.cmd</code>,原来的设置保留</td></tr>
+ <tr><th scope="row">卸载</th><td>双击 <code>uninstall.cmd</code>,服务、防火墙规则和文件一并删除</td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section class="os" id="macos" role="tabpanel" aria-labelledby="tab-macos">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>macOS</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>打开「终端」,逐行运行:
+ <div class="code">
+ <button class="copy" type="button" data-done="已复制">复制</button>
+<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-macos.tar.gz
+tar xzf copysync-server-macos.tar.gz
+cd copysync-server-macos
+./install.sh</code></pre>
+ </div></li>
+ <li>最后显示的 <code>ws://…/signal</code> 就是客户端要填的地址。</li>
+ </ol>
+ <ul class="points">
+ <li><strong>不需要管理员权限。</strong>登录这台 Mac 后自动在后台运行,意外退出会被系统重新拉起。</li>
+ <li><strong>这台 Mac 不能睡眠:</strong>在「系统设置 → 能耗」(笔记本在「电池 → 选项」)里打开防止自动进入睡眠的选项。</li>
+ <li><strong>开着系统防火墙的话,</strong>脚本最后会给出放行 copysync-server 的命令。</li>
+ <li>Intel 与 Apple 芯片通用,macOS 13 及以上。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="在终端里运行 ./install.sh 的输出:安装、写入 LaunchAgent、启动,最后显示客户端要填的地址 ws://192.168.1.20:8787/signal">
+ <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">copysync-server-macos — zsh</span></div>
+<pre class="t-body"><span class="t-prompt">%</span> ./install.sh
+<span class="t-step">▶ 停止旧版本</span>
+<span class="t-step">▶ 安装到 /Users/me/Library/Application Support/CopySync Server</span>
+<span class="t-step">▶ 写入 LaunchAgent(中转地址 192.168.1.20)</span>
+<span class="t-step">▶ 启动</span>
+ ✓ 已启动
+
+安装完成:copysync-server 1.3.3,登录这台 Mac 后自动运行
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ 日志 /Users/me/Library/Logs/CopySync/server.log
+ 重启 launchctl kickstart -k gui/501/com.copysync.server
+ 卸载 ./install.sh uninstall</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>以后会用到的</caption>
+ <tbody>
+ <tr><th scope="row">日志</th><td><code>~/Library/Logs/CopySync/server.log</code></td></tr>
+ <tr><th scope="row">重启</th><td><code>launchctl kickstart -k gui/$(id -u)/com.copysync.server</code></td></tr>
+ <tr><th scope="row">升级</th><td>下载新版本,解压后再运行 <code>./install.sh</code>,原来的设置保留</td></tr>
+ <tr><th scope="row">卸载</th><td><code>./install.sh uninstall</code></td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section class="os" id="linux" role="tabpanel" aria-labelledby="tab-linux">
+ <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>Linux</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>在这台机器上(或者 ssh 登录后)逐行运行:<span class="aside">ARM 设备,比如装了 64 位系统的树莓派,把 <code>amd64</code> 换成 <code>arm64</code>。</span>
+ <div class="code">
+ <button class="copy" type="button" data-done="已复制">复制</button>
+<pre><code>curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
+tar xzf copysync-server-linux-amd64.tar.gz
+cd copysync-server-linux-amd64
+sudo ./install.sh</code></pre>
+ </div></li>
+ <li>最后显示的 <code>ws://…/signal</code> 就是客户端要填的地址。</li>
+ </ol>
+ <ul class="points">
+ <li><strong>注册为 systemd 服务,</strong>开机自动运行。需要 root。</li>
+ <li><strong>开着 ufw 或 firewalld 的话,</strong>脚本最后会给出放行端口的命令。</li>
+ <li><strong>也可以用 Docker:</strong>把 <code>env.example</code> 复制为 <code>.env</code>,<code>TURN_IP</code> 填这台机器的局域网地址,再运行 <code>docker compose up -d</code>。必须用 host 网络,所以只适用于 Linux。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="运行 sudo ./install.sh 的输出:安装、写入 systemd 单元、生成配置、启动,最后显示客户端要填的地址 ws://192.168.1.20:8787/signal">
+ <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">ssh 192.168.1.20</span></div>
+<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh
+<span class="t-step">▶ 安装二进制到 /usr/local/bin</span>
+<span class="t-step">▶ 写入 systemd 单元</span>
+<span class="t-step">▶ 生成配置 /etc/copysync/server.env(中转地址 192.168.1.20)</span>
+<span class="t-step">▶ 启动</span>
+ ✓ 已启动
+
+安装完成:copysync-server 1.3.3
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ <span class="t-url">ws://192.168.1.20:8787/signal</span>
+
+ 配置 /etc/copysync/server.env
+ 日志 journalctl -u copysync-server -f
+ 重启 systemctl restart copysync-server
+ 卸载 sudo ./install.sh uninstall
+
+防火墙需放行:TCP 8787(信令)、UDP 3478(STUN 与 TURN)、UDP 32768-60999(中转端口,系统随机分配)</pre>
+ </figure>
+ </div>
+ </div>
+ <div class="table-scroll">
+ <table class="manage">
+ <caption>以后会用到的</caption>
+ <tbody>
+ <tr><th scope="row">状态</th><td><code>systemctl status copysync-server</code></td></tr>
+ <tr><th scope="row">日志</th><td><code>journalctl -u copysync-server -f</code></td></tr>
+ <tr><th scope="row">重启</th><td><code>sudo systemctl restart copysync-server</code></td></tr>
+ <tr><th scope="row">配置</th><td><code>/etc/copysync/server.env</code>,改完重启服务</td></tr>
+ <tr><th scope="row">升级</th><td>下载新版本,解压后再运行 <code>sudo ./install.sh</code>,原来的配置保留</td></tr>
+ <tr><th scope="row">卸载</th><td><code>sudo ./install.sh uninstall</code></td></tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <h2 id="check-title">检查其他电脑能不能访问到它</h2>
+ <p class="intro">在另一台电脑的浏览器里打开 <code>http://192.168.1.20:8787/healthz</code>(换成你的地址),看到下面这一行,网络就是通的。</p>
+ <figure class="browser" role="img" aria-label="浏览器打开 http://192.168.1.20:8787/healthz,页面显示服务器的状态 ok 与版本号">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">http://192.168.1.20:8787/healthz</span></div>
+ <pre class="b-body">{"status":"ok","version":"1.3.3"}</pre>
+ </figure>
+ <p class="note">打不开的话,看下面的<a href="#faq">常见问题</a>。</p>
+ </div>
+ </section>
+
+ <section class="section" id="clients" aria-labelledby="clients-title">
+ <div class="wrap">
+ <h2 id="clients-title">在每台电脑上填地址</h2>
+ <ol class="flow">
+ <li><h3>打开设置</h3><p>在每台电脑上打开 CopySync,进入「设置」。服务器所在的那台电脑也一样。</p></li>
+ <li><h3>填入地址</h3><p>在「信令服务器地址」里填 <code>ws://192.168.1.20:8787/signal</code>(换成你的地址),按回车保存。</p></li>
+ <li><h3>看连接状态</h3><p>「连接状态」变成绿色的「已连接」就好了。接着在「设备」里配对,之后复制就会同步。</p></li>
+ </ol>
+ <figure class="shot">
+ <img src="../assets/screenshots/settings-lan-dark.png" width="2112" height="1472" loading="lazy" alt="CopySync 的设置页:信令服务器地址填着 ws://192.168.1.20:8787/signal,连接状态显示已连接">
+ </figure>
+ <p class="note">还没装 App?见首页的<a href=".././#install">安装</a>。</p>
+ </div>
+ </section>
+
+ <section class="section" id="faq" aria-labelledby="faq-title">
+ <div class="wrap">
+ <h2 id="faq-title">常见问题</h2>
+ <div class="faq">
+ <details>
+ <summary>连接状态一直是「未连接」?</summary>
+ <div class="answer"><p>先核对地址:以 <code>ws://</code> 开头,端口是 8787,以 <code>/signal</code> 结尾,填完按过回车。</p><p>再在这台电脑的浏览器里打开 <code>http://服务器地址:8787/healthz</code>。打不开,说明到服务器的网络不通:服务器没在运行、那台电脑睡眠了、被防火墙拦住了,或者它的地址变了。</p><p>Windows 的安装脚本已经放行了防火墙;Mac 开着系统防火墙时,运行安装脚本最后给出的放行命令;Linux 上的 ufw、firewalld 也一样。</p></div>
+ </details>
+ <details>
+ <summary>设备之间显示「中转」,不是「直连」?</summary>
+ <div class="answer"><p>同一个局域网里一般都是直连。显示中转,说明两台电脑之间的 UDP 不通,常见于访客网络、开了 AP 隔离的 Wi‑Fi,或者两台电脑在不同网段、中间有防火墙。中转经过服务器,内容同样加密,只是速度受那台电脑的网络限制。</p></div>
+ </details>
+ <details>
+ <summary>服务器的地址变了怎么办?</summary>
+ <div class="answer"><p>带上新地址再运行一次安装脚本:Windows 上是 <code>install.cmd 新地址</code>,Mac 上是 <code>./install.sh 新地址</code>;Linux 上编辑 <code>/etc/copysync/server.env</code> 里的 <code>-turn-ip</code>,再重启服务。然后在每台电脑上改掉服务器地址。</p><p>在路由器里给它固定一个地址,就不会再遇到这件事。</p></div>
+ </details>
+ <details>
+ <summary>离开局域网以后还能同步吗?</summary>
+ <div class="answer"><p>不能,服务器只在局域网里访问得到。要在外面也能用,可以把服务器部署到有公网 IP 的机器上(首页的「安装」里有步骤),或者用 Tailscale、ZeroTier 这类组网工具把设备连进同一个虚拟局域网,服务器地址填它在虚拟网里的地址。</p></div>
+ </details>
+ <details>
+ <summary>用国内的云服务器,填域名连不上、填 IP 却能连?</summary>
+ <div class="answer"><p>域名没有备案时,国内的云厂商会拦截访问它的明文 HTTP 请求,返回一个跳转到拦截页的响应,实测 8787 这样的非常用端口也一样。WebSocket 握手也是一个 HTTP 请求,所以同样被拦,客户端就显示未连接。</p><p>服务器地址里直接填 IP 就行,比如 <code>ws://服务器IP:8787/signal</code>;或者给域名备案。</p></div>
+ </details>
+ <details>
+ <summary>服务器所在的那台电脑也要用 CopySync,地址填什么?</summary>
+ <div class="answer"><p>填同样的局域网地址就行,填 <code>ws://127.0.0.1:8787/signal</code> 也可以。服务器和 App 互不影响。</p></div>
+ </details>
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">一台常开的电脑,就够了。</h2>
+ <div class="cta">
+ <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Mac 版</a>
+ <a class="button quiet" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>下载 Windows 版</a>
+ </div>
+ <p class="note">版本 1.3.3,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>
+ <a class="source" href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">服务器的完整部署说明(含公网与 Docker)</a>
+ </div>
+ </section>
+ </main>
+
+ <footer class="footer">
+ <div class="wrap">
+ <p>CopySync 以 GNU AGPL-3.0 开源,另提供商业授权。</p>
+ <nav aria-label="页脚链接">
+ <a href="https://github.com/baiyuze/copysync/releases">所有版本</a>
+ <a href="https://github.com/baiyuze/copysync/blob/main/CHANGELOG.md">更新记录</a>
+ <a href="https://baiyuze.github.io/copysync/design/nat-traversal.html">技术方案</a>
+ <a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">商业授权</a>
+ <a href="https://github.com/baiyuze/copysync/issues">反馈问题</a>
+ </nav>
+ <nav aria-label="语言">
+ <a href="../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh" aria-current="page">简体中文</a>
+ <a href="../en/server/" hreflang="en" lang="en" data-lang="en">English</a>
+ <a href="../ja/server/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
+ </nav>
+ </div>
+ </footer>
+
+ <script src="../assets/site.js" defer></script>
+</body>
+</html>
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index ecbe593..37cafc4 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -3,7 +3,7 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://baiyuze.github.io/copysync/</loc>
- <lastmod>2026-10-10</lastmod>
+ <lastmod>2026-10-11</lastmod>
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"/>
<xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/"/>
<xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"/>
@@ -11,7 +11,7 @@
</url>
<url>
<loc>https://baiyuze.github.io/copysync/en/</loc>
- <lastmod>2026-10-10</lastmod>
+ <lastmod>2026-10-11</lastmod>
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"/>
<xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/"/>
<xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"/>
@@ -19,18 +19,39 @@
</url>
<url>
<loc>https://baiyuze.github.io/copysync/ja/</loc>
- <lastmod>2026-10-10</lastmod>
+ <lastmod>2026-10-11</lastmod>
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"/>
<xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/"/>
<xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/"/>
</url>
+ <url>
+ <loc>https://baiyuze.github.io/copysync/server/</loc>
+ <lastmod>2026-10-11</lastmod>
+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/server/"/>
+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/server/"/>
+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/server/"/>
+ </url>
+ <url>
+ <loc>https://baiyuze.github.io/copysync/en/server/</loc>
+ <lastmod>2026-10-11</lastmod>
+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/server/"/>
+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/server/"/>
+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/server/"/>
+ </url>
+ <url>
+ <loc>https://baiyuze.github.io/copysync/ja/server/</loc>
+ <lastmod>2026-10-11</lastmod>
+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/server/"/>
+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/server/"/>
+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/server/"/>
+ </url>
<url>
<loc>https://baiyuze.github.io/copysync/design/nat-traversal.html</loc>
- <lastmod>2026-10-10</lastmod>
+ <lastmod>2026-10-11</lastmod>
</url>
<url>
<loc>https://baiyuze.github.io/copysync/design/windows-client.html</loc>
- <lastmod>2026-10-10</lastmod>
+ <lastmod>2026-10-11</lastmod>
</url>
</urlset>
diff --git a/guide/building.md b/guide/building.md
new file mode 100644
index 0000000..ecf71d0
--- /dev/null
+++ b/guide/building.md
@@ -0,0 +1,48 @@
+# Building from source
+
+[简体中文](building.zh-CN.md) · [Back to README](../README.md)
+
+The Mac app needs Go 1.26, Flutter 3.44 and Xcode:
+
+```bash
+./scripts/build.sh # build everything into dist/
+./scripts/package.sh # build the DMG and server packages into release/
+```
+
+The Windows app needs Go, Flutter, Visual Studio ("Desktop development with C++") and Inno Setup 6. On Windows:
+
+```powershell
+powershell -ExecutionPolicy Bypass -File scripts\build-windows.ps1 # installer and portable zip into dist\windows\
+```
+
+The background service is pure Go and also cross-compiles from a Mac: `GOOS=windows go build ./cmd/copysyncd`. CI builds the Windows installer on every commit.
+
+The server is pure Go too. `package.sh` cross-compiles it for Linux (amd64, arm64), macOS and Windows, and bundles each with its install script from `server/deploy/`.
+
+During development:
+
+```bash
+cd client-core && go test ./... # service tests
+./tools/natlab/docker.sh # NAT lab: direct vs relay across 11 network topologies
+cd ui && flutter test # app tests
+./scripts/install-macos.sh # install the service from dist/ as a login item
+./dist/copysync-cli status # service status
+./dist/copysync-cli watch # live event stream
+```
+
+After changing a `.proto` file, run `./scripts/gen-proto.sh` (uses buf; install with `go install`, no protoc needed). After changing the UI, run `./tools/screenshots/render.sh` to regenerate the screenshots from demo data.
+
+```
+client-core/ background service (Go)
+ internal/clipboard clipboard (Mac: cgo + Objective-C; Windows: Win32; main thread only)
+ internal/transport signaling (WebSocket) and P2P (WebRTC)
+ internal/sync sync engine: routing, packing, transfer, storage
+ui/ app (Flutter)
+server/ signaling + TURN relay server (Go); deployment files in server/deploy/
+proto/ message definitions and device ID derivation, shared by all three
+docs/ website (GitHub Pages)
+spikes/ technical validation done before development
+design/ design documents
+tools/natlab/ NAT traversal lab
+tools/installer/ Windows installer (Inno Setup)
+```
diff --git a/guide/building.zh-CN.md b/guide/building.zh-CN.md
new file mode 100644
index 0000000..f29495a
--- /dev/null
+++ b/guide/building.zh-CN.md
@@ -0,0 +1,48 @@
+# 从源码构建
+
+[English](building.md) · [回到 README](../README.zh-CN.md)
+
+Mac 版需要 Go 1.26、Flutter 3.44 和 Xcode:
+
+```bash
+./scripts/build.sh # 构建全部到 dist/
+./scripts/package.sh # 打出 DMG 与服务器发布包到 release/
+```
+
+Windows 版需要 Go、Flutter、Visual Studio(「使用 C++ 的桌面开发」)与 Inno Setup 6,在 Windows 上运行:
+
+```powershell
+powershell -ExecutionPolicy Bypass -File scripts\build-windows.ps1 # 安装程序与便携版到 dist\windows\
+```
+
+后台服务是纯 Go,也可以在 Mac 上交叉编译:`GOOS=windows go build ./cmd/copysyncd`。CI 在每次提交时构建 Windows 安装包。
+
+服务器也是纯 Go。`package.sh` 把它交叉编译成 Linux(amd64、arm64)、macOS 与 Windows 版本,各自带上 `server/deploy/` 里对应的安装脚本。
+
+开发时可以单独运行各部分:
+
+```bash
+cd client-core && go test ./... # 后台服务的测试
+./tools/natlab/docker.sh # NAT 打洞实验室:11 种网络拓扑下的直连与中转
+cd ui && flutter test # 界面的测试
+./scripts/install-macos.sh # 把 dist/ 里的后台服务装成登录项
+./dist/copysync-cli status # 查看后台服务状态
+./dist/copysync-cli watch # 实时事件流
+```
+
+改了 `.proto` 之后运行 `./scripts/gen-proto.sh` 重新生成代码(用 buf,`go install` 即可安装,无需 protoc)。改了界面之后运行 `./tools/screenshots/render.sh` 重新生成截图,截图用演示数据渲染,不会带出本机的真实内容。
+
+```
+client-core/ 后台服务(Go)
+ internal/clipboard 剪贴板(Mac:cgo + Objective-C;Windows:Win32;都必须跑在主线程)
+ internal/transport 信令(WebSocket)与 P2P(WebRTC)
+ internal/sync 同步引擎:分流、打包、传输、落盘
+ui/ 界面(Flutter)
+server/ 信令 + TURN 中转服务器(Go),部署文件在 server/deploy/
+proto/ 消息定义与设备 ID 派生规则,三方共用
+docs/ 项目主页(GitHub Pages)
+spikes/ 开工前的技术验证
+design/ 技术方案文档
+tools/natlab/ NAT 打洞实验室
+tools/installer/ Windows 安装程序(Inno Setup)
+```
diff --git a/guide/how-it-works.md b/guide/how-it-works.md
new file mode 100644
index 0000000..401f57d
--- /dev/null
+++ b/guide/how-it-works.md
@@ -0,0 +1,130 @@
+# How CopySync works
+
+[简体中文](how-it-works.zh-CN.md) · [Back to README](../README.md)
+
+Two computers connect directly and encrypt everything between them. Your server only helps them find each other, and relays encrypted packets when a direct connection can't be made.
+
+## Architecture
+
+```mermaid
+flowchart LR
+ subgraph A["Computer A (Mac or Windows)"]
+ UA["CopySync app"] <-- "gRPC" --> DA["Background service"]
+ end
+ subgraph B["Computer B (Mac or Windows)"]
+ DB["Background service"] <-- "gRPC" --> UB["CopySync app"]
+ end
+ S[("Your server\nsignaling + TURN")]
+ DA -- "Signaling (WebSocket)" --> S
+ DB -- "Signaling (WebSocket)" --> S
+ DA <== "WebRTC direct (DTLS)" ==> DB
+ DA <-. "Relayed via TURN when direct fails" .-> S
+ S <-.-> DB
+```
+
+| Component | Role | Built with |
+|---|---|---|
+| Background service `copysyncd` | Watches the clipboard, connects to peers, sends, receives and stores | Go. The clipboard uses cgo and AppKit on Mac, and calls Win32 directly on Windows (pure Go, no C compiler) |
+| App `CopySync` | History, pairing, settings | Flutter, one codebase for Mac and Windows; talks to the service over local gRPC |
+| Server `copysync-server` | Device discovery, pairing codes, signaling, TURN relay | Go, a single static binary using about 15 MB of RAM |
+| Protocol `proto/` | Messages shared by all three | Protocol Buffers |
+
+## What happens when you copy
+
+1. The service notices the clipboard changed: on Mac it checks the change count at short intervals (reading the count and types needs no permission and never triggers a prompt); on Windows the system notifies it right away.
+2. On a change it reads the content and picks a transport: text is inlined in the message; images and files under 50 MB are streamed right away (tar + zstd); anything larger is announced as a record only.
+3. The receiving computer writes the data to a local cache and then onto its clipboard, so `⌘V` or `Ctrl+V` pastes real local files. File names that are fine on Mac but not on Windows (with a colon, say) get the matching full-width character on Windows.
+
+## How the connection is made
+
+1. Devices connect to the signaling server over WebSocket and receive STUN and TURN addresses.
+2. All connections share one local UDP port. The background service probes several servers from that port to learn its public address, one per uplink on networks with several (see the next section).
+3. During the handshake each side sends its LAN addresses, its public address on every uplink, and its TURN relay address; both sides try each other with WebRTC ICE at the same time. One side holds back its uplink addresses until it has received the other's and sent packets to them, because some routers lock a port when the other side's packet arrives first (see the next section).
+4. A direct path wins if it works; relay paths must wait 5 seconds before they can be selected.
+5. Once connected, each side tells the other whether it is relayed, and both show "relay" if either is.
+6. If the connection still lands on the relay, the side that started it runs an ICE restart while idle to punch again, and moves to the direct path if that works (first after 10 seconds, then at intervals growing to 15 minutes).
+
+Data flows over WebRTC data channels, encrypted with DTLS.
+
+## Hole punching on networks with several uplinks
+
+Office networks with two ISPs, or carriers with a pool of NAT addresses, have several uplinks and choose one per destination IP. One office network we measured had four:
+
+| Uplink | Probe servers that landed on it | Public port |
+|---|---|---|
+| Uplink A | Our own server, Twilio | Unchanged |
+| Uplink B | Bilibili, Google, Nextcloud | Unchanged |
+| Uplink C | Cloudflare, FreeSWITCH | Rewritten, same for every destination |
+| Uplink D | A service on Alibaba Cloud | Rewritten |
+
+Asking one server reveals only one of these addresses. Packets to the peer may leave through another uplink, the peer sees an address it was never told about, and its router drops them. That is why CopySync 1.0 could only relay on such networks.
+
+What 1.1 does:
+
+- **One shared port.** pion used to open a new port for each STUN server, so each answer only applied to its own port. All connections now share one port, and every probe result applies to it.
+- **Probe every uplink.** CopySync queries IP-diverse servers from that port in parallel (your own server plus public STUN servers such as Bilibili and Cloudflare), deduplicates by IP and drops addresses poisoned by DNS.
+- **Tell the peer all of them.** Each uplink's address goes to the peer as a candidate; the peer checks each one, and the one matching the real uplink gets through. Uplinks that rewrite ports report their real mapping.
+- **Remember uplinks.** If a round misses an uplink that preserves ports, its address is filled in as uplink IP plus local port.
+
+A Mac behind that 4-uplink office network now connects directly to a home connection, about 3 seconds after reaching the server. The full design, measurements and validation are in [NAT traversal on multi-uplink networks](../design/nat-traversal.md) (Chinese).
+
+The **NAT lab** (`tools/natlab`) builds real topologies with Linux network namespaces and iptables and runs CopySync's actual connection code through eleven scenarios on every commit:
+
+| Scenario | Result |
+|---|---|
+| Single uplink ↔ home router | Direct |
+| Two uplinks, previous version (control) | Relay |
+| Two uplinks ↔ home router | Direct |
+| Four uplinks ↔ home router | Direct |
+| Two uplinks, second one not probed: no history / with history | Relay / Direct |
+| Two uplinks ↔ two uplinks | Direct |
+| Two uplinks ↔ NAT that randomizes ports | Relay |
+| Blocked at first, network recovers later | Relay first, then direct |
+| Office router locks a port for unsolicited packets | Direct |
+| Home router locks a port for unsolicited packets | Relay, then direct after the first retry |
+
+## Security model
+
+- **The server keeps no accounts.** A device's identity is an Ed25519 key, and its ID is derived from the public key, so the server can verify that an ID belongs to a key without a user table.
+- **Fingerprints are compared by a person when pairing.** Both Macs show the same two lines: the fingerprint of each side's public key (the first 60 bits of its SHA-256, like `R8NF-2WTC-QL5J`), in a fixed order. The server could swap keys in transit, but then the two screens would no longer match — this step is what stops a man in the middle. The fingerprints are shown separately rather than combined into one short code: an attacker controlling both forged keys could find a matching combined code with a birthday attack, while separate fingerprints need a preimage attack per key, roughly a billion times harder.
+- **Every signaling message after that is signed**, so the server cannot forge a device. The DTLS certificate fingerprint of the direct channel is also sent signed and checked against the actual certificate after the handshake; a mismatch drops the connection.
+- **The relay can't read anything either.** TURN only forwards encrypted UDP packets. Relay credentials are issued per device and expire after 12 hours.
+- **Public STUN servers see only your public IP.** To find every uplink on multi-uplink networks, CopySync probes a few public STUN servers by default. They see your public IP, as with any WebRTC app, never content. Turn off **Probe with public servers** in Settings to use only your own server.
+- **Device key.** On Mac it's stored readable only by you; on Windows it's additionally encrypted with DPAPI, so another user or another computer can't decrypt a copied file.
+- **No App Sandbox**, because CopySync needs to read files at whatever path you copy them from.
+
+## Fallbacks
+
+| Situation | What happens |
+|---|---|
+| No direct path (symmetric NAT, corporate firewall) | Switches to the TURN relay on your server, still encrypted; the app shows "relay" |
+| Public STUN servers unreliable (common in mainland China) | The server runs its own STUN and clients prefer it |
+| Multi-uplink networks that pick an uplink per destination (common in offices) | All connections share one local port; CopySync probes several servers from it to learn its address on every uplink and sends them all to the peer, filling gaps from history. See `copysync-cli nat` |
+| Landed on the relay although a direct path works (the peer just started, its addresses arrived a moment late) | While idle, the side that started the connection runs an ICE restart to punch again and switches to direct if it works; never during a transfer. The connection stays up and only pauses for a few seconds |
+| The other Mac sleeps, loses its network or restarts, and the connection dies silently | The dead connection is closed and reconnected right away; if the other side rebuilt its connection, this side follows |
+| The other Mac can't be reached when you copy | The latest 20 items are kept and sent once the connection is back. They only go into the history and never overwrite what's on the other Mac's clipboard now |
+| Signaling connection drops | Reconnects with exponential backoff (1 s up to 30 s, with jitter); status is shown live |
+| Pairing confirmed on one side before the other | Early handshake messages are held and replayed once the other side confirms; the direct link is up within tens of milliseconds |
+| Large files | Above the limit only a record is synced; if the source file is gone when you pull, you get a clear message |
+| Apps that only accept plain text | Rich text is written as both HTML and plain text, so no markup leaks into the paste |
+| Clipboard access not granted yet | Content isn't read (it would block on a prompt a background process can't show); the app asks you to grant access |
+| Background service crashes | launchd restarts it, throttled to once every 10 seconds |
+| App updated in place, or moved | On launch the app re-points the login item and restarts the service on the new version |
+| History and cache grow | Expired items are removed automatically; 3 days by default |
+
+## Lessons learned
+
+Each of these was found by testing and has a regression test. The full investigation is in [spikes/results.md](../spikes/results.md) (Chinese).
+
+- **macOS clipboard calls must run on the main thread.** With the privacy features on, the clipboard API talks to a system UI service through the run loop; calling it from a plain thread crashes. The service locks the main thread at startup and dedicates it to the clipboard.
+- **"Transfer only when the other side pastes" isn't possible on macOS.** The system resolves promised clipboard data about 0.1 s after it's written and caches it, and there is no notification that the clipboard was read. That's why small items are pushed ahead of time and large files are pulled on demand.
+- **Three pitfalls in the pion WebRTC library:** `DetachDataChannels()` is a global switch that breaks regular send/receive on every channel; `OnMessage` doesn't buffer, so messages arriving before the handler is set are dropped (202 bytes sent, 0 received); `OnBufferedAmountLow` is edge-triggered, so a waiter that arrives late never wakes up (a 20 MB transfer stalled at 786 KB).
+- **pion opens a separate port per STUN server**, so the answers don't apply to each other. Adding STUN servers can't fix multi-uplink networks; all connections now share one port and CopySync probes it itself.
+- **One side can't tell on its own whether a connection is relayed.** When one side sends through TURN, the other may just see an ordinary address; once one Mac showed "direct" and the other "relay". Both sides now tell each other after connecting.
+- **pion never switches paths once it has picked one.** The relay handshake is fast, and if it wins that race the whole connection stays relayed. We saw exactly that after the peer restarted: its addresses arrived after the relay wait had expired. The relay wait is now 5 seconds, probe hostnames resolve in parallel (a probe round went from about 1.6 s to under 0.2 s), and relayed connections retry the direct path with an ICE restart.
+- **Who sends first matters.** Some routers (the office one we measured) keep a connection entry for a packet that arrives before you've sent anything to its source, locking the port; your own packets then leave from a different port and punching fails. That's why restarting the office Mac always connected directly while restarting the home Mac fell back to the relay: a freshly started Mac probes its uplinks first, so its addresses went out late and it ended up sending first. A rule now decides who sends first, and retries alternate the order.
+- **A dead connection has to be cleaned up by hand.** When pion reports "failed" it doesn't close the connection; the control channel still looks open and whatever is written to it is lost, and the layer above thinks it's connected and never reconnects. In 1.1.0 this sent six files into a dead connection after the other Mac dropped off, and none arrived.
+- **Public STUN domains can be poisoned by DNS**, resolving to `192.0.2.42` in our tests. Reserved ranges and proxy fake-IP ranges are filtered before probing.
+- **Simulated routers need a firewall.** When both sides punch at once, a packet let through to the router itself leaves a Linux conntrack entry, the outgoing flow then gets a new port, and punching fails. Real routers drop such packets, and the lab does too.
+
+Measured on a LAN with a direct connection: a 20 MB file transfers in about 330 ms with matching checksums.
diff --git a/guide/how-it-works.zh-CN.md b/guide/how-it-works.zh-CN.md
new file mode 100644
index 0000000..81b8768
--- /dev/null
+++ b/guide/how-it-works.zh-CN.md
@@ -0,0 +1,130 @@
+# CopySync 的工作原理
+
+[English](how-it-works.md) · [回到 README](../README.zh-CN.md)
+
+两台电脑之间直接建立加密连接。你的服务器只负责让它们找到彼此,打不通直连的时候再帮忙转发加密后的数据包。
+
+## 架构
+
+```mermaid
+flowchart LR
+ subgraph A["电脑 A(Mac 或 Windows)"]
+ UA["CopySync 界面"] <-- "gRPC" --> DA["后台服务"]
+ end
+ subgraph B["电脑 B(Mac 或 Windows)"]
+ DB["后台服务"] <-- "gRPC" --> UB["CopySync 界面"]
+ end
+ S[("你的服务器\n信令 + TURN")]
+ DA -- "信令(WebSocket)" --> S
+ DB -- "信令(WebSocket)" --> S
+ DA <== "WebRTC 直连(DTLS 加密)" ==> DB
+ DA <-. "打不通时经 TURN 中转" .-> S
+ S <-.-> DB
+```
+
+| 组件 | 做什么 | 技术 |
+|---|---|---|
+| 后台服务 `copysyncd` | 监听剪贴板、与对端建立连接、收发与落盘 | Go。剪贴板部分在 Mac 上用 cgo 调用 AppKit,在 Windows 上直接调用 Win32(纯 Go,不需要 C 编译器) |
+| 界面 `CopySync` | 复制记录、设备配对、设置 | Flutter,经本机 gRPC 与后台服务通信;Mac 与 Windows 共用一套代码 |
+| 服务器 `copysync-server` | 设备发现、转达配对码、转发信令、TURN 中转 | Go,单个静态二进制,约 15 MB 内存 |
+| 协议 `proto/` | 三方共用的消息定义 | Protocol Buffers |
+
+## 一次复制的经过
+
+1. 后台服务发现剪贴板变了:Mac 上每隔一小段时间检查剪贴板的变更计数(只看计数和类型不需要授权,也不会触发系统提示);Windows 上由系统即时通知。
+2. 发现变化后读取内容,按类型和大小决定怎么传:文本直接内联在消息里;50 MB 以内的图片与文件打包成流(tar + zstd)立即推送;更大的只发一条记录。
+3. 对端收到后先写入本地缓存,再写入剪贴板。在那台电脑上 `⌘V` 或 `Ctrl+V` 粘贴出来的,就是本地的真实文件。Mac 上合法、Windows 上不合法的文件名(比如带冒号的)在 Windows 上换成对应的全角字符。
+
+## 连接是怎么建立的
+
+1. 设备通过 WebSocket 连上信令服务器,拿到 STUN 与 TURN 的地址。
+2. 所有连接共用一个本地 UDP 端口。后台服务在这个端口上向多台服务器探测本机的公网地址,网络有几个出口就能拿到几个地址(见下一节)。
+3. 握手时把局域网地址、每个出口的公网地址、TURN 中转地址都发给对端,两边用 WebRTC 的 ICE 同时互相尝试。其中一方先不公布出口地址,等收到对方的、先往那边发过包再公布:有的路由器会被对方先到的包占住端口(见下一节)。
+4. 直连打通就走直连;中转路径至少等 5 秒才允许被选中,给直连留出时间。
+5. 连上后两端互相告知自己是否经过中转,任一端经中转,两边都显示「中转」。
+6. 若还是先落到了中转,发起连接的一方会在空闲时用 ICE 重启再打一次洞,打通就换成直连(10 秒后第一次,之后间隔逐步拉长到 15 分钟)。
+
+数据走 WebRTC 数据通道,DTLS 加密。
+
+## 多出口网络的打洞
+
+公司双线、运营商 NAT 地址池这类网络有多个出口,按目标 IP 选择走哪一个。实测一个公司网络有 4 个出口:
+
+| 出口 | 落在这个出口上的探测服务器 | 公网端口 |
+|---|---|---|
+| 出口 A | 自己的服务器、Twilio | 不变 |
+| 出口 B | B 站、Google、Nextcloud | 不变 |
+| 出口 C | Cloudflare、FreeSWITCH | 改写,但对不同目标相同 |
+| 出口 D | 阿里云上的服务 | 改写 |
+
+只问一台服务器,就只知道其中一个出口的地址;发往对端的包按目标 IP 很可能从另一个出口出去,对端收到的源地址对不上,被它的路由器丢弃。CopySync 1.0 就是这样只能走中转。
+
+1.1 的做法:
+
+- **共用一个端口**:之前 pion 每问一台 STUN 服务器就开一个新端口,问到的地址只对那个端口成立。现在所有连接共用一个端口,探测结果对它全部成立。
+- **探测每个出口**:在这个端口上并发探测 IP 分散的服务器(自己的服务器,加上 B 站、Cloudflare 等公共 STUN),按 IP 去重,过滤被 DNS 污染的地址。
+- **全部告诉对端**:每个出口的地址都作为候选地址发给对端,对端逐个检查,与实际出口吻合的那个能打通。会改写端口的出口拿到的是真实映射。
+- **记住见过的出口**:某一轮漏掉的出口,若它不改端口,就按「出口 IP + 本地端口」推算补上。
+
+实测公司 4 个出口与家用宽带之间直连,连上服务器后约 3 秒建立。设计细节、测量过程与验证见 [多出口网络的 NAT 打洞](../design/nat-traversal.md)。
+
+**NAT 打洞实验室**(`tools/natlab`)用 Linux 网络命名空间与 iptables 搭出真实拓扑,用 CopySync 真实的连接代码验证 11 种场景,每次提交都在 CI 里运行:
+
+| 场景 | 结果 |
+|---|---|
+| 单出口 ↔ 家用路由器 | 直连 |
+| 两个出口,旧版本(对照) | 中转 |
+| 两个出口 ↔ 家用路由器 | 直连 |
+| 四个出口 ↔ 家用路由器 | 直连 |
+| 两个出口,第二条没探测到:无历史 / 有历史 | 中转 / 直连 |
+| 两个出口 ↔ 两个出口 | 直连 |
+| 两个出口 ↔ 端口随机分配的 NAT | 中转 |
+| 一开始打不通,之后网络恢复 | 先中转,随后换成直连 |
+| 公司路由器会为外来的包占住端口 | 直连 |
+| 家用路由器会为外来的包占住端口 | 先中转,第一次重试后直连 |
+
+## 安全模型
+
+- **服务器不存账号**。设备身份是一把 Ed25519 密钥,设备 ID 由公钥派生,服务器据此就能验证"这个 ID 确实属于这把公钥",无需用户表。
+- **配对时人工核对指纹**。两台设备显示同样的两行:双方各自公钥的指纹(SHA-256 的前 60 位,形如 `R8NF-2WTC-QL5J`),按固定顺序排列。服务器可以在配对时替换转发中的公钥,但替换后两块屏幕上的内容就对不上了,这一步就是防中间人的闸门。两个指纹分开显示而不是合成一串短码,是因为攻击者同时控制两把伪造公钥时,凑出一串相同的短码只需生日攻击;分开显示则要为每把公钥各做一次原像攻击,难度高出约十亿倍。
+- **之后的每条信令都带签名**,服务器无法伪造设备。直连通道的 DTLS 证书指纹也经签名传递,握手后比对实际证书,不一致立即断开。
+- **中转也看不到内容**。TURN 只转发加密后的 UDP 包。中转凭证按设备单独签发,12 小时过期。
+- **公共 STUN 服务器只看到公网 IP**。为了在多出口网络里找到每个出口,默认会向几台公共 STUN 服务器探测,它们能看到你的公网 IP(与任何 WebRTC 应用一样),看不到内容。介意的话在设置里关掉「用公共服务器探测网络出口」,只用自己的服务器。
+- **设备私钥**:Mac 上以仅本人可读的权限存放;Windows 上另用系统的 DPAPI 加密,换个用户、或把文件拷到别的电脑上都解不开。
+- **不启用 App 沙盒**:需要访问你复制的任意路径下的文件。
+
+## 兜底:出问题时会发生什么
+
+| 情况 | 处理方式 |
+|---|---|
+| 两端打不通直连(对称 NAT、公司防火墙) | 自动改走服务器的 TURN 中转,内容依然加密;界面上显示「中转」 |
+| 公共 STUN 在国内时通时断 | 服务器自带 STUN,客户端优先用它 |
+| 公司双线等多出口网络(按目标地址选出口) | 所有连接共用一个本地端口,在这个端口上向多台服务器探测每个出口的地址,全部发给对端由它逐个尝试;探测漏掉的出口按历史推算。`copysync-cli nat` 可以看到探测结果 |
+| 先落到了中转,其实打得通(对端刚启动、出口地址晚到一步) | 发起方在空闲时用 ICE 重启再打一次洞,打通就换成直连;有传输在进行时不重启。重启期间连接不断,只停顿几秒 |
+| 对方睡眠、断网、重启,连接悄悄断了 | 发现连接失效立即关闭、重连;对方重建了连接,本端也随之换新 |
+| 复制时对方连不上 | 记下最近 20 条,连接恢复后补发。补发的只进复制记录,不写进对方的剪贴板,免得覆盖对方此刻正在用的内容 |
+| 信令服务器断开 | 指数退避自动重连(1 秒起,最长 30 秒,带随机抖动),界面实时显示连接状态 |
+| 配对时两端确认有先后 | 先确认一方发来的握手消息会被暂存,另一方确认后重放,配对完成几十毫秒内即可直连 |
+| 大文件 | 超过阈值只同步记录,按需拉取;拉取时源文件已被删除会明确提示,而不是失败得不明不白 |
+| 只认纯文本的输入框 | 带格式的文本同时写入 HTML 与纯文本两份,粘贴到哪里都不会出现标签 |
+| 还没有授权读取剪贴板 | 不去读内容(否则会卡在一个后台进程看不见的系统弹窗上),界面上提示去授权 |
+| 后台服务崩溃 | 由 launchd 自动拉起;10 秒节流,不会疯狂重启 |
+| 覆盖安装了新版、或 App 换了位置 | 打开 App 时自动校正登录项,并重启到新版本 |
+| 记录和缓存越来越多 | 到期自动清理,默认保留 3 天 |
+
+## 踩过的坑
+
+这些都是实测撞出来的,各自对应一个回归测试。完整的验证过程见 [spikes/results.md](../spikes/results.md)。
+
+- **macOS 的剪贴板调用必须在主线程。**开启隐私机制后,剪贴板 API 要经系统 UI 服务通信,依赖 run loop,在普通线程上调用会直接崩溃。后台服务启动时就把主线程锁住,专门留给剪贴板,业务逻辑投递过去执行。
+- **"对方按下粘贴键才传输"在 macOS 上做不到。**系统在写入剪贴板后约 0.1 秒就会把延迟提供的数据兑现并缓存,真正按下 `⌘V` 时不再回调,也没有"剪贴板被读取"的通知。所以小文件是预先推送的,大文件改为手动拉取。
+- **WebRTC 库(pion)的三个坑**:`DetachDataChannels()` 是全局开关,开了以后所有通道的普通收发都失效;`OnMessage` 不缓冲,回调设置之前到达的消息直接丢弃(实测发 202 字节,收到 0 字节);`OnBufferedAmountLow` 是边沿触发,等待方晚一步进入等待就再也等不到唤醒(20 MB 传到 786 KB 卡死)。
+- **pion 为每台 STUN 服务器单独开端口**,问到的地址互相用不上。多出口网络里多配几台 STUN 也打不通,所以改为所有连接共用一个端口、由自己探测。
+- **单靠一端判断不了是否中转。**一端经 TURN 发送时,另一端看到的可能只是个普通地址,曾出现一台显示直连、一台显示中转。现在连接就绪后两端互相告知。
+- **pion 选定线路后就不再更换。**中转握手快,一旦赢了这场赛跑,整个连接期间都走中转。实测对端重启后的第一次握手,出口地址比中转的等待时限晚到,就这样一直中转。现在中转等待放宽到 5 秒、探测时并发解析域名(整轮从约 1.6 秒降到 0.2 秒以内),并在中转时用 ICE 重启再试直连。
+- **谁先发包很重要。**有的路由器(实测公司那台)收到对方先到的包,会留下一条连接记录、占住端口,本端随后往外发只好换端口,打洞就失败了。这解释了为什么本机重启时总能直连、家里那台一重启就中转:本机重启时出口要现探测,地址晚发出,本机反而先发包。现在由规则决定谁先发包,换直连的重试里两种顺序轮流用。
+- **连接失效后要自己清理。**pion 报告「失败」后不会关闭连接,控制通道看上去还是打开的,写进去的消息石沉大海;上层以为连接还在,也不会重连。1.1.0 曾因此在对方断线后,把 6 个文件「发」进了一条死连接,对方一个也没收到。
+- **公共 STUN 域名可能被 DNS 污染**,实测被解析到 `192.0.2.42`。这类保留地址和代理软件的 fake-ip 网段在探测前就过滤掉。
+- **测试用的模拟路由器要有防火墙。**两端同时打洞时,对方的包若被放行到路由器本机,Linux 会为它留下一条连接记录,本端随后往外发时只好换端口,打洞就失败了。真实路由器直接丢弃这类包,实验室也照此配置。
+
+局域网直连实测:20 MB 文件约 330 毫秒传完,校验和一致。
diff --git a/guide/troubleshooting.md b/guide/troubleshooting.md
new file mode 100644
index 0000000..67572ca
--- /dev/null
+++ b/guide/troubleshooting.md
@@ -0,0 +1,32 @@
+# Troubleshooting
+
+[简体中文](troubleshooting.zh-CN.md) · [Back to README](../README.md)
+
+**Settings → Connection stays at Not connected**
+Check that the address starts with `ws://`, uses port 8787 and ends in `/signal`, then open `http://<server address>:8787/healthz` in a browser on that computer. If it doesn't load, the network path is broken: the server isn't running, its computer is asleep, a firewall blocks it, or its address changed. The Windows and Linux install scripts print the firewall commands you need; see [Server deployment](../server/deploy/README.md) and the [LAN guide](https://baiyuze.github.io/copysync/en/server/).
+
+**A cloud server in mainland China works by IP but not by domain**
+Providers in mainland China intercept plain HTTP requests for domains without an ICP filing, on any port, and answer with a redirect to a block page. The WebSocket handshake is a plain HTTP request, so it's intercepted too. Enter the IP, as in `ws://<server IP>:8787/signal`, or file the domain.
+
+**`.uuremote_…` file records keep appearing while UU Remote is running**
+Upgrade both clients to 1.3.2 or later. UU Remote puts temporary placeholder files on the system clipboard; older CopySync clients recorded and forwarded them as ordinary files. The new version filters the confirmed `.uuremote_aeawv` followed by digits before scanning, recording or sending, keeps ordinary files in mixed selections, ignores placeholder-only incoming offers, and removes placeholder-only history on startup without deleting UU's source files. Ordinary empty, hidden and large files are unaffected. The 50 MB threshold controls automatic transfer; there is no need to disable UU's UDP P2P. Other clipboard sync tools can still duplicate ordinary content; use one clipboard sync provider if needed. See the [investigation and validation notes](../design/uu-remote-clipboard.md).
+
+**Nothing comes off the clipboard, and `pbpaste` is empty too**
+The system pasteboard service may be stuck: an app declared clipboard content and then crashed, leaving types without data. Run `killall pboard` and copy again.
+
+**A device stays offline**
+Check **Settings → Connection** on both computers. If it isn't connected, verify the server address and that port 8787 is reachable.
+
+**Always "relay", never "direct"**
+Showing "relay" right after connecting and "direct" a little later is normal: the relay makes things work first, and the direct path takes over when the link is idle. If it stays "relay", NAT traversal didn't succeed, which is common with NATs that randomize ports or strict firewalls. Everything still works; speed is limited by the server's bandwidth. Run `copysync-cli nat` to see how many uplinks were found; zero means UDP is blocked.
+
+**Logs**
+The background service logs to `~/Library/Logs/CopySync/daemon.log` on Mac and `%LOCALAPPDATA%\CopySync\logs\daemon.log` on Windows. Server logs: `journalctl -u copysync-server -f` on Linux, `~/Library/Logs/CopySync/server.log` on Mac, `C:\ProgramData\CopySync Server\server.log` on Windows.
+
+## Limitations
+
+- **Not notarized by Apple, and the Windows build isn't code-signed**, so the first launch needs one manual approval.
+- **No "virtual files" on Windows.** Files copied straight out of an Outlook attachment or a zip have no real path on the clipboard and aren't synced. Save or extract them first.
+- **The Mac app doesn't skip password-manager content yet**; the Windows app does.
+- **Items aren't resent after a long absence.** The server stores nothing. While the other Mac is unreachable, this Mac keeps the latest 20 items (from the last 24 hours) in memory, and they're lost if its background service restarts.
+- **Relayed transfers are limited by your server's bandwidth.** Direct connections aren't.
diff --git a/guide/troubleshooting.zh-CN.md b/guide/troubleshooting.zh-CN.md
new file mode 100644
index 0000000..3c5497a
--- /dev/null
+++ b/guide/troubleshooting.zh-CN.md
@@ -0,0 +1,32 @@
+# 排障
+
+[English](troubleshooting.md) · [回到 README](../README.zh-CN.md)
+
+**「设置 → 连接状态」一直是「未连接」**
+先核对地址:以 `ws://` 开头、端口 8787、以 `/signal` 结尾;再在这台电脑的浏览器里打开 `http://<服务器地址>:8787/healthz`。打不开说明到服务器的网络不通:服务器没在运行、那台电脑睡眠了、被防火墙拦住了,或者它的地址变了。Windows 与 Linux 的安装脚本会给出需要的防火墙命令,见[服务器部署说明](../server/deploy/README.md)与[局域网部署教程](https://baiyuze.github.io/copysync/server/)。
+
+**国内云服务器:填域名连不上,填 IP 能连**
+域名没有备案时,国内云厂商会拦截访问它的明文 HTTP 请求,任何端口都一样,返回一个跳转到拦截页的响应。WebSocket 握手就是明文 HTTP 请求,所以同样被拦。地址里直接填 IP(`ws://<服务器IP>:8787/signal`),或者给域名备案。
+
+**UU 远程开启时不断新增 `.uuremote_…` 文件记录**
+升级两端客户端到 1.3.2 或更新的版本。UU 远程会把临时占位文件写入系统剪贴板,旧版 CopySync 会把它们当成普通文件再次转发。新版在扫描、入库和发送之前过滤已确认的 `.uuremote_aeawv` 加数字命名;混合选择保留正常文件,接收端忽略纯占位记录,启动时清理历史里的纯占位记录(不删除 UU 的源文件)。普通空文件、隐藏文件和大文件不受这条规则影响。50 MB 是自动传输阈值,不是故障原因;无需关闭 UU 的 UDP P2P。其他剪贴板同步工具仍可能造成普通内容重复,可只保留一个工具负责剪贴板同步。技术与验证记录见 [UU 远程兼容修复](../design/uu-remote-clipboard.md)。
+
+**剪贴板读不到内容,`pbpaste` 也是空的**
+系统的剪贴板服务可能卡住了:某个程序声明了剪贴板内容后异常退出,会留下一个"有类型声明、没有数据"的空壳。执行 `killall pboard`,再复制一次即可。
+
+**设备一直显示「离线」**
+检查两台电脑的 **设置 → 连接状态** 是否都是「已连接」。不是的话,确认服务器地址正确、8787 端口可以访问。
+
+**一直显示「中转」而不是「直连」**
+刚连上时显示中转、过一会儿变成直连是正常的:先用中转保证能用,空闲时再换直连。一直是中转,说明 NAT 打洞没成功,常见于端口随机分配的 NAT 或严格的防火墙。功能不受影响,只是速度受服务器带宽限制。运行 `copysync-cli nat` 看本机探测到了几个出口:出口为 0 说明 UDP 被拦截了。
+
+**查看日志**
+后台服务的日志:Mac 上在 `~/Library/Logs/CopySync/daemon.log`,Windows 上在 `%LOCALAPPDATA%\CopySync\logs\daemon.log`。服务器的日志:Linux 上用 `journalctl -u copysync-server -f` 查看,Mac 上在 `~/Library/Logs/CopySync/server.log`,Windows 上在 `C:\ProgramData\CopySync Server\server.log`。
+
+## 已知限制
+
+- **没有经过 Apple 公证,Windows 版也没有代码签名**,第一次打开时需要手动放行一次。
+- **Windows 上不支持「虚拟文件」**:从 Outlook 附件、压缩包里直接复制的文件,剪贴板里没有真实路径,不会同步。先保存或解压出来再复制即可。
+- **Mac 版还不会跳过密码管理器复制的内容**,Windows 版已经会。
+- **对方离线太久的内容不会补发**。服务器不存数据;对方暂时连不上时,本机只在内存里记下最近 20 条(24 小时内的),本机的后台服务重启后就清空了。
+- **中转模式的速度取决于服务器带宽**。直连时不受影响。
diff --git a/scripts/build.sh b/scripts/build.sh
index 2acafb7..8d10d99 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -14,7 +14,7 @@ set -euo pipefail
cd "$(dirname "$0")/.."
DIST=dist
-VERSION=${VERSION:-1.3.2}
+VERSION=${VERSION:-1.3.3}
rm -rf "$DIST" && mkdir -p "$DIST"
# 构建 x86_64 + arm64 通用二进制:两台 Mac 的芯片未必相同,单架构的
diff --git a/tools/site/build.py b/tools/site/build.py
index 46343ec..fedd9a5 100644
--- a/tools/site/build.py
+++ b/tools/site/build.py
@@ -18,8 +18,8 @@ DOCS = ROOT / "docs"
SITE = "https://baiyuze.github.io/copysync/"
REPO = "https://github.com/baiyuze/copysync"
DL = REPO + "/releases/latest/download/"
-VERSION = "1.3.2"
-DATE = "2026-10-10"
+VERSION = "1.3.3"
+DATE = "2026-10-11"
# 语言代码 → (页面目录, html 的 lang, og:locale, 语言名)
LANGS = {
@@ -28,6 +28,9 @@ LANGS = {
"ja": ("ja/", "ja", "ja_JP", "日本語"),
}
+# 「在局域网里部署服务器」教程,每种语言目录下一份
+GUIDE = "server/"
+
# 放到网站上的技术方案:文件名 → 网页名。其他 design/*.md 链接到 GitHub
DESIGN_DOCS = {"nat-traversal.md": "nat-traversal", "windows-client.md": "windows-client"}
@@ -89,21 +92,21 @@ def load(code: str) -> dict:
# ─────────────────────────── 首页 ───────────────────────────
-def lang_links(code: str, up: str) -> str:
- """除当前语言外的其他语言链接。up 是当前页面到网站根目录的相对路径。"""
+def lang_links(code: str, up: str, sub: str = "") -> str:
+ """除当前语言外的其他语言链接。up 是当前页面到网站根目录的相对路径,sub 是子页面(如 server/)。"""
out = []
for other, (path, hl, _, name) in LANGS.items():
if other == code:
continue
- out.append(f'<a href="{up}{path or "./"}" hreflang="{hl}" lang="{hl}" data-lang="{other}">{name}</a>')
+ out.append(f'<a href="{up}{path + sub or "./"}" hreflang="{hl}" lang="{hl}" data-lang="{other}">{name}</a>')
return "\n ".join(out)
-def footer(c: dict, code: str, up: str) -> str:
+def footer(c: dict, code: str, up: str, sub: str = "") -> str:
langs = []
for other, (path, hl, _, name) in LANGS.items():
cur = ' aria-current="page"' if other == code else ""
- langs.append(f'<a href="{up}{path or "./"}" hreflang="{hl}" lang="{hl}" data-lang="{other}"{cur}>{name}</a>')
+ langs.append(f'<a href="{up}{path + sub or "./"}" hreflang="{hl}" lang="{hl}" data-lang="{other}"{cur}>{name}</a>')
links = "".join(f'\n <a href="{href}">{label}</a>' for label, href in c["footer_links"])
return f""" <footer class="footer">
<div class="wrap">
@@ -236,7 +239,8 @@ def home(code: str) -> str:
<a class="wide" href="#how">{c["nav_how"]}</a>
<a class="wide" href="#install">{c["nav_install"]}</a>
<a class="wide" href="#faq">{c["nav_faq"]}</a>
- <a href="{REPO}">GitHub</a>
+ <a href="{GUIDE}">{c["nav_server"]}</a>
+ <a class="wide" href="{REPO}">GitHub</a>
{lang_links(code, up)}
</nav>
</div>
@@ -441,6 +445,7 @@ sudo ./install.sh {c["public_ip"]}</code></pre>
</tbody>
</table>
<p class="small">{c["server_docker"]}</p>
+ <a class="button quiet" href="{GUIDE}">{c["server_guide"]}</a>
</div>
</div>
<p class="pairing">{c["pairing"]}</p>
@@ -485,6 +490,434 @@ sudo ./install.sh {c["public_ip"]}</code></pre>
"""
+# ─────────────────────────── 在局域网里部署服务器 ───────────────────────────
+
+# 教程里的示例地址。页面上的终端输出照安装脚本的真实输出抄写,只把地址换成它
+LAN_IP = "192.168.1.20"
+
+# 安装脚本在中文系统上输出中文,其他系统输出英文;日文页面也是英文输出。
+# 改了 server/deploy/ 下脚本的输出,这里跟着改。
+TRANSCRIPTS = {
+ "zh": {
+ "win": f"""> 停止旧版本
+> 安装到 C:\\Program Files\\CopySync Server
+> 注册服务 CopySyncServer(中转地址 {LAN_IP})
+> 在 Windows 防火墙里放行
+> 启动
+ √ 已启动
+
+安装完成:copysync-server {VERSION},作为 Windows 服务开机自动运行
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ ws://{LAN_IP}:8787/signal
+
+ 程序 C:\\Program Files\\CopySync Server
+ 日志 C:\\ProgramData\\CopySync Server\\server.log
+ 重启 Restart-Service CopySyncServer(管理员 PowerShell)
+ 卸载 双击 uninstall.cmd""",
+ "mac": f"""▶ 停止旧版本
+▶ 安装到 /Users/me/Library/Application Support/CopySync Server
+▶ 写入 LaunchAgent(中转地址 {LAN_IP})
+▶ 启动
+ ✓ 已启动
+
+安装完成:copysync-server {VERSION},登录这台 Mac 后自动运行
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ ws://{LAN_IP}:8787/signal
+
+ 日志 /Users/me/Library/Logs/CopySync/server.log
+ 重启 launchctl kickstart -k gui/501/com.copysync.server
+ 卸载 ./install.sh uninstall""",
+ "linux": f"""▶ 安装二进制到 /usr/local/bin
+▶ 写入 systemd 单元
+▶ 生成配置 /etc/copysync/server.env(中转地址 {LAN_IP})
+▶ 启动
+ ✓ 已启动
+
+安装完成:copysync-server {VERSION}
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ ws://{LAN_IP}:8787/signal
+
+ 配置 /etc/copysync/server.env
+ 日志 journalctl -u copysync-server -f
+ 重启 systemctl restart copysync-server
+ 卸载 sudo ./install.sh uninstall
+
+防火墙需放行:TCP 8787(信令)、UDP 3478(STUN 与 TURN)、UDP 32768-60999(中转端口,系统随机分配)""",
+ },
+ "en": {
+ "win": f"""> Stopping the running version
+> Installing to C:\\Program Files\\CopySync Server
+> Registering the service CopySyncServer (relay address {LAN_IP})
+> Allowing it through Windows Firewall
+> Starting
+ √ Running
+
+Installed: copysync-server {VERSION}. It runs as a Windows service and starts with Windows.
+In CopySync on each computer, set Settings > Signaling server to:
+
+ ws://{LAN_IP}:8787/signal
+
+ Program C:\\Program Files\\CopySync Server
+ Logs C:\\ProgramData\\CopySync Server\\server.log
+ Restart Restart-Service CopySyncServer (in an administrator PowerShell)
+ Uninstall double-click uninstall.cmd""",
+ "mac": f"""▶ Stopping the running version
+▶ Installing to /Users/me/Library/Application Support/CopySync Server
+▶ Writing the LaunchAgent (relay address {LAN_IP})
+▶ Starting
+ ✓ Running
+
+Installed: copysync-server {VERSION}. It starts whenever you log in to this Mac.
+In CopySync on each computer, set Settings → Signaling server to:
+
+ ws://{LAN_IP}:8787/signal
+
+ Logs /Users/me/Library/Logs/CopySync/server.log
+ Restart launchctl kickstart -k gui/501/com.copysync.server
+ Uninstall ./install.sh uninstall""",
+ "linux": f"""▶ Installing the binary to /usr/local/bin
+▶ Writing the systemd unit
+▶ Writing /etc/copysync/server.env (relay address {LAN_IP})
+▶ Starting
+ ✓ Running
+
+Installed: copysync-server {VERSION}
+In CopySync on each computer, set Settings → Signaling server to:
+
+ ws://{LAN_IP}:8787/signal
+
+ Config /etc/copysync/server.env
+ Logs journalctl -u copysync-server -f
+ Restart systemctl restart copysync-server
+ Uninstall sudo ./install.sh uninstall
+
+Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768-60999 (relay ports, assigned by the OS)""",
+ },
+}
+
+WINDOWS_LOGO = ('<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">'
+ '<path d="M3 5.5 10.5 4.5v7H3zM11.5 4.4 21 3v8.5h-9.5zM3 12.5h7.5v7L3 18.5zM11.5 12.5H21V21l-9.5-1.4z"/></svg>')
+
+
+def transcript(text: str, prompt: str, command: str) -> str:
+ """终端窗口里的内容:先是输入的命令,再是脚本的输出,客户端要填的地址用蓝色标出来。"""
+ out = html.escape(text, quote=False)
+ url = f"ws://{LAN_IP}:8787/signal"
+ out = out.replace(url, f'<span class="t-url">{url}</span>')
+ # 脚本每一步的提示行(Mac 与 Linux 是 ▶,Windows 是 >,转义后是 &gt;)
+ out = re.sub(r"^((?:▶|&gt;) .*)$", r'<span class="t-step">\1</span>', out, flags=re.M)
+ head = f'<span class="t-prompt">{html.escape(prompt)}</span> {html.escape(command)}\n' if command else ""
+ return head + out
+
+
+def term(kind: str, title: str, body: str, label: str) -> str:
+ """一个终端窗口的示意图。kind 是 mac(红绿灯在左)或 win(窗口按钮在右)。"""
+ if kind == "win":
+ bar = (f'<div class="t-bar win"><span class="t-tab">{WINDOWS_LOGO}{title}</span>'
+ '<span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>')
+ else:
+ bar = f'<div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">{title}</span></div>'
+ return f"""<figure class="term" role="img" aria-label="{esc(label)}">
+ {bar}
+<pre class="t-body">{body}</pre>
+ </figure>"""
+
+
+def code_block(c: dict, code: str) -> str:
+ return f"""<div class="code">
+ <button class="copy" type="button" data-done="{c["copied"]}">{c["copy"]}</button>
+<pre><code>{html.escape(code, quote=False)}</code></pre>
+ </div>"""
+
+
+def server_page(code: str) -> str:
+ c = load(code)
+ g = c["guide"]
+ path, hl, locale, _ = LANGS[code]
+ up = "../" * (path + GUIDE).count("/")
+ home_href = up + (path or "./")
+ a = up + "assets/"
+ shots = up + "assets/screenshots/" + ("" if code == "zh" else code + "/")
+ t = TRANSCRIPTS["zh" if code == "zh" else "en"]
+ url = f"ws://{LAN_IP}:8787/signal"
+ alternates = "\n".join(
+ f' <link rel="alternate" hreflang="{h}" href="{SITE}{p}{GUIDE}">' for p, h, _, _ in LANGS.values())
+
+ def items(lst: list[str], indent: str = " ") -> str:
+ return "\n".join(f"{indent}<li>{x}</li>" for x in lst)
+
+ def manage(rows: list[tuple[str, str]]) -> str:
+ body = "\n".join(f' <tr><th scope="row">{k}</th><td>{v}</td></tr>' for k, v in rows)
+ return f"""<div class="table-scroll">
+ <table class="manage">
+ <caption>{g["manage_caption"]}</caption>
+ <tbody>
+{body}
+ </tbody>
+ </table>
+ </div>"""
+
+ linux_dl = f"""curl -LO {DL}copysync-server-linux-amd64.tar.gz
+tar xzf copysync-server-linux-amd64.tar.gz
+cd copysync-server-linux-amd64
+sudo ./install.sh"""
+ mac_dl = f"""curl -LO {DL}copysync-server-macos.tar.gz
+tar xzf copysync-server-macos.tar.gz
+cd copysync-server-macos
+./install.sh"""
+
+ w, m, l = g["win"], g["mac"], g["linux"]
+ explorer = []
+ for name, kind in [("copysync-server.exe", "exe"), ("install.cmd", "cmd"), ("install.ps1", "doc"),
+ ("README.md", "doc"), ("uninstall.cmd", "cmd")]:
+ # 要双击的那个文件标出来
+ mark = f'<em>{w["double_click"]}</em>' if name == "install.cmd" else ""
+ cls = ' class="hl"' if mark else ""
+ explorer.append(f' <li{cls}><span class="f-icon {kind}" aria-hidden="true"></span>'
+ f'<span class="f-name">{name}</span>{mark}</li>')
+ explorer = "\n".join(explorer)
+ prep = "\n".join(f" <div><dt>{h}</dt><dd>{p}</dd></div>" for h, p in g["prep"])
+ faq = "\n".join(
+ f""" <details>
+ <summary>{q}</summary>
+ <div class="answer">{"".join(f"<p>{p}</p>" for p in answer)}</div>
+ </details>""" for q, answer in g["faq"])
+ d = g["diagram"]
+ toc = "\n".join(f' <li><a href="#{anchor}">{label}</a></li>' for anchor, label in g["toc"])
+
+ return f"""<!doctype html>
+<html lang="{hl}">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>{g["title"]}</title>
+ <meta name="description" content="{esc(g["description"])}">
+ <link rel="canonical" href="{SITE}{path}{GUIDE}">
+{alternates}
+ <meta name="theme-color" content="#141416">
+ <meta property="og:type" content="article">
+ <meta property="og:site_name" content="CopySync">
+ <meta property="og:title" content="{esc(g["title"])}">
+ <meta property="og:description" content="{esc(g["description"])}">
+ <meta property="og:url" content="{SITE}{path}{GUIDE}">
+ <meta property="og:image" content="{SITE}assets/{c["og_image"]}">
+ <meta property="og:locale" content="{locale}">
+ <meta name="twitter:card" content="summary_large_image">
+ <link rel="icon" href="{a}favicon.svg" type="image/svg+xml">
+ <link rel="icon" href="{a}favicon-32.png" sizes="32x32" type="image/png">
+ <link rel="apple-touch-icon" href="{a}apple-touch-icon.png">
+ <link rel="stylesheet" href="{a}site.css">
+</head>
+<body>
+ <a class="skip" href="#main">{c["skip"]}</a>
+
+ <header class="bar">
+ <div class="wrap">
+ <a class="brand" href="{home_href}" aria-label="{c["home_label"]}"><img src="{a}icon.svg" alt="" width="26" height="26">CopySync</a>
+ <nav aria-label="{c["nav_label"]}">
+ <a class="wide" href="{home_href}#how">{c["nav_how"]}</a>
+ <a class="wide" href="{home_href}#install">{c["nav_install"]}</a>
+ <a href="./" aria-current="page">{c["nav_server"]}</a>
+ <a class="wide" href="{REPO}">GitHub</a>
+ {lang_links(code, up, GUIDE)}
+ </nav>
+ </div>
+ </header>
+
+ <main id="main">
+ <section class="hero guide-hero">
+ <div class="wrap">
+ <p class="crumb"><a href="{home_href}">CopySync</a> / {c["nav_server"]}</p>
+ <h1 class="display">{g["h1"]}</h1>
+ <p class="lede">{g["lede"]}</p>
+ <ol class="guide-toc">
+{toc}
+ </ol>
+ </div>
+ </section>
+
+ <section class="section" id="overview" aria-labelledby="overview-title">
+ <div class="wrap">
+ <h2 id="overview-title">{g["overview_h2"]}</h2>
+ <p class="intro">{g["overview_intro"]}</p>
+ <figure class="diagram">
+ <svg viewBox="0 0 960 440" role="img" aria-labelledby="lan-title lan-desc">
+ <title id="lan-title">{d["title"]}</title>
+ <desc id="lan-desc">{d["desc"]}</desc>
+ <rect class="d-lan" x="8" y="8" width="944" height="384" rx="22"/>
+ <text class="d-lan-label" x="32" y="42">{d["lan"]}</text>
+ <rect class="d-box" x="340" y="64" width="280" height="104" rx="14"/>
+ <text class="d-title" x="480" y="106" text-anchor="middle">{d["server"]}</text>
+ <text class="d-ip" x="480" y="138" text-anchor="middle">{LAN_IP}</text>
+ <path class="d-sig" d="M150 250V96H340"/>
+ <path class="d-sig" d="M810 250V96H620"/>
+ <path class="d-relay" d="M206 250V140H340"/>
+ <path class="d-relay" d="M754 250V140H620"/>
+ <text class="d-note" x="164" y="86">{d["sig_note"]}</text>
+ <text class="d-note" x="220" y="200">{d["relay_note"]}</text>
+ <rect class="d-box" x="40" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="160" y="300" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="160" y="328" text-anchor="middle">{d["client"]}</text>
+ <rect class="d-box" x="680" y="250" width="240" height="112" rx="14"/>
+ <text class="d-title" x="800" y="300" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="800" y="328" text-anchor="middle">{d["client"]}</text>
+ <path class="d-direct" d="M280 306H680"/>
+ <text class="d-label" x="480" y="292" text-anchor="middle">{d["direct"]}</text>
+ <text class="d-note" x="480" y="336" text-anchor="middle">{d["direct_note"]}</text>
+ <g class="d-legend" transform="translate(40 424)">
+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">{d["legend_direct"]}</text>
+ <path class="d-relay" d="M250 0H278"/><text x="288" y="5">{d["legend_relay"]}</text>
+ <path class="d-sig" d="M560 0H588"/><text x="598" y="5">{d["legend_sig"]}</text>
+ </g>
+ </svg>
+ </figure>
+ <ul class="points ports">
+{items(g["overview_points"], " ")}
+ </ul>
+ </div>
+ </section>
+
+ <section class="section" id="prepare" aria-labelledby="prepare-title">
+ <div class="wrap">
+ <h2 id="prepare-title">{g["prep_h2"]}</h2>
+ <dl class="fallbacks">
+{prep}
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <h2 id="install-title">{g["install_h2"]}</h2>
+ <p class="intro">{g["install_intro"]}</p>
+ <div class="os-tabs" data-tabs>
+ <div class="tablist" role="tablist" aria-label="{g["os_label"]}" hidden>
+ <button type="button" role="tab" id="tab-windows" aria-controls="windows">Windows</button>
+ <button type="button" role="tab" id="tab-macos" aria-controls="macos">macOS</button>
+ <button type="button" role="tab" id="tab-linux" aria-controls="linux">Linux</button>
+ </div>
+
+ <section class="os" id="windows" role="tabpanel" aria-labelledby="tab-windows">
+ <h3 class="os-title">{DESKTOP}Windows</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+{items(w["steps"])}
+ </ol>
+ <a class="button" href="{DL}copysync-server-windows-amd64.zip">{DOWN}{w["download"]}</a>
+ <ul class="points">
+{items(w["notes"])}
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="explorer" role="img" aria-label="{esc(w["explorer_label"])}">
+ <div class="t-bar win"><span class="t-tab folder">copysync-server-windows-amd64</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
+ <ul class="files">
+{explorer}
+ </ul>
+ </figure>
+ {term("win", w["term_title"], transcript(t["win"], "", ""), w["term_label"])}
+ </div>
+ </div>
+ {manage(w["manage"])}
+ </section>
+
+ <section class="os" id="macos" role="tabpanel" aria-labelledby="tab-macos">
+ <h3 class="os-title">{LAPTOP}macOS</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>{m["steps"][0]}
+ {code_block(c, mac_dl)}</li>
+{items(m["steps"][1:])}
+ </ol>
+ <ul class="points">
+{items(m["notes"])}
+ </ul>
+ </div>
+ <div class="os-figures">
+ {term("mac", "copysync-server-macos — zsh", transcript(t["mac"], "%", "./install.sh"), m["term_label"])}
+ </div>
+ </div>
+ {manage(m["manage"])}
+ </section>
+
+ <section class="os" id="linux" role="tabpanel" aria-labelledby="tab-linux">
+ <h3 class="os-title">{SERVER}Linux</h3>
+ <div class="os-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>{l["steps"][0]}
+ {code_block(c, linux_dl)}</li>
+{items(l["steps"][1:])}
+ </ol>
+ <ul class="points">
+{items(l["notes"])}
+ </ul>
+ </div>
+ <div class="os-figures">
+ {term("mac", f"ssh {LAN_IP}", transcript(t["linux"], "$", "sudo ./install.sh"), l["term_label"])}
+ </div>
+ </div>
+ {manage(l["manage"])}
+ </section>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <h2 id="check-title">{g["check_h2"]}</h2>
+ <p class="intro">{g["check_intro"]}</p>
+ <figure class="browser" role="img" aria-label="{esc(g["check_label"])}">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">http://{LAN_IP}:8787/healthz</span></div>
+ <pre class="b-body">{{"status":"ok","version":"{VERSION}"}}</pre>
+ </figure>
+ <p class="note">{g["check_after"]}</p>
+ </div>
+ </section>
+
+ <section class="section" id="clients" aria-labelledby="clients-title">
+ <div class="wrap">
+ <h2 id="clients-title">{g["clients_h2"]}</h2>
+ <ol class="flow">
+{chr(10).join(f" <li><h3>{h}</h3><p>{p}</p></li>" for h, p in g["clients_steps"])}
+ </ol>
+ <figure class="shot">
+ <img src="{shots}settings-lan-dark.png" width="2112" height="1472" loading="lazy" alt="{esc(g["clients_alt"])}">
+ </figure>
+ <p class="note">{g["clients_after"].format(home=home_href)}</p>
+ </div>
+ </section>
+
+ <section class="section" id="faq" aria-labelledby="faq-title">
+ <div class="wrap">
+ <h2 id="faq-title">{g["faq_h2"]}</h2>
+ <div class="faq">
+{faq}
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">{g["closing"]}</h2>{cta(c)}
+ <a class="source" href="{REPO}/blob/main/server/deploy/README.md">{g["source"]}</a>
+ </div>
+ </section>
+ </main>
+
+{footer(c, code, up, GUIDE)}
+
+ <script src="{a}site.js" defer></script>
+</body>
+</html>
+"""
+
+
# ─────────────────────────── Markdown → HTML ───────────────────────────
# 只实现技术方案用到的那部分:标题、段落、列表(可嵌套)、引用、代码块、表格、分隔线,
# 行内的代码、粗体、链接。
@@ -678,8 +1111,9 @@ def design_page(md_name: str, page: str) -> str:
<div class="wrap">
<a class="brand" href="../" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="页面导航">
- <a href="{REPO}/blob/main/design/{md_name}">在 GitHub 上查看</a>
- <a href="{REPO}">GitHub</a>
+ <a href="../{GUIDE}">{zh["nav_server"]}</a>
+ <a class="wide" href="{REPO}/blob/main/design/{md_name}">在 GitHub 上查看</a>
+ <a class="wide" href="{REPO}">GitHub</a>
</nav>
</div>
</header>
@@ -735,6 +1169,10 @@ def sitemap() -> str:
alts += f'\n <xhtml:link rel="alternate" hreflang="x-default" href="{SITE}"/>'
urls = [f" <url>\n <loc>{SITE}{p}</loc>\n <lastmod>{DATE}</lastmod>{alts}\n </url>"
for p, _, _, _ in LANGS.values()]
+ server_alts = "".join(
+ f'\n <xhtml:link rel="alternate" hreflang="{h}" href="{SITE}{p}{GUIDE}"/>' for p, h, _, _ in LANGS.values())
+ urls += [f" <url>\n <loc>{SITE}{p}{GUIDE}</loc>\n <lastmod>{DATE}</lastmod>{server_alts}\n </url>"
+ for p, _, _, _ in LANGS.values()]
urls += [f" <url>\n <loc>{SITE}design/{page}.html</loc>\n <lastmod>{DATE}</lastmod>\n </url>"
for page in DESIGN_DOCS.values()]
return ('<?xml version="1.0" encoding="UTF-8"?>\n'
@@ -751,6 +1189,7 @@ def write(path: Path, text: str) -> None:
def main() -> None:
for code, (path, _, _, _) in LANGS.items():
write(DOCS / path / "index.html", home(code))
+ write(DOCS / path / GUIDE / "index.html", server_page(code))
for md_name, page in DESIGN_DOCS.items():
write(DOCS / "design" / f"{page}.html", design_page(md_name, page))
write(DOCS / "404.html", not_found())
diff --git a/tools/site/content/en.py b/tools/site/content/en.py
index 913be27..d080203 100644
--- a/tools/site/content/en.py
+++ b/tools/site/content/en.py
@@ -18,6 +18,7 @@ C = {
"nav_how": "How it works",
"nav_install": "Install",
"nav_faq": "FAQ",
+ "nav_server": "Self-host",
"lang_label": "Language",
"h1": "Copy on this computer.<br>Paste on that one.",
@@ -25,7 +26,7 @@ C = {
"Data moves directly between your devices, and stays encrypted even when it passes through your own server.",
"dl_mac": "Download for Mac",
"dl_win": "Download for Windows",
- "dl_note": "Version 1.3.2, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.",
+ "dl_note": "Version 1.3.3, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.",
"stage_label": "Demo: Command C on a MacBook turns a file into a sheet that flies over a direct connection to a Windows "
"laptop, where Ctrl V pastes it",
"stage_file": "Q3 review - final.pptx",
@@ -149,7 +150,7 @@ C = {
"install_h2": "Install",
"install_intro": "Install the app on each computer, and set up a server both of them can reach. If both share a LAN, the "
- "server can run on one of your Macs.",
+ "server can run on one of your Windows, Mac or Linux computers; see the <a href=\"server/\">LAN guide</a>.",
"mac_steps": [
"Download CopySync.dmg, open it and drag CopySync into Applications.",
"Open it from Applications.<span class=\"aside\">The first time, macOS says it can't verify the developer: CopySync "
@@ -166,7 +167,7 @@ C = {
"In Settings, enter your server address and press Enter. Allow it if Windows Firewall asks.",
],
"server_h3": "Server",
- "server_intro": "Any Linux, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.",
+ "server_intro": "To use it across networks: a Linux server with a public IP, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.",
"copy": "Copy",
"copied": "Copied",
"public_ip": "YOUR_PUBLIC_IP",
@@ -175,16 +176,17 @@ C = {
"ports_cols": ["Port", "Purpose"],
"ports": [("8787/tcp", "Signaling"), ("3478/udp", "STUN and TURN"), ("32768–60999/udp", "Relay ports")],
"server_docker": f'Docker works too; see the <a href="{REPO}/blob/main/server/deploy/README.md">server deployment guide</a>.',
+ "server_guide": "LAN setup guide",
"pairing": "<strong>Pairing:</strong> on one computer, choose Devices → Add device to show a 6-character code; enter it on "
"the other, and confirm once both screens show the same two fingerprints. Mac with Windows, or two Windows PCs, "
"works the same way.",
"specs_h2": "Specifications",
"specs": [
- ("Version", '1.3.2, released <time datetime="2026-10-10">October 10, 2026</time>'),
+ ("Version", '1.3.3, released <time datetime="2026-10-11">October 11, 2026</time>'),
("Mac app", "macOS 13 Ventura or later; universal binary for Intel and Apple silicon, no Rosetta; about 47 MB download"),
("Windows app", "Windows 10 (21H2 or later) and Windows 11, x64; installs per user, no administrator rights; about 23 MB download"),
- ("Server", "Linux on x86_64 or ARM64 (systemd or Docker), or macOS; about 15 MB of RAM"),
+ ("Server", "Linux on x86_64 or ARM64 (systemd or Docker), macOS (Intel and Apple silicon), Windows 10 and 11 x64 (as a service); about 15 MB of RAM"),
("Languages", "English, Simplified Chinese and Japanese; follows the system by default, switchable in Settings"),
("Content", "Plain text, rich text, images and screenshots, files, folders; each type can be turned off"),
("Transport", "WebRTC data channels, direct first with TURN relay fallback; every uplink probed on multi-uplink networks; files streamed as tar + zstd"),
@@ -221,7 +223,8 @@ C = {
]),
("Do I need my own server?", [
"Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on "
- "one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough.",
+ "any always-on Windows, Mac or Linux computer; see the <a href=\"server/\">LAN guide</a>. Across networks you need a "
+ "machine with a public IP; the smallest cloud VM is enough.",
]),
("Windows? iPhone?", [
"Windows 10 and 11 (x64) are supported and work together with Macs. Files you paste on Windows are real files you "
@@ -258,6 +261,184 @@ C = {
("Report an issue", f"{REPO}/issues"),
],
+ # ── Tutorial: run the server on your LAN (server/ page) ──
+ "guide": {
+ "title": "Run a CopySync server on your LAN: Windows, Mac and Linux",
+ "description": "When your computers share a network you don't need a cloud server. Run CopySync's signaling and TURN server "
+ "on any always-on Windows, Mac or Linux machine with one script; it starts on boot. Includes app setup and troubleshooting.",
+ "h1": "Run the server on your LAN",
+ "lede": "If your computers are on the same home or office network, you don't need a cloud server. Pick a computer that stays on, "
+ "download and run one script, then enter the address it prints into CopySync on each computer.",
+ "toc": [("prepare", "Before you start"), ("install", "Install"), ("check", "Check"), ("clients", "Set up the apps"), ("faq", "Questions")],
+
+ "overview_h2": "The server only introduces devices",
+ "overview_intro": "Each computer stays connected to the server, which is how they find each other and exchange connection details. "
+ "Once connected, what you copy goes straight between the two computers. Only when that fails does it pass "
+ "through the server, still encrypted.",
+ "diagram": {
+ "title": "CopySync on a LAN",
+ "desc": "On one LAN, a Mac and a Windows PC connect to the server at 192.168.1.20 for signaling. Copied content travels "
+ "directly between the two computers, and through the server's TURN relay only if a direct connection fails.",
+ "lan": "Your LAN: the same Wi‑Fi or wired network",
+ "server": "Server",
+ "sig_note": "Signaling, TCP 8787",
+ "relay_note": "Relay, UDP 3478, if direct fails",
+ "client": "Running CopySync",
+ "direct": "Direct, end-to-end encrypted",
+ "direct_note": "Content stays between the two computers",
+ "legend_direct": "Data (direct)",
+ "legend_relay": "Data (relay, fallback)",
+ "legend_sig": "Signaling",
+ },
+ "overview_points": [
+ "<strong>Signaling, TCP 8787.</strong> Every computer stays connected to it to find the others, pair and exchange connection details.",
+ "<strong>Direct.</strong> On a LAN, content almost always goes straight between the two computers, at the speed of your network.",
+ "<strong>Relay, UDP 3478.</strong> Only used when devices can't reach each other: guest networks, Wi‑Fi with client isolation, separate subnets.",
+ ],
+
+ "prep_h2": "Before you start",
+ "prep": [
+ ("A computer that stays on", "Windows 10 or 11, macOS 13 or later, or any Linux, including one of the two computers you sync. "
+ "Sync pauses while it's off or asleep and resumes when it wakes. A NAS, home router or Mac mini "
+ "is ideal; the server uses about 15 MB of RAM."),
+ ("A fixed address", "Reserve an address for it in your router's DHCP settings (often called DHCP reservation or static lease). "
+ "Otherwise, when the router hands out a new address, every computer has to be updated."),
+ ("The same network", "Devices just need to be on the same Wi‑Fi or wired network. Guest networks and Wi‑Fi with client "
+ "(AP) isolation block devices from reaching each other; use another network or turn isolation off."),
+ ("No sync away from it", "The server is only reachable on your LAN, so a laptop taken elsewhere catches up when it's back. "
+ "To sync from anywhere you need a server with a public IP; see Install on the home page."),
+ ],
+
+ "install_h2": "Install the server",
+ "install_intro": "Choose the system of the computer that will run the server. The script finds the computer's LAN address, "
+ "sets the server to start automatically, and prints the address to enter in the apps.",
+ "os_label": "System of the server computer",
+ "manage_caption": "For later",
+ "win": {
+ "steps": [
+ f'Download <a href="{REPO}/releases/latest/download/copysync-server-windows-amd64.zip">copysync-server-windows-amd64.zip</a> '
+ "and choose Extract All.",
+ "Open the extracted folder and double-click <code>install.cmd</code>."
+ "<span class=\"aside\">If you see \"Windows protected your PC\", click More info, then Run anyway; when User Account "
+ "Control asks, click Yes. The server isn't code-signed yet, which is why Windows asks once.</span>",
+ "Installation continues in a new window. The <code>ws://…/signal</code> address at the end is what you enter in the apps.",
+ ],
+ "download": "Download the Windows server",
+ "notes": [
+ "<strong>Runs as a Windows service:</strong> starts with Windows, no sign-in needed, no window. It appears as CopySync Server in Services.",
+ "<strong>Firewall already allowed:</strong> the script adds an inbound rule for copysync-server.exe only, so there are no ports to open.",
+ "<strong>Wrong address picked</strong> (several network adapters, say from a VM or VPN): type <code>cmd</code> in the "
+ "address bar of the extracted folder, press Enter and run <code>install.cmd 192.168.1.20</code> with your address.",
+ "Windows 10 and 11, x64.",
+ ],
+ "double_click": "Double-click",
+ "explorer_label": "The extracted folder holds copysync-server.exe, install.cmd, install.ps1, README.md and uninstall.cmd; double-click install.cmd",
+ "term_title": "Administrator: Windows PowerShell",
+ "term_label": "The window after install.cmd finishes: it stops the old version, installs, registers the service, allows it through the firewall and starts it, then prints the address ws://192.168.1.20:8787/signal",
+ "manage": [
+ ("Status", "<code>Get-Service CopySyncServer</code> in an administrator PowerShell, or find CopySync Server in Services"),
+ ("Logs", "<code>C:\\ProgramData\\CopySync Server\\server.log</code>"),
+ ("Restart", "<code>Restart-Service CopySyncServer</code> in an administrator PowerShell"),
+ ("Upgrade", "Download the new version, extract it and double-click <code>install.cmd</code> again; your settings are kept"),
+ ("Uninstall", "Double-click <code>uninstall.cmd</code>; it removes the service, the firewall rule and the files"),
+ ],
+ },
+ "mac": {
+ "steps": [
+ "Open Terminal and run these lines:",
+ "The <code>ws://…/signal</code> address at the end is what you enter in the apps.",
+ ],
+ "notes": [
+ "<strong>No administrator rights needed.</strong> It runs in the background whenever you're logged in, and macOS restarts it if it exits.",
+ "<strong>Keep this Mac awake:</strong> in System Settings → Energy (Battery → Options on a laptop), turn on the option that prevents automatic sleep.",
+ "<strong>If the macOS firewall is on,</strong> the script ends with the command to allow copysync-server.",
+ "Intel and Apple silicon, macOS 13 or later.",
+ ],
+ "term_label": "Output of ./install.sh in Terminal: it installs, writes the LaunchAgent and starts the server, then prints the address ws://192.168.1.20:8787/signal",
+ "manage": [
+ ("Logs", "<code>~/Library/Logs/CopySync/server.log</code>"),
+ ("Restart", "<code>launchctl kickstart -k gui/$(id -u)/com.copysync.server</code>"),
+ ("Upgrade", "Download the new version, extract it and run <code>./install.sh</code> again; your settings are kept"),
+ ("Uninstall", "<code>./install.sh uninstall</code>"),
+ ],
+ },
+ "linux": {
+ "steps": [
+ "On the machine itself, or over ssh, run these lines:<span class=\"aside\">On ARM, such as a Raspberry Pi with a 64-bit OS, replace <code>amd64</code> with <code>arm64</code>.</span>",
+ "The <code>ws://…/signal</code> address at the end is what you enter in the apps.",
+ ],
+ "notes": [
+ "<strong>Registers a systemd service</strong> that starts on boot. Needs root.",
+ "<strong>If ufw or firewalld is active,</strong> the script ends with the commands to open the ports.",
+ "<strong>Docker works too:</strong> copy <code>env.example</code> to <code>.env</code>, set <code>TURN_IP</code> to the "
+ "machine's LAN address and run <code>docker compose up -d</code>. It needs host networking, so Linux only.",
+ ],
+ "term_label": "Output of sudo ./install.sh: it installs, writes the systemd unit and config and starts the server, then prints the address ws://192.168.1.20:8787/signal",
+ "manage": [
+ ("Status", "<code>systemctl status copysync-server</code>"),
+ ("Logs", "<code>journalctl -u copysync-server -f</code>"),
+ ("Restart", "<code>sudo systemctl restart copysync-server</code>"),
+ ("Config", "<code>/etc/copysync/server.env</code>; restart the service after editing"),
+ ("Upgrade", "Download the new version, extract it and run <code>sudo ./install.sh</code> again; your config is kept"),
+ ("Uninstall", "<code>sudo ./install.sh uninstall</code>"),
+ ],
+ },
+
+ "check_h2": "Check that other computers can reach it",
+ "check_intro": "On another computer, open <code>http://192.168.1.20:8787/healthz</code> in a browser (with your address). "
+ "If you see this line, the network path works.",
+ "check_label": "A browser showing http://192.168.1.20:8787/healthz, with the server's status ok and its version",
+ "check_after": "If it doesn't load, see the <a href=\"#faq\">questions</a> below.",
+
+ "clients_h2": "Enter the address on each computer",
+ "clients_steps": [
+ ("Open Settings", "Open CopySync on each computer, including the one running the server, and go to Settings."),
+ ("Enter the address", "Under Signaling server, enter <code>ws://192.168.1.20:8787/signal</code> with your address and press Return or Enter."),
+ ("Check the status", "When Connection shows a green Connected, you're set. Pair your devices under Devices and copying starts syncing."),
+ ],
+ "clients_alt": "CopySync Settings: the signaling server is ws://192.168.1.20:8787/signal and the connection status shows Connected",
+ "clients_after": 'Haven\'t installed the app yet? See <a href="{home}#install">Install</a> on the home page.',
+
+ "faq_h2": "Questions",
+ "faq": [
+ ("The status stays at Not connected", [
+ "Check the address first: it starts with <code>ws://</code>, uses port 8787, ends in <code>/signal</code>, and you pressed Return after typing it.",
+ "Then open <code>http://server-address:8787/healthz</code> in a browser on that computer. If it doesn't load, the network "
+ "path is broken: the server isn't running, its computer is asleep, a firewall blocks it, or its address changed.",
+ "The Windows script already allows the server through the firewall. On a Mac with the firewall on, run the command the "
+ "script printed at the end; the same goes for ufw and firewalld on Linux.",
+ ]),
+ ("Devices show Relay instead of Direct", [
+ "On a LAN connections are almost always direct. Relay means UDP can't get between the two computers, usually because of "
+ "a guest network, Wi‑Fi client isolation, or separate subnets with a firewall in between. Relayed content is still "
+ "encrypted; it's just limited by the server computer's network.",
+ ]),
+ ("The server's address changed", [
+ "Run the script again with the new address: <code>install.cmd new-address</code> on Windows, <code>./install.sh new-address</code> "
+ "on a Mac. On Linux, edit <code>-turn-ip</code> in <code>/etc/copysync/server.env</code> and restart the service. Then update "
+ "the address on each computer.",
+ "Reserving the address in your router avoids this.",
+ ]),
+ ("Does it sync away from the LAN?", [
+ "No, the server is only reachable on your LAN. To sync from anywhere, deploy the server on a machine with a public IP "
+ "(steps under Install on the home page), or join your devices with a mesh VPN such as Tailscale or ZeroTier and enter "
+ "the server's address on that network.",
+ ]),
+ ("A cloud server in mainland China works by IP but not by domain", [
+ "Cloud providers in mainland China intercept plain HTTP requests for domains without an ICP filing and answer with a "
+ "redirect to a block page; in our tests that included non-standard ports such as 8787. The WebSocket handshake is an "
+ "HTTP request too, so it is intercepted and the app shows Not connected.",
+ "Enter the server's IP instead, as in <code>ws://server-ip:8787/signal</code>, or file the domain.",
+ ]),
+ ("The server computer also runs CopySync. Which address?", [
+ "The same LAN address works, and so does <code>ws://127.0.0.1:8787/signal</code>. The server and the app don't interfere.",
+ ]),
+ ],
+
+ "closing": "One computer that stays on is enough.",
+ "source": "Full server guide, including public servers and Docker",
+ },
+
"ld_description": "Open-source app that syncs the clipboard and files between Mac and Windows computers. Copy text, "
"images, files or folders on one computer and paste on the other. Devices connect directly over "
"WebRTC with end-to-end DTLS encryption, falling back to a TURN relay on a server the user hosts.",
diff --git a/tools/site/content/ja.py b/tools/site/content/ja.py
index bf971d2..892fa98 100644
--- a/tools/site/content/ja.py
+++ b/tools/site/content/ja.py
@@ -18,6 +18,7 @@ C = {
"nav_how": "しくみ",
"nav_install": "インストール",
"nav_faq": "よくある質問",
+ "nav_server": "サーバーの設置",
"lang_label": "言語",
"h1": "こっちでコピーして、<br>あっちで貼り付け。",
@@ -25,7 +26,7 @@ C = {
"データはデバイス間を直接流れ、自分のサーバーを経由するときも暗号化されたままです。",
"dl_mac": "Mac 版をダウンロード",
"dl_win": "Windows 版をダウンロード",
- "dl_note": "バージョン 1.3.2、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。",
+ "dl_note": "バージョン 1.3.3、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。",
"stage_label": "デモ:MacBook で Command C を押すと、ファイルが一枚の紙になって直接接続で Windows ノートへ飛び、そこで Ctrl V を押して貼り付けます",
"stage_file": "四半期報告_最終版.pptx",
"stage_win": "Windows ノート",
@@ -143,7 +144,7 @@ C = {
],
"install_h2": "インストール",
- "install_intro": "それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。2 台が同じ LAN にあるなら、サーバーはどちらかの Mac で動かせば十分です。",
+ "install_intro": "それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。2 台が同じ LAN にあるなら、サーバーはどれか 1 台の Windows・Mac・Linux で動かせば十分です。<a href=\"server/\">LAN での設置手順</a>をご覧ください。",
"mac_steps": [
"CopySync.dmg をダウンロードして開き、CopySync を「アプリケーション」にドラッグします。",
"「アプリケーション」から開きます。<span class=\"aside\">初回は「開発元を検証できません」と表示されます。CopySync はまだ Apple の公証を受けていないためです。"
@@ -159,7 +160,7 @@ C = {
"「設定」でサーバーのアドレスを入力して Enter を押します。ファイアウォールに聞かれたら許可します。",
],
"server_h3": "サーバー",
- "server_intro": "Linux なら何でも可、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。",
+ "server_intro": "ネットワークをまたいで使う場合:グローバル IP を持つ Linux サーバー、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。",
"copy": "コピー",
"copied": "コピーしました",
"public_ip": "グローバルIP",
@@ -167,15 +168,16 @@ C = {
"ports_cols": ["ポート", "用途"],
"ports": [("8787/tcp", "シグナリング"), ("3478/udp", "STUN と TURN"), ("32768–60999/udp", "中継用ポート")],
"server_docker": f'Docker でも動かせます。<a href="{REPO}/blob/main/server/deploy/README.md">サーバーの構築手順</a>(英語)をご覧ください。',
+ "server_guide": "LAN での設置手順",
"pairing": "<strong>ペアリング:</strong>一台で「デバイス → デバイスを追加」を開いて 6 桁のコードを表示し、もう一台で入力します。"
"両方の画面に同じ 2 行の指紋が表示されたら確定します。Mac と Windows、Windows 同士でも同じ手順です。",
"specs_h2": "仕様",
"specs": [
- ("バージョン", '1.3.2(<time datetime="2026-10-10">2026 年 10 月 10 日</time>公開)'),
+ ("バージョン", '1.3.3(<time datetime="2026-10-11">2026 年 10 月 11 日</time>公開)'),
("Mac アプリ", "macOS 13 Ventura 以降。Intel と Apple シリコンのユニバーサルバイナリで Rosetta 不要。ダウンロードは約 47 MB"),
("Windows アプリ", "Windows 10(21H2 以降)と Windows 11、x64。ユーザーごとのインストールで管理者権限不要。ダウンロードは約 23 MB"),
- ("サーバー", "Linux(x86_64 または ARM64、systemd または Docker)、macOS でも動作。メモリは約 15 MB"),
+ ("サーバー", "Linux(x86_64 または ARM64、systemd または Docker)、macOS(Intel と Apple シリコン)、Windows 10・11 x64(サービスとして動作)。メモリは約 15 MB"),
("表示言語", "日本語、英語、簡体字中国語。初期設定はシステムに合わせ、「設定」で切り替え可能"),
("同期する内容", "プレーンテキスト、書式付きテキスト、画像とスクリーンショット、ファイル、フォルダ。種類ごとにオフにできる"),
("転送", "WebRTC データチャネル。直接接続を優先し、つながらなければ TURN で中継。複数の出口があるネットワークでは出口ごとに調査。ファイルは tar + zstd でストリーム転送"),
@@ -208,7 +210,8 @@ C = {
"テストでは、出口が 4 つある会社の Mac と家庭の回線が直接つながりました。相手がポートをランダムに割り当てる NAT の場合は中継になります。",
]),
("サーバーは自分で用意する必要がありますか?", [
- "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるならどちらかの Mac でサーバーを動かせば十分で、"
+ "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるなら、電源を入れたままの Windows・Mac・Linux の"
+ "どれか 1 台でサーバーを動かせば十分で(<a href=\"server/\">LAN での設置手順</a>)、"
"ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。",
]),
("Windows に対応していますか?iPhone は?", [
@@ -240,6 +243,177 @@ C = {
("問題を報告", f"{REPO}/issues"),
],
+ # ── チュートリアル:LAN にサーバーを置く(server/ ページ) ──
+ "guide": {
+ "title": "LAN に CopySync サーバーを置く:Windows・Mac・Linux の手順",
+ "description": "コンピューターが同じネットワークにあれば、クラウドサーバーは要りません。常に電源が入っている Windows・Mac・Linux の"
+ "コンピューターで、CopySync のシグナリング兼 TURN サーバーをスクリプトひとつで動かせます。起動時に自動で立ち上がります。アプリの設定とトラブル対処つき。",
+ "h1": "LAN にサーバーを置く",
+ "lede": "家や会社のコンピューターが同じネットワークにあるなら、クラウドサーバーは要りません。電源を入れたままのコンピューターを 1 台選び、"
+ "スクリプトをダウンロードして実行し、表示されたアドレスを各コンピューターの CopySync に入力します。",
+ "toc": [("prepare", "準備"), ("install", "インストール"), ("check", "確認"), ("clients", "アドレスの入力"), ("faq", "よくある質問")],
+
+ "overview_h2": "サーバーは引き合わせるだけ",
+ "overview_intro": "各コンピューターはサーバーにつながったままで、それを通じて相手を見つけ、接続情報を交換します。つながったあと、"
+ "コピーした内容は 2 台のあいだを直接流れます。直接つながらないときだけサーバーを中継し、その場合も暗号化されたままです。",
+ "diagram": {
+ "title": "LAN での CopySync",
+ "desc": "同じ LAN の Mac と Windows PC が、アドレス 192.168.1.20 のサーバーにシグナリングで接続します。コピーした内容は 2 台のあいだを"
+ "直接流れ、直接つながらないときだけサーバーの TURN 中継を通ります。",
+ "lan": "LAN:同じ Wi‑Fi または有線ネットワーク",
+ "server": "サーバー",
+ "sig_note": "シグナリング TCP 8787",
+ "relay_note": "中継 UDP 3478(直接不可のとき)",
+ "client": "CopySync を使用",
+ "direct": "直接接続、エンドツーエンド暗号化",
+ "direct_note": "内容は 2 台のあいだだけを流れる",
+ "legend_direct": "データ(直接)",
+ "legend_relay": "データ(中継、予備)",
+ "legend_sig": "シグナリング",
+ },
+ "overview_points": [
+ "<strong>シグナリング、TCP 8787。</strong>各コンピューターが常に接続し、相手の発見、ペアリング、接続情報の交換に使います。",
+ "<strong>直接接続。</strong>LAN 内ではほぼ必ず 2 台のあいだで直接やりとりし、速度は LAN の速度そのままです。",
+ "<strong>中継、UDP 3478。</strong>ゲストネットワーク、AP アイソレーションが有効な Wi‑Fi、別のサブネットなど、互いに届かないときだけ使います。",
+ ],
+
+ "prep_h2": "始める前に",
+ "prep": [
+ ("電源を入れたままのコンピューター", "Windows 10・11、macOS 13 以降、または Linux なら何でも可。同期する 2 台のうちの 1 台でもかまいません。"
+ "電源が切れたりスリープしたりすると同期は止まり、復帰すると再開します。NAS、ルーター、Mac mini などが最適で、メモリは約 15 MB です。"),
+ ("固定のアドレス", "ルーターの DHCP 設定(「固定割り当て」「アドレス予約」など)で、このコンピューターのアドレスを固定します。"
+ "そうしないと、アドレスが変わるたびに全部のコンピューターで入れ直すことになります。"),
+ ("同じネットワークに", "同じ Wi‑Fi か有線ネットワークにつながっていれば十分です。ゲストネットワークや AP アイソレーションが有効な Wi‑Fi では"
+ "デバイスどうしが通信できないので、別のネットワークを使うか、アイソレーションをオフにしてください。"),
+ ("ネットワークの外では同期しない", "サーバーには LAN の中からしか届きません。持ち出したノートパソコンは、戻ってきてから同期を再開します。"
+ "どこからでも同期したい場合は、グローバル IP を持つサーバーが必要です(トップページの「インストール」)。"),
+ ],
+
+ "install_h2": "サーバーをインストール",
+ "install_intro": "サーバーを動かすコンピューターの OS を選んでください。スクリプトが LAN のアドレスを見つけ、サーバーを自動起動に設定し、"
+ "最後にアプリへ入力するアドレスを表示します。",
+ "os_label": "サーバーを動かすコンピューターの OS",
+ "manage_caption": "あとで使うもの",
+ "win": {
+ "steps": [
+ f'<a href="{REPO}/releases/latest/download/copysync-server-windows-amd64.zip">copysync-server-windows-amd64.zip</a> '
+ "をダウンロードし、右クリックで「すべて展開」します。",
+ "展開したフォルダーを開き、<code>install.cmd</code> をダブルクリックします。"
+ "<span class=\"aside\">「Windows によって PC が保護されました」と出たら「詳細情報」から「実行」を、ユーザーアカウント制御が出たら"
+ "「はい」を押します。サーバーはまだコード署名していないため、一度だけ確認されます。</span>",
+ "インストールは新しく開くウィンドウで進みます。最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。",
+ ],
+ "download": "Windows 版サーバーをダウンロード",
+ "notes": [
+ "<strong>Windows サービスとして動作:</strong>Windows の起動とともに立ち上がり、サインイン不要で、ウィンドウも出ません。「サービス」では CopySync Server と表示されます。",
+ "<strong>ファイアウォールは設定済み:</strong>copysync-server.exe だけを対象にした受信規則をスクリプトが追加するので、ポートを開ける必要はありません。",
+ "<strong>アドレスが違うものになった</strong>(仮想マシンや VPN でネットワークアダプターが複数あるなど):展開したフォルダーのアドレスバーに "
+ "<code>cmd</code> と入力して Enter を押し、<code>install.cmd 192.168.1.20</code> のようにアドレスを指定して実行します。",
+ "Windows 10・11、x64 に対応。",
+ ],
+ "double_click": "ダブルクリック",
+ "explorer_label": "展開したフォルダーには copysync-server.exe、install.cmd、install.ps1、README.md、uninstall.cmd があり、install.cmd をダブルクリックする",
+ "term_title": "管理者: Windows PowerShell",
+ "term_label": "install.cmd の実行後のウィンドウ:旧バージョンの停止、インストール、サービス登録、ファイアウォール許可、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示",
+ "manage": [
+ ("状態", "管理者の PowerShell で <code>Get-Service CopySyncServer</code>、または「サービス」で CopySync Server を確認"),
+ ("ログ", "<code>C:\\ProgramData\\CopySync Server\\server.log</code>"),
+ ("再起動", "管理者の PowerShell で <code>Restart-Service CopySyncServer</code>"),
+ ("更新", "新しいバージョンをダウンロードして展開し、もう一度 <code>install.cmd</code> をダブルクリック。設定は引き継がれます"),
+ ("アンインストール", "<code>uninstall.cmd</code> をダブルクリック。サービス、ファイアウォール規則、ファイルをすべて削除します"),
+ ],
+ },
+ "mac": {
+ "steps": [
+ "「ターミナル」を開き、次の行を順に実行します:",
+ "最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。",
+ ],
+ "notes": [
+ "<strong>管理者権限は不要です。</strong>ログインしているあいだバックグラウンドで動き、終了しても macOS が再起動します。",
+ "<strong>この Mac はスリープさせないでください:</strong>「システム設定 → エネルギー」(ノートは「バッテリー → オプション」)で自動スリープを防ぐ項目をオンにします。",
+ "<strong>macOS のファイアウォールがオンなら、</strong>スクリプトの最後に copysync-server を許可するコマンドが表示されます。",
+ "Intel と Apple シリコンの両方に対応、macOS 13 以降。",
+ ],
+ "term_label": "ターミナルで ./install.sh を実行した出力:インストール、LaunchAgent の作成、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示",
+ "manage": [
+ ("ログ", "<code>~/Library/Logs/CopySync/server.log</code>"),
+ ("再起動", "<code>launchctl kickstart -k gui/$(id -u)/com.copysync.server</code>"),
+ ("更新", "新しいバージョンをダウンロードして展開し、もう一度 <code>./install.sh</code> を実行。設定は引き継がれます"),
+ ("アンインストール", "<code>./install.sh uninstall</code>"),
+ ],
+ },
+ "linux": {
+ "steps": [
+ "そのマシン上で(または ssh でログインして)次の行を順に実行します:<span class=\"aside\">ARM(64 ビット OS の Raspberry Pi など)では <code>amd64</code> を <code>arm64</code> に置き換えます。</span>",
+ "最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。",
+ ],
+ "notes": [
+ "<strong>systemd サービスとして登録</strong>され、起動時に立ち上がります。root 権限が必要です。",
+ "<strong>ufw や firewalld が有効なら、</strong>スクリプトの最後にポートを開けるコマンドが表示されます。",
+ "<strong>Docker でも動かせます:</strong><code>env.example</code> を <code>.env</code> にコピーし、<code>TURN_IP</code> にこのマシンの LAN アドレスを入れて "
+ "<code>docker compose up -d</code> を実行します。ホストネットワークが必要なので Linux 専用です。",
+ ],
+ "term_label": "sudo ./install.sh の出力:インストール、systemd ユニットと設定の作成、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示",
+ "manage": [
+ ("状態", "<code>systemctl status copysync-server</code>"),
+ ("ログ", "<code>journalctl -u copysync-server -f</code>"),
+ ("再起動", "<code>sudo systemctl restart copysync-server</code>"),
+ ("設定", "<code>/etc/copysync/server.env</code>。編集したらサービスを再起動"),
+ ("更新", "新しいバージョンをダウンロードして展開し、もう一度 <code>sudo ./install.sh</code> を実行。設定は引き継がれます"),
+ ("アンインストール", "<code>sudo ./install.sh uninstall</code>"),
+ ],
+ },
+
+ "check_h2": "ほかのコンピューターから届くか確認",
+ "check_intro": "別のコンピューターのブラウザーで <code>http://192.168.1.20:8787/healthz</code>(あなたのアドレスに置き換え)を開きます。"
+ "次の 1 行が表示されれば、ネットワークはつながっています。",
+ "check_label": "ブラウザーで http://192.168.1.20:8787/healthz を開くと、サーバーの状態 ok とバージョンが表示される",
+ "check_after": "開けない場合は、下の<a href=\"#faq\">よくある質問</a>をご覧ください。",
+
+ "clients_h2": "各コンピューターにアドレスを入力",
+ "clients_steps": [
+ ("設定を開く", "各コンピューターで CopySync を開き、「設定」に進みます。サーバーを動かしているコンピューターも同じです。"),
+ ("アドレスを入力", "「シグナリングサーバー」に <code>ws://192.168.1.20:8787/signal</code>(あなたのアドレス)を入力し、Return か Enter を押します。"),
+ ("状態を確認", "「接続状態」が緑の「接続済み」になれば完了です。「デバイス」でペアリングすれば、コピーが同期されるようになります。"),
+ ],
+ "clients_alt": "CopySync の設定画面:シグナリングサーバーは ws://192.168.1.20:8787/signal、接続状態は接続済み",
+ "clients_after": 'アプリがまだなら、トップページの<a href="{home}#install">インストール</a>をご覧ください。',
+
+ "faq_h2": "よくある質問",
+ "faq": [
+ ("接続状態が「未接続」のまま", [
+ "まずアドレスを確認します。<code>ws://</code> で始まり、ポートは 8787、末尾は <code>/signal</code>、入力後に Return を押しているか。",
+ "次に、そのコンピューターのブラウザーで <code>http://サーバーのアドレス:8787/healthz</code> を開きます。開けなければネットワークの経路の問題です。"
+ "サーバーが動いていない、そのコンピューターがスリープしている、ファイアウォールに止められている、アドレスが変わった、のいずれかです。",
+ "Windows のスクリプトはファイアウォールを設定済みです。Mac でファイアウォールがオンなら、スクリプトの最後に表示されたコマンドを実行してください。Linux の ufw、firewalld も同様です。",
+ ]),
+ ("デバイスが「直接」ではなく「中継」になる", [
+ "LAN 内ではほとんどの場合直接つながります。中継になるのは 2 台のあいだで UDP が通らないからで、ゲストネットワーク、Wi‑Fi の AP アイソレーション、"
+ "ファイアウォールを挟んだ別のサブネットなどが原因です。中継でも内容は暗号化されたままで、速度がサーバー側のネットワークに左右されるだけです。",
+ ]),
+ ("サーバーのアドレスが変わった", [
+ "新しいアドレスを付けてスクリプトをもう一度実行します。Windows は <code>install.cmd 新しいアドレス</code>、Mac は <code>./install.sh 新しいアドレス</code>。"
+ "Linux では <code>/etc/copysync/server.env</code> の <code>-turn-ip</code> を書き換えてサービスを再起動します。そのあと各コンピューターのアドレスも変更してください。",
+ "ルーターでアドレスを固定しておけば、こうしたことは起きません。",
+ ]),
+ ("LAN の外でも同期できますか?", [
+ "できません。サーバーには LAN の中からしか届かないためです。どこでも使いたい場合は、グローバル IP を持つマシンにサーバーを置くか(トップページの「インストール」)、"
+ "Tailscale や ZeroTier などでデバイスを同じ仮想ネットワークに参加させ、その中でのサーバーのアドレスを入力します。",
+ ]),
+ ("中国本土のクラウドサーバーで、ドメインではつながらず IP ならつながる", [
+ "ICP 登録(备案)のないドメインへの平文 HTTP リクエストは、中国本土のクラウド事業者に横取りされ、ブロックページへのリダイレクトが返されます。"
+ "テストでは 8787 のような一般的でないポートでも同じでした。WebSocket のハンドシェイクも HTTP リクエストなので同じく止められ、アプリは未接続になります。",
+ "アドレスには <code>ws://サーバーのIP:8787/signal</code> のように IP を直接入力するか、ドメインを登録してください。",
+ ]),
+ ("サーバーを動かすコンピューターでも CopySync を使う場合のアドレスは?", [
+ "同じ LAN のアドレスで大丈夫です。<code>ws://127.0.0.1:8787/signal</code> でもかまいません。サーバーとアプリは互いに影響しません。",
+ ]),
+ ],
+
+ "closing": "電源を入れたままの<br>コンピューターが 1 台あれば十分。",
+ "source": "サーバーの詳しい構築手順(グローバル IP、Docker を含む、英語・中国語)",
+ },
+
"ld_description": "Mac と Windows のコンピューター間でクリップボードとファイルを同期するオープンソースのアプリ。テキスト、画像、ファイル、フォルダを一台でコピーし、もう一台で貼り付けられる。"
"デバイス間は WebRTC で直接つながり DTLS でエンドツーエンド暗号化、つながらないときはユーザーが用意したサーバーの TURN で中継する。",
"ld_os": "macOS 13 以降(Intel と Apple シリコン)、Windows 10、Windows 11(x64)",
diff --git a/tools/site/content/zh.py b/tools/site/content/zh.py
index 24800a4..1162f7b 100644
--- a/tools/site/content/zh.py
+++ b/tools/site/content/zh.py
@@ -16,6 +16,7 @@ C = {
"nav_how": "工作原理",
"nav_install": "安装",
"nav_faq": "常见问题",
+ "nav_server": "部署服务器",
"lang_label": "语言",
"h1": "在这台电脑复制,<br>到那台电脑粘贴。",
@@ -23,7 +24,7 @@ C = {
"数据在你的设备之间直接传输,经过你自己的服务器时也是加密的。",
"dl_mac": "下载 Mac 版",
"dl_win": "下载 Windows 版",
- "dl_note": "版本 1.3.2,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。",
+ "dl_note": "版本 1.3.3,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。",
"stage_label": "演示:在 MacBook 上按下 Command C,文件化作一张纸,经直连飞到 Windows 笔记本,在那里按下 Ctrl V 粘贴出来",
"stage_file": "季度汇报-终版.pptx",
"stage_win": "Windows 笔记本",
@@ -137,7 +138,7 @@ C = {
],
"install_h2": "安装",
- "install_intro": "每台电脑装一个 App,再准备一台两边都能访问到的服务器。两台电脑在同一个局域网的话,服务器直接跑在其中一台 Mac 上就行。",
+ "install_intro": "每台电脑装一个 App,再准备一台两边都能访问到的服务器。两台电脑在同一个局域网的话,服务器放在其中一台 Windows、Mac 或 Linux 电脑上就行,见<a href=\"server/\">局域网部署教程</a>。",
"mac_steps": [
"下载 CopySync.dmg,打开后把 CopySync 拖进「应用程序」。",
"从「应用程序」里打开。<span class=\"aside\">第一次会提示「无法验证开发者」:CopySync 还没有经过 Apple 公证。"
@@ -153,7 +154,7 @@ C = {
"在「设置」里填入服务器地址,按回车。防火墙询问时选择允许。",
],
"server_h3": "服务器",
- "server_intro": "任意 Linux,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。",
+ "server_intro": "跨公网使用时,一台有公网 IP 的 Linux 服务器,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。",
"copy": "复制",
"copied": "已复制",
"public_ip": "你的公网IP",
@@ -161,15 +162,16 @@ C = {
"ports_cols": ["端口", "用途"],
"ports": [("8787/tcp", "信令"), ("3478/udp", "STUN 与 TURN"), ("32768–60999/udp", "中转端口")],
"server_docker": f'也可以用 Docker 部署,见<a href="{REPO}/blob/main/server/deploy/README.md">服务器部署说明</a>。',
+ "server_guide": "局域网部署教程",
"pairing": "<strong>配对:</strong>一台点「设备 → 添加设备」生成 6 位配对码,另一台输入它;两块屏幕上的两行安全指纹完全一致后确认。"
"Mac 与 Windows 之间、两台 Windows 之间都一样。",
"specs_h2": "技术规格",
"specs": [
- ("版本", '1.3.2,<time datetime="2026-10-10">2026 年 10 月 10 日</time>发布'),
+ ("版本", '1.3.3,<time datetime="2026-10-11">2026 年 10 月 11 日</time>发布'),
("Mac 客户端", "macOS 13 Ventura 及以上;Intel 与 Apple 芯片通用,不需要 Rosetta;安装包约 47 MB"),
("Windows 客户端", "Windows 10(21H2 及以上)与 Windows 11,x64;按用户安装,不需要管理员权限;安装包约 23 MB"),
- ("服务器", "Linux x86_64 或 ARM64(systemd 或 Docker),也可以运行在 macOS 上;约 15 MB 内存"),
+ ("服务器", "Linux x86_64 或 ARM64(systemd 或 Docker)、macOS(Intel 与 Apple 芯片)、Windows 10 与 11 x64(系统服务);约 15 MB 内存"),
("界面语言", "简体中文、English、日本語,默认跟随系统,可在设置里切换"),
("同步的内容", "纯文本、带格式的文本、图片与截图、文件、文件夹,可以按类型关闭"),
("传输", "WebRTC 数据通道,直连优先,打不通时经 TURN 中转;多出口网络逐个探测每个出口;文件以 tar + zstd 流式打包"),
@@ -201,7 +203,7 @@ C = {
"实测公司 4 个出口与家用宽带之间可以直连。对端是端口随机分配的 NAT 时仍会走中转。",
]),
("必须自己准备服务器吗?", [
- "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;"
+ "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台常开的 Windows、Mac 或 Linux 电脑上运行服务器即可,见<a href=\"server/\">局域网部署教程</a>;"
"跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。",
]),
("支持 Windows 吗?iPhone 呢?", [
@@ -233,6 +235,174 @@ C = {
("反馈问题", f"{REPO}/issues"),
],
+ # ── 「在局域网里部署服务器」教程(server/ 页面) ──
+ "guide": {
+ "title": "在局域网里部署 CopySync 服务器:Windows、Mac、Linux 教程",
+ "description": "两台电脑在同一个网络里时,不需要云服务器:在一台常开的 Windows、Mac 或 Linux 电脑上运行 CopySync 的信令与 TURN 服务器,"
+ "下载后运行一个脚本即可,开机自动运行。附客户端设置与排错。",
+ "h1": "在局域网里部署服务器",
+ "lede": "家里或办公室的电脑在同一个网络里,就不需要云服务器。找一台常开的电脑,下载、运行一个脚本,"
+ "再把它显示的地址填进每台电脑的 CopySync 里。",
+ "toc": [("prepare", "准备"), ("install", "安装服务器"), ("check", "检查"), ("clients", "填地址"), ("faq", "常见问题")],
+
+ "overview_h2": "服务器只负责牵线",
+ "overview_intro": "每台电脑一直连着服务器,靠它找到对方、交换连接信息。连上之后,复制的内容在两台电脑之间直接传输;"
+ "只有直连打不通时,才经过它中转,内容依然加密。",
+ "diagram": {
+ "title": "局域网里的 CopySync",
+ "desc": "同一个局域网里,Mac 与 Windows 电脑通过信令连接到地址为 192.168.1.20 的服务器,复制的内容在两台电脑之间直连传输;"
+ "直连不通时经服务器的 TURN 中转。",
+ "lan": "局域网:同一个 Wi‑Fi 或有线网络",
+ "server": "服务器",
+ "sig_note": "信令 TCP 8787",
+ "relay_note": "中转 UDP 3478,直连不通时",
+ "client": "装着 CopySync",
+ "direct": "直连,端到端加密",
+ "direct_note": "复制的内容只在两台电脑之间传输",
+ "legend_direct": "数据(直连)",
+ "legend_relay": "数据(中转,备用)",
+ "legend_sig": "信令",
+ },
+ "overview_points": [
+ "<strong>信令,TCP 8787。</strong>每台电脑一直连着它,用来发现对方、配对、交换连接信息。",
+ "<strong>直连。</strong>在同一个局域网里,内容几乎总是在两台电脑之间直接传输,速度就是局域网的速度。",
+ "<strong>中转,UDP 3478。</strong>访客网络、开了 AP 隔离的 Wi‑Fi、不同网段之间互相访问不到时才会用到。",
+ ],
+
+ "prep_h2": "开始之前",
+ "prep": [
+ ("一台常开的电脑", "Windows 10、11,macOS 13 及以上,或者任意 Linux 都行,两台电脑中的一台也可以。"
+ "它关机或睡眠时同步会暂停,醒来后自动恢复。NAS、软路由、Mac mini 这类一直开着的设备最合适,内存只占约 15 MB。"),
+ ("一个固定的地址", "在路由器的「DHCP 静态分配」(也叫「地址保留」「IP 与 MAC 绑定」)里给这台电脑固定一个地址。"
+ "不然路由器换了地址,每台电脑都要重新填。"),
+ ("在同一个网络里", "设备连同一个 Wi‑Fi 或有线网络就行。访客网络、开了「AP 隔离」的 Wi‑Fi 不让设备互相访问,需要换个网络或关掉隔离。"),
+ ("离开这个网络就不同步", "服务器只在局域网里访问得到,笔记本带出门后,回来才会继续同步。想在任何地方都能同步,"
+ "需要一台有公网 IP 的服务器,见首页的「安装」。"),
+ ],
+
+ "install_h2": "安装服务器",
+ "install_intro": "选服务器所在电脑的系统。安装脚本会自动找到本机的局域网地址,把服务器设成开机自动运行,最后显示客户端要填的地址。",
+ "os_label": "服务器所在电脑的系统",
+ "manage_caption": "以后会用到的",
+ "win": {
+ "steps": [
+ f'下载 <a href="{REPO}/releases/latest/download/copysync-server-windows-amd64.zip">copysync-server-windows-amd64.zip</a>,'
+ "右键选「全部解压缩」。",
+ "打开解压出的文件夹,双击 <code>install.cmd</code>。"
+ "<span class=\"aside\">提示「Windows 已保护你的电脑」时,点「更多信息」,再点「仍要运行」;弹出用户账户控制时点「是」。"
+ "服务器还没有代码签名,所以会这样问一次。</span>",
+ "安装在新打开的窗口里进行。最后显示的 <code>ws://…/signal</code> 就是客户端要填的地址。",
+ ],
+ "download": "下载 Windows 版服务器",
+ "notes": [
+ "<strong>作为 Windows 服务运行:</strong>开机就启动,不用登录,也没有窗口。在「服务」里叫 CopySync Server。",
+ "<strong>防火墙已经放行:</strong>脚本添加了一条只针对 copysync-server.exe 的入站规则,不用自己开端口。",
+ "<strong>地址认错了</strong>(比如装了虚拟机或 VPN,有好几块网卡):在解压出的文件夹的地址栏里输入 <code>cmd</code> 回车,"
+ "运行 <code>install.cmd 192.168.1.20</code>,换成你的地址。",
+ "支持 Windows 10、11,x64。",
+ ],
+ "double_click": "双击",
+ "explorer_label": "解压出的文件夹里有 copysync-server.exe、install.cmd、install.ps1、README.md、uninstall.cmd,双击其中的 install.cmd",
+ "term_title": "管理员: Windows PowerShell",
+ "term_label": "install.cmd 运行完的窗口:依次停止旧版本、安装、注册服务、放行防火墙、启动,最后显示客户端要填的地址 ws://192.168.1.20:8787/signal",
+ "manage": [
+ ("状态", "管理员 PowerShell 里运行 <code>Get-Service CopySyncServer</code>,或者在「服务」里找 CopySync Server"),
+ ("日志", "<code>C:\\ProgramData\\CopySync Server\\server.log</code>"),
+ ("重启", "管理员 PowerShell 里运行 <code>Restart-Service CopySyncServer</code>"),
+ ("升级", "下载新版本,解压后再双击 <code>install.cmd</code>,原来的设置保留"),
+ ("卸载", "双击 <code>uninstall.cmd</code>,服务、防火墙规则和文件一并删除"),
+ ],
+ },
+ "mac": {
+ "steps": [
+ "打开「终端」,逐行运行:",
+ "最后显示的 <code>ws://…/signal</code> 就是客户端要填的地址。",
+ ],
+ "notes": [
+ "<strong>不需要管理员权限。</strong>登录这台 Mac 后自动在后台运行,意外退出会被系统重新拉起。",
+ "<strong>这台 Mac 不能睡眠:</strong>在「系统设置 → 能耗」(笔记本在「电池 → 选项」)里打开防止自动进入睡眠的选项。",
+ "<strong>开着系统防火墙的话,</strong>脚本最后会给出放行 copysync-server 的命令。",
+ "Intel 与 Apple 芯片通用,macOS 13 及以上。",
+ ],
+ "term_label": "在终端里运行 ./install.sh 的输出:安装、写入 LaunchAgent、启动,最后显示客户端要填的地址 ws://192.168.1.20:8787/signal",
+ "manage": [
+ ("日志", "<code>~/Library/Logs/CopySync/server.log</code>"),
+ ("重启", "<code>launchctl kickstart -k gui/$(id -u)/com.copysync.server</code>"),
+ ("升级", "下载新版本,解压后再运行 <code>./install.sh</code>,原来的设置保留"),
+ ("卸载", "<code>./install.sh uninstall</code>"),
+ ],
+ },
+ "linux": {
+ "steps": [
+ "在这台机器上(或者 ssh 登录后)逐行运行:<span class=\"aside\">ARM 设备,比如装了 64 位系统的树莓派,把 <code>amd64</code> 换成 <code>arm64</code>。</span>",
+ "最后显示的 <code>ws://…/signal</code> 就是客户端要填的地址。",
+ ],
+ "notes": [
+ "<strong>注册为 systemd 服务,</strong>开机自动运行。需要 root。",
+ "<strong>开着 ufw 或 firewalld 的话,</strong>脚本最后会给出放行端口的命令。",
+ "<strong>也可以用 Docker:</strong>把 <code>env.example</code> 复制为 <code>.env</code>,<code>TURN_IP</code> 填这台机器的局域网地址,"
+ "再运行 <code>docker compose up -d</code>。必须用 host 网络,所以只适用于 Linux。",
+ ],
+ "term_label": "运行 sudo ./install.sh 的输出:安装、写入 systemd 单元、生成配置、启动,最后显示客户端要填的地址 ws://192.168.1.20:8787/signal",
+ "manage": [
+ ("状态", "<code>systemctl status copysync-server</code>"),
+ ("日志", "<code>journalctl -u copysync-server -f</code>"),
+ ("重启", "<code>sudo systemctl restart copysync-server</code>"),
+ ("配置", "<code>/etc/copysync/server.env</code>,改完重启服务"),
+ ("升级", "下载新版本,解压后再运行 <code>sudo ./install.sh</code>,原来的配置保留"),
+ ("卸载", "<code>sudo ./install.sh uninstall</code>"),
+ ],
+ },
+
+ "check_h2": "检查其他电脑能不能访问到它",
+ "check_intro": "在另一台电脑的浏览器里打开 <code>http://192.168.1.20:8787/healthz</code>(换成你的地址),看到下面这一行,网络就是通的。",
+ "check_label": "浏览器打开 http://192.168.1.20:8787/healthz,页面显示服务器的状态 ok 与版本号",
+ "check_after": "打不开的话,看下面的<a href=\"#faq\">常见问题</a>。",
+
+ "clients_h2": "在每台电脑上填地址",
+ "clients_steps": [
+ ("打开设置", "在每台电脑上打开 CopySync,进入「设置」。服务器所在的那台电脑也一样。"),
+ ("填入地址", "在「信令服务器地址」里填 <code>ws://192.168.1.20:8787/signal</code>(换成你的地址),按回车保存。"),
+ ("看连接状态", "「连接状态」变成绿色的「已连接」就好了。接着在「设备」里配对,之后复制就会同步。"),
+ ],
+ "clients_alt": "CopySync 的设置页:信令服务器地址填着 ws://192.168.1.20:8787/signal,连接状态显示已连接",
+ "clients_after": '还没装 App?见首页的<a href="{home}#install">安装</a>。',
+
+ "faq_h2": "常见问题",
+ "faq": [
+ ("连接状态一直是「未连接」?", [
+ "先核对地址:以 <code>ws://</code> 开头,端口是 8787,以 <code>/signal</code> 结尾,填完按过回车。",
+ "再在这台电脑的浏览器里打开 <code>http://服务器地址:8787/healthz</code>。打不开,说明到服务器的网络不通:"
+ "服务器没在运行、那台电脑睡眠了、被防火墙拦住了,或者它的地址变了。",
+ "Windows 的安装脚本已经放行了防火墙;Mac 开着系统防火墙时,运行安装脚本最后给出的放行命令;Linux 上的 ufw、firewalld 也一样。",
+ ]),
+ ("设备之间显示「中转」,不是「直连」?", [
+ "同一个局域网里一般都是直连。显示中转,说明两台电脑之间的 UDP 不通,常见于访客网络、开了 AP 隔离的 Wi‑Fi,"
+ "或者两台电脑在不同网段、中间有防火墙。中转经过服务器,内容同样加密,只是速度受那台电脑的网络限制。",
+ ]),
+ ("服务器的地址变了怎么办?", [
+ "带上新地址再运行一次安装脚本:Windows 上是 <code>install.cmd 新地址</code>,Mac 上是 <code>./install.sh 新地址</code>;"
+ "Linux 上编辑 <code>/etc/copysync/server.env</code> 里的 <code>-turn-ip</code>,再重启服务。然后在每台电脑上改掉服务器地址。",
+ "在路由器里给它固定一个地址,就不会再遇到这件事。",
+ ]),
+ ("离开局域网以后还能同步吗?", [
+ "不能,服务器只在局域网里访问得到。要在外面也能用,可以把服务器部署到有公网 IP 的机器上(首页的「安装」里有步骤),"
+ "或者用 Tailscale、ZeroTier 这类组网工具把设备连进同一个虚拟局域网,服务器地址填它在虚拟网里的地址。",
+ ]),
+ ("用国内的云服务器,填域名连不上、填 IP 却能连?", [
+ "域名没有备案时,国内的云厂商会拦截访问它的明文 HTTP 请求,返回一个跳转到拦截页的响应,实测 8787 这样的非常用端口也一样。"
+ "WebSocket 握手也是一个 HTTP 请求,所以同样被拦,客户端就显示未连接。",
+ "服务器地址里直接填 IP 就行,比如 <code>ws://服务器IP:8787/signal</code>;或者给域名备案。",
+ ]),
+ ("服务器所在的那台电脑也要用 CopySync,地址填什么?", [
+ "填同样的局域网地址就行,填 <code>ws://127.0.0.1:8787/signal</code> 也可以。服务器和 App 互不影响。",
+ ]),
+ ],
+
+ "closing": "一台常开的电脑,就够了。",
+ "source": "服务器的完整部署说明(含公网与 Docker)",
+ },
+
"ld_description": "在 Mac 与 Windows 电脑之间同步剪贴板与文件的开源工具。复制文本、图片、文件或文件夹后,另一台电脑可直接粘贴。"
"设备间 WebRTC 直连、DTLS 端到端加密,打不通时经用户自建服务器的 TURN 中转。",
"ld_os": "macOS 13 及以上(Intel 与 Apple 芯片);Windows 10、Windows 11(x64)",
diff --git a/ui/pubspec.yaml b/ui/pubspec.yaml
index e751bf8..074c412 100644
--- a/ui/pubspec.yaml
+++ b/ui/pubspec.yaml
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
-version: 1.3.2+10
+version: 1.3.3+11
environment:
sdk: ^3.12.2
diff --git a/ui/tool/screenshots/screenshots_test.dart b/ui/tool/screenshots/screenshots_test.dart
index c1ec75c..44cd300 100644
--- a/ui/tool/screenshots/screenshots_test.dart
+++ b/ui/tool/screenshots/screenshots_test.dart
@@ -89,7 +89,8 @@ const _mb = 1024 * 1024;
final _quarterly = _t('季度汇报-终版.key', 'Q3 review - final.key', '四半期報告_最終版.key');
AppState _demo({LinkState link = LinkState.online,
- ServiceState? service, Device? pending, bool empty = false}) {
+ ServiceState? service, Device? pending, bool empty = false,
+ String server = 'wss://sync.example.com/signal'}) {
final state = _DemoState();
state.debugSeed(
link: link,
@@ -104,7 +105,7 @@ AppState _demo({LinkState link = LinkState.online,
peersOnline: 2,
),
config: Config(
- signalingUrl: 'wss://sync.example.com/signal',
+ signalingUrl: server,
deviceName: 'MacBook Pro',
autoSyncThresholdBytes: Int64(50 * _mb),
historyTtlSeconds: Int64(3 * 86400),
@@ -312,6 +313,13 @@ void main() {
await _shoot(tester, 'settings', state: _demo(), section: Section.settings);
});
+ // 网站「在局域网里部署服务器」:服务器地址填局域网 IP,已连接
+ testWidgets('settings-lan-dark', (tester) async {
+ await _shoot(tester, 'settings-lan-dark',
+ state: _demo(server: 'ws://192.168.1.20:8787/signal'),
+ section: Section.settings, brightness: Brightness.dark);
+ });
+
// 网站上与文字并排展示的对话框:单独渲染,透明背景,保留对话框自己的圆角与阴影
for (final dark in [false, true]) {
testWidgets(dark ? 'card-verify-dark' : 'card-verify', (tester) async {