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(site): 三种部署方式改为同等地位,由用户自己选;新增公网服务器图文教程

baiyuze04bb69a1bf22
diff --git a/README.md b/README.md
index 2821cf3..d4f5644 100644
--- a/README.md
+++ b/README.md
@@ -65,17 +65,17 @@ With CopySync you pair two computers once. After that, copy on one and paste on
## Get started
-New here? The **[quick start](https://baiyuze.github.io/copysync/en/start/)** walks through it with screenshots. You need **the app on each computer** and **a server both can reach**. It doesn't need a public IP: most people run it on an always-on computer at home.
+New here? The **[quick start](https://baiyuze.github.io/copysync/en/start/)** walks through it with screenshots. You need **the app on each computer** and **a server both can reach**.
-**1. Run the server.** Pick what fits:
+**1. Run the server.** There are three ways; pick the one that fits. Each has a step-by-step guide:
-| Your situation | What to do | Public IP |
-|---|---|:-:|
-| Both computers on one network (home or office) | Run the server on any always-on Windows, Mac or Linux computer there with one install script. **[LAN guide](https://baiyuze.github.io/copysync/en/server/)** | Not needed |
-| One at home, one at the office | Same server at home, plus [Tailscale](https://tailscale.com) on every computer; install the server on its Tailscale address. **[Tailscale guide](https://baiyuze.github.io/copysync/en/tailscale/)** | Not needed |
-| You have a server with a public IP | Linux, as root; see below | Needed |
+| Way | Best for | You need |
+|---|---|---|
+| **[Public server](https://baiyuze.github.io/copysync/en/cloud/)** | Computers on different networks that should sync from anywhere | A Linux VM with a public IP; the smallest is enough |
+| **[LAN](https://baiyuze.github.io/copysync/en/server/)** | All computers on one network (home or office) | One always-on Windows, Mac or Linux computer there |
+| **[LAN + Tailscale](https://baiyuze.github.io/copysync/en/tailscale/)** | Across networks without a public server | An always-on computer, and [Tailscale](https://tailscale.com) on every computer |
-On a server with a public IP:
+On a public server:
```bash
curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
@@ -100,7 +100,7 @@ Open TCP 8787, UDP 3478 and UDP 32768–60999. Docker and all options: [server d
- [How it works](guide/how-it-works.md): architecture, NAT traversal, security model, fallbacks, lessons learned
- [Troubleshooting](guide/troubleshooting.md) and known limitations
-- [Quick start](https://baiyuze.github.io/copysync/en/start/) · [LAN guide](https://baiyuze.github.io/copysync/en/server/) · [Across networks with Tailscale](https://baiyuze.github.io/copysync/en/tailscale/), all with screenshots
+- [Quick start](https://baiyuze.github.io/copysync/en/start/) · [Public server](https://baiyuze.github.io/copysync/en/cloud/) · [LAN](https://baiyuze.github.io/copysync/en/server/) · [LAN + Tailscale](https://baiyuze.github.io/copysync/en/tailscale/), all with screenshots
- [Server deployment](server/deploy/README.md): Windows, macOS, Linux, Docker, Tailscale
- [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)
diff --git a/README.zh-CN.md b/README.zh-CN.md
index de12207..26084f0 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -65,17 +65,17 @@ CopySync 的做法是:两台电脑配对一次,之后在一台上复制,
## 开始使用
-第一次用?跟着**[快速开始](https://baiyuze.github.io/copysync/start/)**一步步来,有截图。需要**每台电脑装一个 App**,再加**一台两端都能访问到的服务器**。服务器不需要公网 IP:大多数人放在家里一台常开的电脑上就行。
+第一次用?跟着**[快速开始](https://baiyuze.github.io/copysync/start/)**一步步来,有截图。需要**每台电脑装一个 App**,再加**一台两端都能访问到的服务器**。
-**1. 部署服务器。**按你的情况选一种:
+**1. 部署服务器。**三种方式,按你的情况选一种,每种都有图文教程:
-| 你的情况 | 做法 | 公网 IP |
-|---|---|:-:|
-| 两台电脑在同一个网络里(家里或办公室) | 服务器放在其中一台常开的 Windows、Mac 或 Linux 电脑上,运行一个安装脚本。**[局域网部署教程](https://baiyuze.github.io/copysync/server/)** | 不需要 |
-| 一台在家,一台在公司 | 服务器照样放在家里,每台电脑装上 [Tailscale](https://tailscale.com),服务器用它的 Tailscale 地址安装。**[Tailscale 教程](https://baiyuze.github.io/copysync/tailscale/)** | 不需要 |
-| 有一台公网服务器 | Linux,需要 root,见下面 | 需要 |
+| 方式 | 适合 | 要准备 |
+|---|---|---|
+| **[公网服务器](https://baiyuze.github.io/copysync/cloud/)** | 电脑分散在不同网络里,想在哪儿都能同步 | 一台有公网 IP 的 Linux 云主机,最低配置就够 |
+| **[局域网](https://baiyuze.github.io/copysync/server/)** | 电脑都在同一个网络里(家里或办公室) | 其中一台常开的 Windows、Mac 或 Linux 电脑 |
+| **[局域网 + Tailscale](https://baiyuze.github.io/copysync/tailscale/)** | 要跨网络,但没有公网服务器 | 一台常开的电脑,每台电脑都装 [Tailscale](https://tailscale.com) |
-有公网 IP 的服务器:
+公网服务器上的安装命令:
```bash
curl -LO https://github.com/baiyuze/copysync/releases/latest/download/copysync-server-linux-amd64.tar.gz
@@ -100,7 +100,7 @@ sudo ./install.sh <服务器公网IP>
- [工作原理](guide/how-it-works.zh-CN.md):架构、NAT 打洞、安全模型、兜底、踩过的坑
- [排障](guide/troubleshooting.zh-CN.md)与已知限制
-- [快速开始](https://baiyuze.github.io/copysync/start/) · [局域网部署](https://baiyuze.github.io/copysync/server/) · [用 Tailscale 跨网络使用](https://baiyuze.github.io/copysync/tailscale/),都是图文教程
+- [快速开始](https://baiyuze.github.io/copysync/start/) · [公网服务器](https://baiyuze.github.io/copysync/cloud/) · [局域网](https://baiyuze.github.io/copysync/server/) · [局域网 + Tailscale](https://baiyuze.github.io/copysync/tailscale/),都是图文教程
- [服务器部署说明](server/deploy/README.md):Windows、macOS、Linux、Docker、Tailscale
- [从源码构建](guide/building.zh-CN.md)
- 技术方案:[多出口网络的 NAT 打洞](design/nat-traversal.md)、[Windows 客户端](design/windows-client.md)
diff --git a/docs/assets/screenshots/en/settings-cloud-dark.png b/docs/assets/screenshots/en/settings-cloud-dark.png
new file mode 100644
index 0000000..3af6859
Binary files /dev/null and b/docs/assets/screenshots/en/settings-cloud-dark.png differ
diff --git a/docs/assets/screenshots/ja/settings-cloud-dark.png b/docs/assets/screenshots/ja/settings-cloud-dark.png
new file mode 100644
index 0000000..9d584fc
Binary files /dev/null and b/docs/assets/screenshots/ja/settings-cloud-dark.png differ
diff --git a/docs/assets/screenshots/settings-cloud-dark.png b/docs/assets/screenshots/settings-cloud-dark.png
new file mode 100644
index 0000000..dc5490e
Binary files /dev/null and b/docs/assets/screenshots/settings-cloud-dark.png differ
diff --git a/docs/assets/site.css b/docs/assets/site.css
index 6230fbe..b66c396 100644
--- a/docs/assets/site.css
+++ b/docs/assets/site.css
@@ -1114,32 +1114,30 @@ td {
margin-top: 1.5rem;
}
-/* 服务器一栏:先是不需要公网 IP 的两种做法,再是云服务器 */
-.install .stack {
- display: flex;
- flex-wrap: wrap;
- gap: 0.6rem;
- margin-top: 1rem;
+/* 服务器一栏:三种部署方式并列,各一行说明 */
+.install .opts {
+ display: grid;
+ gap: 0.9rem;
+ margin: 1.1rem 0 0;
+ padding: 0;
+ list-style: none;
+ font-size: 0.95rem;
}
-.install .stack .button {
- margin-top: 0;
- min-height: 2.6rem;
- padding: 0 1.1rem;
- font-size: 0.92rem;
+.install .opts li {
+ padding-left: 0.9rem;
+ border-left: 2px solid var(--rule-strong);
}
-.install h4 {
- margin: 2rem 0 0;
- padding-top: 1.5rem;
- border-top: 1px solid var(--rule);
- font-size: 1rem;
- font-weight: 650;
- scroll-margin-top: 5rem;
+.install .opts a {
+ display: block;
+ font-weight: 600;
}
-.install h4 + .small {
- margin-top: 0.4rem;
+.install .opts span {
+ display: block;
+ color: var(--dim);
+ font-size: 0.88rem;
}
.install table {
@@ -1975,7 +1973,7 @@ td {
}
}
-/* ── 三种部署方式的卡片:首页与快速开始共用 ── */
+/* ── 三种部署方式:首页的卡片、快速开始里的分页 ── */
.paths {
display: grid;
@@ -2017,24 +2015,7 @@ td {
overflow: visible;
}
-.path-tag {
- align-self: flex-start;
- padding: 0.1rem 0.6rem;
- border-radius: 999px;
- background: var(--blue-wash);
- color: var(--blue-hi);
- font-size: 0.75rem;
- font-weight: 600;
-}
-
-/* 需要公网 IP 的那一种不用蓝色,免得三个看起来一样推荐 */
-.path:last-child .path-tag {
- background: var(--surface-2);
- color: var(--dim);
-}
-
.path-when {
- margin-top: 0.9rem;
color: var(--dim);
font-size: 0.85rem;
}
@@ -2074,12 +2055,13 @@ td {
stroke-dasharray: 4 4;
}
+/* Tailscale 的虚拟局域网:和网络边界同色,用点线区分 */
.p-ts {
- fill: var(--blue-wash);
- stroke: var(--blue);
+ fill: none;
+ stroke: var(--dim);
stroke-width: 1.5;
- stroke-dasharray: 6 5;
- opacity: 0.85;
+ stroke-dasharray: 1.5 4;
+ stroke-linecap: round;
}
.p-sig {
@@ -2109,14 +2091,6 @@ td {
letter-spacing: 0.02em;
}
-/* 首屏引言下面的一句提示 */
-.hero-aside {
- margin: 1.1rem auto 0;
- max-width: var(--text);
- color: var(--ink-2);
- font-size: 0.98rem;
-}
-
.qs-grid {
margin: clamp(2.5rem, 6vw, 4rem) auto 0;
max-width: 70rem;
@@ -2170,53 +2144,6 @@ td {
margin: 0;
}
-/* 局域网教程末尾:离开家也想同步,引到 Tailscale 教程 */
-.callout {
- display: grid;
- gap: 1.75rem;
- align-items: center;
- max-width: 60rem;
- margin: 0 auto;
- padding: clamp(1.75rem, 4vw, 2.75rem);
- border-radius: 22px;
- background: var(--surface);
- box-shadow: inset 0 0 0 1px var(--rule);
-}
-
-.callout svg {
- display: block;
- width: 100%;
- max-width: 16rem;
- height: auto;
- margin: 0 auto;
- overflow: visible;
-}
-
-.callout h2 {
- margin: 0;
- font-family: var(--display);
- font-size: clamp(1.5rem, 3.4vw, 2rem);
- line-height: 1.2;
- letter-spacing: -0.01em;
-}
-
-.callout p {
- margin: 0.75rem 0 0;
- color: var(--dim);
- text-wrap: pretty;
-}
-
-.callout .button {
- margin-top: 1.4rem;
-}
-
-@media (min-width: 52rem) {
- .callout {
- grid-template-columns: 15rem minmax(0, 1fr);
- gap: 2.75rem;
- }
-}
-
/* Tailscale 示意图里的虚拟局域网边界 */
.d-ts {
fill: rgba(61, 139, 234, 0.05);
@@ -2231,42 +2158,42 @@ td {
font: 14px var(--sans);
}
-/* Tailscale 管理后台设备列表的示意 */
-.browser.machines {
+/* 表格类网页的示意:Tailscale 的设备列表、云服务器的安全组规则 */
+.browser.listing {
max-width: none;
margin: 0;
}
-.machines table {
+.listing table {
font-size: 0.85rem;
}
-.machines th,
-.machines td {
+.listing th,
+.listing td {
padding: 0.7rem 1rem;
border-bottom-color: #222226;
}
-.machines tbody tr:last-child td {
+.listing tbody tr:last-child td {
border-bottom: 0;
}
-.machines td:nth-child(2) {
+.listing td:nth-child(2) {
font-family: var(--mono);
font-size: 0.8rem;
}
-.machines tr.hl td {
+.listing tr.hl td {
background: var(--blue-wash);
color: var(--ink);
}
-.machines tr.hl td:nth-child(2) {
+.listing tr.hl td:nth-child(2) {
color: var(--blue-hi);
font-weight: 600;
}
-.machines em {
+.listing em {
margin-left: 0.4rem;
padding: 0.05rem 0.45rem;
border-radius: 999px;
@@ -2276,6 +2203,68 @@ td {
font-size: 0.72rem;
}
+/* 快速开始第 2 步:左边步骤,右边一张卡片写适合谁、要准备什么、要注意什么 */
+.plan-grid {
+ display: grid;
+ gap: 2rem;
+}
+
+.plan-grid > * {
+ min-width: 0;
+}
+
+@media (min-width: 62rem) {
+ .plan-grid {
+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
+ gap: 3.5rem;
+ align-items: start;
+ }
+}
+
+.plan-address {
+ margin: 1.6rem 0 0 2.6rem;
+ color: var(--dim);
+ font-size: 0.95rem;
+}
+
+.plan-grid .button {
+ margin: 1.25rem 0 0 2.6rem;
+}
+
+.plan-card {
+ padding: 1.5rem;
+ border-radius: 18px;
+ background: var(--surface);
+ box-shadow: inset 0 0 0 1px var(--rule);
+}
+
+.plan-card svg {
+ display: block;
+ width: 100%;
+ max-width: 14rem;
+ height: auto;
+ margin: 0 auto 1.25rem;
+ overflow: visible;
+}
+
+.plan-card dl {
+ display: grid;
+ gap: 1rem;
+ margin: 0;
+}
+
+.plan-card dt {
+ color: var(--dim);
+ font-size: 0.82rem;
+ font-weight: 600;
+}
+
+.plan-card dd {
+ margin: 0.15rem 0 0;
+ color: var(--ink-2);
+ font-size: 0.93rem;
+}
+
.server-notes {
max-width: 70rem;
margin: 3rem auto 0;
@@ -2318,11 +2307,21 @@ td {
@media (max-width: 34rem) {
.qs-app .button,
- .qs-grid .os-steps > .button {
+ .qs-grid .os-steps > .button,
+ .plan-address,
+ .plan-grid .button {
margin-left: 0;
}
}
+/* 手机上分段控件放不下三个长名字,收紧一点 */
+@media (max-width: 30rem) {
+ .tablist button {
+ padding-inline: 0.75rem;
+ font-size: 0.86rem;
+ }
+}
+
/* ── 404 ── */
.lost {
diff --git a/docs/assets/site.js b/docs/assets/site.js
index 64b1208..25a434a 100644
--- a/docs/assets/site.js
+++ b/docs/assets/site.js
@@ -1,4 +1,5 @@
-// 首屏动画、代码块的「复制」按钮、部署教程的系统分页、记住选过的语言。没有脚本时页面照样完整:动画停在复制完成的样子。
+// 首屏动画、代码块的「复制」按钮、分页(部署教程按系统分页、快速开始按部署方式分页)、记住选过的语言。
+// 没有脚本时页面照样完整:动画停在复制完成的样子,分页的内容依次排开。
(function () {
var stage = document.querySelector("[data-play]");
@@ -72,7 +73,8 @@
});
});
- // 部署教程按系统分页。链接里带了 #windows 之类就打开那一页,否则按访问者的系统;没有脚本时三个系统依次排开
+ // 分页。链接里带了 #windows、#plan-lan 之类就打开那一页;否则按系统分页(data-tabs="os")的按访问者的系统,
+ // 按部署方式分页(data-tabs="plan")的打开第一页
document.querySelectorAll("[data-tabs]").forEach(function (box) {
var list = box.querySelector("[role=tablist]");
var tabs = Array.prototype.slice.call(list.querySelectorAll("[role=tab]"));
@@ -104,7 +106,9 @@
var ids = panels.map(function (p) { return p.id; });
var pick = ids.indexOf(location.hash.slice(1));
var linked = pick >= 0;
- if (!linked) {
+ if (!linked && box.dataset.tabs !== "os") {
+ pick = 0;
+ } else if (!linked) {
var ua = navigator.userAgent;
pick = /Windows/.test(ua) ? 0 : /Macintosh/.test(ua) ? 1 : /Linux|X11/.test(ua) && !/Android/.test(ua) ? 2 : 0;
}
diff --git a/docs/cloud/index.html b/docs/cloud/index.html
new file mode 100644
index 0000000..9aad043
--- /dev/null
+++ b/docs/cloud/index.html
@@ -0,0 +1,302 @@
+<!doctype html>
+<html lang="zh-CN">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>把 CopySync 服务器部署到公网:云服务器图文教程</title>
+ <meta name="description" content="一台有公网 IP 的 Linux 云主机,运行一个脚本就能装好 CopySync 的信令与 TURN 服务器。每台电脑直接连它,在家、在公司、在外面都能同步剪贴板。含安全组放行、检查、客户端设置与国内域名备案的说明。">
+ <link rel="canonical" href="https://baiyuze.github.io/copysync/cloud/">
+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/cloud/">
+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/cloud/">
+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/cloud/">
+ <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 服务器部署到公网:云服务器图文教程">
+ <meta property="og:description" content="一台有公网 IP 的 Linux 云主机,运行一个脚本就能装好 CopySync 的信令与 TURN 服务器。每台电脑直接连它,在家、在公司、在外面都能同步剪贴板。含安全组放行、检查、客户端设置与国内域名备案的说明。">
+ <meta property="og:url" content="https://baiyuze.github.io/copysync/cloud/">
+ <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 href="../start/">快速开始</a>
+ <a class="wide" href=".././#how">工作原理</a>
+ <a class="wide" href=".././#faq">常见问题</a>
+ <a href="../start/#server" aria-current="true">部署服务器</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../en/cloud/" hreflang="en" lang="en" data-lang="en">English</a>
+ <a href="../ja/cloud/" 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> / <a href="../start/#server">部署服务器</a></p>
+ <h1 class="display">部署到公网服务器</h1>
+ <p class="lede">一台有公网 IP 的 Linux 云主机,最低配置就够。每台电脑直接连它,在家、在公司、在外面都能同步,不用另装软件。</p>
+ <ol class="guide-toc">
+ <li><a href="#prepare">准备</a></li>
+ <li><a href="#ports">放行端口</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 460" role="img" aria-labelledby="cloud-title cloud-desc">
+ <title id="cloud-title">通过公网服务器使用 CopySync</title>
+ <desc id="cloud-desc">公网服务器的地址是 203.0.113.10。Mac 在公司网络里,Windows 在家里的网络里,两台电脑都通过信令连接到服务器;复制的内容在两台电脑之间直连传输,打不通直连时经服务器中转。</desc>
+ <rect class="d-box" x="340" y="24" width="280" height="118" rx="14"/>
+ <text class="d-title" x="480" y="62" text-anchor="middle">公网服务器</text>
+ <text class="d-sub" x="480" y="90" text-anchor="middle">云主机,有公网 IP</text>
+ <text class="d-ip" x="480" y="124" text-anchor="middle">203.0.113.10</text>
+ <rect class="d-lan" x="8" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="32" y="228">公司网络</text>
+ <rect class="d-lan" x="540" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="564" y="228">家里的网络</text>
+ <path class="d-sig" d="M150 250V68H340"/>
+ <path class="d-sig" d="M810 250V68H620"/>
+ <path class="d-relay" d="M210 250V112H340"/>
+ <path class="d-relay" d="M750 250V112H620"/>
+ <text class="d-note" x="164" y="58">信令 TCP 8787</text>
+ <text class="d-note" x="224" y="170">中转 UDP,打不通直连时</text>
+ <rect class="d-box" x="60" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="180" y="302" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="180" y="330" text-anchor="middle">装着 CopySync</text>
+ <rect class="d-box" x="660" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="780" y="302" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="780" y="330" text-anchor="middle">装着 CopySync</text>
+ <path class="d-direct" d="M300 316H660"/>
+ <text class="d-label" x="480" y="302" text-anchor="middle">直连</text>
+ <g class="d-legend" transform="translate(40 444)">
+ <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>两台电脑在不同网络里时,靠 NAT 打洞直接相连,大多数家庭和公司网络都能打通。</li>
+ <li><strong>中转,UDP 3478 与中转端口。</strong>打不通直连时经服务器转发,内容依然加密,速度受服务器带宽限制。</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>Linux,x86_64 或 ARM64 都行,最低配置就够,服务器只占约 15 MB 内存。需要 root 权限。</dd></div>
+ <div><dt>一个公网 IP</dt><dd>云主机自带的公网 IP 就行,最好是固定的(弹性 IP)。地址变了,每台电脑都要重新填。</dd></div>
+ <div><dt>能登录它</dt><dd>能用 ssh 登录,或者用云厂商网页上的远程终端。</dd></div>
+ <div><dt>国内的云主机</dt><dd>域名没有备案时,客户端里要直接填 IP,不能填域名,原因见下面的<a href="#faq">常见问题</a>。</dd></div>
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="ports" aria-labelledby="ports-title">
+ <div class="wrap">
+ <p class="eyebrow">第 1 步</p>
+ <h2 id="ports-title">在安全组里放行端口</h2>
+ <p class="intro">在云厂商的控制台里,给这台云主机的安全组添加下面三条入站规则。</p>
+ <div class="os-grid qs-grid">
+ <div class="os-figures">
+ <figure class="browser listing" role="img" aria-label="云服务器安全组的入站规则(示意):TCP 8787 信令,UDP 3478 用于 STUN 与 TURN,UDP 32768-60999 是中转端口,来源都是 0.0.0.0/0">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">云服务器控制台 › 安全组 › 入站规则</span></div>
+ <table>
+ <thead><tr><th scope="col">协议</th><th scope="col">端口范围</th><th scope="col">来源</th><th scope="col">用途</th></tr></thead>
+ <tbody>
+ <tr><td>TCP</td><td>8787</td><td>0.0.0.0/0</td><td>信令</td></tr>
+ <tr><td>UDP</td><td>3478</td><td>0.0.0.0/0</td><td>STUN 与 TURN</td></tr>
+ <tr><td>UDP</td><td>32768-60999</td><td>0.0.0.0/0</td><td>中转端口</td></tr>
+ </tbody>
+ </table>
+ </figure>
+ </div>
+ <ul class="points">
+ <li><strong>叫法不一样:</strong>有的云厂商叫「防火墙」或「网络 ACL」,都是这一项。</li>
+ <li><strong>中转端口</strong>由系统随机分配,范围以服务器为准:运行 <code>cat /proc/sys/net/ipv4/ip_local_port_range</code> 查看,安装脚本最后也会打印出来。</li>
+ <li><strong>系统防火墙:</strong>开着 ufw 或 firewalld 的话,这三条也要放行,安装脚本最后会给出命令。</li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <p class="eyebrow">第 2 步</p>
+ <h2 id="install-title">运行安装脚本</h2>
+ <p class="intro">把公网 IP 带给安装脚本,它会装好服务器、注册为开机自启的 systemd 服务,最后显示客户端要填的地址。</p>
+ <div class="os-grid qs-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>用 ssh 登录服务器,比如 <code>ssh [email protected]</code>(换成你的公网 IP)。</li>
+ <li>逐行运行,最后一行换成你的公网 IP:<span class="aside">ARM 服务器把 <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 203.0.113.10</code></pre>
+ </div></li>
+ <li>最后显示的 <code>ws://203.0.113.10:8787/signal</code> 就是客户端要填的地址。</li>
+ </ol>
+ <ul class="points">
+ <li><strong>注册为 systemd 服务,</strong>开机自动运行,配置在 <code>/etc/copysync/server.env</code>。</li>
+ <li><strong>升级:</strong>下载新版本,解压后再运行 <code>sudo ./install.sh</code>,原来的配置保留。</li>
+ <li><strong>也可以用 Docker:</strong>见<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">服务器部署说明</a>。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="运行 sudo ./install.sh 203.0.113.10 的输出:安装、写入 systemd 单元、生成配置、启动,最后显示客户端要填的地址 ws://203.0.113.10: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 [email protected]</span></div>
+<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh 203.0.113.10
+<span class="t-step">▶ 安装二进制到 /usr/local/bin</span>
+<span class="t-step">▶ 写入 systemd 单元</span>
+<span class="t-step">▶ 生成配置 /etc/copysync/server.env(中转地址 203.0.113.10)</span>
+<span class="t-step">▶ 启动</span>
+ ✓ 已启动
+
+安装完成:copysync-server 1.3.3
+在每台电脑的 CopySync「设置 → 信令服务器地址」填:
+
+ <span class="t-url">ws://203.0.113.10: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>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <p class="eyebrow">第 3 步</p>
+ <h2 id="check-title">检查能不能访问到它</h2>
+ <p class="intro">在任意一台电脑的浏览器里打开 <code>http://203.0.113.10:8787/healthz</code>(换成你的公网 IP),看到下面这一行就通了。</p>
+ <figure class="browser" role="img" aria-label="浏览器打开 http://203.0.113.10: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://203.0.113.10: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">
+ <p class="eyebrow">第 4 步</p>
+ <h2 id="clients-title">在每台电脑上填地址</h2>
+ <ol class="flow">
+ <li><h3>打开设置</h3><p>在每台电脑上打开 CopySync,进入「设置」。</p></li>
+ <li><h3>填公网地址</h3><p>在「信令服务器地址」里填 <code>ws://203.0.113.10:8787/signal</code>(换成你的公网 IP),按回车保存。</p></li>
+ <li><h3>看连接状态</h3><p>「连接状态」变成绿色的「已连接」就好了。还没配对的话,在「设备」里配对。</p></li>
+ </ol>
+ <figure class="shot">
+ <img src="../assets/screenshots/settings-cloud-dark.png" width="2112" height="1472" loading="lazy" alt="CopySync 的设置页:信令服务器地址填着 ws://203.0.113.10:8787/signal,连接状态显示已连接">
+ </figure>
+ <p class="note">还没装 App?见<a href="../start/">快速开始</a>。</p>
+ <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>
+ </div>
+ </section>
+
+ <section class="section" id="faq" aria-labelledby="faq-title">
+ <div class="wrap">
+ <h2 id="faq-title">常见问题</h2>
+ <div class="faq">
+ <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>要多大的配置?</summary>
+ <div class="answer"><p>最低配置就够。服务器只占约 15 MB 内存,平时只转发很少的信令消息。复制的内容能直连时不经过它;只有打不通直连、走中转时,速度才受它的出口带宽限制。</p></div>
+ </details>
+ <details>
+ <summary>设备之间显示「中转」,不是「直连」?</summary>
+ <div class="answer"><p>刚连上时显示中转、过一会儿变成直连是正常的:先用中转保证能用,空闲时再换直连。一直是中转,说明两台电脑之间打不通,常见于端口随机分配的 NAT 或严格的防火墙。内容同样加密,只是速度受服务器带宽限制。</p></div>
+ </details>
+ <details>
+ <summary>想用 HTTPS(wss://)?</summary>
+ <div class="answer"><p>可以放在 HTTPS 反向代理后面,客户端填 <code>wss://</code> 开头的地址,代理需要支持 WebSocket 升级。国内的域名需要备案。STUN 与 TURN 走 UDP,不经过反向代理,安全组照样要放行。</p></div>
+ </details>
+ <details>
+ <summary>家里宽带有公网 IP,能当公网服务器用吗?</summary>
+ <div class="answer"><p>可以,但比云主机麻烦:要在路由器上把 TCP 8787、UDP 3478 和一大段中转用的 UDP 端口转发到那台电脑,家里的公网 IP 也可能会变。电脑都在家里时用<a href="../server/">局域网</a>更简单;要跨网络又不想折腾端口转发,可以用<a href="../tailscale/">局域网 + Tailscale</a>。</p></div>
+ </details>
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">一台云主机,<br>在哪儿都能同步。</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="../cloud/" hreflang="zh-CN" lang="zh-CN" data-lang="zh" aria-current="page">简体中文</a>
+ <a href="../en/cloud/" hreflang="en" lang="en" data-lang="en">English</a>
+ <a href="../ja/cloud/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
+ </nav>
+ </div>
+ </footer>
+
+ <script src="../assets/site.js" defer></script>
+ <script type="module" src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "7ee226baf4a949a397c4bfd69a9e7461"}'></script>
+</body>
+</html>
diff --git a/docs/design/nat-traversal.html b/docs/design/nat-traversal.html
index ce23ca6..63656de 100644
--- a/docs/design/nat-traversal.html
+++ b/docs/design/nat-traversal.html
@@ -17,7 +17,7 @@
<a class="brand" href="../" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="页面导航">
<a href="../start/">快速开始</a>
- <a href="../server/">部署服务器</a>
+ <a href="../start/#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>
diff --git a/docs/design/windows-client.html b/docs/design/windows-client.html
index 925f56f..2b31feb 100644
--- a/docs/design/windows-client.html
+++ b/docs/design/windows-client.html
@@ -17,7 +17,7 @@
<a class="brand" href="../" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="页面导航">
<a href="../start/">快速开始</a>
- <a href="../server/">部署服务器</a>
+ <a href="../start/#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>
diff --git a/docs/en/cloud/index.html b/docs/en/cloud/index.html
new file mode 100644
index 0000000..fd53284
--- /dev/null
+++ b/docs/en/cloud/index.html
@@ -0,0 +1,302 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Run the CopySync server on a public server: cloud VM guide</title>
+ <meta name="description" content="One script installs CopySync&#x27;s signaling and TURN server on a Linux VM with a public IP. Every computer connects to it directly, so the clipboard syncs at home, at the office and anywhere else. Covers the security group, checking, app setup and domains in mainland China.">
+ <link rel="canonical" href="https://baiyuze.github.io/copysync/en/cloud/">
+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/cloud/">
+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/cloud/">
+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/cloud/">
+ <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 the CopySync server on a public server: cloud VM guide">
+ <meta property="og:description" content="One script installs CopySync&#x27;s signaling and TURN server on a Linux VM with a public IP. Every computer connects to it directly, so the clipboard syncs at home, at the office and anywhere else. Covers the security group, checking, app setup and domains in mainland China.">
+ <meta property="og:url" content="https://baiyuze.github.io/copysync/en/cloud/">
+ <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 href="../../en/start/">Quick start</a>
+ <a class="wide" href="../../en/#how">How it works</a>
+ <a class="wide" href="../../en/#faq">FAQ</a>
+ <a href="../../en/start/#server" aria-current="true">Self-host</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../../cloud/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../ja/cloud/" 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> / <a href="../../en/start/#server">Self-host</a></p>
+ <h1 class="display">Run it on a public server</h1>
+ <p class="lede">A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly and syncs at home, at the office or anywhere else, with nothing extra to install.</p>
+ <ol class="guide-toc">
+ <li><a href="#prepare">Before you start</a></li>
+ <li><a href="#ports">Open ports</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">Every computer connects to it</h2>
+ <p class="intro">The server is on the public internet, so every computer can reach it from whatever network it's on. What you copy goes directly between the two computers when possible; when that fails, it's relayed through the server, still encrypted.</p>
+ <figure class="diagram">
+ <svg viewBox="0 0 960 460" role="img" aria-labelledby="cloud-title cloud-desc">
+ <title id="cloud-title">CopySync with a public server</title>
+ <desc id="cloud-desc">The public server is at 203.0.113.10. A Mac on an office network and a Windows PC on a home network both connect to it for signaling; copied content goes directly between them, and through the server's relay if that fails.</desc>
+ <rect class="d-box" x="340" y="24" width="280" height="118" rx="14"/>
+ <text class="d-title" x="480" y="62" text-anchor="middle">Public server</text>
+ <text class="d-sub" x="480" y="90" text-anchor="middle">Cloud VM with a public IP</text>
+ <text class="d-ip" x="480" y="124" text-anchor="middle">203.0.113.10</text>
+ <rect class="d-lan" x="8" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="32" y="228">Office network</text>
+ <rect class="d-lan" x="540" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="564" y="228">Home network</text>
+ <path class="d-sig" d="M150 250V68H340"/>
+ <path class="d-sig" d="M810 250V68H620"/>
+ <path class="d-relay" d="M210 250V112H340"/>
+ <path class="d-relay" d="M750 250V112H620"/>
+ <text class="d-note" x="164" y="58">Signaling, TCP 8787</text>
+ <text class="d-note" x="224" y="170">Relay over UDP, if direct fails</text>
+ <rect class="d-box" x="60" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="180" y="302" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="180" y="330" text-anchor="middle">Running CopySync</text>
+ <rect class="d-box" x="660" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="780" y="302" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="780" y="330" text-anchor="middle">Running CopySync</text>
+ <path class="d-direct" d="M300 316H660"/>
+ <text class="d-label" x="480" y="302" text-anchor="middle">Direct</text>
+ <g class="d-legend" transform="translate(40 444)">
+ <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> Computers on different networks connect directly through NAT hole punching, which works on most home and office networks.</li>
+ <li><strong>Relay, UDP 3478 and relay ports.</strong> When a direct path fails, the server forwards the traffic, still encrypted and limited by its bandwidth.</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 cloud VM</dt><dd>Linux on x86_64 or ARM64; the smallest size is enough, as the server uses about 15 MB of RAM. You need root.</dd></div>
+ <div><dt>A public IP</dt><dd>The VM's own public IP works; a static (elastic) one is best. If it changes, every computer has to be updated.</dd></div>
+ <div><dt>A way in</dt><dd>ssh, or the web terminal in your provider's console.</dd></div>
+ <div><dt>VMs in mainland China</dt><dd>Without an ICP filing for the domain, enter the IP in the apps, not the domain; see the <a href="#faq">questions</a>.</dd></div>
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="ports" aria-labelledby="ports-title">
+ <div class="wrap">
+ <p class="eyebrow">Step 1</p>
+ <h2 id="ports-title">Open the ports in the security group</h2>
+ <p class="intro">In your cloud provider's console, add these three inbound rules to the VM's security group.</p>
+ <div class="os-grid qs-grid">
+ <div class="os-figures">
+ <figure class="browser listing" role="img" aria-label="Inbound rules in a cloud security group (illustration): TCP 8787 for signaling, UDP 3478 for STUN and TURN, UDP 32768-60999 for relay ports, all from 0.0.0.0/0">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">Cloud console › Security group › Inbound rules</span></div>
+ <table>
+ <thead><tr><th scope="col">Protocol</th><th scope="col">Port range</th><th scope="col">Source</th><th scope="col">Purpose</th></tr></thead>
+ <tbody>
+ <tr><td>TCP</td><td>8787</td><td>0.0.0.0/0</td><td>Signaling</td></tr>
+ <tr><td>UDP</td><td>3478</td><td>0.0.0.0/0</td><td>STUN and TURN</td></tr>
+ <tr><td>UDP</td><td>32768-60999</td><td>0.0.0.0/0</td><td>Relay ports</td></tr>
+ </tbody>
+ </table>
+ </figure>
+ </div>
+ <ul class="points">
+ <li><strong>Different names:</strong> some providers call it a firewall or a network ACL; it's the same setting.</li>
+ <li><strong>Relay ports</strong> are assigned by the OS; the range depends on the server. Run <code>cat /proc/sys/net/ipv4/ip_local_port_range</code> to see it; the install script prints it too.</li>
+ <li><strong>System firewall:</strong> if ufw or firewalld is active, open the same ports there; the install script prints the commands.</li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <p class="eyebrow">Step 2</p>
+ <h2 id="install-title">Run the install script</h2>
+ <p class="intro">Give the script the public IP. It installs the server, registers a systemd service that starts on boot, and prints the address to enter in the apps.</p>
+ <div class="os-grid qs-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>Log in with ssh, for example <code>ssh [email protected]</code> with your public IP.</li>
+ <li>Run these lines, with your public IP on the last one:<span class="aside">On ARM, 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 203.0.113.10</code></pre>
+ </div></li>
+ <li>The <code>ws://203.0.113.10:8787/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; the config is <code>/etc/copysync/server.env</code>.</li>
+ <li><strong>Upgrade:</strong> download the new version, extract it and run <code>sudo ./install.sh</code> again; your config is kept.</li>
+ <li><strong>Docker works too:</strong> see the <a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">server deployment guide</a>.</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="Output of sudo ./install.sh 203.0.113.10: it installs, writes the systemd unit and config and starts the server, then prints the address ws://203.0.113.10: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 [email protected]</span></div>
+<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh 203.0.113.10
+<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 203.0.113.10)</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://203.0.113.10: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>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <p class="eyebrow">Step 3</p>
+ <h2 id="check-title">Check that it's reachable</h2>
+ <p class="intro">Open <code>http://203.0.113.10:8787/healthz</code> (with your public IP) in a browser on any computer. If you see this line, it works.</p>
+ <figure class="browser" role="img" aria-label="A browser showing http://203.0.113.10: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://203.0.113.10: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">
+ <p class="eyebrow">Step 4</p>
+ <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 and go to Settings.</p></li>
+ <li><h3>Enter the public address</h3><p>Under Signaling server, enter <code>ws://203.0.113.10:8787/signal</code> with your public IP and press Return or Enter.</p></li>
+ <li><h3>Check the status</h3><p>When Connection shows a green Connected, you're set. If you haven't paired yet, pair under Devices.</p></li>
+ </ol>
+ <figure class="shot">
+ <img src="../../assets/screenshots/en/settings-cloud-dark.png" width="2112" height="1472" loading="lazy" alt="CopySync Settings: the signaling server is ws://203.0.113.10:8787/signal and the connection status shows Connected">
+ </figure>
+ <p class="note">Haven't installed the app yet? See the <a href="../../en/start/">quick start</a>.</p>
+ <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>
+ </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>It 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>How big a server do I need?</summary>
+ <div class="answer"><p>The smallest one. The server uses about 15 MB of RAM and normally forwards only a few signaling messages. Content goes directly between computers when possible; only relayed transfers are limited by the server's bandwidth.</p></div>
+ </details>
+ <details>
+ <summary>Devices show Relay instead of Direct</summary>
+ <div class="answer"><p>Relay right after connecting, then Direct a little later, is normal: the relay gets you going and the direct path takes over while idle. Staying on Relay means the two computers can't reach each other directly, usually because of a NAT that randomizes ports or a strict firewall. It's still encrypted, just limited by the server's bandwidth.</p></div>
+ </details>
+ <details>
+ <summary>Can I use HTTPS (wss://)?</summary>
+ <div class="answer"><p>Yes, behind an HTTPS reverse proxy that supports WebSocket upgrades; enter an address starting with <code>wss://</code>. Domains in mainland China need an ICP filing. STUN and TURN use UDP and bypass the proxy, so keep those ports open.</p></div>
+ </details>
+ <details>
+ <summary>My home connection has a public IP. Can I use that?</summary>
+ <div class="answer"><p>Yes, but it's more work than a VM: forward TCP 8787, UDP 3478 and a large range of UDP relay ports to that computer, and a home IP may change. If all your computers are at home, the <a href="../../en/server/">LAN</a> setup is simpler; to sync across networks without port forwarding, see <a href="../../en/tailscale/">LAN + Tailscale</a>.</p></div>
+ </details>
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">One cloud VM,<br>sync from anywhere.</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 Docker and every option</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="../../cloud/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../en/cloud/" hreflang="en" lang="en" data-lang="en" aria-current="page">English</a>
+ <a href="../../ja/cloud/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
+ </nav>
+ </div>
+ </footer>
+
+ <script src="../../assets/site.js" defer></script>
+ <script type="module" src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "7ee226baf4a949a397c4bfd69a9e7461"}'></script>
+</body>
+</html>
diff --git a/docs/en/index.html b/docs/en/index.html
index 8525f48..a8dabd2 100644
--- a/docs/en/index.html
+++ b/docs/en/index.html
@@ -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. But it doesn't need a public IP: an always-on Windows, Mac or Linux computer at home will do; see the LAN guide. Computers on other networks reach it through Tailscale; see the Tailscale guide. If you have a public IP, a cloud server works too, and the smallest VM is enough."
+ "text": "Yes. There is no public server, so nobody's data passes through anyone else's machine. There are three ways to run it: a public server, where the smallest VM is enough and sync works from anywhere; your LAN, on an always-on computer when all your computers share a network; or LAN + Tailscale, across networks without a public server."
}
},
{
@@ -115,7 +115,7 @@
"name": "No public IP at home. Can I sync between home and the office?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "Yes. Run the server on an always-on computer at home, install Tailscale on your home and office computers under the same account, and use the server's Tailscale address. They behave as if they shared a LAN, and what you copy still goes directly between the two computers. See Use it across networks with Tailscale."
+ "text": "Yes, in two ways. With a public server, run CopySync's server there and connect both computers to it; see the public server guide. Without one, run the server on an always-on computer at home, install Tailscale on every computer under the same account, and use the server's Tailscale address; see LAN + Tailscale."
}
},
{
@@ -166,7 +166,7 @@
<a href="start/">Quick start</a>
<a class="wide" href="#how">How it works</a>
<a class="wide" href="#faq">FAQ</a>
- <a href="server/">Self-host</a>
+ <a href="start/#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>
@@ -214,35 +214,32 @@
<section class="section" id="deploy" aria-labelledby="deploy-title">
<div class="wrap">
- <h2 id="deploy-title">No public IP? No problem</h2>
- <p class="intro">Your computers find each other through a server, but it doesn't have to be on the public internet. Most home connections have no public IP, and an always-on computer at home works fine.</p>
+ <h2 id="deploy-title">Where to run the server</h2>
+ <p class="intro">Your computers find each other through a server; nothing you copy is stored on it. There's no public server, so pick one of three ways to run your own.</p>
<div class="paths">
+ <a class="path" href="cloud/">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
+ <span class="path-when">Syncs from anywhere</span>
+ <h3>Public server</h3>
+ <p>A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly, at home, at the office or anywhere else, with nothing extra to install.</p>
+ <span class="path-go">Public server guide →</span>
+ </a>
<a class="path" href="server/">
<svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
- <span class="path-tag">No public IP needed</span>
- <span class="path-when">Both computers on one network</span>
- <h3>On your LAN</h3>
- <p>At home or in the office, on the same Wi‑Fi or wired network. Run the server on one of your always-on Windows, Mac or Linux computers with a single script.</p>
+ <span class="path-when">All computers on one network</span>
+ <h3>LAN</h3>
+ <p>At home or in the office, on the same Wi‑Fi or wired network. Run the server on one of your always-on Windows, Mac or Linux computers with one script. Free.</p>
<span class="path-go">LAN guide →</span>
</a>
<a class="path" href="tailscale/">
<svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <span class="path-tag">No public IP needed</span>
- <span class="path-when">One at home, one at the office</span>
+ <span class="path-when">Across networks, no public server</span>
<h3>LAN + Tailscale</h3>
- <p>The server stays at home. Install Tailscale on each computer and they act as if they shared a LAN, so your laptop keeps syncing wherever you take it.</p>
+ <p>Run the server on an always-on computer at home, then install Tailscale on each computer under the same account. They act as if they shared a LAN.</p>
<span class="path-go">Tailscale guide →</span>
</a>
- <a class="path" href="#cloud">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
- <span class="path-tag">Needs a public IP</span>
- <span class="path-when">You have a public server</span>
- <h3>Cloud server</h3>
- <p>A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly, with nothing else to install.</p>
- <span class="path-go">Setup steps →</span>
- </a>
</div>
- <p class="note">Not sure which? Follow the <a href="start/">quick start</a>.</p>
+ <p class="note">Not sure? The <a href="start/#server">quick start</a> compares all three.</p>
</div>
</section>
@@ -416,7 +413,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. No public IP needed: run the server on an always-on computer at home, use it directly on your LAN, and add Tailscale for computers elsewhere. First time? Follow the <a href="start/">quick start</a>.</p>
+ <p class="intro">Install the app on each computer, and set up a server both of them can reach. First time? Follow the <a href="start/">quick start</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>
@@ -439,30 +436,13 @@
</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"><strong>No public IP needed.</strong> Run the server on an always-on Windows, Mac or Linux computer at home or in the office with one script. Computers on other networks reach it through Tailscale.</p>
- <div class="stack">
- <a class="button" href="server/">LAN setup guide</a>
- <a class="button quiet" href="tailscale/">Across networks with Tailscale</a>
- </div>
- <h4 id="cloud">On a server with a public IP</h4>
- <p class="small">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
-tar xzf copysync-server-linux-amd64.tar.gz
-cd copysync-server-linux-amd64
-sudo ./install.sh YOUR_PUBLIC_IP</code></pre>
- </div>
- <p class="small">The script registers a systemd service that starts on boot and prints the address to enter in the app. Open these ports in your firewall or security group:</p>
- <table>
- <thead><tr><th scope="col">Port</th><th scope="col">Purpose</th></tr></thead>
- <tbody>
- <tr><td>8787/tcp</td><td>Signaling</td></tr>
- <tr><td>3478/udp</td><td>STUN and TURN</td></tr>
- <tr><td>32768–60999/udp</td><td>Relay ports</td></tr>
- </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>
+ <p class="small">Three ways to run it; pick the one that fits. Each has a step-by-step guide:</p>
+ <ul class="opts">
+ <li><a href="cloud/">Public server</a><span>Syncs from anywhere</span></li>
+ <li><a href="server/">LAN</a><span>All computers on one network</span></li>
+ <li><a href="tailscale/">LAN + Tailscale</a><span>Across networks, no public server</span></li>
+ </ul>
+ <a class="button quiet" href="start/#server">Compare the three</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>
@@ -517,11 +497,11 @@ 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. But it doesn't need a public IP: an always-on Windows, Mac or Linux computer at home will do; see the <a href="server/">LAN guide</a>. Computers on other networks reach it through Tailscale; see the <a href="tailscale/">Tailscale guide</a>. If you have a public IP, a cloud server works too, and the smallest 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. There are three ways to run it: a <a href="cloud/">public server</a>, where the smallest VM is enough and sync works from anywhere; your <a href="server/">LAN</a>, on an always-on computer when all your computers share a network; or <a href="tailscale/">LAN + Tailscale</a>, across networks without a public server.</p></div>
</details>
<details>
<summary>No public IP at home. Can I sync between home and the office?</summary>
- <div class="answer"><p>Yes. Run the server on an always-on computer at home, install Tailscale on your home and office computers under the same account, and use the server's Tailscale address. They behave as if they shared a LAN, and what you copy still goes directly between the two computers. See <a href="tailscale/">Use it across networks with Tailscale</a>.</p></div>
+ <div class="answer"><p>Yes, in two ways. With a public server, run CopySync's server there and connect both computers to it; see the <a href="cloud/">public server guide</a>. Without one, run the server on an always-on computer at home, install Tailscale on every computer under the same account, and use the server's Tailscale address; see <a href="tailscale/">LAN + Tailscale</a>.</p></div>
</details>
<details>
<summary>Windows? iPhone?</summary>
diff --git a/docs/en/server/index.html b/docs/en/server/index.html
index eb4e6ac..c1e9e44 100644
--- a/docs/en/server/index.html
+++ b/docs/en/server/index.html
@@ -33,7 +33,7 @@
<a href="../../en/start/">Quick start</a>
<a class="wide" href="../../en/#how">How it works</a>
<a class="wide" href="../../en/#faq">FAQ</a>
- <a href="./" aria-current="page">Self-host</a>
+ <a href="../../en/start/#server" aria-current="true">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>
@@ -44,16 +44,14 @@
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href="../../en/">CopySync</a> / Self-host</p>
+ <p class="crumb"><a href="../../en/">CopySync</a> / <a href="../../en/start/#server">Self-host</a></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>
- <p class="hero-aside">Not on the same network, and no public IP? See <a href="../../en/tailscale/">Use it across networks with Tailscale</a>.</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="#away">Away from home</a></li>
<li><a href="#faq">Questions</a></li>
</ol>
</div>
@@ -109,7 +107,7 @@
<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>Syncing away from it</dt><dd>The server is only reachable on your LAN. To keep a laptop syncing when you take it out, install Tailscale on each computer; no public IP needed. See the <a href="../../en/tailscale/">Tailscale guide</a>.</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.</dd></div>
</dl>
</div>
</section>
@@ -118,7 +116,7 @@
<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="os-tabs" data-tabs="os">
<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>
@@ -334,19 +332,6 @@ Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768
</div>
</section>
- <section class="section" id="away" aria-labelledby="away-title">
- <div class="wrap">
- <div class="callout">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <div>
- <h2 id="away-title">Want to sync away from home?</h2>
- <p>Install Tailscale on each computer and run the server on its Tailscale address. From the office or anywhere else, your computers reach the server at home as if they were on the same LAN. No public IP, no router settings.</p>
- <a class="button" href="../../en/tailscale/">Use it across networks with Tailscale</a>
- </div>
- </div>
- </div>
- </section>
-
<section class="section" id="faq" aria-labelledby="faq-title">
<div class="wrap">
<h2 id="faq-title">Questions</h2>
@@ -365,11 +350,7 @@ Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768
</details>
<details>
<summary>Does it sync away from the LAN?</summary>
- <div class="answer"><p>Yes, with Tailscale: install it on each computer under the same account, install the server with its Tailscale address and enter that address in the apps. No public IP needed. See <a href="../../en/tailscale/">Use it across networks with Tailscale</a>.</p><p>If you have a public IP, you can also run the server in the cloud; see the <a href="../../en/#cloud">steps on the home page</a>.</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>
+ <div class="answer"><p>No, the server is only reachable on your LAN. To sync from other networks, switch to one of the other two ways: a <a href="../../en/cloud/">public server</a>, or <a href="../../en/tailscale/">LAN + Tailscale</a>.</p></div>
</details>
<details>
<summary>The server computer also runs CopySync. Which address?</summary>
diff --git a/docs/en/start/index.html b/docs/en/start/index.html
index 0bfb84c..e9a19a4 100644
--- a/docs/en/start/index.html
+++ b/docs/en/start/index.html
@@ -33,7 +33,7 @@
<a href="./" aria-current="page">Quick start</a>
<a class="wide" href="../../en/#how">How it works</a>
<a class="wide" href="../../en/#faq">FAQ</a>
- <a href="../../en/server/">Self-host</a>
+ <a href="#server">Self-host</a>
<a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="../../start/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../../ja/start/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
@@ -92,34 +92,83 @@
<div class="wrap">
<p class="eyebrow">Step 2</p>
<h2 id="server-title">Set up a server</h2>
- <p class="intro">Your computers find each other through it; nothing you copy is stored there. There's no public server, so pick the option that fits:</p>
- <div class="paths">
- <a class="path" href="../../en/server/">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
- <span class="path-tag">No public IP needed</span>
- <span class="path-when">Both computers on one network</span>
- <h3>On your LAN</h3>
- <p>At home or in the office, on the same Wi‑Fi or wired network. Run the server on one of your always-on Windows, Mac or Linux computers with a single script.</p>
- <span class="path-go">LAN guide →</span>
- </a>
- <a class="path" href="../../en/tailscale/">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <span class="path-tag">No public IP needed</span>
- <span class="path-when">One at home, one at the office</span>
- <h3>LAN + Tailscale</h3>
- <p>The server stays at home. Install Tailscale on each computer and they act as if they shared a LAN, so your laptop keeps syncing wherever you take it.</p>
- <span class="path-go">Tailscale guide →</span>
- </a>
- <a class="path" href="../../en/#cloud">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
- <span class="path-tag">Needs a public IP</span>
- <span class="path-when">You have a public server</span>
- <h3>Cloud server</h3>
- <p>A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly, with nothing else to install.</p>
- <span class="path-go">Setup steps →</span>
- </a>
+ <p class="intro">Your computers find each other through it; nothing you copy is stored there. There's no public server, and there are three ways to run your own. Pick the one that fits.</p>
+ <div class="os-tabs" data-tabs="plan">
+ <div class="tablist" role="tablist" aria-label="Ways to run the server" hidden>
+ <button type="button" role="tab" id="tab-plan-cloud" aria-controls="plan-cloud">Public server</button>
+ <button type="button" role="tab" id="tab-plan-lan" aria-controls="plan-lan">LAN</button>
+ <button type="button" role="tab" id="tab-plan-ts" aria-controls="plan-ts">LAN + Tailscale</button>
+ </div>
+
+ <section class="os" id="plan-cloud" role="tabpanel" aria-labelledby="tab-plan-cloud">
+ <h3 class="os-title">Public server</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>In your cloud provider's security group, open TCP 8787, UDP 3478 and UDP 32768–60999.</li>
+ <li>Log in with ssh, download the install script and run it with the public IP: <code>sudo ./install.sh PUBLIC_IP</code>.</li>
+ <li>Open <code>http://PUBLIC_IP:8787/healthz</code> in a browser; ok means it's running.</li>
+ </ol>
+ <p class="plan-address">Address for every computer: <code>ws://PUBLIC_IP:8787/signal</code></p>
+ <a class="button quiet" href="../../en/cloud/">Public server guide →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
+ <dl>
+ <div><dt>Best for</dt><dd>Computers spread across networks that should sync from anywhere. The simplest way across networks.</dd></div>
+ <div><dt>You need</dt><dd>A Linux VM with a public IP, as root; the smallest one is enough.</dd></div>
+ <div><dt>Keep in mind</dt><dd>The VM costs money. When a direct connection fails, the relay is limited by the server's bandwidth. In mainland China, use the IP unless the domain has an ICP filing.</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
+
+ <section class="os" id="plan-lan" role="tabpanel" aria-labelledby="tab-plan-lan">
+ <h3 class="os-title">LAN</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>Reserve an address for the server computer in your router.</li>
+ <li>Download the server for its system and run the install script: double-click <code>install.cmd</code> on <a href="../../en/server/#windows">Windows</a>, run <code>./install.sh</code> on <a href="../../en/server/#macos">macOS</a> or <a href="../../en/server/#linux">Linux</a>.</li>
+ <li>The script finds the computer's LAN address and prints the address for the apps.</li>
+ </ol>
+ <p class="plan-address">Address for every computer: <code>ws://LAN_ADDRESS:8787/signal</code>, for example <code>ws://192.168.1.20:8787/signal</code></p>
+ <a class="button quiet" href="../../en/server/">LAN guide →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
+ <dl>
+ <div><dt>Best for</dt><dd>Computers on the same Wi‑Fi or wired network, such as at home or in the office.</dd></div>
+ <div><dt>You need</dt><dd>An always-on Windows, Mac or Linux computer; one of the computers you sync is fine.</dd></div>
+ <div><dt>Keep in mind</dt><dd>No sync away from that network; it resumes when you're back. Sync also pauses while the server computer is off or asleep.</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
+
+ <section class="os" id="plan-ts" role="tabpanel" aria-labelledby="tab-plan-ts">
+ <h3 class="os-title">LAN + Tailscale</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>Install Tailscale on each computer and sign in to the same account.</li>
+ <li>On the server computer, run <code>tailscale ip -4</code> and note the address starting with 100.</li>
+ <li>Install the server with that address, as in <code>install.cmd 100.101.102.103</code> or <code>./install.sh 100.101.102.103</code>.</li>
+ </ol>
+ <p class="plan-address">Address for every computer: <code>ws://TAILSCALE_ADDRESS:8787/signal</code></p>
+ <a class="button quiet" href="../../en/tailscale/">Tailscale guide →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
+ <dl>
+ <div><dt>Best for</dt><dd>Computers on different networks, without a public server.</dd></div>
+ <div><dt>You need</dt><dd>An always-on computer for the server, and Tailscale on every computer under one account.</dd></div>
+ <div><dt>Keep in mind</dt><dd>Every computer that runs CopySync needs Tailscale, and the one at home stays on. When Tailscale can't connect peer to peer it relays through DERP servers, which can be slow.</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
</div>
- <p class="note">When it's installed, the script prints an address like <code>ws://192.168.1.20:8787/signal</code>. You'll need it in the next step.</p>
</div>
</section>
diff --git a/docs/en/tailscale/index.html b/docs/en/tailscale/index.html
index 2dbca43..fa0ed27 100644
--- a/docs/en/tailscale/index.html
+++ b/docs/en/tailscale/index.html
@@ -33,7 +33,7 @@
<a href="../../en/start/">Quick start</a>
<a class="wide" href="../../en/#how">How it works</a>
<a class="wide" href="../../en/#faq">FAQ</a>
- <a href="../../en/server/">Self-host</a>
+ <a href="../../en/start/#server" aria-current="true">Self-host</a>
<a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="../../tailscale/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../../ja/tailscale/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
@@ -44,7 +44,7 @@
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href="../../en/">CopySync</a> / <a href="../../en/server/">Self-host</a> / Tailscale</p>
+ <p class="crumb"><a href="../../en/">CopySync</a> / <a href="../../en/start/#server">Self-host</a></p>
<h1 class="display">Across networks with Tailscale</h1>
<p class="lede">Sync between home and the office without a public IP. The server stays at home; with Tailscale on each computer, they act as if they shared a LAN. No router settings, no cloud server.</p>
<ol class="guide-toc">
@@ -131,7 +131,7 @@
<a class="button" href="https://tailscale.com/download"><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 Tailscale</a>
</div>
<div class="os-figures">
- <figure class="browser machines" role="img" aria-label="The machine list in the Tailscale admin console (illustration): mac-mini is the server at 100.101.102.103, macbook-pro is 100.88.20.5 and home-pc is 100.92.41.17">
+ <figure class="browser listing" role="img" aria-label="The machine list in the Tailscale admin console (illustration): mac-mini is the server at 100.101.102.103, macbook-pro is 100.88.20.5 and home-pc is 100.92.41.17">
<div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">login.tailscale.com/admin/machines</span></div>
<table>
<thead><tr><th scope="col">Machine</th><th scope="col">Tailscale address</th><th scope="col">OS</th></tr></thead>
@@ -176,7 +176,7 @@
<p class="eyebrow">Step 3</p>
<h2 id="install-title">Install the server on that address</h2>
<p class="intro">The install scripts use the LAN address by default. Pass the Tailscale address instead so computers elsewhere can use the server's relay. Already installed it with the <a href="../../en/server/">LAN guide</a>? Run the script again with the address; your settings are kept.</p>
- <div class="os-tabs" data-tabs>
+ <div class="os-tabs" data-tabs="os">
<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>
@@ -382,7 +382,7 @@ Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768
</details>
<details>
<summary>I have a public IP. Do I need Tailscale?</summary>
- <div class="answer"><p>No. Run the server on the machine with the public IP and enter that address on every computer; see the <a href="../../en/#cloud">steps on the home page</a>.</p></div>
+ <div class="answer"><p>No. Run the server on the machine with the public IP and enter that address on every computer; see the <a href="../../en/cloud/">public server guide</a>.</p></div>
</details>
</div>
</div>
diff --git a/docs/index.html b/docs/index.html
index fa5445f..9b0e0e4 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -127,7 +127,7 @@
"name": "必须自己准备服务器吗?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。但它不需要公网 IP:放在家里一台常开的 Windows、Mac 或 Linux 电脑上就行,见局域网部署教程;不在同一个网络的电脑,装上 Tailscale 就能连回来,见Tailscale 教程。有公网 IP 的话,也可以部署在云服务器上,最低配置就够。"
+ "text": "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。有三种部署方式:公网服务器,最低配置的云主机就够,在哪儿都能同步;局域网,电脑都在同一个网络里时,放在其中一台常开的电脑上;局域网 + Tailscale,要跨网络又没有公网服务器时用。"
}
},
{
@@ -135,7 +135,7 @@
"name": "家里没有公网 IP,能在家和公司之间同步吗?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "能。服务器装在家里一台常开的电脑上,家里和公司的电脑都装上 Tailscale、登录同一个账号,服务器地址填它的 Tailscale 地址。它们就像在同一个局域网里,复制的内容照样在两台电脑之间直接传输。步骤见用 Tailscale 跨网络使用。"
+ "text": "能,有两种做法。有一台公网服务器的话,把服务器部署在上面,家里和公司的电脑都直接连它,见公网服务器部署。没有的话,服务器放在家里一台常开的电脑上,每台电脑装上 Tailscale、登录同一个账号,服务器地址填它的 Tailscale 地址,见局域网 + Tailscale。"
}
},
{
@@ -186,7 +186,7 @@
<a href="start/">快速开始</a>
<a class="wide" href="#how">工作原理</a>
<a class="wide" href="#faq">常见问题</a>
- <a href="server/">部署服务器</a>
+ <a href="start/#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>
@@ -234,35 +234,32 @@
<section class="section" id="deploy" aria-labelledby="deploy-title">
<div class="wrap">
- <h2 id="deploy-title">没有公网 IP,也能用</h2>
- <p class="intro">两台电脑要靠一台服务器找到彼此。这台服务器不必在公网上:大多数人家里没有公网 IP,放在家里一台常开的电脑上就行。</p>
+ <h2 id="deploy-title">服务器放在哪</h2>
+ <p class="intro">两台电脑靠一台服务器找到彼此,复制的内容不会存在上面。CopySync 不提供公共服务器,有三种部署方式,按你的情况选一种。</p>
<div class="paths">
+ <a class="path" href="cloud/">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
+ <span class="path-when">在哪儿都能同步</span>
+ <h3>公网服务器</h3>
+ <p>一台有公网 IP 的 Linux 云主机,最低配置就够。每台电脑直接连它,在家、在公司、在外面都能用,不用另装软件。</p>
+ <span class="path-go">公网服务器部署教程 →</span>
+ </a>
<a class="path" href="server/">
<svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
- <span class="path-tag">不需要公网 IP</span>
- <span class="path-when">两台电脑在同一个网络里</span>
- <h3>局域网部署</h3>
- <p>家里或办公室,连着同一个 Wi‑Fi 或有线网络。服务器装在其中一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本就好。</p>
+ <span class="path-when">电脑都在同一个网络里</span>
+ <h3>局域网</h3>
+ <p>家里或办公室,连着同一个 Wi‑Fi 或有线网络。服务器装在其中一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本,不花钱。</p>
<span class="path-go">局域网部署教程 →</span>
</a>
<a class="path" href="tailscale/">
<svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <span class="path-tag">不需要公网 IP</span>
- <span class="path-when">一台在家,一台在公司</span>
- <h3>局域网部署 + Tailscale</h3>
- <p>服务器照样放在家里。每台电脑装上 Tailscale,就像在同一个局域网里:笔记本带到哪儿,复制都能同步。</p>
+ <span class="path-when">要跨网络,没有公网服务器</span>
+ <h3>局域网 + Tailscale</h3>
+ <p>服务器放在家里一台常开的电脑上,每台电脑装上 Tailscale、登录同一个账号,就像在同一个局域网里。</p>
<span class="path-go">Tailscale 教程 →</span>
</a>
- <a class="path" href="#cloud">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
- <span class="path-tag">需要公网 IP</span>
- <span class="path-when">有一台公网服务器</span>
- <h3>云服务器部署</h3>
- <p>一台有公网 IP 的 Linux 云主机,最低配置就够。所有电脑直接连它,不用另装组网工具。</p>
- <span class="path-go">部署步骤 →</span>
- </a>
</div>
- <p class="note">拿不准选哪个?跟着<a href="start/">快速开始</a>一步步来。</p>
+ <p class="note">拿不准?<a href="start/#server">快速开始</a>里有三种方式的对比。</p>
</div>
</section>
@@ -436,7 +433,7 @@
<section class="section" id="install" aria-labelledby="install-title">
<div class="wrap">
<h2 id="install-title">安装</h2>
- <p class="intro">每台电脑装一个 App,再准备一台服务器。不需要公网 IP:服务器放在家里一台常开的电脑上,同一个局域网直接用,不在同一个网络就加上 Tailscale。第一次装可以跟着<a href="start/">快速开始</a>。</p>
+ <p class="intro">每台电脑装一个 App,再准备一台两边都能访问到的服务器。第一次装可以跟着<a href="start/">快速开始</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>
@@ -459,30 +456,13 @@
</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"><strong>没有公网 IP 也行。</strong>服务器装在家里或办公室一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本。不在同一个网络的电脑,装上 Tailscale 就能连回来。</p>
- <div class="stack">
- <a class="button" href="server/">局域网部署教程</a>
- <a class="button quiet" href="tailscale/">用 Tailscale 跨网络</a>
- </div>
- <h4 id="cloud">有公网 IP 的服务器</h4>
- <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
-tar xzf copysync-server-linux-amd64.tar.gz
-cd copysync-server-linux-amd64
-sudo ./install.sh 你的公网IP</code></pre>
- </div>
- <p class="small">脚本会注册开机自启的 systemd 服务,最后打印出 App 里要填的地址。防火墙或云安全组需要放行:</p>
- <table>
- <thead><tr><th scope="col">端口</th><th scope="col">用途</th></tr></thead>
- <tbody>
- <tr><td>8787/tcp</td><td>信令</td></tr>
- <tr><td>3478/udp</td><td>STUN 与 TURN</td></tr>
- <tr><td>32768–60999/udp</td><td>中转端口</td></tr>
- </tbody>
- </table>
- <p class="small">也可以用 Docker 部署,见<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">服务器部署说明</a>。</p>
+ <p class="small">三种部署方式,按你的情况选一种,每种都有图文教程:</p>
+ <ul class="opts">
+ <li><a href="cloud/">公网服务器</a><span>在哪儿都能同步</span></li>
+ <li><a href="server/">局域网</a><span>电脑都在同一个网络里</span></li>
+ <li><a href="tailscale/">局域网 + Tailscale</a><span>要跨网络,没有公网服务器</span></li>
+ </ul>
+ <a class="button quiet" href="start/#server">对比三种方式</a>
</div>
</div>
<p class="pairing"><strong>配对:</strong>一台点「设备 → 添加设备」生成 6 位配对码,另一台输入它;两块屏幕上的两行安全指纹完全一致后确认。Mac 与 Windows 之间、两台 Windows 之间都一样。</p>
@@ -537,11 +517,11 @@ sudo ./install.sh 你的公网IP</code></pre>
</details>
<details>
<summary>必须自己准备服务器吗?</summary>
- <div class="answer"><p>是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。但它不需要公网 IP:放在家里一台常开的 Windows、Mac 或 Linux 电脑上就行,见<a href="server/">局域网部署教程</a>;不在同一个网络的电脑,装上 Tailscale 就能连回来,见<a href="tailscale/">Tailscale 教程</a>。有公网 IP 的话,也可以部署在云服务器上,最低配置就够。</p></div>
+ <div class="answer"><p>是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。有三种部署方式:<a href="cloud/">公网服务器</a>,最低配置的云主机就够,在哪儿都能同步;<a href="server/">局域网</a>,电脑都在同一个网络里时,放在其中一台常开的电脑上;<a href="tailscale/">局域网 + Tailscale</a>,要跨网络又没有公网服务器时用。</p></div>
</details>
<details>
<summary>家里没有公网 IP,能在家和公司之间同步吗?</summary>
- <div class="answer"><p>能。服务器装在家里一台常开的电脑上,家里和公司的电脑都装上 Tailscale、登录同一个账号,服务器地址填它的 Tailscale 地址。它们就像在同一个局域网里,复制的内容照样在两台电脑之间直接传输。步骤见<a href="tailscale/">用 Tailscale 跨网络使用</a>。</p></div>
+ <div class="answer"><p>能,有两种做法。有一台公网服务器的话,把服务器部署在上面,家里和公司的电脑都直接连它,见<a href="cloud/">公网服务器部署</a>。没有的话,服务器放在家里一台常开的电脑上,每台电脑装上 Tailscale、登录同一个账号,服务器地址填它的 Tailscale 地址,见<a href="tailscale/">局域网 + Tailscale</a>。</p></div>
</details>
<details>
<summary>支持 Windows 吗?iPhone 呢?</summary>
diff --git a/docs/ja/cloud/index.html b/docs/ja/cloud/index.html
new file mode 100644
index 0000000..728863d
--- /dev/null
+++ b/docs/ja/cloud/index.html
@@ -0,0 +1,302 @@
+<!doctype html>
+<html lang="ja">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>CopySync のサーバーを公開サーバーに置く:クラウドサーバーの手順</title>
+ <meta name="description" content="グローバル IP を持つ Linux のクラウドサーバーに、スクリプトひとつで CopySync のシグナリング兼 TURN サーバーを入れます。各コンピューターが直接つながり、自宅でも会社でも外出先でもクリップボードを同期できます。セキュリティグループ、確認、アプリの設定、中国本土のドメインについて。">
+ <link rel="canonical" href="https://baiyuze.github.io/copysync/ja/cloud/">
+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/cloud/">
+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/cloud/">
+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/cloud/">
+ <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 のサーバーを公開サーバーに置く:クラウドサーバーの手順">
+ <meta property="og:description" content="グローバル IP を持つ Linux のクラウドサーバーに、スクリプトひとつで CopySync のシグナリング兼 TURN サーバーを入れます。各コンピューターが直接つながり、自宅でも会社でも外出先でもクリップボードを同期できます。セキュリティグループ、確認、アプリの設定、中国本土のドメインについて。">
+ <meta property="og:url" content="https://baiyuze.github.io/copysync/ja/cloud/">
+ <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 href="../../ja/start/">はじめかた</a>
+ <a class="wide" href="../../ja/#how">しくみ</a>
+ <a class="wide" href="../../ja/#faq">よくある質問</a>
+ <a href="../../ja/start/#server" aria-current="true">サーバーの設置</a>
+ <a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
+ <a href="../../cloud/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../en/cloud/" 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> / <a href="../../ja/start/#server">サーバーの設置</a></p>
+ <h1 class="display">公開サーバーに置く</h1>
+ <p class="lede">グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。各コンピューターが直接つながり、自宅でも会社でも外出先でも同期でき、ほかに入れるものはありません。</p>
+ <ol class="guide-toc">
+ <li><a href="#prepare">準備</a></li>
+ <li><a href="#ports">ポートを開ける</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 460" role="img" aria-labelledby="cloud-title cloud-desc">
+ <title id="cloud-title">公開サーバーを使う CopySync</title>
+ <desc id="cloud-desc">公開サーバーのアドレスは 203.0.113.10。会社のネットワークの Mac と自宅のネットワークの Windows PC が、どちらもシグナリングでサーバーに接続します。コピーした内容は 2 台のあいだを直接流れ、直接つながらないときはサーバーで中継します。</desc>
+ <rect class="d-box" x="340" y="24" width="280" height="118" rx="14"/>
+ <text class="d-title" x="480" y="62" text-anchor="middle">公開サーバー</text>
+ <text class="d-sub" x="480" y="90" text-anchor="middle">グローバル IP のクラウドサーバー</text>
+ <text class="d-ip" x="480" y="124" text-anchor="middle">203.0.113.10</text>
+ <rect class="d-lan" x="8" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="32" y="228">会社のネットワーク</text>
+ <rect class="d-lan" x="540" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="564" y="228">自宅のネットワーク</text>
+ <path class="d-sig" d="M150 250V68H340"/>
+ <path class="d-sig" d="M810 250V68H620"/>
+ <path class="d-relay" d="M210 250V112H340"/>
+ <path class="d-relay" d="M750 250V112H620"/>
+ <text class="d-note" x="164" y="58">シグナリング TCP 8787</text>
+ <text class="d-note" x="224" y="170">中継 UDP(直接不可のとき)</text>
+ <rect class="d-box" x="60" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="180" y="302" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="180" y="330" text-anchor="middle">CopySync を使用</text>
+ <rect class="d-box" x="660" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="780" y="302" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="780" y="330" text-anchor="middle">CopySync を使用</text>
+ <path class="d-direct" d="M300 316H660"/>
+ <text class="d-label" x="480" y="302" text-anchor="middle">直接接続</text>
+ <g class="d-legend" transform="translate(40 444)">
+ <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>別々のネットワークにある 2 台は NAT 穴あけで直接つながります。ほとんどの家庭と会社のネットワークで成功します。</li>
+ <li><strong>中継、UDP 3478 と中継用ポート。</strong>直接つながらないときはサーバーが転送します。暗号化されたままで、速度はサーバーの帯域に左右されます。</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>Linux(x86_64 または ARM64)。サーバーのメモリは約 15 MB なので最小構成で足ります。root 権限が必要です。</dd></div>
+ <div><dt>グローバル IP</dt><dd>クラウドサーバーに付いているもので構いません。固定(Elastic IP など)が理想です。変わると全部のコンピューターで入れ直しになります。</dd></div>
+ <div><dt>ログインの手段</dt><dd>ssh、またはクラウドのコンソールにある Web ターミナル。</dd></div>
+ <div><dt>中国本土のクラウドサーバー</dt><dd>ICP 登録のないドメインは使えないので、アプリにはドメインではなく IP を入力します(<a href="#faq">よくある質問</a>)。</dd></div>
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="ports" aria-labelledby="ports-title">
+ <div class="wrap">
+ <p class="eyebrow">ステップ 1</p>
+ <h2 id="ports-title">セキュリティグループでポートを開ける</h2>
+ <p class="intro">クラウドのコンソールで、このサーバーのセキュリティグループに次の 3 つのインバウンドルールを追加します。</p>
+ <div class="os-grid qs-grid">
+ <div class="os-figures">
+ <figure class="browser listing" role="img" aria-label="クラウドのセキュリティグループのインバウンドルール(イメージ):TCP 8787 はシグナリング、UDP 3478 は STUN と TURN、UDP 32768-60999 は中継用ポート、ソースはすべて 0.0.0.0/0">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">クラウドのコンソール › セキュリティグループ › インバウンドルール</span></div>
+ <table>
+ <thead><tr><th scope="col">プロトコル</th><th scope="col">ポート範囲</th><th scope="col">ソース</th><th scope="col">用途</th></tr></thead>
+ <tbody>
+ <tr><td>TCP</td><td>8787</td><td>0.0.0.0/0</td><td>シグナリング</td></tr>
+ <tr><td>UDP</td><td>3478</td><td>0.0.0.0/0</td><td>STUN と TURN</td></tr>
+ <tr><td>UDP</td><td>32768-60999</td><td>0.0.0.0/0</td><td>中継用ポート</td></tr>
+ </tbody>
+ </table>
+ </figure>
+ </div>
+ <ul class="points">
+ <li><strong>呼び名の違い:</strong>事業者によって「ファイアウォール」「ネットワーク ACL」などと呼ばれますが、同じ設定です。</li>
+ <li><strong>中継用ポート</strong>は OS が割り当て、範囲はサーバーによって異なります。<code>cat /proc/sys/net/ipv4/ip_local_port_range</code> で確認でき、インストールスクリプトも最後に表示します。</li>
+ <li><strong>OS のファイアウォール:</strong>ufw や firewalld が有効なら同じポートを開けます。コマンドはスクリプトの最後に表示されます。</li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ <p class="eyebrow">ステップ 2</p>
+ <h2 id="install-title">インストールスクリプトを実行</h2>
+ <p class="intro">スクリプトにグローバル IP を渡すと、サーバーをインストールし、起動時に立ち上がる systemd サービスを登録して、最後にアプリへ入力するアドレスを表示します。</p>
+ <div class="os-grid qs-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>ssh でログインします(例:<code>ssh [email protected]</code>、あなたのグローバル IP に置き換え)。</li>
+ <li>次の行を順に実行します。最後の行はあなたのグローバル IP に置き換えます:<span class="aside">ARM では <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 203.0.113.10</code></pre>
+ </div></li>
+ <li>最後に表示される <code>ws://203.0.113.10:8787/signal</code> がアプリに入力するアドレスです。</li>
+ </ol>
+ <ul class="points">
+ <li><strong>systemd サービスとして登録</strong>され、起動時に立ち上がります。設定は <code>/etc/copysync/server.env</code>。</li>
+ <li><strong>更新:</strong>新しいバージョンをダウンロードして展開し、もう一度 <code>sudo ./install.sh</code> を実行。設定は引き継がれます。</li>
+ <li><strong>Docker でも動かせます:</strong><a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">サーバーの構築手順</a>(英語・中国語)をご覧ください。</li>
+ </ul>
+ </div>
+ <div class="os-figures">
+ <figure class="term" role="img" aria-label="sudo ./install.sh 203.0.113.10 の出力:インストール、systemd ユニットと設定の作成、起動のあと、アドレス ws://203.0.113.10: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 [email protected]</span></div>
+<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh 203.0.113.10
+<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 203.0.113.10)</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://203.0.113.10: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>
+ </section>
+
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ <p class="eyebrow">ステップ 3</p>
+ <h2 id="check-title">つながるか確認</h2>
+ <p class="intro">どのコンピューターでもよいので、ブラウザーで <code>http://203.0.113.10:8787/healthz</code>(あなたのグローバル IP)を開きます。次の 1 行が表示されれば成功です。</p>
+ <figure class="browser" role="img" aria-label="ブラウザーで http://203.0.113.10: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://203.0.113.10: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">
+ <p class="eyebrow">ステップ 4</p>
+ <h2 id="clients-title">各コンピューターにアドレスを入力</h2>
+ <ol class="flow">
+ <li><h3>設定を開く</h3><p>各コンピューターで CopySync を開き、「設定」に進みます。</p></li>
+ <li><h3>公開アドレスを入力</h3><p>「シグナリングサーバー」に <code>ws://203.0.113.10:8787/signal</code>(あなたのグローバル IP)を入力し、Return か Enter を押します。</p></li>
+ <li><h3>状態を確認</h3><p>「接続状態」が緑の「接続済み」になれば完了です。まだペアリングしていなければ「デバイス」でペアリングします。</p></li>
+ </ol>
+ <figure class="shot">
+ <img src="../../assets/screenshots/ja/settings-cloud-dark.png" width="2112" height="1472" loading="lazy" alt="CopySync の設定画面:シグナリングサーバーは ws://203.0.113.10:8787/signal、接続状態は接続済み">
+ </figure>
+ <p class="note">アプリがまだなら、<a href="../../ja/start/">はじめかた</a>をご覧ください。</p>
+ <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>
+ </div>
+ </section>
+
+ <section class="section" id="faq" aria-labelledby="faq-title">
+ <div class="wrap">
+ <h2 id="faq-title">よくある質問</h2>
+ <div class="faq">
+ <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>どのくらいの性能が必要ですか?</summary>
+ <div class="answer"><p>最小構成で十分です。サーバーのメモリは約 15 MB で、ふだんは少しのシグナリングメッセージを転送するだけです。コピーした内容は直接つながればサーバーを通らず、中継になったときだけ速度がサーバーの帯域に左右されます。</p></div>
+ </details>
+ <details>
+ <summary>デバイスが「直接」ではなく「中継」になる</summary>
+ <div class="answer"><p>つながった直後は中継、少しして直接に変わるのは正常です。まず中継で使えるようにし、アイドル時に直接接続に切り替えます。ずっと中継のままなら、2 台のあいだで直接つながっていません。ポートをランダムに割り当てる NAT や厳しいファイアウォールが原因です。暗号化はそのままで、速度がサーバーの帯域に左右されるだけです。</p></div>
+ </details>
+ <details>
+ <summary>HTTPS(wss://)で使えますか?</summary>
+ <div class="answer"><p>WebSocket のアップグレードに対応した HTTPS のリバースプロキシの後ろに置けば使えます。アドレスは <code>wss://</code> で始めます。中国本土のドメインには ICP 登録が必要です。STUN と TURN は UDP でプロキシを通らないので、そのポートは開けたままにします。</p></div>
+ </details>
+ <details>
+ <summary>自宅の回線にグローバル IP があります。それで代わりになりますか?</summary>
+ <div class="answer"><p>なりますが、クラウドサーバーより手間がかかります。ルーターで TCP 8787、UDP 3478、中継用の広い範囲の UDP ポートをそのコンピューターに転送する必要があり、自宅のグローバル IP は変わることもあります。全部が自宅にあるなら <a href="../../ja/server/">LAN</a> のほうが簡単で、ポート転送なしでネットワークをまたぐなら <a href="../../ja/tailscale/">LAN + Tailscale</a> があります。</p></div>
+ </details>
+ </div>
+ </div>
+ </section>
+
+ <section class="closing" aria-labelledby="closing-title">
+ <div class="wrap">
+ <h2 class="display" id="closing-title">クラウドサーバー 1 台で、<br>どこからでも同期。</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="../../cloud/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
+ <a href="../../en/cloud/" hreflang="en" lang="en" data-lang="en">English</a>
+ <a href="../../ja/cloud/" hreflang="ja" lang="ja" data-lang="ja" aria-current="page">日本語</a>
+ </nav>
+ </div>
+ </footer>
+
+ <script src="../../assets/site.js" defer></script>
+ <script type="module" src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "7ee226baf4a949a397c4bfd69a9e7461"}'></script>
+</body>
+</html>
diff --git a/docs/ja/index.html b/docs/ja/index.html
index d0a105d..1882e33 100644
--- a/docs/ja/index.html
+++ b/docs/ja/index.html
@@ -107,7 +107,7 @@
"name": "サーバーは自分で用意する必要がありますか?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。ただしグローバル IP は不要で、自宅で電源を入れたままの Windows・Mac・Linux で十分です(LAN での設置手順)。別のネットワークにあるコンピューターは Tailscale でつながります(Tailscale での手順)。グローバル IP があれば、最小構成のクラウドサーバーに置くこともできます。"
+ "text": "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。置き方は 3 通りです。公開サーバーは最小構成のクラウドサーバーで足り、どこからでも同期できます。LAN はすべてのコンピューターが同じネットワークにあるとき、電源を入れたままの 1 台に置きます。LAN + Tailscale は公開サーバーなしでネットワークをまたぐときに使います。"
}
},
{
@@ -115,7 +115,7 @@
"name": "自宅にグローバル IP がありません。自宅と会社のあいだで同期できますか?",
"acceptedAnswer": {
"@type": "Answer",
- "text": "できます。自宅で電源を入れたままのコンピューターでサーバーを動かし、自宅と会社のコンピューターに Tailscale を入れて同じアカウントでサインインし、サーバーのアドレスに Tailscale のアドレスを使います。同じ LAN にあるのと同じように扱え、コピーした内容は 2 台のあいだを直接流れます。手順はTailscale でネットワークをまたいで使うをご覧ください。"
+ "text": "できます。方法は 2 つあります。公開サーバーがあれば、そこにサーバーを置いて両方のコンピューターから直接つなぎます(公開サーバーでの手順)。なければ、自宅で電源を入れたままのコンピューターでサーバーを動かし、すべてのコンピューターに Tailscale を入れて同じアカウントでサインインし、サーバーのアドレスに Tailscale のアドレスを使います(LAN + Tailscale)。"
}
},
{
@@ -166,7 +166,7 @@
<a href="start/">はじめかた</a>
<a class="wide" href="#how">しくみ</a>
<a class="wide" href="#faq">よくある質問</a>
- <a href="server/">サーバーの設置</a>
+ <a href="start/#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>
@@ -214,35 +214,32 @@
<section class="section" id="deploy" aria-labelledby="deploy-title">
<div class="wrap">
- <h2 id="deploy-title">グローバル IP がなくても使える</h2>
- <p class="intro">2 台のコンピューターはサーバーを通じてお互いを見つけます。ただしサーバーはインターネットに公開されている必要はありません。多くの家庭の回線にはグローバル IP がありませんが、家で電源を入れたままのコンピューターで十分です。</p>
+ <h2 id="deploy-title">サーバーをどこに置くか</h2>
+ <p class="intro">2 台はサーバーを通じてお互いを見つけます。コピーした内容がそこに保存されることはありません。公開サーバーはないので、3 通りの置き方から状況に合うものを選んでください。</p>
<div class="paths">
+ <a class="path" href="cloud/">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
+ <span class="path-when">どこからでも同期</span>
+ <h3>公開サーバー</h3>
+ <p>グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。各コンピューターが直接つながり、自宅でも会社でも外出先でも、ほかに入れるものはありません。</p>
+ <span class="path-go">公開サーバーでの手順 →</span>
+ </a>
<a class="path" href="server/">
<svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
- <span class="path-tag">グローバル IP 不要</span>
- <span class="path-when">2 台が同じネットワークにある</span>
- <h3>LAN に置く</h3>
- <p>家や会社で、同じ Wi‑Fi か有線ネットワークにつながっている場合。電源を入れたままの Windows・Mac・Linux のどれか 1 台で、スクリプトをひとつ実行するだけです。</p>
+ <span class="path-when">全部が同じネットワークにある</span>
+ <h3>LAN</h3>
+ <p>家や会社で、同じ Wi‑Fi か有線ネットワークにつながっている場合。電源を入れたままの Windows・Mac・Linux のどれか 1 台で、スクリプトをひとつ実行するだけ。費用はかかりません。</p>
<span class="path-go">LAN での設置手順 →</span>
</a>
<a class="path" href="tailscale/">
<svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <span class="path-tag">グローバル IP 不要</span>
- <span class="path-when">1 台は自宅、1 台は会社</span>
+ <span class="path-when">ネットワークをまたぐ、公開サーバーなし</span>
<h3>LAN + Tailscale</h3>
- <p>サーバーは自宅に置いたまま。各コンピューターに Tailscale を入れれば同じ LAN にあるのと同じように扱えて、ノートパソコンを持ち出しても同期が続きます。</p>
+ <p>サーバーは自宅で電源を入れたままのコンピューターに置き、各コンピューターに Tailscale を入れて同じアカウントでサインインします。同じ LAN にあるのと同じように扱えます。</p>
<span class="path-go">Tailscale での手順 →</span>
</a>
- <a class="path" href="#cloud">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
- <span class="path-tag">グローバル IP が必要</span>
- <span class="path-when">公開サーバーがある</span>
- <h3>クラウドに置く</h3>
- <p>グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。すべてのコンピューターが直接つながり、ほかに入れるものはありません。</p>
- <span class="path-go">設置手順 →</span>
- </a>
</div>
- <p class="note">迷ったら<a href="start/">はじめかた</a>に沿って進めてください。</p>
+ <p class="note">迷ったら<a href="start/#server">はじめかた</a>で 3 通りを比べられます。</p>
</div>
</section>
@@ -416,7 +413,7 @@
<section class="section" id="install" aria-labelledby="install-title">
<div class="wrap">
<h2 id="install-title">インストール</h2>
- <p class="intro">それぞれのコンピューターにアプリを入れ、サーバーを 1 台用意します。グローバル IP は要りません。自宅で電源を入れたままのコンピューターでサーバーを動かし、同じ LAN ならそのまま、別のネットワークからは Tailscale を加えて使います。はじめての方は<a href="start/">はじめかた</a>をどうぞ。</p>
+ <p class="intro">それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。はじめての方は<a href="start/">はじめかた</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>
@@ -439,30 +436,13 @@
</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"><strong>グローバル IP は不要です。</strong>家や会社で電源を入れたままの Windows・Mac・Linux で、スクリプトをひとつ実行するだけ。別のネットワークにあるコンピューターは Tailscale でつながります。</p>
- <div class="stack">
- <a class="button" href="server/">LAN での設置手順</a>
- <a class="button quiet" href="tailscale/">Tailscale でネットワークをまたぐ</a>
- </div>
- <h4 id="cloud">グローバル IP を持つサーバーに置く</h4>
- <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
-tar xzf copysync-server-linux-amd64.tar.gz
-cd copysync-server-linux-amd64
-sudo ./install.sh グローバルIP</code></pre>
- </div>
- <p class="small">スクリプトは起動時に立ち上がる systemd サービスを登録し、最後にアプリへ入力するアドレスを表示します。ファイアウォールやセキュリティグループで次のポートを開けてください。</p>
- <table>
- <thead><tr><th scope="col">ポート</th><th scope="col">用途</th></tr></thead>
- <tbody>
- <tr><td>8787/tcp</td><td>シグナリング</td></tr>
- <tr><td>3478/udp</td><td>STUN と TURN</td></tr>
- <tr><td>32768–60999/udp</td><td>中継用ポート</td></tr>
- </tbody>
- </table>
- <p class="small">Docker でも動かせます。<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">サーバーの構築手順</a>(英語)をご覧ください。</p>
+ <p class="small">置き方は 3 通り。状況に合うものを選んでください。どれにも手順のページがあります:</p>
+ <ul class="opts">
+ <li><a href="cloud/">公開サーバー</a><span>どこからでも同期</span></li>
+ <li><a href="server/">LAN</a><span>全部が同じネットワークにある</span></li>
+ <li><a href="tailscale/">LAN + Tailscale</a><span>ネットワークをまたぐ、公開サーバーなし</span></li>
+ </ul>
+ <a class="button quiet" href="start/#server">3 通りを比べる</a>
</div>
</div>
<p class="pairing"><strong>ペアリング:</strong>一台で「デバイス → デバイスを追加」を開いて 6 桁のコードを表示し、もう一台で入力します。両方の画面に同じ 2 行の指紋が表示されたら確定します。Mac と Windows、Windows 同士でも同じ手順です。</p>
@@ -517,11 +497,11 @@ sudo ./install.sh グローバルIP</code></pre>
</details>
<details>
<summary>サーバーは自分で用意する必要がありますか?</summary>
- <div class="answer"><p>はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。ただしグローバル IP は不要で、自宅で電源を入れたままの Windows・Mac・Linux で十分です(<a href="server/">LAN での設置手順</a>)。別のネットワークにあるコンピューターは Tailscale でつながります(<a href="tailscale/">Tailscale での手順</a>)。グローバル IP があれば、最小構成のクラウドサーバーに置くこともできます。</p></div>
+ <div class="answer"><p>はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。置き方は 3 通りです。<a href="cloud/">公開サーバー</a>は最小構成のクラウドサーバーで足り、どこからでも同期できます。<a href="server/">LAN</a> はすべてのコンピューターが同じネットワークにあるとき、電源を入れたままの 1 台に置きます。<a href="tailscale/">LAN + Tailscale</a> は公開サーバーなしでネットワークをまたぐときに使います。</p></div>
</details>
<details>
<summary>自宅にグローバル IP がありません。自宅と会社のあいだで同期できますか?</summary>
- <div class="answer"><p>できます。自宅で電源を入れたままのコンピューターでサーバーを動かし、自宅と会社のコンピューターに Tailscale を入れて同じアカウントでサインインし、サーバーのアドレスに Tailscale のアドレスを使います。同じ LAN にあるのと同じように扱え、コピーした内容は 2 台のあいだを直接流れます。手順は<a href="tailscale/">Tailscale でネットワークをまたいで使う</a>をご覧ください。</p></div>
+ <div class="answer"><p>できます。方法は 2 つあります。公開サーバーがあれば、そこにサーバーを置いて両方のコンピューターから直接つなぎます(<a href="cloud/">公開サーバーでの手順</a>)。なければ、自宅で電源を入れたままのコンピューターでサーバーを動かし、すべてのコンピューターに Tailscale を入れて同じアカウントでサインインし、サーバーのアドレスに Tailscale のアドレスを使います(<a href="tailscale/">LAN + Tailscale</a>)。</p></div>
</details>
<details>
<summary>Windows に対応していますか?iPhone は?</summary>
diff --git a/docs/ja/server/index.html b/docs/ja/server/index.html
index f9d521e..1c57eb6 100644
--- a/docs/ja/server/index.html
+++ b/docs/ja/server/index.html
@@ -33,7 +33,7 @@
<a href="../../ja/start/">はじめかた</a>
<a class="wide" href="../../ja/#how">しくみ</a>
<a class="wide" href="../../ja/#faq">よくある質問</a>
- <a href="./" aria-current="page">サーバーの設置</a>
+ <a href="../../ja/start/#server" aria-current="true">サーバーの設置</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>
@@ -44,16 +44,14 @@
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href="../../ja/">CopySync</a> / サーバーの設置</p>
+ <p class="crumb"><a href="../../ja/">CopySync</a> / <a href="../../ja/start/#server">サーバーの設置</a></p>
<h1 class="display">LAN にサーバーを置く</h1>
<p class="lede">家や会社のコンピューターが同じネットワークにあるなら、クラウドサーバーは要りません。電源を入れたままのコンピューターを 1 台選び、スクリプトをダウンロードして実行し、表示されたアドレスを各コンピューターの CopySync に入力します。</p>
- <p class="hero-aside">2 台が別のネットワークにあり、グローバル IP もない場合は<a href="../../ja/tailscale/">Tailscale でネットワークをまたいで使う</a>をご覧ください。</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="#away">外出先でも使う</a></li>
<li><a href="#faq">よくある質問</a></li>
</ol>
</div>
@@ -109,7 +107,7 @@
<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 の中からしか届きません。持ち出したノートパソコンでも同期したい場合は、各コンピューターに Tailscale を入れれば、グローバル IP なしでつながります(<a href="../../ja/tailscale/">Tailscale での手順</a>)。</dd></div>
+ <div><dt>ネットワークの外では同期しない</dt><dd>サーバーには LAN の中からしか届きません。持ち出したノートパソコンは、戻ってきてから同期を再開します。</dd></div>
</dl>
</div>
</section>
@@ -118,7 +116,7 @@
<div class="wrap">
<h2 id="install-title">サーバーをインストール</h2>
<p class="intro">サーバーを動かすコンピューターの OS を選んでください。スクリプトが LAN のアドレスを見つけ、サーバーを自動起動に設定し、最後にアプリへ入力するアドレスを表示します。</p>
- <div class="os-tabs" data-tabs>
+ <div class="os-tabs" data-tabs="os">
<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>
@@ -334,19 +332,6 @@ Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768
</div>
</section>
- <section class="section" id="away" aria-labelledby="away-title">
- <div class="wrap">
- <div class="callout">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <div>
- <h2 id="away-title">外出先でも同期したい?</h2>
- <p>各コンピューターに Tailscale を入れ、サーバーをその Tailscale アドレスで動かせば、会社からでも外出先からでも、同じ LAN にいるように自宅のサーバーにつながります。グローバル IP もルーターの設定も要りません。</p>
- <a class="button" href="../../ja/tailscale/">Tailscale でネットワークをまたいで使う</a>
- </div>
- </div>
- </div>
- </section>
-
<section class="section" id="faq" aria-labelledby="faq-title">
<div class="wrap">
<h2 id="faq-title">よくある質問</h2>
@@ -365,11 +350,7 @@ Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768
</details>
<details>
<summary>LAN の外でも同期できますか?</summary>
- <div class="answer"><p>Tailscale を使えばできます。各コンピューターに入れて同じアカウントでサインインし、サーバーを Tailscale のアドレスでインストールして、アプリにもそのアドレスを入力します。グローバル IP は不要です。手順は<a href="../../ja/tailscale/">Tailscale でネットワークをまたいで使う</a>をご覧ください。</p><p>グローバル IP があれば、クラウドサーバーに置くこともできます(<a href="../../ja/#cloud">トップページの設置手順</a>)。</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>
+ <div class="answer"><p>できません。サーバーには LAN の中からしか届かないためです。別のネットワークからも同期したい場合は、ほかの 2 通りのどちらかに切り替えます:<a href="../../ja/cloud/">公開サーバー</a>、または <a href="../../ja/tailscale/">LAN + Tailscale</a>。</p></div>
</details>
<details>
<summary>サーバーを動かすコンピューターでも CopySync を使う場合のアドレスは?</summary>
diff --git a/docs/ja/start/index.html b/docs/ja/start/index.html
index 282588b..75d4c63 100644
--- a/docs/ja/start/index.html
+++ b/docs/ja/start/index.html
@@ -33,7 +33,7 @@
<a href="./" aria-current="page">はじめかた</a>
<a class="wide" href="../../ja/#how">しくみ</a>
<a class="wide" href="../../ja/#faq">よくある質問</a>
- <a href="../../ja/server/">サーバーの設置</a>
+ <a href="#server">サーバーの設置</a>
<a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="../../start/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../../en/start/" hreflang="en" lang="en" data-lang="en">English</a>
@@ -92,34 +92,83 @@
<div class="wrap">
<p class="eyebrow">ステップ 2</p>
<h2 id="server-title">サーバーを用意する</h2>
- <p class="intro">2 台はサーバーを通じてお互いを見つけます。コピーした内容がそこに保存されることはありません。公開サーバーはないので、状況に合うものを選んでください。</p>
- <div class="paths">
- <a class="path" href="../../ja/server/">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
- <span class="path-tag">グローバル IP 不要</span>
- <span class="path-when">2 台が同じネットワークにある</span>
- <h3>LAN に置く</h3>
- <p>家や会社で、同じ Wi‑Fi か有線ネットワークにつながっている場合。電源を入れたままの Windows・Mac・Linux のどれか 1 台で、スクリプトをひとつ実行するだけです。</p>
- <span class="path-go">LAN での設置手順 →</span>
- </a>
- <a class="path" href="../../ja/tailscale/">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <span class="path-tag">グローバル IP 不要</span>
- <span class="path-when">1 台は自宅、1 台は会社</span>
- <h3>LAN + Tailscale</h3>
- <p>サーバーは自宅に置いたまま。各コンピューターに Tailscale を入れれば同じ LAN にあるのと同じように扱えて、ノートパソコンを持ち出しても同期が続きます。</p>
- <span class="path-go">Tailscale での手順 →</span>
- </a>
- <a class="path" href="../../ja/#cloud">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
- <span class="path-tag">グローバル IP が必要</span>
- <span class="path-when">公開サーバーがある</span>
- <h3>クラウドに置く</h3>
- <p>グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。すべてのコンピューターが直接つながり、ほかに入れるものはありません。</p>
- <span class="path-go">設置手順 →</span>
- </a>
+ <p class="intro">2 台はサーバーを通じてお互いを見つけます。コピーした内容がそこに保存されることはありません。公開サーバーはないので、3 通りの置き方から状況に合うものを選んでください。</p>
+ <div class="os-tabs" data-tabs="plan">
+ <div class="tablist" role="tablist" aria-label="サーバーの置き方" hidden>
+ <button type="button" role="tab" id="tab-plan-cloud" aria-controls="plan-cloud">公開サーバー</button>
+ <button type="button" role="tab" id="tab-plan-lan" aria-controls="plan-lan">LAN</button>
+ <button type="button" role="tab" id="tab-plan-ts" aria-controls="plan-ts">LAN + Tailscale</button>
+ </div>
+
+ <section class="os" id="plan-cloud" role="tabpanel" aria-labelledby="tab-plan-cloud">
+ <h3 class="os-title">公開サーバー</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>クラウドのセキュリティグループで TCP 8787、UDP 3478、UDP 32768–60999 を開けます。</li>
+ <li>ssh でログインし、インストールスクリプトをダウンロードして、グローバル IP を付けて実行します:<code>sudo ./install.sh グローバルIP</code>。</li>
+ <li>ブラウザーで <code>http://グローバルIP:8787/healthz</code> を開き、ok と表示されれば完了です。</li>
+ </ol>
+ <p class="plan-address">各コンピューターに入力するアドレス:<code>ws://グローバルIP:8787/signal</code></p>
+ <a class="button quiet" href="../../ja/cloud/">公開サーバーでの手順 →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
+ <dl>
+ <div><dt>向いている</dt><dd>コンピューターが別々のネットワークにあり、どこからでも同期したい場合。ネットワークをまたぐならいちばん手間がかかりません。</dd></div>
+ <div><dt>必要なもの</dt><dd>グローバル IP を持つ Linux のクラウドサーバー(最小構成で可)と root 権限。</dd></div>
+ <div><dt>注意</dt><dd>クラウドサーバーの費用がかかります。直接つながらないときの中継はサーバーの帯域に左右されます。中国本土では、ICP 登録のないドメインは使えないので IP を入力します。</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
+
+ <section class="os" id="plan-lan" role="tabpanel" aria-labelledby="tab-plan-lan">
+ <h3 class="os-title">LAN</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>サーバーにするコンピューターのアドレスをルーターで固定します。</li>
+ <li>OS に合ったサーバーをダウンロードしてインストールスクリプトを実行します。<a href="../../ja/server/#windows">Windows</a> は <code>install.cmd</code> をダブルクリック、<a href="../../ja/server/#macos">macOS</a> と <a href="../../ja/server/#linux">Linux</a> は <code>./install.sh</code> を実行します。</li>
+ <li>スクリプトが LAN のアドレスを見つけ、最後にアプリに入力するアドレスを表示します。</li>
+ </ol>
+ <p class="plan-address">各コンピューターに入力するアドレス:<code>ws://LANのアドレス:8787/signal</code>(例:<code>ws://192.168.1.20:8787/signal</code>)</p>
+ <a class="button quiet" href="../../ja/server/">LAN での設置手順 →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
+ <dl>
+ <div><dt>向いている</dt><dd>コンピューターがすべて同じ Wi‑Fi か有線ネットワークにある場合(家や会社など)。</dd></div>
+ <div><dt>必要なもの</dt><dd>電源を入れたままの Windows・Mac・Linux。同期するコンピューターの 1 台でもかまいません。</dd></div>
+ <div><dt>注意</dt><dd>そのネットワークの外では同期せず、戻ると再開します。そのコンピューターの電源が切れたりスリープしたりしているあいだも止まります。</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
+
+ <section class="os" id="plan-ts" role="tabpanel" aria-labelledby="tab-plan-ts">
+ <h3 class="os-title">LAN + Tailscale</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>各コンピューターに Tailscale を入れ、同じアカウントでサインインします。</li>
+ <li>サーバーにするコンピューターで <code>tailscale ip -4</code> を実行し、100 で始まるアドレスを控えます。</li>
+ <li>そのアドレスを付けてサーバーをインストールします(例:<code>install.cmd 100.101.102.103</code>、<code>./install.sh 100.101.102.103</code>)。</li>
+ </ol>
+ <p class="plan-address">各コンピューターに入力するアドレス:<code>ws://Tailscaleのアドレス:8787/signal</code></p>
+ <a class="button quiet" href="../../ja/tailscale/">Tailscale での手順 →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
+ <dl>
+ <div><dt>向いている</dt><dd>コンピューターが別々のネットワークにあり、公開サーバーがない場合。</dd></div>
+ <div><dt>必要なもの</dt><dd>サーバー用に電源を入れたままのコンピューター 1 台と、すべてのコンピューターに同じアカウントの Tailscale。</dd></div>
+ <div><dt>注意</dt><dd>CopySync を使うコンピューターすべてに Tailscale が必要で、自宅の 1 台は電源を入れたままにします。Tailscale が P2P でつなげないときは DERP サーバーで中継され、遅くなることがあります。</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
</div>
- <p class="note">インストールが終わると、スクリプトが <code>ws://192.168.1.20:8787/signal</code> のようなアドレスを表示します。次のステップで使います。</p>
</div>
</section>
diff --git a/docs/ja/tailscale/index.html b/docs/ja/tailscale/index.html
index ed9a10f..b766c69 100644
--- a/docs/ja/tailscale/index.html
+++ b/docs/ja/tailscale/index.html
@@ -33,7 +33,7 @@
<a href="../../ja/start/">はじめかた</a>
<a class="wide" href="../../ja/#how">しくみ</a>
<a class="wide" href="../../ja/#faq">よくある質問</a>
- <a href="../../ja/server/">サーバーの設置</a>
+ <a href="../../ja/start/#server" aria-current="true">サーバーの設置</a>
<a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="../../tailscale/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../../en/tailscale/" hreflang="en" lang="en" data-lang="en">English</a>
@@ -44,7 +44,7 @@
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href="../../ja/">CopySync</a> / <a href="../../ja/server/">サーバーの設置</a> / Tailscale</p>
+ <p class="crumb"><a href="../../ja/">CopySync</a> / <a href="../../ja/start/#server">サーバーの設置</a></p>
<h1 class="display">Tailscale でネットワークをまたぐ</h1>
<p class="lede">グローバル IP がなくても、自宅と会社のあいだで同期できます。サーバーは自宅に置いたまま、各コンピューターに Tailscale を入れれば、同じ LAN にあるのと同じように扱えます。ルーターの設定もクラウドサーバーも要りません。</p>
<ol class="guide-toc">
@@ -131,7 +131,7 @@
<a class="button" href="https://tailscale.com/download"><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>Tailscale をダウンロード</a>
</div>
<div class="os-figures">
- <figure class="browser machines" role="img" aria-label="Tailscale の管理画面のデバイス一覧(イメージ):mac-mini がサーバーで 100.101.102.103、macbook-pro は 100.88.20.5、home-pc は 100.92.41.17">
+ <figure class="browser listing" role="img" aria-label="Tailscale の管理画面のデバイス一覧(イメージ):mac-mini がサーバーで 100.101.102.103、macbook-pro は 100.88.20.5、home-pc は 100.92.41.17">
<div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">login.tailscale.com/admin/machines</span></div>
<table>
<thead><tr><th scope="col">デバイス</th><th scope="col">Tailscale のアドレス</th><th scope="col">OS</th></tr></thead>
@@ -176,7 +176,7 @@
<p class="eyebrow">ステップ 3</p>
<h2 id="install-title">そのアドレスでサーバーを入れる</h2>
<p class="intro">インストールスクリプトは初期設定で LAN のアドレスを使います。ここでは Tailscale のアドレスを指定して、外のコンピューターからもサーバーの中継を使えるようにします。すでに<a href="../../ja/server/">LAN での手順</a>で入れている場合は、アドレスを付けてもう一度実行するだけで、設定は引き継がれます。</p>
- <div class="os-tabs" data-tabs>
+ <div class="os-tabs" data-tabs="os">
<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>
@@ -382,7 +382,7 @@ Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768
</details>
<details>
<summary>グローバル IP があります。Tailscale は必要?</summary>
- <div class="answer"><p>不要です。グローバル IP を持つマシンにサーバーを置き、すべてのコンピューターにそのアドレスを入力してください(<a href="../../ja/#cloud">トップページの設置手順</a>)。</p></div>
+ <div class="answer"><p>不要です。グローバル IP を持つマシンにサーバーを置き、すべてのコンピューターにそのアドレスを入力してください(<a href="../../ja/cloud/">公開サーバーでの手順</a>)。</p></div>
</details>
</div>
</div>
diff --git a/docs/llms.txt b/docs/llms.txt
index 45643a8..83c1ea8 100644
--- a/docs/llms.txt
+++ b/docs/llms.txt
@@ -9,7 +9,7 @@ Key facts:
- 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), 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. No public IP is needed to sync across networks: keep the server on an always-on computer at home, put every computer on the same Tailscale network (or ZeroTier), install the server on its Tailscale address (100.x.y.z) and enter that address in every app. 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.
+- 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. There are three equal ways to run it: on a public server (a cloud VM with a public IP; reachable from any network), on a LAN (any always-on computer; works only on that network), or on a LAN plus Tailscale (across networks without a public server: every computer joins the same Tailscale network and the server is installed on its 100.x.y.z address). 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.
@@ -22,8 +22,9 @@ Key facts:
- [Website (English)](https://baiyuze.github.io/copysync/en/), [简体中文](https://baiyuze.github.io/copysync/), [日本語](https://baiyuze.github.io/copysync/ja/)
- [Quick start](https://baiyuze.github.io/copysync/en/start/): install the apps, choose how to run the server, enter its address and pair ([中文](https://baiyuze.github.io/copysync/start/), [日本語](https://baiyuze.github.io/copysync/ja/start/))
+- [Run the server on a public server](https://baiyuze.github.io/copysync/en/cloud/): security group, install script, checks ([中文](https://baiyuze.github.io/copysync/cloud/), [日本語](https://baiyuze.github.io/copysync/ja/cloud/))
- [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/))
-- [Use it across networks with Tailscale](https://baiyuze.github.io/copysync/en/tailscale/): sync between home and office without a public IP, with the server at home on its Tailscale address ([中文](https://baiyuze.github.io/copysync/tailscale/), [日本語](https://baiyuze.github.io/copysync/ja/tailscale/))
+- [Use it across networks with Tailscale](https://baiyuze.github.io/copysync/en/tailscale/): sync across networks without a public server, with the server at home on its Tailscale address ([中文](https://baiyuze.github.io/copysync/tailscale/), [日本語](https://baiyuze.github.io/copysync/ja/tailscale/))
- [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
diff --git a/docs/server/index.html b/docs/server/index.html
index bb91389..d77353d 100644
--- a/docs/server/index.html
+++ b/docs/server/index.html
@@ -33,7 +33,7 @@
<a href="../start/">快速开始</a>
<a class="wide" href=".././#how">工作原理</a>
<a class="wide" href=".././#faq">常见问题</a>
- <a href="./" aria-current="page">部署服务器</a>
+ <a href="../start/#server" aria-current="true">部署服务器</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>
@@ -44,16 +44,14 @@
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href=".././">CopySync</a> / 部署服务器</p>
+ <p class="crumb"><a href=".././">CopySync</a> / <a href="../start/#server">部署服务器</a></p>
<h1 class="display">在局域网里部署服务器</h1>
<p class="lede">家里或办公室的电脑在同一个网络里,就不需要云服务器。找一台常开的电脑,下载、运行一个脚本,再把它显示的地址填进每台电脑的 CopySync 里。</p>
- <p class="hero-aside">两台电脑不在同一个网络,又没有公网 IP?看<a href="../tailscale/">用 Tailscale 跨网络使用</a>。</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="#away">离开家也想用</a></li>
<li><a href="#faq">常见问题</a></li>
</ol>
</div>
@@ -109,7 +107,7 @@
<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>服务器只在局域网里访问得到。笔记本带出门也想同步,给每台电脑装上 Tailscale 就行,不需要公网 IP,见<a href="../tailscale/">Tailscale 教程</a>。</dd></div>
+ <div><dt>离开这个网络就不同步</dt><dd>服务器只在局域网里访问得到,笔记本带出门后,回来才会继续同步。</dd></div>
</dl>
</div>
</section>
@@ -118,7 +116,7 @@
<div class="wrap">
<h2 id="install-title">安装服务器</h2>
<p class="intro">选服务器所在电脑的系统。安装脚本会自动找到本机的局域网地址,把服务器设成开机自动运行,最后显示客户端要填的地址。</p>
- <div class="os-tabs" data-tabs>
+ <div class="os-tabs" data-tabs="os">
<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>
@@ -334,19 +332,6 @@ sudo ./install.sh</code></pre>
</div>
</section>
- <section class="section" id="away" aria-labelledby="away-title">
- <div class="wrap">
- <div class="callout">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <div>
- <h2 id="away-title">离开家,也想同步?</h2>
- <p>给每台电脑装上 Tailscale,服务器用它分配的地址,在公司、在外面都能连回家里的服务器,就像在同一个局域网里。不需要公网 IP,也不用改路由器。</p>
- <a class="button" href="../tailscale/">用 Tailscale 跨网络使用</a>
- </div>
- </div>
- </div>
- </section>
-
<section class="section" id="faq" aria-labelledby="faq-title">
<div class="wrap">
<h2 id="faq-title">常见问题</h2>
@@ -365,11 +350,7 @@ sudo ./install.sh</code></pre>
</details>
<details>
<summary>离开局域网以后还能同步吗?</summary>
- <div class="answer"><p>能,加上 Tailscale 就行:每台电脑装上 Tailscale、登录同一个账号,服务器用 Tailscale 地址安装,客户端也填这个地址,不需要公网 IP。步骤见<a href="../tailscale/">用 Tailscale 跨网络使用</a>。</p><p>有公网 IP 的话,也可以把服务器部署到云服务器上,见<a href=".././#cloud">首页的部署步骤</a>。</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>
+ <div class="answer"><p>不能,服务器只在局域网里访问得到。要在别的网络里也能同步,换成另外两种部署方式之一:<a href="../cloud/">公网服务器</a>,或者<a href="../tailscale/">局域网 + Tailscale</a>。</p></div>
</details>
<details>
<summary>服务器所在的那台电脑也要用 CopySync,地址填什么?</summary>
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index 4b88c7c..8d09818 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -46,6 +46,27 @@
<xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/start/"/>
<xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/start/"/>
</url>
+ <url>
+ <loc>https://baiyuze.github.io/copysync/cloud/</loc>
+ <lastmod>2026-10-11</lastmod>
+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/cloud/"/>
+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/cloud/"/>
+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/cloud/"/>
+ </url>
+ <url>
+ <loc>https://baiyuze.github.io/copysync/en/cloud/</loc>
+ <lastmod>2026-10-11</lastmod>
+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/cloud/"/>
+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/cloud/"/>
+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/cloud/"/>
+ </url>
+ <url>
+ <loc>https://baiyuze.github.io/copysync/ja/cloud/</loc>
+ <lastmod>2026-10-11</lastmod>
+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/cloud/"/>
+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/cloud/"/>
+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/cloud/"/>
+ </url>
<url>
<loc>https://baiyuze.github.io/copysync/server/</loc>
<lastmod>2026-10-11</lastmod>
diff --git a/docs/start/index.html b/docs/start/index.html
index 1bc6c4f..575b683 100644
--- a/docs/start/index.html
+++ b/docs/start/index.html
@@ -33,7 +33,7 @@
<a href="./" aria-current="page">快速开始</a>
<a class="wide" href=".././#how">工作原理</a>
<a class="wide" href=".././#faq">常见问题</a>
- <a href="../server/">部署服务器</a>
+ <a href="#server">部署服务器</a>
<a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="../en/start/" hreflang="en" lang="en" data-lang="en">English</a>
<a href="../ja/start/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
@@ -92,34 +92,83 @@
<div class="wrap">
<p class="eyebrow">第 2 步</p>
<h2 id="server-title">准备一台服务器</h2>
- <p class="intro">两台电脑靠它找到彼此,复制的内容不会存在上面。CopySync 不提供公共服务器,按你的情况选一种:</p>
- <div class="paths">
- <a class="path" href="../server/">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
- <span class="path-tag">不需要公网 IP</span>
- <span class="path-when">两台电脑在同一个网络里</span>
- <h3>局域网部署</h3>
- <p>家里或办公室,连着同一个 Wi‑Fi 或有线网络。服务器装在其中一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本就好。</p>
- <span class="path-go">局域网部署教程 →</span>
- </a>
- <a class="path" href="../tailscale/">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
- <span class="path-tag">不需要公网 IP</span>
- <span class="path-when">一台在家,一台在公司</span>
- <h3>局域网部署 + Tailscale</h3>
- <p>服务器照样放在家里。每台电脑装上 Tailscale,就像在同一个局域网里:笔记本带到哪儿,复制都能同步。</p>
- <span class="path-go">Tailscale 教程 →</span>
- </a>
- <a class="path" href=".././#cloud">
- <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
- <span class="path-tag">需要公网 IP</span>
- <span class="path-when">有一台公网服务器</span>
- <h3>云服务器部署</h3>
- <p>一台有公网 IP 的 Linux 云主机,最低配置就够。所有电脑直接连它,不用另装组网工具。</p>
- <span class="path-go">部署步骤 →</span>
- </a>
+ <p class="intro">两台电脑靠它找到彼此,复制的内容不会存在上面。CopySync 不提供公共服务器,有三种部署方式,选一种适合你的。</p>
+ <div class="os-tabs" data-tabs="plan">
+ <div class="tablist" role="tablist" aria-label="部署方式" hidden>
+ <button type="button" role="tab" id="tab-plan-cloud" aria-controls="plan-cloud">公网服务器</button>
+ <button type="button" role="tab" id="tab-plan-lan" aria-controls="plan-lan">局域网</button>
+ <button type="button" role="tab" id="tab-plan-ts" aria-controls="plan-ts">局域网 + Tailscale</button>
+ </div>
+
+ <section class="os" id="plan-cloud" role="tabpanel" aria-labelledby="tab-plan-cloud">
+ <h3 class="os-title">公网服务器</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>在云厂商的安全组里放行 TCP 8787、UDP 3478 和 UDP 32768–60999。</li>
+ <li>ssh 登录服务器,下载并运行安装脚本,带上它的公网 IP:<code>sudo ./install.sh 公网IP</code>。</li>
+ <li>在浏览器里打开 <code>http://公网IP:8787/healthz</code>,能看到 ok 就装好了。</li>
+ </ol>
+ <p class="plan-address">每台电脑要填的地址:<code>ws://公网IP:8787/signal</code></p>
+ <a class="button quiet" href="../cloud/">公网服务器部署教程 →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-dev" x="98" y="8" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="23" width="44" height="12" rx="3"/><rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/><rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/><path class="p-sig" d="M56 64V22h42M184 64V22h-42"/><path class="p-data" d="M80 80h80"/><rect class="p-dev" x="37" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M32 93h48"/><rect class="p-dev" x="165" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M160 93h48"/></svg>
+ <dl>
+ <div><dt>适合</dt><dd>电脑分散在不同的网络里,想在哪儿都能同步。跨网络时最省心。</dd></div>
+ <div><dt>要准备</dt><dd>一台有公网 IP 的 Linux 云主机,最低配置就够,需要 root。</dd></div>
+ <div><dt>要注意</dt><dd>云主机要花钱。打不通直连时走中转,速度受服务器带宽限制。国内域名没有备案时,客户端要填 IP。</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
+
+ <section class="os" id="plan-lan" role="tabpanel" aria-labelledby="tab-plan-lan">
+ <h3 class="os-title">局域网</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>在路由器里给当服务器的电脑固定一个地址。</li>
+ <li>下载对应系统的服务器,运行安装脚本:<a href="../server/#windows">Windows</a> 上双击 <code>install.cmd</code>,<a href="../server/#macos">macOS</a> 与 <a href="../server/#linux">Linux</a> 上运行 <code>./install.sh</code>。</li>
+ <li>脚本会找到本机的局域网地址,最后显示客户端要填的地址。</li>
+ </ol>
+ <p class="plan-address">每台电脑要填的地址:<code>ws://局域网地址:8787/signal</code>,比如 <code>ws://192.168.1.20:8787/signal</code></p>
+ <a class="button quiet" href="../server/">局域网部署教程 →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/><rect class="p-dev" x="98" y="16" width="44" height="12" rx="3"/><rect class="p-dev" x="98" y="31" width="44" height="12" rx="3"/><path class="p-sig" d="M58 66V30h40M182 66V30h-40"/><path class="p-data" d="M82 82h76"/><rect class="p-dev" x="39" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M34 95h48"/><rect class="p-dev" x="163" y="66" width="38" height="24" rx="3"/><path class="p-dev" d="M158 95h48"/></svg>
+ <dl>
+ <div><dt>适合</dt><dd>电脑都在同一个 Wi‑Fi 或有线网络里,比如家里或办公室。</dd></div>
+ <div><dt>要准备</dt><dd>一台常开的 Windows、Mac 或 Linux 电脑,要同步的电脑之一也行。</dd></div>
+ <div><dt>要注意</dt><dd>离开这个网络就不同步,回来后自动恢复。那台电脑关机或睡眠时同步也会暂停。</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
+
+ <section class="os" id="plan-ts" role="tabpanel" aria-labelledby="tab-plan-ts">
+ <h3 class="os-title">局域网 + Tailscale</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+ <li>每台电脑装上 Tailscale,登录同一个账号。</li>
+ <li>在当服务器的电脑上运行 <code>tailscale ip -4</code>,记下 100 开头的地址。</li>
+ <li>带上这个地址安装服务器,比如 <code>install.cmd 100.101.102.103</code> 或 <code>./install.sh 100.101.102.103</code>。</li>
+ </ol>
+ <p class="plan-address">每台电脑要填的地址:<code>ws://Tailscale 地址:8787/signal</code></p>
+ <a class="button quiet" href="../tailscale/">Tailscale 教程 →</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true"><rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/><rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/><rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/><rect class="p-dev" x="39" y="20" width="44" height="12" rx="3"/><rect class="p-dev" x="39" y="35" width="44" height="12" rx="3"/><path class="p-sig" d="M180 64V54H61v-7M61 64V54"/><path class="p-data" d="M85 80h71"/><rect class="p-dev" x="42" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M37 93h48"/><rect class="p-dev" x="161" y="64" width="38" height="24" rx="3"/><path class="p-dev" d="M156 93h48"/></svg>
+ <dl>
+ <div><dt>适合</dt><dd>电脑在不同的网络里,又没有公网服务器。</dd></div>
+ <div><dt>要准备</dt><dd>一台常开的电脑当服务器;每台电脑都装 Tailscale,登录同一个账号。</dd></div>
+ <div><dt>要注意</dt><dd>所有用 CopySync 的电脑都要装 Tailscale,家里那台要一直开着。Tailscale 自己打不通时经境外中转,在国内会慢。</dd></div>
+ </dl>
+ </div>
+ </div>
+ </section>
</div>
- <p class="note">装好后,安装脚本最后会显示一个地址,形如 <code>ws://192.168.1.20:8787/signal</code>,下一步要用。</p>
</div>
</section>
diff --git a/docs/tailscale/index.html b/docs/tailscale/index.html
index b26eba0..5a849d1 100644
--- a/docs/tailscale/index.html
+++ b/docs/tailscale/index.html
@@ -33,7 +33,7 @@
<a href="../start/">快速开始</a>
<a class="wide" href=".././#how">工作原理</a>
<a class="wide" href=".././#faq">常见问题</a>
- <a href="../server/">部署服务器</a>
+ <a href="../start/#server" aria-current="true">部署服务器</a>
<a class="wide" href="https://github.com/baiyuze/copysync">GitHub</a>
<a href="../en/tailscale/" hreflang="en" lang="en" data-lang="en">English</a>
<a href="../ja/tailscale/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
@@ -44,7 +44,7 @@
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href=".././">CopySync</a> / <a href="../server/">部署服务器</a> / Tailscale</p>
+ <p class="crumb"><a href=".././">CopySync</a> / <a href="../start/#server">部署服务器</a></p>
<h1 class="display">用 Tailscale 跨网络使用</h1>
<p class="lede">没有公网 IP,也能在家和公司之间同步。服务器照样放在家里,每台电脑装上 Tailscale,它们就像在同一个局域网里,不用改路由器,也不用买云服务器。</p>
<ol class="guide-toc">
@@ -131,7 +131,7 @@
<a class="button" href="https://tailscale.com/download"><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>下载 Tailscale</a>
</div>
<div class="os-figures">
- <figure class="browser machines" role="img" aria-label="Tailscale 管理后台的设备列表(示意):mac-mini 是服务器,地址 100.101.102.103;macbook-pro 是 100.88.20.5;home-pc 是 100.92.41.17">
+ <figure class="browser listing" role="img" aria-label="Tailscale 管理后台的设备列表(示意):mac-mini 是服务器,地址 100.101.102.103;macbook-pro 是 100.88.20.5;home-pc 是 100.92.41.17">
<div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">login.tailscale.com/admin/machines</span></div>
<table>
<thead><tr><th scope="col">设备</th><th scope="col">Tailscale 地址</th><th scope="col">系统</th></tr></thead>
@@ -176,7 +176,7 @@
<p class="eyebrow">第 3 步</p>
<h2 id="install-title">用这个地址安装服务器</h2>
<p class="intro">安装脚本默认用局域网地址,这里要带上 Tailscale 地址,外面的电脑才用得到服务器的中转。已经照<a href="../server/">局域网教程</a>装过的,带上地址再运行一次即可,原来的设置保留。</p>
- <div class="os-tabs" data-tabs>
+ <div class="os-tabs" data-tabs="os">
<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>
@@ -382,7 +382,7 @@ sudo systemctl restart copysync-server</code></pre>
</details>
<details>
<summary>我有公网 IP,还需要 Tailscale 吗?</summary>
- <div class="answer"><p>不需要。把服务器部署在有公网 IP 的机器上,所有电脑填它的公网地址就行,见<a href=".././#cloud">首页的部署步骤</a>。</p></div>
+ <div class="answer"><p>不需要。把服务器部署在有公网 IP 的机器上,所有电脑填它的公网地址就行,见<a href="../cloud/">公网服务器部署教程</a>。</p></div>
</details>
</div>
</div>
diff --git a/guide/troubleshooting.md b/guide/troubleshooting.md
index 312ecd1..1619b66 100644
--- a/guide/troubleshooting.md
+++ b/guide/troubleshooting.md
@@ -6,7 +6,7 @@
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.
+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. See the [public server guide](https://baiyuze.github.io/copysync/en/cloud/).
**Using Tailscale: devices show Direct, but transfers are slow**
Direct means the two computers connect directly on the Tailscale network. When Tailscale can't connect them peer to peer, it relays through its DERP servers, which can be far away. Run `tailscale ping <other device>`: "via DERP" means Tailscale is relaying, "via <IP>:<port>" means peer to peer. Also make sure the server was installed on its Tailscale address and every computer uses `ws://<Tailscale address>:8787/signal`; see the [Tailscale guide](https://baiyuze.github.io/copysync/en/tailscale/).
diff --git a/guide/troubleshooting.zh-CN.md b/guide/troubleshooting.zh-CN.md
index cd7a67f..c070f0f 100644
--- a/guide/troubleshooting.zh-CN.md
+++ b/guide/troubleshooting.zh-CN.md
@@ -6,7 +6,7 @@
先核对地址:以 `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`),或者给域名备案。
+域名没有备案时,国内云厂商会拦截访问它的明文 HTTP 请求,任何端口都一样,返回一个跳转到拦截页的响应。WebSocket 握手就是明文 HTTP 请求,所以同样被拦。地址里直接填 IP(`ws://<服务器IP>:8787/signal`),或者给域名备案。见[公网服务器部署教程](https://baiyuze.github.io/copysync/cloud/)。
**用 Tailscale 时显示「直连」,传输却很慢**
「直连」指两台电脑在 Tailscale 的虚拟网里直接相连。Tailscale 自己打不通两台电脑时,会经它在境外的中转服务器(DERP)转发,在国内用就会慢。运行 `tailscale ping <对方>`:显示 via DERP 说明 Tailscale 在中转,显示 via <IP>:<端口> 才是点对点。另外确认服务器是用 Tailscale 地址安装的,每台电脑填的都是 `ws://<Tailscale 地址>:8787/signal`,见 [Tailscale 教程](https://baiyuze.github.io/copysync/tailscale/)。
diff --git a/server/deploy/README.md b/server/deploy/README.md
index bb6fba5..ac172ac 100644
--- a/server/deploy/README.md
+++ b/server/deploy/README.md
@@ -6,16 +6,17 @@ CopySync 的服务器只做两件事:让你的设备找到彼此(信令)
Step-by-step guides with screenshots / 带截图的图文教程:
-- On your LAN / 局域网部署:<https://baiyuze.github.io/copysync/server/>
-- Across networks with Tailscale, no public IP / 用 Tailscale 跨网络使用,不需要公网 IP:<https://baiyuze.github.io/copysync/tailscale/>
+- On a public server / 公网服务器:<https://baiyuze.github.io/copysync/cloud/>
+- On your LAN / 局域网:<https://baiyuze.github.io/copysync/server/>
+- LAN + Tailscale, across networks without a public server / 局域网 + Tailscale,跨网络但没有公网服务器:<https://baiyuze.github.io/copysync/tailscale/>
## Where to run it / 放在哪里
| | Requirement 要求 |
|---|---|
+| **Public server** 公网服务器 | A Linux machine with a public IP; the smallest VPS is enough. Reachable from any network. 一台有公网 IP 的 Linux 机器,最低配的云主机就够,任何网络都能连上。 |
| **On your LAN** 局域网 | Any always-on Windows 10/11, macOS 13+ or Linux computer on the same network, one of your own computers included. Reserve its address in the router. 同一网络里任意一台常开的 Windows 10/11、macOS 13 以上或 Linux 电脑,自己的电脑也行;在路由器里给它固定地址。 |
-| **Across networks, no public IP** 跨网络,没有公网 IP | The same always-on computer at home, with [Tailscale](https://tailscale.com) on it and on every client; see [Tailscale](#tailscale) below. 同样放在家里一台常开的电脑上,它和每台客户端都装上 Tailscale,见下面的 [Tailscale](#tailscale)。 |
-| **Across the internet** 跨公网 | A Linux machine with a public IP; the smallest VPS is enough. 一台有公网 IP 的 Linux 机器,最低配的云主机就够。 |
+| **LAN + Tailscale** 局域网 + Tailscale | Across networks without a public server: an always-on computer at home, with [Tailscale](https://tailscale.com) on it and on every client; see [Tailscale](#tailscale) below. 跨网络但没有公网服务器:家里一台常开的电脑,它和每台客户端都装上 Tailscale,见下面的 [Tailscale](#tailscale)。 |
It uses about 15 MB of RAM. 内存占用约 15 MB。
@@ -100,9 +101,9 @@ docker compose up -d
## Tailscale
-Without a public IP you can still sync across networks: keep the server at home and join every computer, the server's included, to the same [Tailscale](https://tailscale.com) network. Each device gets a fixed `100.x.y.z` address that the others can reach from anywhere. Install the server on that address, so the TURN relay is reachable through Tailscale too, and enter it in every app.
+Without a public server you can still sync across networks: keep the server at home and join every computer, the server's included, to the same [Tailscale](https://tailscale.com) network. Each device gets a fixed `100.x.y.z` address that the others can reach from anywhere. Install the server on that address, so the TURN relay is reachable through Tailscale too, and enter it in every app.
-没有公网 IP 也能跨网络使用:服务器照样放在家里,所有电脑(包括服务器所在的那台)加入同一个 [Tailscale](https://tailscale.com) 网络。每台设备会分到一个固定的 `100.x.y.z` 地址,在哪儿都能互相访问。服务器用这个地址安装(TURN 中转也就能通过 Tailscale 访问到),每台电脑也填这个地址。
+没有公网服务器也能跨网络使用:服务器照样放在家里,所有电脑(包括服务器所在的那台)加入同一个 [Tailscale](https://tailscale.com) 网络。每台设备会分到一个固定的 `100.x.y.z` 地址,在哪儿都能互相访问。服务器用这个地址安装(TURN 中转也就能通过 Tailscale 访问到),每台电脑也填这个地址。
```bash
tailscale ip -4 # the server's Tailscale address / 服务器的 Tailscale 地址,例如 100.101.102.103
diff --git a/tools/site/build.py b/tools/site/build.py
index a2bf9b3..9d869d3 100644
--- a/tools/site/build.py
+++ b/tools/site/build.py
@@ -1,5 +1,5 @@
-"""生成官网:docs/index.html(简体中文)、docs/en/、docs/ja/,每种语言下还有快速开始(start/)、
-局域网部署(server/)、用 Tailscale 跨网络使用(tailscale/)三个教程页面,以及 docs/design/ 下的技术方案页面。
+"""生成官网:docs/index.html(简体中文)、docs/en/、docs/ja/,每种语言下还有快速开始(start/)与三种部署方式的教程——
+公网服务器(cloud/)、局域网(server/)、局域网 + Tailscale(tailscale/),以及 docs/design/ 下的技术方案页面。
python3 tools/site/build.py
@@ -35,11 +35,14 @@ LANGS = {
ANALYTICS = (" <script type=\"module\" src=\"https://static.cloudflareinsights.com/beacon.min.js\" "
"data-cf-beacon='{\"token\": \"7ee226baf4a949a397c4bfd69a9e7461\"}'></script>\n")
-# 教程页面,每种语言目录下各一份:在局域网里部署服务器、快速开始、用 Tailscale 跨网络使用
-GUIDE = "server/"
+# 教程页面,每种语言目录下各一份:快速开始,以及三种部署方式各一篇——
+# 公网服务器、局域网、局域网 + Tailscale。三种方式地位相同,在快速开始里由用户自己选
START = "start/"
+CLOUD = "cloud/"
+GUIDE = "server/"
TAILSCALE = "tailscale/"
-SUBPAGES = [START, GUIDE, TAILSCALE]
+SUBPAGES = [START, CLOUD, GUIDE, TAILSCALE]
+DEPLOY_PAGES = [CLOUD, GUIDE, TAILSCALE]
# 放到网站上的技术方案:文件名 → 网页名。其他 design/*.md 链接到 GitHub
DESIGN_DOCS = {"nat-traversal.md": "nat-traversal", "windows-client.md": "windows-client"}
@@ -142,27 +145,30 @@ def cta(c: dict, start: str = "") -> str:
def header(c: dict, code: str, up: str, sub: str = "") -> str:
- """顶栏。sub 是当前的教程页面(START、GUIDE 等),首页为空。窄屏只留不带 wide 的几项。"""
+ """顶栏。sub 是当前的教程页面(START、GUIDE 等),首页为空。窄屏只留不带 wide 的几项。
+ 「部署服务器」指向快速开始里三种部署方式的选择,在三篇部署教程里显示为当前所在的栏目。"""
path = LANGS[code][0]
if sub:
home = up + (path or "./")
base = up + path # 语言根目录,教程页面互相链接用
else:
home, base = "", ""
-
- def page(target: str, label: str) -> str:
- if target == sub:
- return f'<a href="./" aria-current="page">{label}</a>'
- return f'<a href="{base}{target}">{label}</a>'
+ if sub == START:
+ start = '<a href="./" aria-current="page">'
+ deploy = '<a href="#server">'
+ else:
+ start = f'<a href="{base}{START}">'
+ current = ' aria-current="true"' if sub in DEPLOY_PAGES else ""
+ deploy = f'<a href="{base}{START}#server"{current}>'
return f""" <header class="bar">
<div class="wrap">
<a class="brand" href="{home or "./"}" aria-label="{c["home_label"]}"><img src="{up}assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="{c["nav_label"]}">
- {page(START, c["nav_start"])}
+ {start}{c["nav_start"]}</a>
<a class="wide" href="{home}#how">{c["nav_how"]}</a>
<a class="wide" href="{home}#faq">{c["nav_faq"]}</a>
- {page(GUIDE, c["nav_server"])}
+ {deploy}{c["nav_server"]}</a>
<a class="wide" href="{REPO}">GitHub</a>
{lang_links(code, up, sub)}
</nav>
@@ -181,47 +187,84 @@ def _server(x: int, y: int) -> str:
f'<rect class="p-dev" x="{x}" y="{y + 15}" width="44" height="12" rx="3"/>')
-PATH_ART = {
- # 同一个局域网:一个网络里,服务器在上,两台电脑在下
- "lan": ('<rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/>'
- + _server(98, 16)
- + '<path class="p-sig" d="M58 66V30h40M182 66V30h-40"/>'
- + '<path class="p-data" d="M82 82h76"/>'
- + _laptop(34, 66) + _laptop(158, 66)),
- # 局域网 + Tailscale:家与公司是两个网络,蓝色虚线框把它们连成一个虚拟局域网
- "ts": ('<rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/>'
- '<rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/>'
- '<rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/>'
- + _server(39, 20)
- + '<path class="p-sig" d="M180 64V54H61v-7M61 64V54"/>'
- + '<path class="p-data" d="M85 80h71"/>'
- + _laptop(37, 64) + _laptop(156, 64)),
- # 云服务器:服务器在两个网络之外,两边都直接连它
- "cloud": (_server(98, 8)
- + '<rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/>'
- + '<rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/>'
- + '<path class="p-sig" d="M56 64V22h42M184 64V22h-42"/>'
- + '<path class="p-data" d="M80 80h80"/>'
- + _laptop(32, 64) + _laptop(160, 64)),
-}
-
-
-def paths(c: dict, base: str, home: str) -> str:
- """三种部署方式的卡片。base 是语言根目录(教程页面在它下面),home 是首页地址(首页上为空)。"""
- hrefs = [base + GUIDE, base + TAILSCALE, home + "#cloud"]
+# 三种部署方式,按这个顺序出现在首页、快速开始与安装一节:(文案里的键, 教程页面, 插图)
+PLANS = [
+ # 公网服务器:服务器在两个网络之外,两边都直接连它
+ ("cloud", CLOUD, _server(98, 8)
+ + '<rect class="p-net" x="6" y="50" width="100" height="56" rx="10"/>'
+ + '<rect class="p-net" x="134" y="50" width="100" height="56" rx="10"/>'
+ + '<path class="p-sig" d="M56 64V22h42M184 64V22h-42"/>'
+ + '<path class="p-data" d="M80 80h80"/>'
+ + _laptop(32, 64) + _laptop(160, 64)),
+ # 局域网:一个网络里,服务器在上,两台电脑在下
+ ("lan", GUIDE, '<rect class="p-net" x="6" y="6" width="228" height="100" rx="14"/>'
+ + _server(98, 16)
+ + '<path class="p-sig" d="M58 66V30h40M182 66V30h-40"/>'
+ + '<path class="p-data" d="M82 82h76"/>'
+ + _laptop(34, 66) + _laptop(158, 66)),
+ # 局域网 + Tailscale:家与公司是两个网络,外面一圈点线把它们连成一个虚拟局域网
+ ("ts", TAILSCALE, '<rect class="p-ts" x="2" y="2" width="236" height="108" rx="16"/>'
+ '<rect class="p-net" x="12" y="12" width="98" height="88" rx="10"/>'
+ '<rect class="p-net" x="130" y="12" width="98" height="88" rx="10"/>'
+ + _server(39, 20)
+ + '<path class="p-sig" d="M180 64V54H61v-7M61 64V54"/>'
+ + '<path class="p-data" d="M85 80h71"/>'
+ + _laptop(37, 64) + _laptop(156, 64)),
+]
+
+
+def paths(c: dict, base: str) -> str:
+ """首页上三种部署方式的卡片,样式相同、不分主次。base 是语言根目录(教程页面在它下面)。"""
cards = []
- for (tag, when, title, text, go), href, art in zip(c["paths"], hrefs, PATH_ART.values()):
- cards.append(f""" <a class="path" href="{href}">
+ for key, page, art in PLANS:
+ p = c["plans"][key]
+ cards.append(f""" <a class="path" href="{base}{page}">
<svg viewBox="0 0 240 112" aria-hidden="true">{art}</svg>
- <span class="path-tag">{tag}</span>
- <span class="path-when">{when}</span>
- <h3>{title}</h3>
- <p>{text}</p>
- <span class="path-go">{go}</span>
+ <span class="path-when">{p["fit"]}</span>
+ <h3>{p["name"]}</h3>
+ <p>{p["summary"]}</p>
+ <span class="path-go">{p["go"]}</span>
</a>""")
return '<div class="paths">\n' + "\n".join(cards) + "\n </div>"
+def plan_tabs(c: dict, base: str) -> str:
+ """快速开始第 2 步:三种部署方式分页,由用户自己选。每页是适合谁、要准备什么、要注意什么,
+ 精简的步骤,最后要填的地址,以及完整教程的链接。"""
+ links = {"cloud": base + CLOUD, "server": base + GUIDE, "ts": base + TAILSCALE}
+ tabs, panels = [], []
+ for key, page, art in PLANS:
+ p = c["plans"][key]
+ tabs.append(f' <button type="button" role="tab" id="tab-plan-{key}" aria-controls="plan-{key}">{p["name"]}</button>')
+ facts = "\n".join(f" <div><dt>{k}</dt><dd>{v}</dd></div>" for k, v in p["facts"])
+ steps = "\n".join(f" <li>{fill(x, links)}</li>" for x in p["steps"])
+ panels.append(f""" <section class="os" id="plan-{key}" role="tabpanel" aria-labelledby="tab-plan-{key}">
+ <h3 class="os-title">{p["name"]}</h3>
+ <div class="plan-grid">
+ <div>
+ <ol class="steps">
+{steps}
+ </ol>
+ <p class="plan-address">{p["address"]}</p>
+ <a class="button quiet" href="{base}{page}">{p["go"]}</a>
+ </div>
+ <div class="plan-card">
+ <svg viewBox="0 0 240 112" aria-hidden="true">{art}</svg>
+ <dl>
+{facts}
+ </dl>
+ </div>
+ </div>
+ </section>""")
+ return f"""<div class="os-tabs" data-tabs="plan">
+ <div class="tablist" role="tablist" aria-label="{c["plans_label"]}" hidden>
+{chr(10).join(tabs)}
+ </div>
+
+{(chr(10) + chr(10)).join(panels)}
+ </div>"""
+
+
def jsonld(c: dict, code: str, path: str, shots: str) -> str:
data = {
"@context": "https://schema.org",
@@ -284,9 +327,11 @@ def home(code: str) -> str:
fallbacks = "\n".join(f" <div><dt>{t}</dt><dd>{d}</dd></div>" for t, d in c["fallbacks"])
mac_steps = "\n".join(f" <li>{s}</li>" for s in c["mac_steps"])
win_steps = "\n".join(f" <li>{s}</li>" for s in c["win_steps"])
- ports = "\n".join(f" <tr><td>{p}</td><td>{u}</td></tr>" for p, u in c["ports"])
+ opts = "\n".join(
+ f' <li><a href="{page}">{c["plans"][key]["name"]}</a><span>{c["plans"][key]["fit"]}</span></li>'
+ for key, page, _ in PLANS)
specs = "\n".join(f' <tr><th scope="row">{k}</th><td>{v}</td></tr>' for k, v in c["specs"])
- links = {"server": GUIDE, "ts": TAILSCALE, "start": START}
+ links = {"cloud": CLOUD, "server": GUIDE, "ts": TAILSCALE, "start": START}
faq = faq_list(c["faq"], links)
d = c["diagram"]
@@ -360,7 +405,7 @@ def home(code: str) -> str:
<div class="wrap">
<h2 id="deploy-title">{c["paths_h2"]}</h2>
<p class="intro">{c["paths_intro"]}</p>
- {paths(c, "", "")}
+ {paths(c, "")}
<p class="note">{fill(c["paths_after"], links)}</p>
</div>
</section>
@@ -516,28 +561,11 @@ def home(code: str) -> str:
</div>
<div>
<h3>{SERVER}{c["server_h3"]}</h3>
- <p class="small">{c["server_lan"]}</p>
- <div class="stack">
- <a class="button" href="{GUIDE}">{c["server_guide"]}</a>
- <a class="button quiet" href="{TAILSCALE}">{c["server_ts"]}</a>
- </div>
- <h4 id="cloud">{c["server_cloud"]}</h4>
<p class="small">{c["server_intro"]}</p>
- <div class="code">
- <button class="copy" type="button" data-done="{c["copied"]}">{c["copy"]}</button>
-<pre><code>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 {c["public_ip"]}</code></pre>
- </div>
- <p class="small">{c["server_after"]}</p>
- <table>
- <thead><tr><th scope="col">{c["ports_cols"][0]}</th><th scope="col">{c["ports_cols"][1]}</th></tr></thead>
- <tbody>
-{ports}
- </tbody>
- </table>
- <p class="small">{c["server_docker"]}</p>
+ <ul class="opts">
+{opts}
+ </ul>
+ <a class="button quiet" href="{START}#server">{c["server_compare"]}</a>
</div>
</div>
<p class="pairing">{c["pairing"]}</p>
@@ -762,6 +790,11 @@ def toc_list(toc: list[tuple[str, str]]) -> str:
return "\n".join(f' <li><a href="#{anchor}">{label}</a></li>' for anchor, label in toc)
+def crumb(c: dict, home: str, base: str) -> str:
+ """部署教程顶部的面包屑:CopySync / 部署服务器,后者回到快速开始里三种方式的选择。"""
+ return f'<p class="crumb"><a href="{home}">CopySync</a> / <a href="{base}{START}#server">{c["nav_server"]}</a></p>'
+
+
def page_top(c: dict, code: str, sub: str, title: str, description: str) -> str:
"""教程页面从 <!doctype> 到顶栏的部分。sub 是页面目录(GUIDE、START 等)。"""
path, hl, locale, _ = LANGS[code]
@@ -839,7 +872,7 @@ cd copysync-server-macos
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)
- links = {"home": home_href, "ts": base + TAILSCALE, "start": base + START}
+ links = {"home": home_href, "cloud": base + CLOUD, "ts": base + TAILSCALE, "start": base + START}
prep = "\n".join(f" <div><dt>{h}</dt><dd>{fill(p, links)}</dd></div>" for h, p in g["prep"])
d = g["diagram"]
@@ -847,10 +880,9 @@ cd copysync-server-macos
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href="{home_href}">CopySync</a> / {c["nav_server"]}</p>
+ {crumb(c, home_href, base)}
<h1 class="display">{g["h1"]}</h1>
<p class="lede">{g["lede"]}</p>
- <p class="hero-aside">{fill(g["hero_aside"], links)}</p>
<ol class="guide-toc">
{toc_list(g["toc"])}
</ol>
@@ -911,7 +943,7 @@ cd copysync-server-macos
<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="os-tabs" data-tabs="os">
<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>
@@ -1011,36 +1043,213 @@ cd copysync-server-macos
</div>
</section>
- <section class="section" id="away" aria-labelledby="away-title">
+ <section class="section" id="faq" aria-labelledby="faq-title">
<div class="wrap">
- <div class="callout">
- <svg viewBox="0 0 240 112" aria-hidden="true">{PATH_ART["ts"]}</svg>
- <div>
- <h2 id="away-title">{g["away_h2"]}</h2>
- <p>{g["away_text"]}</p>
- <a class="button" href="{links["ts"]}">{g["away_button"]}</a>
+ <h2 id="faq-title">{g["faq_h2"]}</h2>
+ <div class="faq">
+{faq_list(g["faq"], links)}
+ </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>
+""" + page_bottom(c, code, GUIDE)
+
+
+# ─────────────────────────── 部署到公网服务器 ───────────────────────────
+
+# 教程里的公网 IP:RFC 5737 留给文档用的地址段,不会是任何人真实的服务器
+CLOUD_IP = "203.0.113.10"
+
+
+def cloud_page(code: str) -> str:
+ c = load(code)
+ g = c["guide"]
+ cl = c["cloud"]
+ path = LANGS[code][0]
+ up = "../" * (path + CLOUD).count("/")
+ home_href = up + (path or "./")
+ base = up + path
+ shots = up + "assets/screenshots/" + ("" if code == "zh" else code + "/")
+ t = TRANSCRIPTS["zh" if code == "zh" else "en"]
+ links = {"home": home_href, "server": base + GUIDE, "ts": base + TAILSCALE, "start": base + START,
+ "deploy": f"{REPO}/blob/main/server/deploy/README.md"}
+ d = cl["diagram"]
+ install = 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 {CLOUD_IP}"""
+ rules = "\n".join(
+ " <tr>" + "".join(f"<td>{x}</td>" for x in row) + "</tr>" for row in cl["rules"])
+ cols = "".join(f'<th scope="col">{h}</th>' for h in cl["rules_cols"])
+
+ def step(n: int) -> str:
+ return f'<p class="eyebrow">{cl["step"].format(n=n)}</p>'
+
+ return page_top(c, code, CLOUD, cl["title"], cl["description"]) + f"""
+ <main id="main">
+ <section class="hero guide-hero">
+ <div class="wrap">
+ {crumb(c, home_href, base)}
+ <h1 class="display">{cl["h1"]}</h1>
+ <p class="lede">{cl["lede"]}</p>
+ <ol class="guide-toc">
+{toc_list(cl["toc"])}
+ </ol>
+ </div>
+ </section>
+
+ <section class="section" id="overview" aria-labelledby="overview-title">
+ <div class="wrap">
+ <h2 id="overview-title">{cl["overview_h2"]}</h2>
+ <p class="intro">{cl["overview_intro"]}</p>
+ <figure class="diagram">
+ <svg viewBox="0 0 960 460" role="img" aria-labelledby="cloud-title cloud-desc">
+ <title id="cloud-title">{d["title"]}</title>
+ <desc id="cloud-desc">{d["desc"]}</desc>
+ <rect class="d-box" x="340" y="24" width="280" height="118" rx="14"/>
+ <text class="d-title" x="480" y="62" text-anchor="middle">{d["server"]}</text>
+ <text class="d-sub" x="480" y="90" text-anchor="middle">{d["server_sub"]}</text>
+ <text class="d-ip" x="480" y="124" text-anchor="middle">{CLOUD_IP}</text>
+ <rect class="d-lan" x="8" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="32" y="228">{d["office"]}</text>
+ <rect class="d-lan" x="540" y="196" width="412" height="212" rx="22"/>
+ <text class="d-lan-label" x="564" y="228">{d["home"]}</text>
+ <path class="d-sig" d="M150 250V68H340"/>
+ <path class="d-sig" d="M810 250V68H620"/>
+ <path class="d-relay" d="M210 250V112H340"/>
+ <path class="d-relay" d="M750 250V112H620"/>
+ <text class="d-note" x="164" y="58">{d["sig_note"]}</text>
+ <text class="d-note" x="224" y="170">{d["relay_note"]}</text>
+ <rect class="d-box" x="60" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="180" y="302" text-anchor="middle">Mac</text>
+ <text class="d-sub" x="180" y="330" text-anchor="middle">{d["client"]}</text>
+ <rect class="d-box" x="660" y="250" width="240" height="120" rx="14"/>
+ <text class="d-title" x="780" y="302" text-anchor="middle">Windows</text>
+ <text class="d-sub" x="780" y="330" text-anchor="middle">{d["client"]}</text>
+ <path class="d-direct" d="M300 316H660"/>
+ <text class="d-label" x="480" y="302" text-anchor="middle">{d["direct"]}</text>
+ <g class="d-legend" transform="translate(40 444)">
+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">{g["diagram"]["legend_direct"]}</text>
+ <path class="d-relay" d="M250 0H278"/><text x="288" y="5">{g["diagram"]["legend_relay"]}</text>
+ <path class="d-sig" d="M560 0H588"/><text x="598" y="5">{g["diagram"]["legend_sig"]}</text>
+ </g>
+ </svg>
+ </figure>
+ <ul class="points ports">
+{items(cl["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">
+{chr(10).join(f" <div><dt>{h}</dt><dd>{fill(p, links)}</dd></div>" for h, p in cl["prep"])}
+ </dl>
+ </div>
+ </section>
+
+ <section class="section" id="ports" aria-labelledby="ports-title">
+ <div class="wrap">
+ {step(1)}
+ <h2 id="ports-title">{cl["ports_h2"]}</h2>
+ <p class="intro">{cl["ports_intro"]}</p>
+ <div class="os-grid qs-grid">
+ <div class="os-figures">
+ <figure class="browser listing" role="img" aria-label="{esc(cl["rules_label"])}">
+ <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">{cl["rules_url"]}</span></div>
+ <table>
+ <thead><tr>{cols}</tr></thead>
+ <tbody>
+{rules}
+ </tbody>
+ </table>
+ </figure>
+ </div>
+ <ul class="points">
+{items(cl["ports_notes"], " ")}
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <section class="section" id="install" aria-labelledby="install-title">
+ <div class="wrap">
+ {step(2)}
+ <h2 id="install-title">{cl["install_h2"]}</h2>
+ <p class="intro">{cl["install_intro"]}</p>
+ <div class="os-grid qs-grid">
+ <div class="os-steps">
+ <ol class="steps">
+ <li>{cl["install_steps"][0]}</li>
+ <li>{cl["install_steps"][1]}
+ {code_block(c, install)}</li>
+{items(cl["install_steps"][2:], " ")}
+ </ol>
+ <ul class="points">
+{items([fill(x, links) for x in cl["install_notes"]], " ")}
+ </ul>
+ </div>
+ <div class="os-figures">
+ {term("mac", f"ssh root@{CLOUD_IP}", transcript(t["linux"], "$", f"sudo ./install.sh {CLOUD_IP}", CLOUD_IP), cl["term_label"])}
</div>
</div>
</div>
</section>
+ <section class="section" id="check" aria-labelledby="check-title">
+ <div class="wrap">
+ {step(3)}
+ <h2 id="check-title">{cl["check_h2"]}</h2>
+ <p class="intro">{cl["check_intro"]}</p>
+ <figure class="browser" role="img" aria-label="{esc(cl["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://{CLOUD_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">
+ {step(4)}
+ <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 cl["clients_steps"])}
+ </ol>
+ <figure class="shot">
+ <img src="{shots}settings-cloud-dark.png" width="2112" height="1472" loading="lazy" alt="{esc(cl["clients_alt"])}">
+ </figure>
+ <p class="note">{fill(g["clients_after"], links)}</p>
+ {manage(g["manage_caption"], g["linux"]["manage"])}
+ </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_list(g["faq"], links)}
+{faq_list(cl["faq"], links)}
</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>
+ <h2 class="display" id="closing-title">{cl["closing"]}</h2>{cta(c)}
+ <a class="source" href="{links["deploy"]}">{cl["source"]}</a>
</div>
</section>
</main>
-""" + page_bottom(c, code, GUIDE)
+""" + page_bottom(c, code, CLOUD)
# ─────────────────────────── 快速开始 ───────────────────────────
@@ -1054,7 +1263,8 @@ def start_page(code: str) -> str:
home_href = up + (path or "./")
base = up + path
shots = up + "assets/screenshots/" + ("" if code == "zh" else code + "/")
- links = {"home": home_href, "server": base + GUIDE, "ts": base + TAILSCALE, "issues": REPO + "/issues"}
+ links = {"home": home_href, "cloud": base + CLOUD, "server": base + GUIDE, "ts": base + TAILSCALE,
+ "issues": REPO + "/issues"}
def step(n: int) -> str:
return f'<p class="eyebrow">{s["step"].format(n=n)}</p>'
@@ -1106,8 +1316,7 @@ def start_page(code: str) -> str:
{step(2)}
<h2 id="server-title">{s["server_h2"]}</h2>
<p class="intro">{s["server_intro"]}</p>
- {paths(c, base, home_href)}
- <p class="note">{s["server_after"]}</p>
+ {plan_tabs(c, base)}
</div>
</section>
@@ -1177,7 +1386,7 @@ def tailscale_page(code: str) -> str:
base = up + path
shots = up + "assets/screenshots/" + ("" if code == "zh" else code + "/")
t = TRANSCRIPTS["zh" if code == "zh" else "en"]
- links = {"home": home_href, "server": base + GUIDE, "start": base + START}
+ links = {"home": home_href, "cloud": base + CLOUD, "server": base + GUIDE, "start": base + START}
d = ts["diagram"]
w, m, l = ts["win"], ts["mac"], ts["linux"]
@@ -1207,7 +1416,7 @@ sudo systemctl restart copysync-server"""
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
- <p class="crumb"><a href="{home_href}">CopySync</a> / <a href="{links["server"]}">{c["nav_server"]}</a> / Tailscale</p>
+ {crumb(c, home_href, base)}
<h1 class="display">{ts["h1"]}</h1>
<p class="lede">{ts["lede"]}</p>
<ol class="guide-toc">
@@ -1282,7 +1491,7 @@ sudo systemctl restart copysync-server"""
<a class="button" href="https://tailscale.com/download">{DOWN}{ts["join_download"]}</a>
</div>
<div class="os-figures">
- <figure class="browser machines" role="img" aria-label="{esc(ts["machines_label"])}">
+ <figure class="browser listing" role="img" aria-label="{esc(ts["machines_label"])}">
<div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">login.tailscale.com/admin/machines</span></div>
<table>
<thead><tr>{cols}</tr></thead>
@@ -1319,7 +1528,7 @@ sudo systemctl restart copysync-server"""
<p class="eyebrow">{ts["step"].format(n=3)}</p>
<h2 id="install-title">{ts["install_h2"]}</h2>
<p class="intro">{fill(ts["install_intro"], links)}</p>
- <div class="os-tabs" data-tabs>
+ <div class="os-tabs" data-tabs="os">
<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>
@@ -1627,7 +1836,7 @@ def design_page(md_name: str, page: str) -> str:
<a class="brand" href="../" aria-label="CopySync 首页"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>
<nav aria-label="页面导航">
<a href="../{START}">{zh["nav_start"]}</a>
- <a href="../{GUIDE}">{zh["nav_server"]}</a>
+ <a href="../{START}#server">{zh["nav_server"]}</a>
<a class="wide" href="{REPO}/blob/main/design/{md_name}">在 GitHub 上查看</a>
<a class="wide" href="{REPO}">GitHub</a>
</nav>
@@ -1708,6 +1917,7 @@ def main() -> None:
write(DOCS / path / "index.html", home(code))
write(DOCS / path / GUIDE / "index.html", server_page(code))
write(DOCS / path / START / "index.html", start_page(code))
+ write(DOCS / path / CLOUD / "index.html", cloud_page(code))
write(DOCS / path / TAILSCALE / "index.html", tailscale_page(code))
for md_name, page in DESIGN_DOCS.items():
write(DOCS / "design" / f"{page}.html", design_page(md_name, page))
diff --git a/tools/site/content/en.py b/tools/site/content/en.py
index e22f91c..fbd9433 100644
--- a/tools/site/content/en.py
+++ b/tools/site/content/en.py
@@ -35,26 +35,75 @@ C = {
"stage_arc": "Direct, end-to-end encrypted",
"replay": "Play again",
- # Three ways to run the server: (requirement, situation, approach, text, link). Links go to the LAN guide,
- # the Tailscale guide and the cloud steps on the home page, in that order.
- "paths_h2": "No public IP? No problem",
- "paths_intro": "Your computers find each other through a server, but it doesn't have to be on the public internet. "
- "Most home connections have no public IP, and an always-on computer at home works fine.",
- "paths": [
- ("No public IP needed", "Both computers on one network", "On your LAN",
- "At home or in the office, on the same Wi‑Fi or wired network. Run the server on one of your always-on Windows, "
- "Mac or Linux computers with a single script.",
- "LAN guide →"),
- ("No public IP needed", "One at home, one at the office", "LAN + Tailscale",
- "The server stays at home. Install Tailscale on each computer and they act as if they shared a LAN, so your "
- "laptop keeps syncing wherever you take it.",
- "Tailscale guide →"),
- ("Needs a public IP", "You have a public server", "Cloud server",
- "A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly, with nothing "
- "else to install.",
- "Setup steps →"),
- ],
- "paths_after": "Not sure which? Follow the <a href=\"{start}\">quick start</a>.",
+ # Three ways to run the server, on equal footing; the reader picks one. Home cards use name, fit, summary, go;
+ # the quick start tabs use name, facts, steps, address, go; the install section uses name, fit.
+ # {cloud}, {server} and {ts} in steps become links to the matching guide.
+ "paths_h2": "Where to run the server",
+ "paths_intro": "Your computers find each other through a server; nothing you copy is stored on it. There's no public server, "
+ "so pick one of three ways to run your own.",
+ "paths_after": "Not sure? The <a href=\"{start}#server\">quick start</a> compares all three.",
+ "plans_label": "Ways to run the server",
+ "plans": {
+ "cloud": {
+ "name": "Public server",
+ "fit": "Syncs from anywhere",
+ "summary": "A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly, at home, "
+ "at the office or anywhere else, with nothing extra to install.",
+ "go": "Public server guide →",
+ "facts": [
+ ("Best for", "Computers spread across networks that should sync from anywhere. The simplest way across networks."),
+ ("You need", "A Linux VM with a public IP, as root; the smallest one is enough."),
+ ("Keep in mind", "The VM costs money. When a direct connection fails, the relay is limited by the server's "
+ "bandwidth. In mainland China, use the IP unless the domain has an ICP filing."),
+ ],
+ "steps": [
+ "In your cloud provider's security group, open TCP 8787, UDP 3478 and UDP 32768–60999.",
+ "Log in with ssh, download the install script and run it with the public IP: <code>sudo ./install.sh PUBLIC_IP</code>.",
+ "Open <code>http://PUBLIC_IP:8787/healthz</code> in a browser; ok means it's running.",
+ ],
+ "address": "Address for every computer: <code>ws://PUBLIC_IP:8787/signal</code>",
+ },
+ "lan": {
+ "name": "LAN",
+ "fit": "All computers on one network",
+ "summary": "At home or in the office, on the same Wi‑Fi or wired network. Run the server on one of your always-on "
+ "Windows, Mac or Linux computers with one script. Free.",
+ "go": "LAN guide →",
+ "facts": [
+ ("Best for", "Computers on the same Wi‑Fi or wired network, such as at home or in the office."),
+ ("You need", "An always-on Windows, Mac or Linux computer; one of the computers you sync is fine."),
+ ("Keep in mind", "No sync away from that network; it resumes when you're back. Sync also pauses while the "
+ "server computer is off or asleep."),
+ ],
+ "steps": [
+ "Reserve an address for the server computer in your router.",
+ "Download the server for its system and run the install script: double-click <code>install.cmd</code> on "
+ "<a href=\"{server}#windows\">Windows</a>, run <code>./install.sh</code> on <a href=\"{server}#macos\">macOS</a> "
+ "or <a href=\"{server}#linux\">Linux</a>.",
+ "The script finds the computer's LAN address and prints the address for the apps.",
+ ],
+ "address": "Address for every computer: <code>ws://LAN_ADDRESS:8787/signal</code>, for example <code>ws://192.168.1.20:8787/signal</code>",
+ },
+ "ts": {
+ "name": "LAN + Tailscale",
+ "fit": "Across networks, no public server",
+ "summary": "Run the server on an always-on computer at home, then install Tailscale on each computer under the same "
+ "account. They act as if they shared a LAN.",
+ "go": "Tailscale guide →",
+ "facts": [
+ ("Best for", "Computers on different networks, without a public server."),
+ ("You need", "An always-on computer for the server, and Tailscale on every computer under one account."),
+ ("Keep in mind", "Every computer that runs CopySync needs Tailscale, and the one at home stays on. When "
+ "Tailscale can't connect peer to peer it relays through DERP servers, which can be slow."),
+ ],
+ "steps": [
+ "Install Tailscale on each computer and sign in to the same account.",
+ "On the server computer, run <code>tailscale ip -4</code> and note the address starting with 100.",
+ "Install the server with that address, as in <code>install.cmd 100.101.102.103</code> or <code>./install.sh 100.101.102.103</code>.",
+ ],
+ "address": "Address for every computer: <code>ws://TAILSCALE_ADDRESS:8787/signal</code>",
+ },
+ },
"history_h2": "Everything you copied, on every computer",
"history_intro": "History keeps the last 3 days, ready to go back on the clipboard; click an image to preview it. "
@@ -171,9 +220,8 @@ C = {
],
"install_h2": "Install",
- "install_intro": "Install the app on each computer and set up a server. No public IP needed: run the server on an always-on "
- "computer at home, use it directly on your LAN, and add Tailscale for computers elsewhere. "
- "First time? Follow the <a href=\"{start}\">quick start</a>.",
+ "install_intro": "Install the app on each computer, and set up a server both of them can reach. First time? Follow the "
+ "<a href=\"{start}\">quick start</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 "
@@ -190,20 +238,10 @@ C = {
"In Settings, enter your server address and press Enter. Allow it if Windows Firewall asks.",
],
"server_h3": "Server",
- "server_lan": "<strong>No public IP needed.</strong> Run the server on an always-on Windows, Mac or Linux computer at home "
- "or in the office with one script. Computers on other networks reach it through Tailscale.",
- "server_ts": "Across networks with Tailscale",
- "server_cloud": "On a server with a public IP",
- "server_intro": "A Linux server with a public IP, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.",
+ "server_intro": "Three ways to run it; pick the one that fits. Each has a step-by-step guide:",
+ "server_compare": "Compare the three",
"copy": "Copy",
"copied": "Copied",
- "public_ip": "YOUR_PUBLIC_IP",
- "server_after": "The script registers a systemd service that starts on boot and prints the address to enter in the app. "
- "Open these ports in your firewall or security group:",
- "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.",
@@ -249,15 +287,16 @@ C = {
"back to the relay.",
]),
("Do I need my own server?", [
- "Yes. There is no public server, so nobody's data passes through anyone else's machine. But it doesn't need a public IP: "
- "an always-on Windows, Mac or Linux computer at home will do; see the <a href=\"{server}\">LAN guide</a>. Computers on "
- "other networks reach it through Tailscale; see the <a href=\"{ts}\">Tailscale guide</a>. If you have a public IP, a "
- "cloud server works too, and the smallest VM is enough.",
+ "Yes. There is no public server, so nobody's data passes through anyone else's machine. There are three ways to run it: "
+ "a <a href=\"{cloud}\">public server</a>, where the smallest VM is enough and sync works from anywhere; "
+ "your <a href=\"{server}\">LAN</a>, on an always-on computer when all your computers share a network; "
+ "or <a href=\"{ts}\">LAN + Tailscale</a>, across networks without a public server.",
]),
("No public IP at home. Can I sync between home and the office?", [
- "Yes. Run the server on an always-on computer at home, install Tailscale on your home and office computers under the "
- "same account, and use the server's Tailscale address. They behave as if they shared a LAN, and what you copy still "
- "goes directly between the two computers. See <a href=\"{ts}\">Use it across networks with Tailscale</a>.",
+ "Yes, in two ways. With a public server, run CopySync's server there and connect both computers to it; see the "
+ "<a href=\"{cloud}\">public server guide</a>. Without one, run the server on an always-on computer at home, install "
+ "Tailscale on every computer under the same account, and use the server's Tailscale address; see "
+ "<a href=\"{ts}\">LAN + Tailscale</a>.",
]),
("Windows? iPhone?", [
"Windows 10 and 11 (x64) are supported and work together with Macs. Files you paste on Windows are real files you "
@@ -302,9 +341,7 @@ C = {
"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.",
- "hero_aside": "Not on the same network, and no public IP? See <a href=\"{ts}\">Use it across networks with Tailscale</a>.",
- "toc": [("prepare", "Before you start"), ("install", "Install"), ("check", "Check"), ("clients", "Set up the apps"),
- ("away", "Away from home"), ("faq", "Questions")],
+ "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. "
@@ -340,8 +377,7 @@ C = {
"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."),
- ("Syncing away from it", "The server is only reachable on your LAN. To keep a laptop syncing when you take it out, "
- "install Tailscale on each computer; no public IP needed. See the <a href=\"{ts}\">Tailscale guide</a>."),
+ ("No sync away from it", "The server is only reachable on your LAN, so a laptop taken elsewhere catches up when it's back."),
],
"install_h2": "Install the server",
@@ -434,11 +470,6 @@ C = {
"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 the <a href="{start}">quick start</a>.',
- "away_h2": "Want to sync away from home?",
- "away_text": "Install Tailscale on each computer and run the server on its Tailscale address. From the office or anywhere "
- "else, your computers reach the server at home as if they were on the same LAN. No public IP, no router settings.",
- "away_button": "Use it across networks with Tailscale",
-
"faq_h2": "Questions",
"faq": [
("The status stays at Not connected", [
@@ -460,23 +491,133 @@ C = {
"Reserving the address in your router avoids this.",
]),
("Does it sync away from the LAN?", [
- "Yes, with Tailscale: install it on each computer under the same account, install the server with its Tailscale "
- "address and enter that address in the apps. No public IP needed. See <a href=\"{ts}\">Use it across networks with Tailscale</a>.",
- "If you have a public IP, you can also run the server in the cloud; see the <a href=\"{home}#cloud\">steps on the home page</a>.",
+ "No, the server is only reachable on your LAN. To sync from other networks, switch to one of the other two ways: "
+ "a <a href=\"{cloud}\">public server</a>, or <a href=\"{ts}\">LAN + Tailscale</a>.",
]),
- ("A cloud server in mainland China works by IP but not by 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",
+ },
+
+ # ── Run it on a public server (cloud/ page) ──
+ "cloud": {
+ "title": "Run the CopySync server on a public server: cloud VM guide",
+ "description": "One script installs CopySync's signaling and TURN server on a Linux VM with a public IP. Every computer "
+ "connects to it directly, so the clipboard syncs at home, at the office and anywhere else. Covers the "
+ "security group, checking, app setup and domains in mainland China.",
+ "h1": "Run it on a public server",
+ "lede": "A Linux VM with a public IP; the smallest one is enough. Every computer connects to it directly and syncs at "
+ "home, at the office or anywhere else, with nothing extra to install.",
+ "toc": [("prepare", "Before you start"), ("ports", "Open ports"), ("install", "Install"), ("check", "Check"),
+ ("clients", "Set up the apps"), ("faq", "Questions")],
+ "step": "Step {n}",
+
+ "overview_h2": "Every computer connects to it",
+ "overview_intro": "The server is on the public internet, so every computer can reach it from whatever network it's on. "
+ "What you copy goes directly between the two computers when possible; when that fails, it's relayed "
+ "through the server, still encrypted.",
+ "diagram": {
+ "title": "CopySync with a public server",
+ "desc": "The public server is at 203.0.113.10. A Mac on an office network and a Windows PC on a home network both "
+ "connect to it for signaling; copied content goes directly between them, and through the server's relay if that fails.",
+ "server": "Public server",
+ "server_sub": "Cloud VM with a public IP",
+ "office": "Office network",
+ "home": "Home network",
+ "client": "Running CopySync",
+ "sig_note": "Signaling, TCP 8787",
+ "relay_note": "Relay over UDP, if direct fails",
+ "direct": "Direct",
+ },
+ "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> Computers on different networks connect directly through NAT hole punching, which works on most home and office networks.",
+ "<strong>Relay, UDP 3478 and relay ports.</strong> When a direct path fails, the server forwards the traffic, still encrypted and limited by its bandwidth.",
+ ],
+
+ "prep": [
+ ("A cloud VM", "Linux on x86_64 or ARM64; the smallest size is enough, as the server uses about 15 MB of RAM. You need root."),
+ ("A public IP", "The VM's own public IP works; a static (elastic) one is best. If it changes, every computer has to be updated."),
+ ("A way in", "ssh, or the web terminal in your provider's console."),
+ ("VMs in mainland China", "Without an ICP filing for the domain, enter the IP in the apps, not the domain; see the <a href=\"#faq\">questions</a>."),
+ ],
+
+ "ports_h2": "Open the ports in the security group",
+ "ports_intro": "In your cloud provider's console, add these three inbound rules to the VM's security group.",
+ "rules_url": "Cloud console › Security group › Inbound rules",
+ "rules_cols": ["Protocol", "Port range", "Source", "Purpose"],
+ "rules": [
+ ("TCP", "8787", "0.0.0.0/0", "Signaling"),
+ ("UDP", "3478", "0.0.0.0/0", "STUN and TURN"),
+ ("UDP", "32768-60999", "0.0.0.0/0", "Relay ports"),
+ ],
+ "rules_label": "Inbound rules in a cloud security group (illustration): TCP 8787 for signaling, UDP 3478 for STUN and TURN, UDP 32768-60999 for relay ports, all from 0.0.0.0/0",
+ "ports_notes": [
+ "<strong>Different names:</strong> some providers call it a firewall or a network ACL; it's the same setting.",
+ "<strong>Relay ports</strong> are assigned by the OS; the range depends on the server. Run <code>cat /proc/sys/net/ipv4/ip_local_port_range</code> "
+ "to see it; the install script prints it too.",
+ "<strong>System firewall:</strong> if ufw or firewalld is active, open the same ports there; the install script prints the commands.",
+ ],
+
+ "install_h2": "Run the install script",
+ "install_intro": "Give the script the public IP. It installs the server, registers a systemd service that starts on boot, "
+ "and prints the address to enter in the apps.",
+ "install_steps": [
+ "Log in with ssh, for example <code>ssh [email protected]</code> with your public IP.",
+ "Run these lines, with your public IP on the last one:<span class=\"aside\">On ARM, replace <code>amd64</code> with <code>arm64</code>.</span>",
+ "The <code>ws://203.0.113.10:8787/signal</code> address at the end is what you enter in the apps.",
+ ],
+ "install_notes": [
+ "<strong>Registers a systemd service</strong> that starts on boot; the config is <code>/etc/copysync/server.env</code>.",
+ "<strong>Upgrade:</strong> download the new version, extract it and run <code>sudo ./install.sh</code> again; your config is kept.",
+ "<strong>Docker works too:</strong> see the <a href=\"{deploy}\">server deployment guide</a>.",
+ ],
+ "term_label": "Output of sudo ./install.sh 203.0.113.10: it installs, writes the systemd unit and config and starts the server, then prints the address ws://203.0.113.10:8787/signal",
+
+ "check_h2": "Check that it's reachable",
+ "check_intro": "Open <code>http://203.0.113.10:8787/healthz</code> (with your public IP) in a browser on any computer. If you see this line, it works.",
+ "check_label": "A browser showing http://203.0.113.10:8787/healthz, with the server's status ok and its version",
+
+ "clients_steps": [
+ ("Open Settings", "Open CopySync on each computer and go to Settings."),
+ ("Enter the public address", "Under Signaling server, enter <code>ws://203.0.113.10:8787/signal</code> with your public IP and press Return or Enter."),
+ ("Check the status", "When Connection shows a green Connected, you're set. If you haven't paired yet, pair under Devices."),
+ ],
+ "clients_alt": "CopySync Settings: the signaling server is ws://203.0.113.10:8787/signal and the connection status shows Connected",
+
+ "faq": [
+ ("It 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.",
+ ("How big a server do I need?", [
+ "The smallest one. The server uses about 15 MB of RAM and normally forwards only a few signaling messages. Content "
+ "goes directly between computers when possible; only relayed transfers are limited by the server's bandwidth.",
+ ]),
+ ("Devices show Relay instead of Direct", [
+ "Relay right after connecting, then Direct a little later, is normal: the relay gets you going and the direct path "
+ "takes over while idle. Staying on Relay means the two computers can't reach each other directly, usually because "
+ "of a NAT that randomizes ports or a strict firewall. It's still encrypted, just limited by the server's bandwidth.",
+ ]),
+ ("Can I use HTTPS (wss://)?", [
+ "Yes, behind an HTTPS reverse proxy that supports WebSocket upgrades; enter an address starting with <code>wss://</code>. "
+ "Domains in mainland China need an ICP filing. STUN and TURN use UDP and bypass the proxy, so keep those ports open.",
+ ]),
+ ("My home connection has a public IP. Can I use that?", [
+ "Yes, but it's more work than a VM: forward TCP 8787, UDP 3478 and a large range of UDP relay ports to that computer, "
+ "and a home IP may change. If all your computers are at home, the <a href=\"{server}\">LAN</a> setup is simpler; to sync "
+ "across networks without port forwarding, see <a href=\"{ts}\">LAN + Tailscale</a>.",
]),
],
- "closing": "One computer that stays on is enough.",
- "source": "Full server guide, including public servers and Docker",
+ "closing": "One cloud VM,<br>sync from anywhere.",
+ "source": "Full server guide, including Docker and every option",
},
# ── Quick start (start/ page) ──
@@ -508,9 +649,7 @@ C = {
"server_h2": "Set up a server",
"server_intro": "Your computers find each other through it; nothing you copy is stored there. There's no public server, "
- "so pick the option that fits:",
- "server_after": "When it's installed, the script prints an address like <code>ws://192.168.1.20:8787/signal</code>. "
- "You'll need it in the next step.",
+ "and there are three ways to run your own. Pick the one that fits.",
"connect_h2": "Enter the server address on each computer",
"connect_steps": [
@@ -710,7 +849,7 @@ C = {
]),
("I have a public IP. Do I need Tailscale?", [
"No. Run the server on the machine with the public IP and enter that address on every computer; see the "
- "<a href=\"{home}#cloud\">steps on the home page</a>.",
+ "<a href=\"{cloud}\">public server guide</a>.",
]),
],
diff --git a/tools/site/content/ja.py b/tools/site/content/ja.py
index d51a6ea..cbe4bf9 100644
--- a/tools/site/content/ja.py
+++ b/tools/site/content/ja.py
@@ -34,22 +34,68 @@ C = {
"stage_arc": "直接接続、エンドツーエンド暗号化",
"replay": "もう一度再生",
- # サーバーの置き方 3 通り:(条件、状況、方法、説明、リンク)。リンク先は順に LAN の手順、Tailscale の手順、トップページのクラウド手順
- "paths_h2": "グローバル IP がなくても使える",
- "paths_intro": "2 台のコンピューターはサーバーを通じてお互いを見つけます。ただしサーバーはインターネットに公開されている必要はありません。"
- "多くの家庭の回線にはグローバル IP がありませんが、家で電源を入れたままのコンピューターで十分です。",
- "paths": [
- ("グローバル IP 不要", "2 台が同じネットワークにある", "LAN に置く",
- "家や会社で、同じ Wi‑Fi か有線ネットワークにつながっている場合。電源を入れたままの Windows・Mac・Linux のどれか 1 台で、スクリプトをひとつ実行するだけです。",
- "LAN での設置手順 →"),
- ("グローバル IP 不要", "1 台は自宅、1 台は会社", "LAN + Tailscale",
- "サーバーは自宅に置いたまま。各コンピューターに Tailscale を入れれば同じ LAN にあるのと同じように扱えて、ノートパソコンを持ち出しても同期が続きます。",
- "Tailscale での手順 →"),
- ("グローバル IP が必要", "公開サーバーがある", "クラウドに置く",
- "グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。すべてのコンピューターが直接つながり、ほかに入れるものはありません。",
- "設置手順 →"),
- ],
- "paths_after": "迷ったら<a href=\"{start}\">はじめかた</a>に沿って進めてください。",
+ # サーバーの置き方 3 通り。どれも同じ扱いで、ユーザーが選ぶ。トップページのカードは name、fit、summary、go、
+ # はじめかたのタブは name、facts、steps、address、go、インストール欄は name、fit を使う。
+ # steps の {cloud}、{server}、{ts} はそれぞれの手順ページへのリンクに置き換わる
+ "paths_h2": "サーバーをどこに置くか",
+ "paths_intro": "2 台はサーバーを通じてお互いを見つけます。コピーした内容がそこに保存されることはありません。公開サーバーはないので、"
+ "3 通りの置き方から状況に合うものを選んでください。",
+ "paths_after": "迷ったら<a href=\"{start}#server\">はじめかた</a>で 3 通りを比べられます。",
+ "plans_label": "サーバーの置き方",
+ "plans": {
+ "cloud": {
+ "name": "公開サーバー",
+ "fit": "どこからでも同期",
+ "summary": "グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。各コンピューターが直接つながり、自宅でも会社でも外出先でも、ほかに入れるものはありません。",
+ "go": "公開サーバーでの手順 →",
+ "facts": [
+ ("向いている", "コンピューターが別々のネットワークにあり、どこからでも同期したい場合。ネットワークをまたぐならいちばん手間がかかりません。"),
+ ("必要なもの", "グローバル IP を持つ Linux のクラウドサーバー(最小構成で可)と root 権限。"),
+ ("注意", "クラウドサーバーの費用がかかります。直接つながらないときの中継はサーバーの帯域に左右されます。中国本土では、ICP 登録のないドメインは使えないので IP を入力します。"),
+ ],
+ "steps": [
+ "クラウドのセキュリティグループで TCP 8787、UDP 3478、UDP 32768–60999 を開けます。",
+ "ssh でログインし、インストールスクリプトをダウンロードして、グローバル IP を付けて実行します:<code>sudo ./install.sh グローバルIP</code>。",
+ "ブラウザーで <code>http://グローバルIP:8787/healthz</code> を開き、ok と表示されれば完了です。",
+ ],
+ "address": "各コンピューターに入力するアドレス:<code>ws://グローバルIP:8787/signal</code>",
+ },
+ "lan": {
+ "name": "LAN",
+ "fit": "全部が同じネットワークにある",
+ "summary": "家や会社で、同じ Wi‑Fi か有線ネットワークにつながっている場合。電源を入れたままの Windows・Mac・Linux のどれか 1 台で、スクリプトをひとつ実行するだけ。費用はかかりません。",
+ "go": "LAN での設置手順 →",
+ "facts": [
+ ("向いている", "コンピューターがすべて同じ Wi‑Fi か有線ネットワークにある場合(家や会社など)。"),
+ ("必要なもの", "電源を入れたままの Windows・Mac・Linux。同期するコンピューターの 1 台でもかまいません。"),
+ ("注意", "そのネットワークの外では同期せず、戻ると再開します。そのコンピューターの電源が切れたりスリープしたりしているあいだも止まります。"),
+ ],
+ "steps": [
+ "サーバーにするコンピューターのアドレスをルーターで固定します。",
+ "OS に合ったサーバーをダウンロードしてインストールスクリプトを実行します。<a href=\"{server}#windows\">Windows</a> は "
+ "<code>install.cmd</code> をダブルクリック、<a href=\"{server}#macos\">macOS</a> と <a href=\"{server}#linux\">Linux</a> は <code>./install.sh</code> を実行します。",
+ "スクリプトが LAN のアドレスを見つけ、最後にアプリに入力するアドレスを表示します。",
+ ],
+ "address": "各コンピューターに入力するアドレス:<code>ws://LANのアドレス:8787/signal</code>(例:<code>ws://192.168.1.20:8787/signal</code>)",
+ },
+ "ts": {
+ "name": "LAN + Tailscale",
+ "fit": "ネットワークをまたぐ、公開サーバーなし",
+ "summary": "サーバーは自宅で電源を入れたままのコンピューターに置き、各コンピューターに Tailscale を入れて同じアカウントでサインインします。同じ LAN にあるのと同じように扱えます。",
+ "go": "Tailscale での手順 →",
+ "facts": [
+ ("向いている", "コンピューターが別々のネットワークにあり、公開サーバーがない場合。"),
+ ("必要なもの", "サーバー用に電源を入れたままのコンピューター 1 台と、すべてのコンピューターに同じアカウントの Tailscale。"),
+ ("注意", "CopySync を使うコンピューターすべてに Tailscale が必要で、自宅の 1 台は電源を入れたままにします。Tailscale が P2P でつなげないときは DERP サーバーで中継され、遅くなることがあります。"),
+ ],
+ "steps": [
+ "各コンピューターに Tailscale を入れ、同じアカウントでサインインします。",
+ "サーバーにするコンピューターで <code>tailscale ip -4</code> を実行し、100 で始まるアドレスを控えます。",
+ "そのアドレスを付けてサーバーをインストールします(例:<code>install.cmd 100.101.102.103</code>、<code>./install.sh 100.101.102.103</code>)。",
+ ],
+ "address": "各コンピューターに入力するアドレス:<code>ws://Tailscaleのアドレス:8787/signal</code>",
+ },
+ },
"history_h2": "どのデバイスでコピーしたものも、ここに",
"history_intro": "履歴には直近 3 日分が残り、いつでもクリップボードに戻せます。画像はクリックでプレビュー。"
@@ -162,8 +208,7 @@ C = {
],
"install_h2": "インストール",
- "install_intro": "それぞれのコンピューターにアプリを入れ、サーバーを 1 台用意します。グローバル IP は要りません。自宅で電源を入れたままのコンピューターでサーバーを動かし、"
- "同じ LAN ならそのまま、別のネットワークからは Tailscale を加えて使います。はじめての方は<a href=\"{start}\">はじめかた</a>をどうぞ。",
+ "install_intro": "それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。はじめての方は<a href=\"{start}\">はじめかた</a>をどうぞ。",
"mac_steps": [
"CopySync.dmg をダウンロードして開き、CopySync を「アプリケーション」にドラッグします。",
"「アプリケーション」から開きます。<span class=\"aside\">初回は「開発元を検証できません」と表示されます。CopySync はまだ Apple の公証を受けていないためです。"
@@ -179,19 +224,10 @@ C = {
"「設定」でサーバーのアドレスを入力して Enter を押します。ファイアウォールに聞かれたら許可します。",
],
"server_h3": "サーバー",
- "server_lan": "<strong>グローバル IP は不要です。</strong>家や会社で電源を入れたままの Windows・Mac・Linux で、スクリプトをひとつ実行するだけ。"
- "別のネットワークにあるコンピューターは Tailscale でつながります。",
- "server_ts": "Tailscale でネットワークをまたぐ",
- "server_cloud": "グローバル IP を持つサーバーに置く",
- "server_intro": "グローバル IP を持つ Linux サーバー、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。",
+ "server_intro": "置き方は 3 通り。状況に合うものを選んでください。どれにも手順のページがあります:",
+ "server_compare": "3 通りを比べる",
"copy": "コピー",
"copied": "コピーしました",
- "public_ip": "グローバルIP",
- "server_after": "スクリプトは起動時に立ち上がる systemd サービスを登録し、最後にアプリへ入力するアドレスを表示します。ファイアウォールやセキュリティグループで次のポートを開けてください。",
- "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 同士でも同じ手順です。",
@@ -233,15 +269,15 @@ C = {
"テストでは、出口が 4 つある会社の Mac と家庭の回線が直接つながりました。相手がポートをランダムに割り当てる NAT の場合は中継になります。",
]),
("サーバーは自分で用意する必要がありますか?", [
- "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。ただしグローバル IP は不要で、"
- "自宅で電源を入れたままの Windows・Mac・Linux で十分です(<a href=\"{server}\">LAN での設置手順</a>)。"
- "別のネットワークにあるコンピューターは Tailscale でつながります(<a href=\"{ts}\">Tailscale での手順</a>)。"
- "グローバル IP があれば、最小構成のクラウドサーバーに置くこともできます。",
+ "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。置き方は 3 通りです。"
+ "<a href=\"{cloud}\">公開サーバー</a>は最小構成のクラウドサーバーで足り、どこからでも同期できます。"
+ "<a href=\"{server}\">LAN</a> はすべてのコンピューターが同じネットワークにあるとき、電源を入れたままの 1 台に置きます。"
+ "<a href=\"{ts}\">LAN + Tailscale</a> は公開サーバーなしでネットワークをまたぐときに使います。",
]),
("自宅にグローバル IP がありません。自宅と会社のあいだで同期できますか?", [
- "できます。自宅で電源を入れたままのコンピューターでサーバーを動かし、自宅と会社のコンピューターに Tailscale を入れて同じアカウントでサインインし、"
- "サーバーのアドレスに Tailscale のアドレスを使います。同じ LAN にあるのと同じように扱え、コピーした内容は 2 台のあいだを直接流れます。"
- "手順は<a href=\"{ts}\">Tailscale でネットワークをまたいで使う</a>をご覧ください。",
+ "できます。方法は 2 つあります。公開サーバーがあれば、そこにサーバーを置いて両方のコンピューターから直接つなぎます(<a href=\"{cloud}\">公開サーバーでの手順</a>)。"
+ "なければ、自宅で電源を入れたままのコンピューターでサーバーを動かし、すべてのコンピューターに Tailscale を入れて同じアカウントでサインインし、"
+ "サーバーのアドレスに Tailscale のアドレスを使います(<a href=\"{ts}\">LAN + Tailscale</a>)。",
]),
("Windows に対応していますか?iPhone は?", [
"Windows 10 と Windows 11(x64)に対応し、Mac と相互に使えます。Windows で貼り付けたファイルは本物のファイルなので、エクスプローラーや Office にそのまま貼り付けられます。",
@@ -280,9 +316,7 @@ C = {
"h1": "LAN にサーバーを置く",
"lede": "家や会社のコンピューターが同じネットワークにあるなら、クラウドサーバーは要りません。電源を入れたままのコンピューターを 1 台選び、"
"スクリプトをダウンロードして実行し、表示されたアドレスを各コンピューターの CopySync に入力します。",
- "hero_aside": "2 台が別のネットワークにあり、グローバル IP もない場合は<a href=\"{ts}\">Tailscale でネットワークをまたいで使う</a>をご覧ください。",
- "toc": [("prepare", "準備"), ("install", "インストール"), ("check", "確認"), ("clients", "アドレスの入力"),
- ("away", "外出先でも使う"), ("faq", "よくある質問")],
+ "toc": [("prepare", "準備"), ("install", "インストール"), ("check", "確認"), ("clients", "アドレスの入力"), ("faq", "よくある質問")],
"overview_h2": "サーバーは引き合わせるだけ",
"overview_intro": "各コンピューターはサーバーにつながったままで、それを通じて相手を見つけ、接続情報を交換します。つながったあと、"
@@ -316,8 +350,7 @@ C = {
"そうしないと、アドレスが変わるたびに全部のコンピューターで入れ直すことになります。"),
("同じネットワークに", "同じ Wi‑Fi か有線ネットワークにつながっていれば十分です。ゲストネットワークや AP アイソレーションが有効な Wi‑Fi では"
"デバイスどうしが通信できないので、別のネットワークを使うか、アイソレーションをオフにしてください。"),
- ("ネットワークの外でも同期したいなら", "サーバーには LAN の中からしか届きません。持ち出したノートパソコンでも同期したい場合は、"
- "各コンピューターに Tailscale を入れれば、グローバル IP なしでつながります(<a href=\"{ts}\">Tailscale での手順</a>)。"),
+ ("ネットワークの外では同期しない", "サーバーには LAN の中からしか届きません。持ち出したノートパソコンは、戻ってきてから同期を再開します。"),
],
"install_h2": "サーバーをインストール",
@@ -410,11 +443,6 @@ C = {
"clients_alt": "CopySync の設定画面:シグナリングサーバーは ws://192.168.1.20:8787/signal、接続状態は接続済み",
"clients_after": 'アプリがまだなら、<a href="{start}">はじめかた</a>をご覧ください。',
- "away_h2": "外出先でも同期したい?",
- "away_text": "各コンピューターに Tailscale を入れ、サーバーをその Tailscale アドレスで動かせば、会社からでも外出先からでも、"
- "同じ LAN にいるように自宅のサーバーにつながります。グローバル IP もルーターの設定も要りません。",
- "away_button": "Tailscale でネットワークをまたいで使う",
-
"faq_h2": "よくある質問",
"faq": [
("接続状態が「未接続」のまま", [
@@ -433,14 +461,8 @@ C = {
"ルーターでアドレスを固定しておけば、こうしたことは起きません。",
]),
("LAN の外でも同期できますか?", [
- "Tailscale を使えばできます。各コンピューターに入れて同じアカウントでサインインし、サーバーを Tailscale のアドレスでインストールして、"
- "アプリにもそのアドレスを入力します。グローバル IP は不要です。手順は<a href=\"{ts}\">Tailscale でネットワークをまたいで使う</a>をご覧ください。",
- "グローバル IP があれば、クラウドサーバーに置くこともできます(<a href=\"{home}#cloud\">トップページの設置手順</a>)。",
- ]),
- ("中国本土のクラウドサーバーで、ドメインではつながらず IP ならつながる", [
- "ICP 登録(备案)のないドメインへの平文 HTTP リクエストは、中国本土のクラウド事業者に横取りされ、ブロックページへのリダイレクトが返されます。"
- "テストでは 8787 のような一般的でないポートでも同じでした。WebSocket のハンドシェイクも HTTP リクエストなので同じく止められ、アプリは未接続になります。",
- "アドレスには <code>ws://サーバーのIP:8787/signal</code> のように IP を直接入力するか、ドメインを登録してください。",
+ "できません。サーバーには LAN の中からしか届かないためです。別のネットワークからも同期したい場合は、ほかの 2 通りのどちらかに切り替えます:"
+ "<a href=\"{cloud}\">公開サーバー</a>、または <a href=\"{ts}\">LAN + Tailscale</a>。",
]),
("サーバーを動かすコンピューターでも CopySync を使う場合のアドレスは?", [
"同じ LAN のアドレスで大丈夫です。<code>ws://127.0.0.1:8787/signal</code> でもかまいません。サーバーとアプリは互いに影響しません。",
@@ -451,6 +473,116 @@ C = {
"source": "サーバーの詳しい構築手順(グローバル IP、Docker を含む、英語・中国語)",
},
+ # ── 公開サーバーに置く(cloud/ ページ) ──
+ "cloud": {
+ "title": "CopySync のサーバーを公開サーバーに置く:クラウドサーバーの手順",
+ "description": "グローバル IP を持つ Linux のクラウドサーバーに、スクリプトひとつで CopySync のシグナリング兼 TURN サーバーを入れます。"
+ "各コンピューターが直接つながり、自宅でも会社でも外出先でもクリップボードを同期できます。セキュリティグループ、確認、アプリの設定、中国本土のドメインについて。",
+ "h1": "公開サーバーに置く",
+ "lede": "グローバル IP を持つ Linux のクラウドサーバー。最小構成で足ります。各コンピューターが直接つながり、自宅でも会社でも外出先でも同期でき、ほかに入れるものはありません。",
+ "toc": [("prepare", "準備"), ("ports", "ポートを開ける"), ("install", "インストール"), ("check", "確認"),
+ ("clients", "アドレスの入力"), ("faq", "よくある質問")],
+ "step": "ステップ {n}",
+
+ "overview_h2": "すべてのコンピューターが直接つながる",
+ "overview_intro": "サーバーはインターネット上にあるので、各コンピューターはどのネットワークからでも直接つながります。コピーした内容はできるかぎり 2 台のあいだを直接流れ、"
+ "直接つながらないときはサーバーで中継します。その場合も暗号化されたままです。",
+ "diagram": {
+ "title": "公開サーバーを使う CopySync",
+ "desc": "公開サーバーのアドレスは 203.0.113.10。会社のネットワークの Mac と自宅のネットワークの Windows PC が、どちらもシグナリングでサーバーに接続します。"
+ "コピーした内容は 2 台のあいだを直接流れ、直接つながらないときはサーバーで中継します。",
+ "server": "公開サーバー",
+ "server_sub": "グローバル IP のクラウドサーバー",
+ "office": "会社のネットワーク",
+ "home": "自宅のネットワーク",
+ "client": "CopySync を使用",
+ "sig_note": "シグナリング TCP 8787",
+ "relay_note": "中継 UDP(直接不可のとき)",
+ "direct": "直接接続",
+ },
+ "overview_points": [
+ "<strong>シグナリング、TCP 8787。</strong>各コンピューターが常に接続し、相手の発見、ペアリング、接続情報の交換に使います。",
+ "<strong>直接接続。</strong>別々のネットワークにある 2 台は NAT 穴あけで直接つながります。ほとんどの家庭と会社のネットワークで成功します。",
+ "<strong>中継、UDP 3478 と中継用ポート。</strong>直接つながらないときはサーバーが転送します。暗号化されたままで、速度はサーバーの帯域に左右されます。",
+ ],
+
+ "prep": [
+ ("クラウドサーバー", "Linux(x86_64 または ARM64)。サーバーのメモリは約 15 MB なので最小構成で足ります。root 権限が必要です。"),
+ ("グローバル IP", "クラウドサーバーに付いているもので構いません。固定(Elastic IP など)が理想です。変わると全部のコンピューターで入れ直しになります。"),
+ ("ログインの手段", "ssh、またはクラウドのコンソールにある Web ターミナル。"),
+ ("中国本土のクラウドサーバー", "ICP 登録のないドメインは使えないので、アプリにはドメインではなく IP を入力します(<a href=\"#faq\">よくある質問</a>)。"),
+ ],
+
+ "ports_h2": "セキュリティグループでポートを開ける",
+ "ports_intro": "クラウドのコンソールで、このサーバーのセキュリティグループに次の 3 つのインバウンドルールを追加します。",
+ "rules_url": "クラウドのコンソール › セキュリティグループ › インバウンドルール",
+ "rules_cols": ["プロトコル", "ポート範囲", "ソース", "用途"],
+ "rules": [
+ ("TCP", "8787", "0.0.0.0/0", "シグナリング"),
+ ("UDP", "3478", "0.0.0.0/0", "STUN と TURN"),
+ ("UDP", "32768-60999", "0.0.0.0/0", "中継用ポート"),
+ ],
+ "rules_label": "クラウドのセキュリティグループのインバウンドルール(イメージ):TCP 8787 はシグナリング、UDP 3478 は STUN と TURN、UDP 32768-60999 は中継用ポート、ソースはすべて 0.0.0.0/0",
+ "ports_notes": [
+ "<strong>呼び名の違い:</strong>事業者によって「ファイアウォール」「ネットワーク ACL」などと呼ばれますが、同じ設定です。",
+ "<strong>中継用ポート</strong>は OS が割り当て、範囲はサーバーによって異なります。<code>cat /proc/sys/net/ipv4/ip_local_port_range</code> で確認でき、インストールスクリプトも最後に表示します。",
+ "<strong>OS のファイアウォール:</strong>ufw や firewalld が有効なら同じポートを開けます。コマンドはスクリプトの最後に表示されます。",
+ ],
+
+ "install_h2": "インストールスクリプトを実行",
+ "install_intro": "スクリプトにグローバル IP を渡すと、サーバーをインストールし、起動時に立ち上がる systemd サービスを登録して、最後にアプリへ入力するアドレスを表示します。",
+ "install_steps": [
+ "ssh でログインします(例:<code>ssh [email protected]</code>、あなたのグローバル IP に置き換え)。",
+ "次の行を順に実行します。最後の行はあなたのグローバル IP に置き換えます:<span class=\"aside\">ARM では <code>amd64</code> を <code>arm64</code> に置き換えます。</span>",
+ "最後に表示される <code>ws://203.0.113.10:8787/signal</code> がアプリに入力するアドレスです。",
+ ],
+ "install_notes": [
+ "<strong>systemd サービスとして登録</strong>され、起動時に立ち上がります。設定は <code>/etc/copysync/server.env</code>。",
+ "<strong>更新:</strong>新しいバージョンをダウンロードして展開し、もう一度 <code>sudo ./install.sh</code> を実行。設定は引き継がれます。",
+ "<strong>Docker でも動かせます:</strong><a href=\"{deploy}\">サーバーの構築手順</a>(英語・中国語)をご覧ください。",
+ ],
+ "term_label": "sudo ./install.sh 203.0.113.10 の出力:インストール、systemd ユニットと設定の作成、起動のあと、アドレス ws://203.0.113.10:8787/signal を表示",
+
+ "check_h2": "つながるか確認",
+ "check_intro": "どのコンピューターでもよいので、ブラウザーで <code>http://203.0.113.10:8787/healthz</code>(あなたのグローバル IP)を開きます。次の 1 行が表示されれば成功です。",
+ "check_label": "ブラウザーで http://203.0.113.10:8787/healthz を開くと、サーバーの状態 ok とバージョンが表示される",
+
+ "clients_steps": [
+ ("設定を開く", "各コンピューターで CopySync を開き、「設定」に進みます。"),
+ ("公開アドレスを入力", "「シグナリングサーバー」に <code>ws://203.0.113.10:8787/signal</code>(あなたのグローバル IP)を入力し、Return か Enter を押します。"),
+ ("状態を確認", "「接続状態」が緑の「接続済み」になれば完了です。まだペアリングしていなければ「デバイス」でペアリングします。"),
+ ],
+ "clients_alt": "CopySync の設定画面:シグナリングサーバーは ws://203.0.113.10:8787/signal、接続状態は接続済み",
+
+ "faq": [
+ ("ドメインではつながらず、IP ならつながる", [
+ "ICP 登録(备案)のないドメインへの平文 HTTP リクエストは、中国本土のクラウド事業者に横取りされ、ブロックページへのリダイレクトが返されます。"
+ "テストでは 8787 のような一般的でないポートでも同じでした。WebSocket のハンドシェイクも HTTP リクエストなので同じく止められ、アプリは未接続になります。",
+ "アドレスには <code>ws://サーバーのIP:8787/signal</code> のように IP を直接入力するか、ドメインを登録してください。",
+ ]),
+ ("どのくらいの性能が必要ですか?", [
+ "最小構成で十分です。サーバーのメモリは約 15 MB で、ふだんは少しのシグナリングメッセージを転送するだけです。コピーした内容は直接つながればサーバーを通らず、"
+ "中継になったときだけ速度がサーバーの帯域に左右されます。",
+ ]),
+ ("デバイスが「直接」ではなく「中継」になる", [
+ "つながった直後は中継、少しして直接に変わるのは正常です。まず中継で使えるようにし、アイドル時に直接接続に切り替えます。"
+ "ずっと中継のままなら、2 台のあいだで直接つながっていません。ポートをランダムに割り当てる NAT や厳しいファイアウォールが原因です。暗号化はそのままで、速度がサーバーの帯域に左右されるだけです。",
+ ]),
+ ("HTTPS(wss://)で使えますか?", [
+ "WebSocket のアップグレードに対応した HTTPS のリバースプロキシの後ろに置けば使えます。アドレスは <code>wss://</code> で始めます。中国本土のドメインには ICP 登録が必要です。"
+ "STUN と TURN は UDP でプロキシを通らないので、そのポートは開けたままにします。",
+ ]),
+ ("自宅の回線にグローバル IP があります。それで代わりになりますか?", [
+ "なりますが、クラウドサーバーより手間がかかります。ルーターで TCP 8787、UDP 3478、中継用の広い範囲の UDP ポートをそのコンピューターに転送する必要があり、"
+ "自宅のグローバル IP は変わることもあります。全部が自宅にあるなら <a href=\"{server}\">LAN</a> のほうが簡単で、ポート転送なしでネットワークをまたぐなら "
+ "<a href=\"{ts}\">LAN + Tailscale</a> があります。",
+ ]),
+ ],
+
+ "closing": "クラウドサーバー 1 台で、<br>どこからでも同期。",
+ "source": "サーバーの詳しい構築手順(Docker とすべてのオプション、英語・中国語)",
+ },
+
# ── はじめかた(start/ ページ) ──
"start": {
"title": "はじめかた:3 ステップで CopySync を使い始める",
@@ -477,8 +609,7 @@ C = {
"app_alt": "初めて開いた CopySync:バックグラウンド同期を有効にするよう案内している",
"server_h2": "サーバーを用意する",
- "server_intro": "2 台はサーバーを通じてお互いを見つけます。コピーした内容がそこに保存されることはありません。公開サーバーはないので、状況に合うものを選んでください。",
- "server_after": "インストールが終わると、スクリプトが <code>ws://192.168.1.20:8787/signal</code> のようなアドレスを表示します。次のステップで使います。",
+ "server_intro": "2 台はサーバーを通じてお互いを見つけます。コピーした内容がそこに保存されることはありません。公開サーバーはないので、3 通りの置き方から状況に合うものを選んでください。",
"connect_h2": "各コンピューターにサーバーのアドレスを入力",
"connect_steps": [
@@ -659,7 +790,7 @@ C = {
"通常は変わりません。アドレスはデバイスに付いていて、再起動やネットワークの変更でも同じです。デバイスを Tailscale から削除して追加し直したときだけ変わります。",
]),
("グローバル IP があります。Tailscale は必要?", [
- "不要です。グローバル IP を持つマシンにサーバーを置き、すべてのコンピューターにそのアドレスを入力してください(<a href=\"{home}#cloud\">トップページの設置手順</a>)。",
+ "不要です。グローバル IP を持つマシンにサーバーを置き、すべてのコンピューターにそのアドレスを入力してください(<a href=\"{cloud}\">公開サーバーでの手順</a>)。",
]),
],
diff --git a/tools/site/content/zh.py b/tools/site/content/zh.py
index 5a11bf3..d6b5ea4 100644
--- a/tools/site/content/zh.py
+++ b/tools/site/content/zh.py
@@ -32,21 +32,67 @@ C = {
"stage_arc": "直连,端到端加密",
"replay": "再演示一次",
- # 三种部署方式:(适用条件, 情况, 做法, 说明, 链接文字),链接依次是局域网教程、Tailscale 教程、首页的云服务器部署
- "paths_h2": "没有公网 IP,也能用",
- "paths_intro": "两台电脑要靠一台服务器找到彼此。这台服务器不必在公网上:大多数人家里没有公网 IP,放在家里一台常开的电脑上就行。",
- "paths": [
- ("不需要公网 IP", "两台电脑在同一个网络里", "局域网部署",
- "家里或办公室,连着同一个 Wi‑Fi 或有线网络。服务器装在其中一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本就好。",
- "局域网部署教程 →"),
- ("不需要公网 IP", "一台在家,一台在公司", "局域网部署 + Tailscale",
- "服务器照样放在家里。每台电脑装上 Tailscale,就像在同一个局域网里:笔记本带到哪儿,复制都能同步。",
- "Tailscale 教程 →"),
- ("需要公网 IP", "有一台公网服务器", "云服务器部署",
- "一台有公网 IP 的 Linux 云主机,最低配置就够。所有电脑直接连它,不用另装组网工具。",
- "部署步骤 →"),
- ],
- "paths_after": "拿不准选哪个?跟着<a href=\"{start}\">快速开始</a>一步步来。",
+ # 三种部署方式,地位相同,由用户自己选。首页的卡片用 name、fit、summary、go;
+ # 快速开始的分页用 name、facts、steps、address、go;安装一节用 name、fit。
+ # steps 里的 {cloud}、{server}、{ts} 换成对应教程的地址
+ "paths_h2": "服务器放在哪",
+ "paths_intro": "两台电脑靠一台服务器找到彼此,复制的内容不会存在上面。CopySync 不提供公共服务器,有三种部署方式,按你的情况选一种。",
+ "paths_after": "拿不准?<a href=\"{start}#server\">快速开始</a>里有三种方式的对比。",
+ "plans_label": "部署方式",
+ "plans": {
+ "cloud": {
+ "name": "公网服务器",
+ "fit": "在哪儿都能同步",
+ "summary": "一台有公网 IP 的 Linux 云主机,最低配置就够。每台电脑直接连它,在家、在公司、在外面都能用,不用另装软件。",
+ "go": "公网服务器部署教程 →",
+ "facts": [
+ ("适合", "电脑分散在不同的网络里,想在哪儿都能同步。跨网络时最省心。"),
+ ("要准备", "一台有公网 IP 的 Linux 云主机,最低配置就够,需要 root。"),
+ ("要注意", "云主机要花钱。打不通直连时走中转,速度受服务器带宽限制。国内域名没有备案时,客户端要填 IP。"),
+ ],
+ "steps": [
+ "在云厂商的安全组里放行 TCP 8787、UDP 3478 和 UDP 32768–60999。",
+ "ssh 登录服务器,下载并运行安装脚本,带上它的公网 IP:<code>sudo ./install.sh 公网IP</code>。",
+ "在浏览器里打开 <code>http://公网IP:8787/healthz</code>,能看到 ok 就装好了。",
+ ],
+ "address": "每台电脑要填的地址:<code>ws://公网IP:8787/signal</code>",
+ },
+ "lan": {
+ "name": "局域网",
+ "fit": "电脑都在同一个网络里",
+ "summary": "家里或办公室,连着同一个 Wi‑Fi 或有线网络。服务器装在其中一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本,不花钱。",
+ "go": "局域网部署教程 →",
+ "facts": [
+ ("适合", "电脑都在同一个 Wi‑Fi 或有线网络里,比如家里或办公室。"),
+ ("要准备", "一台常开的 Windows、Mac 或 Linux 电脑,要同步的电脑之一也行。"),
+ ("要注意", "离开这个网络就不同步,回来后自动恢复。那台电脑关机或睡眠时同步也会暂停。"),
+ ],
+ "steps": [
+ "在路由器里给当服务器的电脑固定一个地址。",
+ "下载对应系统的服务器,运行安装脚本:<a href=\"{server}#windows\">Windows</a> 上双击 <code>install.cmd</code>,"
+ "<a href=\"{server}#macos\">macOS</a> 与 <a href=\"{server}#linux\">Linux</a> 上运行 <code>./install.sh</code>。",
+ "脚本会找到本机的局域网地址,最后显示客户端要填的地址。",
+ ],
+ "address": "每台电脑要填的地址:<code>ws://局域网地址:8787/signal</code>,比如 <code>ws://192.168.1.20:8787/signal</code>",
+ },
+ "ts": {
+ "name": "局域网 + Tailscale",
+ "fit": "要跨网络,没有公网服务器",
+ "summary": "服务器放在家里一台常开的电脑上,每台电脑装上 Tailscale、登录同一个账号,就像在同一个局域网里。",
+ "go": "Tailscale 教程 →",
+ "facts": [
+ ("适合", "电脑在不同的网络里,又没有公网服务器。"),
+ ("要准备", "一台常开的电脑当服务器;每台电脑都装 Tailscale,登录同一个账号。"),
+ ("要注意", "所有用 CopySync 的电脑都要装 Tailscale,家里那台要一直开着。Tailscale 自己打不通时经境外中转,在国内会慢。"),
+ ],
+ "steps": [
+ "每台电脑装上 Tailscale,登录同一个账号。",
+ "在当服务器的电脑上运行 <code>tailscale ip -4</code>,记下 100 开头的地址。",
+ "带上这个地址安装服务器,比如 <code>install.cmd 100.101.102.103</code> 或 <code>./install.sh 100.101.102.103</code>。",
+ ],
+ "address": "每台电脑要填的地址:<code>ws://Tailscale 地址:8787/signal</code>",
+ },
+ },
"history_h2": "所有设备上复制过的,都在这里",
"history_intro": "复制记录保留最近 3 天的内容,随时可以放回剪贴板,图片点开就能预览。"
@@ -155,7 +201,7 @@ C = {
],
"install_h2": "安装",
- "install_intro": "每台电脑装一个 App,再准备一台服务器。不需要公网 IP:服务器放在家里一台常开的电脑上,同一个局域网直接用,不在同一个网络就加上 Tailscale。第一次装可以跟着<a href=\"{start}\">快速开始</a>。",
+ "install_intro": "每台电脑装一个 App,再准备一台两边都能访问到的服务器。第一次装可以跟着<a href=\"{start}\">快速开始</a>。",
"mac_steps": [
"下载 CopySync.dmg,打开后把 CopySync 拖进「应用程序」。",
"从「应用程序」里打开。<span class=\"aside\">第一次会提示「无法验证开发者」:CopySync 还没有经过 Apple 公证。"
@@ -171,18 +217,10 @@ C = {
"在「设置」里填入服务器地址,按回车。防火墙询问时选择允许。",
],
"server_h3": "服务器",
- "server_lan": "<strong>没有公网 IP 也行。</strong>服务器装在家里或办公室一台常开的 Windows、Mac 或 Linux 电脑上,运行一个脚本。不在同一个网络的电脑,装上 Tailscale 就能连回来。",
- "server_ts": "用 Tailscale 跨网络",
- "server_cloud": "有公网 IP 的服务器",
- "server_intro": "一台有公网 IP 的 Linux 服务器,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。",
+ "server_intro": "三种部署方式,按你的情况选一种,每种都有图文教程:",
+ "server_compare": "对比三种方式",
"copy": "复制",
"copied": "已复制",
- "public_ip": "你的公网IP",
- "server_after": "脚本会注册开机自启的 systemd 服务,最后打印出 App 里要填的地址。防火墙或云安全组需要放行:",
- "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 之间都一样。",
@@ -223,12 +261,14 @@ C = {
"实测公司 4 个出口与家用宽带之间可以直连。对端是端口随机分配的 NAT 时仍会走中转。",
]),
("必须自己准备服务器吗?", [
- "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。但它不需要公网 IP:放在家里一台常开的 Windows、Mac 或 Linux 电脑上就行,见<a href=\"{server}\">局域网部署教程</a>;"
- "不在同一个网络的电脑,装上 Tailscale 就能连回来,见<a href=\"{ts}\">Tailscale 教程</a>。有公网 IP 的话,也可以部署在云服务器上,最低配置就够。",
+ "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。有三种部署方式:"
+ "<a href=\"{cloud}\">公网服务器</a>,最低配置的云主机就够,在哪儿都能同步;"
+ "<a href=\"{server}\">局域网</a>,电脑都在同一个网络里时,放在其中一台常开的电脑上;"
+ "<a href=\"{ts}\">局域网 + Tailscale</a>,要跨网络又没有公网服务器时用。",
]),
("家里没有公网 IP,能在家和公司之间同步吗?", [
- "能。服务器装在家里一台常开的电脑上,家里和公司的电脑都装上 Tailscale、登录同一个账号,服务器地址填它的 Tailscale 地址。"
- "它们就像在同一个局域网里,复制的内容照样在两台电脑之间直接传输。步骤见<a href=\"{ts}\">用 Tailscale 跨网络使用</a>。",
+ "能,有两种做法。有一台公网服务器的话,把服务器部署在上面,家里和公司的电脑都直接连它,见<a href=\"{cloud}\">公网服务器部署</a>。"
+ "没有的话,服务器放在家里一台常开的电脑上,每台电脑装上 Tailscale、登录同一个账号,服务器地址填它的 Tailscale 地址,见<a href=\"{ts}\">局域网 + Tailscale</a>。",
]),
("支持 Windows 吗?iPhone 呢?", [
"支持 Windows 10 与 Windows 11(x64),与 Mac 互通。复制的文件在 Windows 上粘贴出来就是真实文件,能直接粘进资源管理器、微信、Office。",
@@ -267,8 +307,7 @@ C = {
"h1": "在局域网里部署服务器",
"lede": "家里或办公室的电脑在同一个网络里,就不需要云服务器。找一台常开的电脑,下载、运行一个脚本,"
"再把它显示的地址填进每台电脑的 CopySync 里。",
- "hero_aside": "两台电脑不在同一个网络,又没有公网 IP?看<a href=\"{ts}\">用 Tailscale 跨网络使用</a>。",
- "toc": [("prepare", "准备"), ("install", "安装服务器"), ("check", "检查"), ("clients", "填地址"), ("away", "离开家也想用"), ("faq", "常见问题")],
+ "toc": [("prepare", "准备"), ("install", "安装服务器"), ("check", "检查"), ("clients", "填地址"), ("faq", "常见问题")],
"overview_h2": "服务器只负责牵线",
"overview_intro": "每台电脑一直连着服务器,靠它找到对方、交换连接信息。连上之后,复制的内容在两台电脑之间直接传输;"
@@ -301,8 +340,7 @@ C = {
("一个固定的地址", "在路由器的「DHCP 静态分配」(也叫「地址保留」「IP 与 MAC 绑定」)里给这台电脑固定一个地址。"
"不然路由器换了地址,每台电脑都要重新填。"),
("在同一个网络里", "设备连同一个 Wi‑Fi 或有线网络就行。访客网络、开了「AP 隔离」的 Wi‑Fi 不让设备互相访问,需要换个网络或关掉隔离。"),
- ("离开这个网络也想同步", "服务器只在局域网里访问得到。笔记本带出门也想同步,给每台电脑装上 Tailscale 就行,"
- "不需要公网 IP,见<a href=\"{ts}\">Tailscale 教程</a>。"),
+ ("离开这个网络就不同步", "服务器只在局域网里访问得到,笔记本带出门后,回来才会继续同步。"),
],
"install_h2": "安装服务器",
@@ -393,10 +431,6 @@ C = {
"clients_alt": "CopySync 的设置页:信令服务器地址填着 ws://192.168.1.20:8787/signal,连接状态显示已连接",
"clients_after": '还没装 App?见<a href="{start}">快速开始</a>。',
- "away_h2": "离开家,也想同步?",
- "away_text": "给每台电脑装上 Tailscale,服务器用它分配的地址,在公司、在外面都能连回家里的服务器,就像在同一个局域网里。不需要公网 IP,也不用改路由器。",
- "away_button": "用 Tailscale 跨网络使用",
-
"faq_h2": "常见问题",
"faq": [
("连接状态一直是「未连接」?", [
@@ -415,14 +449,8 @@ C = {
"在路由器里给它固定一个地址,就不会再遇到这件事。",
]),
("离开局域网以后还能同步吗?", [
- "能,加上 Tailscale 就行:每台电脑装上 Tailscale、登录同一个账号,服务器用 Tailscale 地址安装,客户端也填这个地址,不需要公网 IP。"
- "步骤见<a href=\"{ts}\">用 Tailscale 跨网络使用</a>。",
- "有公网 IP 的话,也可以把服务器部署到云服务器上,见<a href=\"{home}#cloud\">首页的部署步骤</a>。",
- ]),
- ("用国内的云服务器,填域名连不上、填 IP 却能连?", [
- "域名没有备案时,国内的云厂商会拦截访问它的明文 HTTP 请求,返回一个跳转到拦截页的响应,实测 8787 这样的非常用端口也一样。"
- "WebSocket 握手也是一个 HTTP 请求,所以同样被拦,客户端就显示未连接。",
- "服务器地址里直接填 IP 就行,比如 <code>ws://服务器IP:8787/signal</code>;或者给域名备案。",
+ "不能,服务器只在局域网里访问得到。要在别的网络里也能同步,换成另外两种部署方式之一:"
+ "<a href=\"{cloud}\">公网服务器</a>,或者<a href=\"{ts}\">局域网 + Tailscale</a>。",
]),
("服务器所在的那台电脑也要用 CopySync,地址填什么?", [
"填同样的局域网地址就行,填 <code>ws://127.0.0.1:8787/signal</code> 也可以。服务器和 App 互不影响。",
@@ -433,6 +461,115 @@ C = {
"source": "服务器的完整部署说明(含公网与 Docker)",
},
+ # ── 部署到公网服务器(cloud/ 页面) ──
+ "cloud": {
+ "title": "把 CopySync 服务器部署到公网:云服务器图文教程",
+ "description": "一台有公网 IP 的 Linux 云主机,运行一个脚本就能装好 CopySync 的信令与 TURN 服务器。每台电脑直接连它,"
+ "在家、在公司、在外面都能同步剪贴板。含安全组放行、检查、客户端设置与国内域名备案的说明。",
+ "h1": "部署到公网服务器",
+ "lede": "一台有公网 IP 的 Linux 云主机,最低配置就够。每台电脑直接连它,在家、在公司、在外面都能同步,不用另装软件。",
+ "toc": [("prepare", "准备"), ("ports", "放行端口"), ("install", "安装服务器"), ("check", "检查"),
+ ("clients", "填地址"), ("faq", "常见问题")],
+ "step": "第 {n} 步",
+
+ "overview_h2": "所有电脑都直接连它",
+ "overview_intro": "服务器在公网上,每台电脑不管在哪个网络里,都能直接连上。复制的内容优先在两台电脑之间直连传输;"
+ "打不通直连时经服务器中转,内容依然加密。",
+ "diagram": {
+ "title": "通过公网服务器使用 CopySync",
+ "desc": "公网服务器的地址是 203.0.113.10。Mac 在公司网络里,Windows 在家里的网络里,两台电脑都通过信令连接到服务器;"
+ "复制的内容在两台电脑之间直连传输,打不通直连时经服务器中转。",
+ "server": "公网服务器",
+ "server_sub": "云主机,有公网 IP",
+ "office": "公司网络",
+ "home": "家里的网络",
+ "client": "装着 CopySync",
+ "sig_note": "信令 TCP 8787",
+ "relay_note": "中转 UDP,打不通直连时",
+ "direct": "直连",
+ },
+ "overview_points": [
+ "<strong>信令,TCP 8787。</strong>每台电脑一直连着它,用来发现对方、配对、交换连接信息。",
+ "<strong>直连。</strong>两台电脑在不同网络里时,靠 NAT 打洞直接相连,大多数家庭和公司网络都能打通。",
+ "<strong>中转,UDP 3478 与中转端口。</strong>打不通直连时经服务器转发,内容依然加密,速度受服务器带宽限制。",
+ ],
+
+ "prep": [
+ ("一台云主机", "Linux,x86_64 或 ARM64 都行,最低配置就够,服务器只占约 15 MB 内存。需要 root 权限。"),
+ ("一个公网 IP", "云主机自带的公网 IP 就行,最好是固定的(弹性 IP)。地址变了,每台电脑都要重新填。"),
+ ("能登录它", "能用 ssh 登录,或者用云厂商网页上的远程终端。"),
+ ("国内的云主机", "域名没有备案时,客户端里要直接填 IP,不能填域名,原因见下面的<a href=\"#faq\">常见问题</a>。"),
+ ],
+
+ "ports_h2": "在安全组里放行端口",
+ "ports_intro": "在云厂商的控制台里,给这台云主机的安全组添加下面三条入站规则。",
+ "rules_url": "云服务器控制台 › 安全组 › 入站规则",
+ "rules_cols": ["协议", "端口范围", "来源", "用途"],
+ "rules": [
+ ("TCP", "8787", "0.0.0.0/0", "信令"),
+ ("UDP", "3478", "0.0.0.0/0", "STUN 与 TURN"),
+ ("UDP", "32768-60999", "0.0.0.0/0", "中转端口"),
+ ],
+ "rules_label": "云服务器安全组的入站规则(示意):TCP 8787 信令,UDP 3478 用于 STUN 与 TURN,UDP 32768-60999 是中转端口,来源都是 0.0.0.0/0",
+ "ports_notes": [
+ "<strong>叫法不一样:</strong>有的云厂商叫「防火墙」或「网络 ACL」,都是这一项。",
+ "<strong>中转端口</strong>由系统随机分配,范围以服务器为准:运行 <code>cat /proc/sys/net/ipv4/ip_local_port_range</code> 查看,安装脚本最后也会打印出来。",
+ "<strong>系统防火墙:</strong>开着 ufw 或 firewalld 的话,这三条也要放行,安装脚本最后会给出命令。",
+ ],
+
+ "install_h2": "运行安装脚本",
+ "install_intro": "把公网 IP 带给安装脚本,它会装好服务器、注册为开机自启的 systemd 服务,最后显示客户端要填的地址。",
+ "install_steps": [
+ "用 ssh 登录服务器,比如 <code>ssh [email protected]</code>(换成你的公网 IP)。",
+ "逐行运行,最后一行换成你的公网 IP:<span class=\"aside\">ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。</span>",
+ "最后显示的 <code>ws://203.0.113.10:8787/signal</code> 就是客户端要填的地址。",
+ ],
+ "install_notes": [
+ "<strong>注册为 systemd 服务,</strong>开机自动运行,配置在 <code>/etc/copysync/server.env</code>。",
+ "<strong>升级:</strong>下载新版本,解压后再运行 <code>sudo ./install.sh</code>,原来的配置保留。",
+ "<strong>也可以用 Docker:</strong>见<a href=\"{deploy}\">服务器部署说明</a>。",
+ ],
+ "term_label": "运行 sudo ./install.sh 203.0.113.10 的输出:安装、写入 systemd 单元、生成配置、启动,最后显示客户端要填的地址 ws://203.0.113.10:8787/signal",
+
+ "check_h2": "检查能不能访问到它",
+ "check_intro": "在任意一台电脑的浏览器里打开 <code>http://203.0.113.10:8787/healthz</code>(换成你的公网 IP),看到下面这一行就通了。",
+ "check_label": "浏览器打开 http://203.0.113.10:8787/healthz,页面显示服务器的状态 ok 与版本号",
+
+ "clients_steps": [
+ ("打开设置", "在每台电脑上打开 CopySync,进入「设置」。"),
+ ("填公网地址", "在「信令服务器地址」里填 <code>ws://203.0.113.10:8787/signal</code>(换成你的公网 IP),按回车保存。"),
+ ("看连接状态", "「连接状态」变成绿色的「已连接」就好了。还没配对的话,在「设备」里配对。"),
+ ],
+ "clients_alt": "CopySync 的设置页:信令服务器地址填着 ws://203.0.113.10:8787/signal,连接状态显示已连接",
+
+ "faq": [
+ ("填域名连不上、填 IP 却能连?", [
+ "域名没有备案时,国内的云厂商会拦截访问它的明文 HTTP 请求,返回一个跳转到拦截页的响应,实测 8787 这样的非常用端口也一样。"
+ "WebSocket 握手也是一个 HTTP 请求,所以同样被拦,客户端就显示未连接。",
+ "服务器地址里直接填 IP 就行,比如 <code>ws://服务器IP:8787/signal</code>;或者给域名备案。",
+ ]),
+ ("要多大的配置?", [
+ "最低配置就够。服务器只占约 15 MB 内存,平时只转发很少的信令消息。复制的内容能直连时不经过它;"
+ "只有打不通直连、走中转时,速度才受它的出口带宽限制。",
+ ]),
+ ("设备之间显示「中转」,不是「直连」?", [
+ "刚连上时显示中转、过一会儿变成直连是正常的:先用中转保证能用,空闲时再换直连。"
+ "一直是中转,说明两台电脑之间打不通,常见于端口随机分配的 NAT 或严格的防火墙。内容同样加密,只是速度受服务器带宽限制。",
+ ]),
+ ("想用 HTTPS(wss://)?", [
+ "可以放在 HTTPS 反向代理后面,客户端填 <code>wss://</code> 开头的地址,代理需要支持 WebSocket 升级。国内的域名需要备案。"
+ "STUN 与 TURN 走 UDP,不经过反向代理,安全组照样要放行。",
+ ]),
+ ("家里宽带有公网 IP,能当公网服务器用吗?", [
+ "可以,但比云主机麻烦:要在路由器上把 TCP 8787、UDP 3478 和一大段中转用的 UDP 端口转发到那台电脑,家里的公网 IP 也可能会变。"
+ "电脑都在家里时用<a href=\"{server}\">局域网</a>更简单;要跨网络又不想折腾端口转发,可以用<a href=\"{ts}\">局域网 + Tailscale</a>。",
+ ]),
+ ],
+
+ "closing": "一台云主机,<br>在哪儿都能同步。",
+ "source": "服务器的完整部署说明(含 Docker 与全部参数)",
+ },
+
# ── 快速开始(start/ 页面) ──
"start": {
"title": "快速开始:三步用上 CopySync",
@@ -457,8 +594,7 @@ C = {
"app_alt": "第一次打开 CopySync:提示启用后台同步",
"server_h2": "准备一台服务器",
- "server_intro": "两台电脑靠它找到彼此,复制的内容不会存在上面。CopySync 不提供公共服务器,按你的情况选一种:",
- "server_after": "装好后,安装脚本最后会显示一个地址,形如 <code>ws://192.168.1.20:8787/signal</code>,下一步要用。",
+ "server_intro": "两台电脑靠它找到彼此,复制的内容不会存在上面。CopySync 不提供公共服务器,有三种部署方式,选一种适合你的。",
"connect_h2": "在每台电脑上填服务器地址",
"connect_steps": [
@@ -636,7 +772,7 @@ C = {
"一般不会。地址跟着设备走,重启、换网络都不变;只有把设备从 Tailscale 里删掉再重新加入,才会换一个。",
]),
("我有公网 IP,还需要 Tailscale 吗?", [
- "不需要。把服务器部署在有公网 IP 的机器上,所有电脑填它的公网地址就行,见<a href=\"{home}#cloud\">首页的部署步骤</a>。",
+ "不需要。把服务器部署在有公网 IP 的机器上,所有电脑填它的公网地址就行,见<a href=\"{cloud}\">公网服务器部署教程</a>。",
]),
],
diff --git a/ui/tool/screenshots/screenshots_test.dart b/ui/tool/screenshots/screenshots_test.dart
index a35cfca..ad950a4 100644
--- a/ui/tool/screenshots/screenshots_test.dart
+++ b/ui/tool/screenshots/screenshots_test.dart
@@ -327,6 +327,13 @@ void main() {
section: Section.settings, brightness: Brightness.dark);
});
+ // 网站「部署到公网服务器」:服务器地址填公网 IP(文档专用的示例地址段)
+ testWidgets('settings-cloud-dark', (tester) async {
+ await _shoot(tester, 'settings-cloud-dark',
+ state: _demo(server: 'ws://203.0.113.10:8787/signal'),
+ section: Section.settings, brightness: Brightness.dark);
+ });
+
// 网站「快速开始」:第一次打开、生成配对码,深色界面配深色网页
testWidgets('welcome-dark', (tester) async {
final state = _demo(link: LinkState.offline, service: ServiceState.notInstalled, empty: true);