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.
Dart airdrop-alternativeclipboardclipboard-sharingclipboard-synccopy-pastecross-platformend-to-end-encryptionfile-syncfile-transferfluttergolanglinuxmacosnat-traversalp2pself-hostedtailscaleuniversal-clipboardwebrtcwindows
1.3.0:改用 AGPL-3.0 并提供商业授权;网站整页深色改版,新增日文页面与语言识别
baiyuze0bfed9f25444
diff --git a/.github/ISSUE_TEMPLATE/commercial-license.yml b/.github/ISSUE_TEMPLATE/commercial-license.ymlnew file mode 100644index 0000000..1153750--- /dev/null+++ b/.github/ISSUE_TEMPLATE/commercial-license.yml@@ -0,0 +1,34 @@+name: Commercial license / 商业授权+description: Use CopySync without the AGPL-3.0 obligations. 不受 AGPL-3.0 条件约束地使用 CopySync。+title: "Commercial license: "+labels: ["commercial-license"]+body:+ - type: markdown+ attributes:+ value: |+ This issue is public. Leave out anything confidential; we'll continue in private.+ See [LICENSING.md](https://github.com/baiyuze/copysync/blob/main/LICENSING.md) for what the AGPL-3.0 already allows for free.++ issue 是公开的,请不要写机密信息,后续会转到私下沟通。AGPL-3.0 下哪些用法本来就免费,见 [LICENSING.md](https://github.com/baiyuze/copysync/blob/main/LICENSING.md)。+ - type: input+ id: organization+ attributes:+ label: Organization / 公司或组织+ validations:+ required: true+ - type: textarea+ id: use+ attributes:+ label: How you plan to use CopySync / 打算怎么用+ description: For example, inside a closed-source product, a modified internal build, or a hosted server. 比如放进闭源产品、内部使用修改版、或运营托管服务。+ validations:+ required: true+ - type: input+ id: scale+ attributes:+ label: Roughly how many devices or users / 大约多少台设备或多少用户+ - type: input+ id: contact+ attributes:+ label: How to reach you privately / 私下联系方式+ description: An email address or other channel. Only if you're comfortable posting it publicly; otherwise we'll reply here first. 只在愿意公开时填写,否则我们先在这里回复。diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cf6096d..660719a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,26 @@# 更新记录 / Changelog+## 1.3.0 — 2026-10-09++- **界面支持简体中文、英文、日文**:默认跟随系统语言,也可以在「设置 → 这台 Mac / 这台电脑 → 语言」里切换。+ Windows 托盘菜单也跟着变。图片和文件记录的标题按当前语言显示。+ **The interface is now in English, Simplified Chinese and Japanese.** It follows the system language and can be+ switched in Settings; the Windows tray menu follows too.+- **许可改为 GNU AGPL-3.0,另提供商业授权。**个人和公司都可以免费使用和修改;分发、或通过网络提供修改过的版本时,+ 需要以同样的许可公开源码。闭源产品、不公开的修改、托管服务等情况可以购买商业授权,见 `LICENSING.md`。+ 1.2.0 及更早的版本仍适用 MIT。+ **License changed to the GNU AGPL-3.0, with commercial licenses available.** Versions 1.2.0 and earlier remain MIT.+ See `LICENSING.md`.+- 复制记录:鼠标移到一行上时,「预览」按钮不再被挤开换位置,不容易点错。+ History: the Preview button no longer shifts when you hover a row.+- 图片预览按应用窗口的比例定大小(窗口的 80%),小图按原始大小显示、不放大。+ Image preview is sized relative to the app window, and small images are no longer upscaled.+- 配对对话框在文字较长(英文、日文、系统字号调大)时改为滚动,不再溢出。+ The pairing dialog scrolls instead of overflowing with longer text.+- 网站改版:整页深色,新增日文页面,首次打开按浏览器语言显示;技术方案放到网站上,不用再跳到 GitHub。+ New website design with a Japanese page and language detection; design notes are now hosted on the site.+- 服务器不需要升级;设备之间的协议没有变化。 No server upgrade needed; the device-to-device protocol is unchanged.+## 1.2.0 — 2026-10-09- **新增 Windows 客户端**:Windows 10(21H2 起)与 Windows 11,x64。与 Mac 互通,Mac 与 Mac、diff --git a/LICENSE b/LICENSEindex 280ddfc..be3f7b2 100644--- a/LICENSE+++ b/LICENSE@@ -1,21 +1,661 @@-MIT License--Copyright (c) 2026 baiyuze--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in all-copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE-SOFTWARE.+ GNU AFFERO GENERAL PUBLIC LICENSE+ Version 3, 19 November 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++ Preamble++ The GNU Affero General Public License is a free, copyleft license for+software and other kinds of works, specifically designed to ensure+cooperation with the community in the case of network server software.++ The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+our General Public Licenses are intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users.++ When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++ Developers that use our General Public Licenses protect your rights+with two steps: (1) assert copyright on the software, and (2) offer+you this License which gives you legal permission to copy, distribute+and/or modify the software.++ A secondary benefit of defending all users' freedom is that+improvements made in alternate versions of the program, if they+receive widespread use, become available for other developers to+incorporate. Many developers of free software are heartened and+encouraged by the resulting cooperation. However, in the case of+software used on network servers, this result may fail to come about.+The GNU General Public License permits making a modified version and+letting the public access it on a server without ever releasing its+source code to the public.++ The GNU Affero General Public License is designed specifically to+ensure that, in such cases, the modified source code becomes available+to the community. It requires the operator of a network server to+provide the source code of the modified version running there to the+users of that server. Therefore, public use of a modified version, on+a publicly accessible server, gives the public access to the source+code of the modified version.++ An older license, called the Affero General Public License and+published by Affero, was designed to accomplish similar goals. This is+a different license, not a version of the Affero GPL, but Affero has+released a new version of the Affero GPL which permits relicensing under+this license.++ The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++ 0. Definitions.++ "This License" refers to version 3 of the GNU Affero General Public License.++ "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++ "The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++ To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++ A "covered work" means either the unmodified Program or a work based+on the Program.++ To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++ To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++ An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++ 1. Source Code.++ The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++ A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++ The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++ The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++ The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++ The Corresponding Source for a work in source code form is that+same work.++ 2. Basic Permissions.++ All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++ You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++ Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.++ No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++ When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++ 4. Conveying Verbatim Copies.++ You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++ You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++ 5. Conveying Modified Source Versions.++ You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++ A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++ 6. Conveying Non-Source Forms.++ You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++ A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++ A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++ "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++ If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++ The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++ Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++ 7. Additional Terms.++ "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++ When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++ Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++ All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++ If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++ Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++ 8. Termination.++ You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++ However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++ Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++ Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++ 9. Acceptance Not Required for Having Copies.++ You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++ 10. Automatic Licensing of Downstream Recipients.++ Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++ An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++ You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++ 11. Patents.++ A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++ A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++ Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++ In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++ If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++ If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++ A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++ Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++ 12. No Surrender of Others' Freedom.++ If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++ 13. Remote Network Interaction; Use with the GNU General Public License.++ Notwithstanding any other provision of this License, if you modify the+Program, your modified version must prominently offer all users+interacting with it remotely through a computer network (if your version+supports such interaction) an opportunity to receive the Corresponding+Source of your version by providing access to the Corresponding Source+from a network server at no charge, through some standard or customary+means of facilitating copying of software. This Corresponding Source+shall include the Corresponding Source for any work covered by version 3+of the GNU General Public License that is incorporated pursuant to the+following paragraph.++ Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the work with which it is combined will remain governed by version+3 of the GNU General Public License.++ 14. Revised Versions of this License.++ The Free Software Foundation may publish revised and/or new versions of+the GNU Affero General Public License from time to time. Such new versions+will be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++ Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU Affero General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU Affero General Public License, you may choose any version ever published+by the Free Software Foundation.++ If the Program specifies that a proxy can decide which future+versions of the GNU Affero General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++ Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++ 15. Disclaimer of Warranty.++ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. Limitation of Liability.++ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++ 17. Interpretation of Sections 15 and 16.++ If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++ If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++ To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU Affero General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU Affero General Public License for more details.++ You should have received a copy of the GNU Affero General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++ If your software can interact with users remotely through a computer+network, you should also make sure that it provides a way for users to+get its source. For example, if your program is a web application, its+interface could display a "Source" link that leads users to an archive+of the code. There are many ways you could offer source, and different+solutions will be better for different programs; see section 13 for the+specific requirements.++ You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU AGPL, see+<https://www.gnu.org/licenses/>.diff --git a/LICENSING.md b/LICENSING.mdnew file mode 100644index 0000000..0a2da90--- /dev/null+++ b/LICENSING.md@@ -0,0 +1,79 @@+# Licensing / 授权++[English](#english) · [简体中文](#简体中文)++## English++Copyright © 2026 baiyuze.++Starting with version 1.3.0, CopySync is dual-licensed. You can use it under either of these:++### 1. GNU AGPL-3.0, free of charge++The full text is in [LICENSE](LICENSE). Anyone can use, study, modify and share CopySync under it, including companies. In return, if you:++- distribute CopySync or a modified version (as an app, inside another product, or preinstalled on devices), or+- let people use a modified version over a network (for example, a modified signaling server offered as a service),++you must make the complete source code of your version available to those users under the AGPL-3.0, including your changes and the code you combine with it.++### 2. Commercial license, paid++For organizations that can't or don't want to meet those terms. Typical cases:++- shipping CopySync, or code from it, inside a closed-source product;+- modifying CopySync for internal or customer use without publishing the changes;+- running a modified server as a hosted service without releasing its source;+- needing terms the AGPL doesn't offer, such as a warranty, support or indemnity.++To ask about a commercial license, [open a "Commercial license" issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml). Issues are public, so leave out anything confidential; we'll continue in private.++### Earlier versions++Versions 1.2.0 and earlier were released under the MIT License, and those releases stay under it.++### Contributions++By submitting a contribution, you license it to everyone under the AGPL-3.0 and grant baiyuze the right to also distribute it under commercial licenses. This is what keeps the commercial license possible.++### Third-party components++Libraries that CopySync uses keep their own licenses (MIT, BSD, Apache-2.0 and similar), all compatible with the AGPL-3.0.++## 简体中文++版权所有 © 2026 baiyuze。++从 1.3.0 版起,CopySync 采用双授权,任选其一:++### 1. GNU AGPL-3.0,免费++全文见 [LICENSE](LICENSE)。任何人都可以按它使用、研究、修改和分享 CopySync,公司也一样。条件是,如果你:++- 分发 CopySync 或修改过的版本(单独分发、放进其他产品、或预装在设备上),或者+- 让别人通过网络使用修改过的版本(比如把改过的信令服务器作为服务提供),++就必须按 AGPL-3.0 向这些用户提供你这个版本的完整源码,包括你的修改和与之组合的代码。++### 2. 商业授权,付费++给不能或不愿意满足上面这些条件的组织。常见的情况:++- 把 CopySync 或其中的代码放进闭源产品;+- 修改 CopySync 供内部或客户使用,但不公开修改;+- 把修改过的服务器作为托管服务运营,但不公开源码;+- 需要 AGPL 不提供的条款,比如质量保证、技术支持或侵权责任担保。++商业授权请[提交一个「商业授权」issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml)。issue 是公开的,请不要写机密信息,后续会转到私下沟通。++### 之前的版本++1.2.0 及更早的版本以 MIT 许可发布,这些版本仍然适用 MIT。++### 贡献代码++提交贡献即表示你同意:这些代码以 AGPL-3.0 授权给所有人,同时授权 baiyuze 将其纳入商业授权一并分发。这样才能继续提供商业授权。++### 第三方组件++CopySync 用到的第三方库保留各自的许可(MIT、BSD、Apache-2.0 等),都与 AGPL-3.0 兼容。diff --git a/README.md b/README.mdindex 552abdc..f5b1bf1 100644--- a/README.md+++ b/README.md@@ -24,15 +24,13 @@<img src="https://img.shields.io/badge/macOS-13%2B-1D1D1F" alt="macOS 13+"><img src="https://img.shields.io/badge/Windows-10%20%2F%2011-1D1D1F" alt="Windows 10 / 11"><img src="https://img.shields.io/badge/Intel%20%2B%20Apple%20silicon-universal-1D1D1F" alt="Universal binary">- <img src="https://img.shields.io/github/license/baiyuze/copysync?color=6E6E73" alt="MIT License">+ <img src="https://img.shields.io/badge/license-AGPL--3.0-6E6E73" alt="AGPL-3.0 License"></p><p align="center"><img src="docs/assets/screenshots/en/history.png" alt="CopySync's history view: files, images and text arriving from other Macs"></p>-> The app's interface is in Simplified Chinese for now. The screenshots below are annotated in the alt text.-## WhyIf you work on two computers, you move things between them all day: a snippet of text, a screenshot, a file.@@ -65,6 +63,7 @@ With CopySync you pair two computers once. After that, copy on one and paste on- **Fingerprint check when pairing**, so neither the server nor anyone on the network can impersonate your device.- **Runs in the background.** Keeps syncing with the window closed, starts at login, recovers from crashes. On Windows it lives in the notification area.- **Mac and Windows.** Native on Intel and Apple silicon Macs; Windows 10 and 11. Pasted files are real files you can drop into Explorer, WeChat or Office. Light and dark appearance.+- **English, Chinese and Japanese.** The interface follows your system language, and you can switch it in Settings.- **Passwords stay put** (Windows). Content that a password manager marks as "don't record" is skipped: not synced, not kept in the history.<table>@@ -123,8 +122,8 @@ For Docker, or for LAN-only use, see the [server deployment guide](server/deployThe first time, macOS says it can't verify the developer: CopySync isn't notarized by Apple yet (that requires a paid developer account). Go to **System Settings → Privacy & Security**, scroll down and click **Open Anyway**. You only need to do this once.-3. Click **启用后台同步** (Enable background sync).-4. In **设置 → 信令服务器地址** (Settings → Signaling server), enter `ws://<server address>:8787/signal` and press Return.+3. Click **Turn on background sync**.+4. In **Settings → Signaling server**, enter `ws://<server address>:8787/signal` and press Return.5. Recent versions of macOS ask whether CopySync Daemon may read the clipboard. Allow it; you can switch it to always allow under **System Settings → Privacy & Security → Paste from Other Apps**.**Windows**@@ -133,16 +132,16 @@ For Docker, or for LAN-only use, see the [server deployment guide](server/deployCopySync isn't code-signed yet, so Windows says "Windows protected your PC": click **More info → Run anyway**. To skip the installer, download the [portable zip](https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip), extract it and open CopySync.-2. Open CopySync (it opens when setup finishes; there's also a desktop shortcut) and click **启用后台同步** (Enable background sync).-3. In **设置 → 信令服务器地址** (Settings → Signaling server), enter `ws://<server address>:8787/signal` and press Enter.+2. Open CopySync (it opens when setup finishes; there's also a desktop shortcut) and click **Turn on background sync**.+3. In **Settings → Signaling server**, enter `ws://<server address>:8787/signal` and press Enter.4. If Windows Firewall asks about copysyncd, allow it.After you close the window, CopySync keeps running in the notification area; open it again from the tray icon or the desktop shortcut.### 3. Pair-1. On one computer: **设备 → 添加设备 → 生成配对码** (Devices → Add device → Generate code).-2. On the other: **添加设备 → 输入配对码** (Add device → Enter code), and type the 6 characters.+1. On one computer: **Devices → Add device → Show a code**.+2. On the other: **Add device → Enter a code**, and type the 6 characters.3. Both screens show the same two lines of fingerprints, one for each device. **Confirm only if the two screens match line for line.**From then on, copy on either one and paste on the other.@@ -232,7 +231,7 @@ The **NAT lab** (`tools/natlab`) builds real topologies with Linux network names- **Fingerprints are compared by a person when pairing.** Both Macs show the same two lines: the fingerprint of each side's public key (the first 60 bits of its SHA-256, like `R8NF-2WTC-QL5J`), in a fixed order. The server could swap keys in transit, but then the two screens would no longer match — this step is what stops a man in the middle. The fingerprints are shown separately rather than combined into one short code: an attacker controlling both forged keys could find a matching combined code with a birthday attack, while separate fingerprints need a preimage attack per key, roughly a billion times harder.- **Every signaling message after that is signed**, so the server cannot forge a device. The DTLS certificate fingerprint of the direct channel is also sent signed and checked against the actual certificate after the handshake; a mismatch drops the connection.- **The relay can't read anything either.** TURN only forwards encrypted UDP packets. Relay credentials are issued per device and expire after 12 hours.-- **Public STUN servers see only your public IP.** To find every uplink on multi-uplink networks, CopySync probes a few public STUN servers by default. They see your public IP, as with any WebRTC app, never content. Turn off 用公共服务器探测网络出口 (Probe with public servers) in Settings to use only your own server.+- **Public STUN servers see only your public IP.** To find every uplink on multi-uplink networks, CopySync probes a few public STUN servers by default. They see your public IP, as with any WebRTC app, never content. Turn off **Probe with public servers** in Settings to use only your own server.- **Device key.** On Mac it's stored readable only by you; on Windows it's additionally encrypted with DPAPI, so another user or another computer can't decrypt a copied file.- **No App Sandbox**, because CopySync needs to read files at whatever path you copy them from.@@ -279,7 +278,6 @@ Measured on a LAN with a direct connection: a 20 MB file transfers in about 330- **The Mac app doesn't skip password-manager content yet**; the Windows app does.- **Items aren't resent after a long absence.** The server stores nothing. While the other Mac is unreachable, this Mac keeps the latest 20 items (from the last 24 hours) in memory, and they're lost if its background service restarts.- **Relayed transfers are limited by your server's bandwidth.** Direct connections aren't.-- The interface is in Simplified Chinese.## Build from source@@ -332,7 +330,7 @@ tools/installer/ Windows installer (Inno Setup)The system pasteboard service may be stuck: an app declared clipboard content and then crashed, leaving types without data. Run `killall pboard` and copy again.**A device stays offline**-Check **设置 → 连接状态** (Settings → Connection) on both computers. If it isn't connected, verify the server address and that port 8787 is reachable.+Check **Settings → Connection** on both computers. If it isn't connected, verify the server address and that port 8787 is reachable.**Always "relay", never "direct"**Showing "relay" right after connecting and "direct" a little later is normal: the relay makes things work first, and the direct path takes over when the link is idle. If it stays "relay", NAT traversal didn't succeed, which is common with NATs that randomize ports or strict firewalls. Everything still works; speed is limited by the server's bandwidth. Run `copysync-cli nat` to see how many uplinks were found; zero means UDP is blocked.@@ -342,4 +340,4 @@ The background service logs to `~/Library/Logs/CopySync/daemon.log` on Mac and `## License-[MIT](LICENSE)+CopySync is dual-licensed. It's free under the [GNU AGPL-3.0](LICENSE): anyone, companies included, can use and modify it, but distributing it or offering a modified version over a network means publishing your source under the same license. A [commercial license](LICENSING.md) is available for closed-source products, private modifications and hosted services; [open a "Commercial license" issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml) to ask. Versions 1.2.0 and earlier remain under the MIT License. Details are in [LICENSING.md](LICENSING.md).diff --git a/README.zh-CN.md b/README.zh-CN.mdindex b61a5e3..412ca26 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -24,7 +24,7 @@<img src="https://img.shields.io/badge/macOS-13%2B-1D1D1F" alt="macOS 13+"><img src="https://img.shields.io/badge/Windows-10%20%2F%2011-1D1D1F" alt="Windows 10 / 11"><img src="https://img.shields.io/badge/Intel%20%2B%20Apple%20%E8%8A%AF%E7%89%87-%E9%80%9A%E7%94%A8-1D1D1F" alt="Intel 与 Apple 芯片通用">- <img src="https://img.shields.io/github/license/baiyuze/copysync?color=6E6E73" alt="MIT 许可">+ <img src="https://img.shields.io/badge/%E8%AE%B8%E5%8F%AF-AGPL--3.0-6E6E73" alt="AGPL-3.0 许可"></p><p align="center">@@ -63,6 +63,7 @@ CopySync 的做法是:两台电脑配对一次,之后在一台上复制,- **配对时核对安全指纹**:防止服务器或网络上的第三方冒充你的设备。- **后台常驻**:关掉窗口照常同步,开机自动启动,崩溃后自动恢复。Windows 上在任务栏右下角有托盘图标。- **Mac 与 Windows 互通**:Mac 上 Intel 与 Apple 芯片原生运行;Windows 10、11 均可,粘贴文件时得到的是真实文件,能直接粘进资源管理器、微信、Office。支持浅色与深色外观。+- **中文、英文、日文界面**:默认跟随系统语言,也可以在设置里切换。- **不同步密码**(Windows):密码管理器复制的内容带着「不要记录」的标记,CopySync 跳过它们,不同步也不进复制记录。<table>@@ -339,4 +340,4 @@ tools/installer/ Windows 安装程序(Inno Setup)## 许可-[MIT](LICENSE)+CopySync 采用双授权。按 [GNU AGPL-3.0](LICENSE) 免费使用:任何人(包括公司)都可以使用和修改,但分发它、或通过网络提供修改过的版本时,必须以同样的许可公开你的源码。闭源产品、不公开的修改、托管服务等情况可以购买[商业授权](LICENSING.md),请[提交「商业授权」issue](https://github.com/baiyuze/copysync/issues/new?template=commercial-license.yml)。1.2.0 及更早的版本仍适用 MIT 许可。详见 [LICENSING.md](LICENSING.md)。diff --git a/docs/404.html b/docs/404.htmlindex 572fdf9..f29561d 100644--- a/docs/404.html+++ b/docs/404.html@@ -4,18 +4,20 @@<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="robots" content="noindex">- <title>页面不存在 / Page not found — CopySync</title>+ <title>页面不存在 / Page not found:CopySync</title>+ <meta name="theme-color" content="#141416"><link rel="icon" href="/copysync/assets/favicon.svg" type="image/svg+xml"><link rel="stylesheet" href="/copysync/assets/site.css"></head><body>- <main class="closing">+ <main class="lost"><div class="wrap">- <h2>这个页面不存在</h2>- <p class="intro" style="margin-inline:auto">Page not found.</p>+ <h1 class="display">404</h1>+ <p class="lede">这个页面不存在。<br><span lang="en">This page doesn't exist.</span><br><span lang="ja">このページは存在しません。</span></p><div class="cta"><a class="button" href="/copysync/">回到首页</a>- <a href="/copysync/en/">English home</a>+ <a class="button quiet" href="/copysync/en/" lang="en">English home</a>+ <a class="button quiet" href="/copysync/ja/" lang="ja">日本語のホーム</a></div></div></main>diff --git a/docs/assets/screenshots/ja/card-verify-dark.png b/docs/assets/screenshots/ja/card-verify-dark.pngnew file mode 100644index 0000000..9cb85b8Binary files /dev/null and b/docs/assets/screenshots/ja/card-verify-dark.png differdiff --git a/docs/assets/screenshots/ja/card-verify.png b/docs/assets/screenshots/ja/card-verify.pngnew file mode 100644index 0000000..88a2aedBinary files /dev/null and b/docs/assets/screenshots/ja/card-verify.png differdiff --git a/docs/assets/screenshots/ja/devices.png b/docs/assets/screenshots/ja/devices.pngnew file mode 100644index 0000000..c1bb036Binary files /dev/null and b/docs/assets/screenshots/ja/devices.png differdiff --git a/docs/assets/screenshots/ja/history-dark.png b/docs/assets/screenshots/ja/history-dark.pngnew file mode 100644index 0000000..5583769Binary files /dev/null and b/docs/assets/screenshots/ja/history-dark.png differdiff --git a/docs/assets/screenshots/ja/history.png b/docs/assets/screenshots/ja/history.pngnew file mode 100644index 0000000..76cc8d0Binary files /dev/null and b/docs/assets/screenshots/ja/history.png differdiff --git a/docs/assets/screenshots/ja/pairing.png b/docs/assets/screenshots/ja/pairing.pngnew file mode 100644index 0000000..a1cf027Binary files /dev/null and b/docs/assets/screenshots/ja/pairing.png differdiff --git a/docs/assets/screenshots/ja/settings.png b/docs/assets/screenshots/ja/settings.pngnew file mode 100644index 0000000..7e45ce9Binary files /dev/null and b/docs/assets/screenshots/ja/settings.png differdiff --git a/docs/assets/screenshots/ja/verify.png b/docs/assets/screenshots/ja/verify.pngnew file mode 100644index 0000000..967ec32Binary files /dev/null and b/docs/assets/screenshots/ja/verify.png differdiff --git a/docs/assets/screenshots/ja/welcome.png b/docs/assets/screenshots/ja/welcome.pngnew file mode 100644index 0000000..0adbf4fBinary files /dev/null and b/docs/assets/screenshots/ja/welcome.png differdiff --git a/docs/assets/site.css b/docs/assets/site.cssindex c8176f4..3f0aa6b 100644--- a/docs/assets/site.css+++ b/docs/assets/site.css@@ -1,45 +1,46 @@-/* CopySync 项目主页+/* CopySync 官网。由 tools/site/build.py 生成的页面共用这一份样式。*- * 与 App 同一套颜色:大面积白与石墨灰,强调色只给按钮和链接。- * 不加载网页字体:Mac 上就是 SF Pro 与苹方,和 App 本身一致,国内访问也快。+ * 整页一种深色:石墨底,系统蓝只给按钮、链接、直连的线和「被复制的那张纸」。+ * 区块之间靠留白分开,不再交替换底色。首屏的复制动画是整页唯一的动画。+ * 不加载网页字体:Mac 上是 SF Pro、苹方、冬青,Windows 上是 Segoe UI、微软雅黑、Meiryo。+ * 从手机宽度写起,宽屏再放开;标题与引言居中,正文、列表、表格左对齐。*/:root {- --page: #ffffff;- --band: #f5f5f4;- --ink: #1d1d1f;- --dim: #6e6e73;- --faint: #a1a1a6;- --rule: #e4e4e2;- --blue: #0a66d8;- --blue-ink: #0857b8;- --green: #248a3d;- --code-bg: #f5f5f4;- --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);-- --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",- "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;- --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;-- --measure: 40rem;- --wide: 68rem;- color-scheme: light dark;-}--@media (prefers-color-scheme: dark) {- :root {- --page: #161617;- --band: #1d1d1f;- --ink: #f5f5f7;- --dim: #98989d;- --faint: #636366;- --rule: #333335;- --blue: #3b8beb;- --blue-ink: #5aa0f0;- --green: #32d74b;- --code-bg: #232325;- --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);- }+ color-scheme: dark;++ --ground: #141416;+ --surface: #1c1c1f;+ --surface-2: #242428;+ --rule: #2b2b30;+ --rule-strong: #3a3a40;+ --ink: #f3f3f1;+ --ink-2: #cfcfcb;+ --dim: #95959b;+ --faint: #66666c;+ --blue: #3d8bea;+ --blue-hi: #6ea9f1;+ --blue-wash: rgba(61, 139, 234, 0.13);++ --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI",+ "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;+ --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display",+ "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;+ --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;++ --content: 72rem;+ --text: 38rem;+ --gutter: clamp(1.25rem, 5vw, 3rem);+ --section: clamp(5rem, 12vw, 9rem);+ --ease: cubic-bezier(0.2, 0.7, 0.1, 1);+}++/* 日文用日文字形:冬青与 Meiryo 排在中文字体前面 */+:lang(ja) {+ --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI",+ "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans CJK JP", sans-serif;+ --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display",+ "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans CJK JP", sans-serif;}*,@@ -51,103 +52,112 @@html {-webkit-text-size-adjust: 100%;scroll-behavior: smooth;+ scroll-padding-top: 4.5rem;+ background: var(--ground);}body {margin: 0;- background: var(--page);+ background: var(--ground);color: var(--ink);- font: 17px/1.6 var(--sans);+ font: 17px/1.7 var(--sans);-webkit-font-smoothing: antialiased;text-rendering: optimizeLegibility;+ overflow-wrap: break-word;+}++:lang(zh) body,+body:lang(zh),+body:lang(ja) {+ line-height: 1.8;}img {+ display: block;max-width: 100%;height: auto;- display: block;}a {- color: var(--blue);+ color: var(--blue-hi);text-decoration: none;}a:hover {- color: var(--blue-ink);text-decoration: underline;text-underline-offset: 3px;}:focus-visible {- outline: 2px solid var(--blue);+ outline: 2px solid var(--blue-hi);outline-offset: 3px;border-radius: 4px;}-code,-kbd,-pre {- font-family: var(--mono);- font-size: 0.88em;-}--p code,-li code,-td code {- background: var(--code-bg);- padding: 0.1em 0.35em;- border-radius: 4px;+::selection {+ background: rgba(61, 139, 234, 0.45);}.wrap {- width: min(100% - 3rem, var(--wide));+ width: min(100%, var(--content));margin-inline: auto;+ padding-inline: var(--gutter);}.skip {position: absolute;- left: -999px;+ left: -9999px;}.skip:focus {left: 1rem;top: 1rem;- background: var(--page);- padding: 0.5rem 0.75rem;- z-index: 10;+ z-index: 50;+ padding: 0.5rem 1rem;+ border-radius: 8px;+ background: var(--surface-2);+ color: var(--ink);+}++caption.skip {+ position: absolute;+ width: 1px;+ height: 1px;+ overflow: hidden;+ clip-path: inset(50%);}-/* ─────────────────────────── 页头 ─────────────────────────── */+/* ── 顶栏 ── */-.site-header {+.bar {position: sticky;top: 0;- z-index: 5;- background: color-mix(in srgb, var(--page) 86%, transparent);- backdrop-filter: saturate(180%) blur(16px);- -webkit-backdrop-filter: saturate(180%) blur(16px);- border-bottom: 1px solid var(--rule);+ z-index: 10;+ backdrop-filter: saturate(1.4) blur(16px);+ -webkit-backdrop-filter: saturate(1.4) blur(16px);+ background: rgba(20, 20, 22, 0.74);+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);}-.site-header .wrap {+.bar .wrap {display: flex;align-items: center;- gap: 1.5rem;- height: 3.25rem;+ justify-content: space-between;+ height: 3.5rem;+ gap: 1rem;}.brand {- display: flex;+ display: inline-flex;align-items: center;gap: 0.55rem;color: var(--ink);- font-weight: 600;- font-size: 1rem;+ font-weight: 650;+ letter-spacing: -0.01em;+ white-space: nowrap;}.brand:hover {- color: var(--ink);text-decoration: none;}@@ -156,317 +166,431 @@ td code {height: 26px;}-.site-nav {+.bar nav {display: flex;- gap: 1.5rem;- margin-left: auto;+ align-items: center;+ gap: clamp(0.85rem, 2.6vw, 1.6rem);font-size: 0.875rem;+ white-space: nowrap;}-.site-nav a {+.bar nav a {color: var(--dim);}-.site-nav a:hover {+.bar nav a:hover {color: var(--ink);text-decoration: none;}-@media (max-width: 720px) {- .site-nav .optional {+/* 窄屏只留 GitHub 与语言切换,免得挤成两行 */+@media (max-width: 46rem) {+ .bar nav .wide {display: none;}}-/* ─────────────────────────── 首屏 ─────────────────────────── */+/* ── 通用排版 ── */-.hero {- padding: 5.5rem 0 4rem;+.display {+ margin: 0;+ font-family: var(--display);+ font-weight: 700;+ font-size: clamp(2.5rem, 8vw, 6rem);+ line-height: 1.05;+ letter-spacing: -0.035em;+ text-wrap: balance;}-.hero h1 {- margin: 0;- font-size: clamp(2.4rem, 1.2rem + 4.4vw, 4.25rem);- line-height: 1.08;+/* 中日文字距本来就紧,负字距会挤在一起 */+:lang(zh) .display,+:lang(ja) .display,+:lang(zh) .section h2,+:lang(ja) .section h2 {+ letter-spacing: -0.01em;+}++/* 日文没有空格,标题按词组换行(支持的浏览器),字号也收一点,手机上「コピーして、」不会被拆开 */+:lang(ja) .display {+ font-size: clamp(1.85rem, 7.4vw, 5.2rem);+ line-height: 1.18;+ word-break: auto-phrase;+}++:lang(ja) .section > .wrap > h2,+:lang(ja) .flow h3 {+ word-break: auto-phrase;+}++.lede {+ margin: 1.6rem auto 0;+ max-width: var(--text);+ font-size: clamp(1.05rem, 2.1vw, 1.25rem);+ line-height: 1.65;+ color: var(--dim);+ text-wrap: pretty;+}++.section {+ padding-block: var(--section) 0;+}++.section > .wrap > h2 {+ margin: 0 auto;+ max-width: 18em;+ text-align: center;+ font-family: var(--display);font-weight: 700;+ font-size: clamp(2rem, 5vw, 3.4rem);+ line-height: 1.1;letter-spacing: -0.03em;- max-width: 14em;+ text-wrap: balance;}-.hero .lede {- margin: 1.5rem 0 0;- max-width: 34rem;- font-size: 1.25rem;- line-height: 1.55;+.intro {+ margin: 1.25rem auto 0;+ max-width: var(--text);+ text-align: center;+ color: var(--dim);+ font-size: clamp(1rem, 1.9vw, 1.12rem);+ text-wrap: pretty;+}++.block {+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ max-width: 64rem;+}++h3 {+ margin: 0;+ font-size: 1.08rem;+ line-height: 1.4;+ font-weight: 650;+}++.small {+ font-size: 0.9rem;color: var(--dim);}+.center {+ text-align: center;+}++code {+ font-family: var(--mono);+ font-size: 0.88em;+ padding: 0.08em 0.35em;+ border-radius: 5px;+ background: var(--surface-2);+ color: var(--ink-2);+}++/* ── 按钮 ── */+.cta {display: flex;flex-wrap: wrap;- align-items: center;- gap: 0.75rem 1.5rem;+ justify-content: center;+ gap: 0.75rem;margin-top: 2.25rem;}.button {display: inline-flex;align-items: center;+ justify-content: center;gap: 0.5rem;- padding: 0.75rem 1.35rem;- border-radius: 10px;+ min-height: 3rem;+ padding: 0 1.4rem;+ border-radius: 999px;background: var(--blue);color: #fff;font-weight: 600;font-size: 1rem;+ white-space: nowrap;+ transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s;}.button:hover {- background: var(--blue-ink);- color: #fff;+ background: #2f7ad6;text-decoration: none;}+.button:active {+ transform: scale(0.98);+}+.button svg {width: 18px;height: 18px;+ flex: none;}-/* 第二个下载按钮:描边,与主按钮并排时不抢主次 */-.button-alt {+.button.quiet {background: transparent;- color: var(--blue);- box-shadow: inset 0 0 0 1.5px var(--blue);+ color: var(--ink);+ box-shadow: inset 0 0 0 1.5px var(--rule-strong);}-.button-alt:hover {- background: var(--blue);- color: #fff;+.button.quiet:hover {+ box-shadow: inset 0 0 0 1.5px var(--ink-2);}-.cta .note {+.note {+ margin: 1rem 0 0;+ text-align: center;font-size: 0.875rem;color: var(--dim);}-/* 首屏演示:两台 Mac,一次复制、一次粘贴 */+/* 手机上两个下载按钮各占一行、等宽,拇指好点 */+@media (max-width: 30rem) {+ .cta .button {+ flex: 1 1 100%;+ }+}++/* ── 首屏:左边 Mac 按 ⌘C,一张蓝色的纸沿弧线飞到右边的 Windows,按 Ctrl V 落下 ── */++.hero {+ padding: clamp(4rem, 10vw, 7.5rem) 0 0;+ text-align: center;+ overflow: hidden;+}-.demo {+.stage {+ position: relative;display: grid;- grid-template-columns: 1fr minmax(7rem, 0.6fr) 1fr;- align-items: center;- max-width: 58rem;- margin-top: 4.5rem;+ grid-template-columns: minmax(0, 1fr) minmax(2rem, 0.45fr) minmax(0, 1fr);+ align-items: end;+ margin: clamp(4.5rem, 10vw, 7rem) auto 0;+ max-width: 62rem;}-.mac {+.device {margin: 0;+ min-width: 0;}-.mac-screen {+.device .screen {position: relative;- aspect-ratio: 16 / 10;- border-radius: 14px 14px 4px 4px;- border: 1px solid var(--rule);- background: var(--band);- padding: 15% 9% 0;+ aspect-ratio: 16 / 10.4;+ border-radius: clamp(8px, 1.2vw, 14px) clamp(8px, 1.2vw, 14px) 3px 3px;+ background: #0b0b0d;+ box-shadow: inset 0 0 0 clamp(4px, 0.7vw, 8px) #2d2d32, 0 40px 80px -40px rgba(0, 0, 0, 0.9);+ overflow: hidden;+}++/* 屏幕里的桌面:Mac 顶部有菜单栏,Windows 底部有居中的任务栏,一眼分得出 */+.device .desk {+ position: absolute;+ inset: clamp(4px, 0.7vw, 8px);+ border-radius: clamp(4px, 0.6vw, 8px) clamp(4px, 0.6vw, 8px) 0 0;overflow: hidden;}-/* 屏幕顶部的菜单栏,让这块区域一眼读作 Mac 的桌面 */-.mac-screen::before {+.mac .desk {+ background: linear-gradient(#3a3c43, #27292e);+}++.mac .desk::before {content: "";position: absolute;inset: 0 0 auto;height: 7%;- background: color-mix(in srgb, var(--ink) 6%, var(--band));- border-bottom: 1px solid var(--rule);+ background: rgba(255, 255, 255, 0.08);}-.mac-base {- height: 9px;- margin: 0 -5%;- border-radius: 0 0 10px 10px;- background: linear-gradient(var(--rule), var(--band));- border: 1px solid var(--rule);- border-top: none;+.win .desk {+ background: linear-gradient(#2e3747, #222730);}-.mac figcaption {- margin-top: 0.85rem;- text-align: center;- font-size: 0.875rem;- color: var(--dim);+.win .desk::after {+ content: "";+ position: absolute;+ inset: auto 0 0;+ height: 10%;+ background: rgba(255, 255, 255, 0.07);}-.file {+.win .taskbar {+ position: absolute;+ bottom: 2.6%;+ left: 50%;+ transform: translateX(-50%);display: flex;- align-items: center;- gap: 0.6rem;- width: fit-content;- max-width: 100%;- padding: 0.55rem 0.8rem;- border-radius: 8px;- background: var(--page);- border: 1px solid var(--rule);- box-shadow: var(--shadow);- font-size: 0.9rem;- white-space: nowrap;+ gap: 4%;+ width: 30%;+ height: 5%;+ z-index: 1;}-.file svg {- flex: none;- width: 20px;- height: 20px;- color: var(--dim);+.win .taskbar i {+ flex: 1;+ border-radius: 2px;+ background: rgba(255, 255, 255, 0.28);+}++.device .base {+ height: clamp(6px, 1vw, 12px);+ margin: 0 -6%;+ border-radius: 0 0 clamp(8px, 1.4vw, 16px) clamp(8px, 1.4vw, 16px);+ background: linear-gradient(#45454b, #26262a);}-.file small {+.device figcaption {+ margin-top: 1rem;+ font-size: 0.85rem;color: var(--dim);- font-size: 0.78rem;}-.keys {+.file {position: absolute;- right: 9%;- bottom: 12%;+ left: 50%;+ top: 44%;+ transform: translate(-50%, -50%);display: flex;- gap: 0.3rem;-}--.keys kbd {- display: grid;- place-items: center;- min-width: 2.1rem;- height: 2.1rem;- padding: 0 0.4rem;- border-radius: 7px;- background: var(--page);- border: 1px solid var(--rule);- box-shadow: 0 2px 0 var(--rule);- font: 600 0.95rem var(--sans);- color: var(--ink);+ flex-direction: column;+ align-items: center;+ gap: 0.35rem;+ width: 60%;+ font-size: clamp(0.5rem, 1.1vw, 0.8rem);+ line-height: 1.3;+ color: #ececee;}-.link {+.file .doc {position: relative;- height: 2px;- margin: 0 0.75rem;- margin-bottom: 2.4rem; /* 与两侧屏幕的中线对齐,抵消下方设备名的高度 */- background-image: linear-gradient(90deg, var(--faint) 50%, transparent 50%);- background-size: 8px 2px;+ width: clamp(1.5rem, 4.2vw, 3.3rem);+ aspect-ratio: 0.78;+ border-radius: 10%;+ background: #f5f5f4;+ box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);}-.link .packet {+/* 纸上的三行字,与 App 图标同一个造型 */+.lines {position: absolute;- top: 50%;- left: 0;- width: 12px;- height: 12px;- margin-top: -6px;- border-radius: 50%;- background: var(--blue);- opacity: 0;+ inset: 22% 18% auto;+ display: grid;+ gap: 14%;}-.link-label {- position: absolute;- top: 0.9rem;- left: 50%;- transform: translateX(-50%);- white-space: nowrap;- font-size: 0.78rem;- color: var(--dim);+.lines i {+ display: block;+ height: 0.28em;+ min-height: 2px;+ border-radius: 99px;+ background: currentColor;+ opacity: 0.85;}-.mac-b .file {- opacity: 0;+.lines i:nth-child(1) { width: 100%; }+.lines i:nth-child(2) { width: 75%; }+.lines i:nth-child(3) { width: 52%; }++.file .doc .lines {+ color: #4a4a4f;}-/* 动画:一次性的完整演示。结束后停在终态 */-.demo.play .mac-a .file {- animation: select 0.3s ease-out 0.5s both;+.file .name {+ max-width: 100%;+ padding: 0.1em 0.45em;+ border-radius: 4px;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;}-.demo.play .mac-a kbd {- animation: press 0.35s ease-in-out 0.7s both;+.stage:not(.play) .win .file {+ opacity: 1;}-.demo.play .packet {- animation: travel 1s cubic-bezier(0.55, 0, 0.45, 1) 1.15s both;+.stage.play .win .file {+ opacity: 0;}-.demo.play .mac-b kbd {- animation: press 0.35s ease-in-out 2.25s both;+.keys {+ position: absolute;+ right: 5%;+ bottom: 14%;+ display: flex;+ gap: 0.3rem;}-.demo.play .mac-b .file {- animation: arrive 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) 2.45s both;+.mac .keys {+ bottom: 9%;}-@keyframes select {- to {- background: color-mix(in srgb, var(--blue) 14%, var(--page));- border-color: color-mix(in srgb, var(--blue) 45%, var(--rule));- }+kbd {+ display: inline-grid;+ place-items: center;+ min-width: 2em;+ height: 2em;+ padding: 0 0.45em;+ border-radius: 6px;+ background: #3b3d43;+ box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);+ font: 600 clamp(0.55rem, 1.15vw, 0.85rem) / 1 var(--sans);+ color: #f5f5f4;}-@keyframes press {- 40% {- transform: translateY(2px);- box-shadow: 0 0 0 var(--rule);- background: color-mix(in srgb, var(--blue) 12%, var(--page));- }+/* 飞过去的那张纸:与 App 图标前面那张纸同色 */+.sheet-fly {+ position: absolute;+ left: 0;+ top: 0;+ width: clamp(2rem, 5vw, 3.6rem);+ aspect-ratio: 0.78;+ border-radius: 12%;+ background: var(--blue);+ color: #fff;+ box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.8);+ opacity: 0;+ z-index: 2;+ translate: var(--sx, 0) var(--sy, 0);+ pointer-events: none;}-@keyframes travel {- 0% {- left: 0;- opacity: 0;- }- 12%,- 88% {- opacity: 1;- }- 100% {- left: calc(100% - 12px);- opacity: 0;- }+.sheet-fly .lines {+ color: #fff;}-@keyframes arrive {- from {- opacity: 0;- transform: translateY(8px) scale(0.96);- }- to {- opacity: 1;- transform: none;- }+.arc {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ overflow: visible;+ pointer-events: none;}-/* 不想看动画的用户直接看到终态 */-@media (prefers-reduced-motion: reduce) {- .demo .mac-b .file {- opacity: 1;- }- .demo.play * {- animation: none !important;- }- html {- scroll-behavior: auto;- }+.arc path {+ fill: none;+ stroke: var(--blue);+ stroke-width: 1.5;+ stroke-dasharray: 4 6;+ opacity: 0.45;+}++.arc-label {+ position: absolute;+ left: 50%;+ top: 0;+ transform: translate(-50%, var(--ly, -2rem));+ font-size: 0.8rem;+ color: var(--dim);+ white-space: nowrap;}.replay {- display: block;- margin: 1.5rem auto 0;- padding: 0.3rem 0.6rem;- border: none;+ margin-top: 1.75rem;+ border: 0;background: none;color: var(--dim);font: inherit;- font-size: 0.8rem;+ font-size: 0.85rem;cursor: pointer;}@@ -474,334 +598,570 @@ td code {color: var(--ink);}-@media (max-width: 720px) {- .demo {- grid-template-columns: 1fr;- gap: 0;- }- .link {- width: 2px;- height: 4.5rem;- margin: 1rem auto;- background-image: linear-gradient(180deg, var(--faint) 50%, transparent 50%);- background-size: 2px 8px;- }- .link .packet {- left: 50%;- margin: 0 0 0 -6px;- }- .link-label {- top: 50%;- left: 1rem;- transform: translateY(-50%);- }- @keyframes travel {- 0% {- top: 0;- opacity: 0;- }- 12%,- 88% {- opacity: 1;- }- 100% {- top: calc(100% - 12px);- opacity: 0;- }- }+/* 编排:一次复制、一次粘贴,约 3.6 秒 */+.stage.play .mac kbd {+ animation: press 0.32s var(--ease) both;}-/* ─────────────────────────── 通用段落 ─────────────────────────── */--.section {- padding: 6rem 0;+.stage.play .mac kbd:nth-child(2) {+ animation-delay: 0.12s;}-.section-band {- background: var(--band);+.stage.play .mac .file .name {+ animation: select 3.6s both;}-.section h2 {- margin: 0;- font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.4rem);- line-height: 1.2;- font-weight: 700;- letter-spacing: -0.02em;- max-width: 20em;+.stage.play .sheet-fly {+ animation: fly 1.5s var(--ease) 0.55s both;}-.section h3 {- margin: 0 0 0.5rem;- font-size: 1.15rem;- line-height: 1.35;- font-weight: 600;+.stage.play .arc path {+ animation: arc 3.6s both;}-.section .intro {- margin: 1rem 0 0;- max-width: var(--measure);- color: var(--dim);- font-size: 1.1rem;+.stage.play .arc-label {+ animation: label 3.6s both;}-.prose {- max-width: var(--measure);+.stage.play .win kbd {+ animation: press 0.32s var(--ease) 2.1s both;}-.prose p,-.prose ul {- margin: 1rem 0 0;+.stage.play .win kbd:nth-child(2) {+ animation-delay: 2.22s;}-.prose ul {- padding-left: 1.2rem;+.stage.play .win .file {+ animation: land 0.6s var(--ease) 2.45s both;}-.prose li + li {- margin-top: 0.5rem;+@keyframes press {+ 0% { transform: none; background: #3b3d43; }+ 40% { transform: translateY(1px) scale(0.92); background: var(--blue); }+ 100% { transform: none; background: #3b3d43; }}-.two-col {- display: grid;- grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);- gap: 4rem;- align-items: start;- margin-top: 3rem;+@keyframes select {+ 0%, 8% { background: transparent; }+ 14%, 70% { background: var(--blue); }+ 100% { background: transparent; }}-@media (max-width: 880px) {- .two-col {- grid-template-columns: 1fr;- gap: 2.5rem;- }+@keyframes fly {+ 0% { opacity: 0; translate: var(--sx) var(--sy); scale: 0.55; rotate: 0deg; }+ 12% { opacity: 1; }+ 50% { translate: calc((var(--sx) + var(--tx)) / 2) calc(min(var(--sy), var(--ty)) - var(--lift)); scale: 1; rotate: 8deg; }+ 88% { opacity: 1; }+ 100% { opacity: 0; translate: var(--tx) var(--ty); scale: 0.6; rotate: 0deg; }}-/* ─────────────────────────── 截图 ─────────────────────────── */--.shot {- margin: 3rem 0 0;+@keyframes arc {+ 0%, 12% { opacity: 0; stroke-dashoffset: 40; }+ 30%, 80% { opacity: 0.9; stroke-dashoffset: 0; }+ 100% { opacity: 0.45; stroke-dashoffset: 0; }}-/* 截图自带 macOS 窗口的阴影与留白,向两侧略微出血,视觉上与正文对齐 */-.shot img {- width: calc(100% + 4.5%);- max-width: none;- margin-left: -2.25%;+@keyframes label {+ 0%, 30% { opacity: 0; }+ 45%, 100% { opacity: 1; }}-.shot figcaption {- margin-top: 0.5rem;- text-align: center;- font-size: 0.875rem;- color: var(--dim);+@keyframes land {+ from { opacity: 0; transform: translate(-50%, -40%) scale(0.85); }+ to { opacity: 1; transform: translate(-50%, -50%); }}-/* ─────────────────────────── 表格 ─────────────────────────── */+/* 窄屏:设备上的文件名太小读不清,只留图标与键帽 */+@media (max-width: 34rem) {+ .file .name {+ display: none;+ }-.table-scroll {- overflow-x: auto;- margin-top: 2.5rem;+ .stage {+ grid-template-columns: minmax(0, 1fr) 1.5rem minmax(0, 1fr);+ }}-table {- width: 100%;- border-collapse: collapse;- font-size: 0.95rem;-}+/* ── 产品截图 ── */-th,-td {- padding: 0.8rem 1rem 0.8rem 0;- text-align: left;- vertical-align: top;- border-bottom: 1px solid var(--rule);+.shot {+ margin: clamp(2rem, 5vw, 3.5rem) auto 0;+ max-width: 66rem;}-thead th {- font-weight: 600;- font-size: 0.85rem;- color: var(--dim);+/* 截图自带窗口外框与阴影 */+.shot img {+ width: 100%;}-tbody th {- font-weight: 500;+/* ── 一次复制的经过:真的是先后三步,才用序号与连线 ── */++.flow {+ position: relative;+ display: grid;+ gap: 2rem;+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ padding: 0;+ max-width: 62rem;+ list-style: none;+ counter-reset: step;}-.compare td,-.compare thead th:not(:first-child) {- text-align: center;- padding-right: 0.5rem;- padding-left: 0.5rem;+.flow li {+ counter-increment: step;+ position: relative;+ padding-left: 3.25rem;+}++.flow li::before {+ content: counter(step);+ position: absolute;+ left: 0;+ top: -0.1rem;+ width: 2rem;+ height: 2rem;+ border-radius: 50%;+ display: grid;+ place-items: center;+ font-size: 0.85rem;+ font-weight: 700;+ color: var(--blue-hi);+ background: var(--ground);+ box-shadow: inset 0 0 0 1.5px var(--blue);+ z-index: 1;+}++/* 窄屏是竖线,宽屏是横线,把三个圆连起来 */+.flow::before {+ content: "";+ position: absolute;+ left: calc(1rem - 0.75px);+ top: 1rem;+ bottom: 2rem;+ width: 1.5px;+ background: linear-gradient(var(--blue), var(--rule-strong));+}++.flow p {+ margin: 0.4rem 0 0;+ color: var(--dim);+ font-size: 0.95rem;+ text-wrap: pretty;+}++@media (min-width: 56rem) {+ .flow {+ grid-template-columns: repeat(3, minmax(0, 1fr));+ gap: 2.5rem;+ }++ .flow li {+ padding: 3.25rem 0 0;+ text-align: center;+ }++ .flow li::before {+ left: 50%;+ transform: translateX(-50%);+ top: 0;+ }++ .flow::before {+ left: 16.6%;+ right: 16.6%;+ top: 1rem;+ bottom: auto;+ width: auto;+ height: 1.5px;+ background: linear-gradient(90deg, var(--blue), var(--rule-strong));+ }+}++/* ── 表格 ── */++.table-scroll {+ overflow-x: auto;+ -webkit-overflow-scrolling: touch;+}++table {+ width: 100%;+ border-collapse: collapse;+ font-size: 0.93rem;+}++th,+td {+ padding: 0.75rem 0.9rem;+ border-bottom: 1px solid var(--rule);+ text-align: left;+ vertical-align: top;+}++thead th {+ color: var(--dim);+ font-weight: 600;+ font-size: 0.85rem;+ border-bottom-color: var(--rule-strong);+}++tbody th {+ font-weight: 500;+ color: var(--ink-2);+}++td {+ color: var(--ink-2);+}++/* 对比表:CopySync 这一列有一道浅蓝底 */+.compare {+ min-width: 40rem;+}++.compare th,+.compare td {+ text-align: center;+}++.compare tbody th {+ text-align: left;}.compare .ours {+ background: var(--blue-wash);color: var(--ink);font-weight: 600;}-.yes {- color: var(--green);- font-weight: 600;+.compare thead .ours {+ color: var(--blue-hi);+ border-radius: 10px 10px 0 0;}-.no {+.compare .no {color: var(--faint);}-.partial {+.compare .partial {color: var(--dim);- font-size: 0.85rem;}-/* ─────────────────────────── 工作原理 ─────────────────────────── */+.compare .yes {+ color: var(--ink);+}++/* ── 工作原理的示意图 ── */.diagram {- margin: 3rem 0 0;+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ max-width: 60rem;}.diagram svg {+ display: block;width: 100%;height: auto;- display: block;+ overflow: visible;}-.diagram text {- font-family: var(--sans);+.d-box {+ fill: var(--surface);+ stroke: var(--rule-strong);+ stroke-width: 1.5;}-.steps {- list-style: none;- counter-reset: step;- margin: 3rem 0 0;- padding: 0;+.d-title {+ fill: var(--ink);+ font: 600 22px var(--sans);+}++.d-sub,+.d-note,+.d-legend text {+ fill: var(--dim);+ font: 15px var(--sans);+}++.d-label {+ fill: var(--blue-hi);+ font: 600 16px var(--sans);+}++.d-direct {+ fill: none;+ stroke: var(--blue);+ stroke-width: 3;+}++.d-relay {+ fill: none;+ stroke: var(--dim);+ stroke-width: 1.8;+ stroke-dasharray: 7 6;+}++.d-sig {+ fill: none;+ stroke: var(--faint);+ stroke-width: 1.5;+ stroke-dasharray: 2 5;+ stroke-linecap: round;+}++/* 手机上图里的字太小,换成文字说明 */+.diagram .diagram-text {+ display: none;+}++@media (max-width: 34rem) {+ .diagram svg {+ display: none;+ }++ .diagram .diagram-text {+ display: grid;+ }+}++/* ── 两栏 ── */++.cols {display: grid;- grid-template-columns: repeat(3, minmax(0, 1fr));- gap: 2.5rem;+ gap: clamp(2rem, 5vw, 4rem);+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ max-width: 64rem;}-.steps li {- counter-increment: step;+.cols > * {+ min-width: 0;}-.steps li::before {- content: counter(step);+@media (min-width: 52rem) {+ .cols {+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);+ align-items: start;+ }+}++.points {+ margin: 0;+ padding: 0;+ list-style: none;display: grid;- place-items: center;- width: 1.9rem;- height: 1.9rem;- margin-bottom: 0.9rem;+ gap: 1.1rem;+}++.points li {+ position: relative;+ padding-left: 1.25rem;+ color: var(--dim);+ font-size: 0.97rem;+}++.points li::before {+ content: "";+ position: absolute;+ left: 0;+ top: 0.72em;+ width: 6px;+ height: 6px;border-radius: 50%;- border: 1.5px solid var(--ink);+ background: var(--blue);+}++.points strong {+ color: var(--ink);font-weight: 600;- font-size: 0.9rem;}-.steps p {+.cols h3 {+ margin-bottom: 1rem;+}++.cols .small {+ margin: 1rem 0 0;+}++.figure-card {margin: 0;- color: var(--dim);}-@media (max-width: 880px) {- .steps {- grid-template-columns: 1fr;- gap: 2rem;- }+.figure-card img {+ width: 100%;+ max-width: 34rem;+ margin-inline: auto;}-/* ─────────────────────────── 兜底 ─────────────────────────── */+/* ── 出问题的时候 ── */.fallbacks {- margin: 2.5rem 0 0;display: grid;- grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);- border-top: 1px solid var(--rule);+ gap: 1.75rem 3rem;+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ max-width: 64rem;}-.fallbacks dt,-.fallbacks dd {- margin: 0;- padding: 1rem 0;- border-bottom: 1px solid var(--rule);+.fallbacks > div {+ min-width: 0;+ padding-top: 1.1rem;+ border-top: 1px solid var(--rule);}.fallbacks dt {- padding-right: 2rem;font-weight: 600;}.fallbacks dd {+ margin: 0.35rem 0 0;color: var(--dim);+ font-size: 0.95rem;}-@media (max-width: 720px) {+@media (min-width: 52rem) {.fallbacks {- grid-template-columns: 1fr;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ }+}++/* ── 安装:三栏之间用细线分开,窄屏叠起来 ── */++.install {+ display: grid;+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ max-width: 70rem;+}++.install > div {+ min-width: 0;+ padding: 1.75rem 0;+ border-top: 1px solid var(--rule);+}++@media (min-width: 60rem) {+ .install {+ grid-template-columns: repeat(3, minmax(0, 1fr));}- .fallbacks dt {- border-bottom: none;- padding-bottom: 0.25rem;++ .install > div {+ padding: 0.25rem 2rem;+ border-top: 0;+ border-left: 1px solid var(--rule);}- .fallbacks dd {- padding-top: 0;++ .install > div:first-child {+ padding-left: 0;+ border-left: 0;}-}-/* ─────────────────────────── 安装 ─────────────────────────── */+ .install > div:last-child {+ padding-right: 0;+ }+}-.install-steps {- margin: 1.5rem 0 0;- padding-left: 1.3rem;+.install h3 {+ display: flex;+ align-items: center;+ gap: 0.6rem;+ margin-bottom: 1rem;+ font-size: 1.15rem;}-/* 同一栏里接着的下一段(Mac 之后的 Windows、配对),与上一段拉开距离 */-.install-steps + h3 {- margin-top: 2rem;+.install h3 svg {+ width: 22px;+ height: 22px;+ color: var(--dim);}-.install-steps li {- padding-left: 0.3rem;+.install ol {+ margin: 0;+ padding-left: 1.2rem;+ color: var(--ink-2);+ font-size: 0.95rem;}-.install-steps li + li {- margin-top: 0.9rem;+.install li + li {+ margin-top: 0.6rem;}-.install-steps li::marker {- font-weight: 600;+.install li::marker {+ color: var(--faint);}-.install-steps .aside {+.aside {display: block;margin-top: 0.3rem;+ font-size: 0.85rem;color: var(--dim);- font-size: 0.92rem;+}++.install .button {+ margin-top: 1.5rem;+}++.install table {+ margin-top: 0.75rem;+ font-size: 0.88rem;+}++.install th,+.install td {+ padding: 0.5rem 0.6rem 0.5rem 0;+}++.pairing {+ margin: 2.5rem auto 0;+ max-width: var(--text);+ text-align: center;+ color: var(--dim);+ font-size: 0.95rem;+}++.pairing strong {+ color: var(--ink);}.code {position: relative;- margin: 1.25rem 0 0;- border-radius: 10px;- background: var(--code-bg);- border: 1px solid var(--rule);+ margin-top: 0.4rem;}-.code pre {+.code pre,+.article pre {margin: 0;- padding: 1rem 4.5rem 1rem 1.1rem; /* 右侧给「复制」按钮留位置 */+ padding: 1rem 1.1rem;+ border-radius: 12px;+ background: #0d0d0f;+ box-shadow: inset 0 0 0 1px var(--rule);+ color: var(--ink-2);+ font: 0.8rem/1.7 var(--mono);overflow-x: auto;- line-height: 1.7;+ -webkit-overflow-scrolling: touch;+}++.code pre code,+.article pre code {+ padding: 0;+ background: none;+ font-size: inherit;+}++/* 有「复制」按钮时,代码从按钮下面开始,不被挡住 */+.code pre {+ padding-top: 2.4rem;}.code .copy {position: absolute;top: 0.5rem;right: 0.5rem;- padding: 0.25rem 0.55rem;+ padding: 0.2rem 0.6rem;+ border: 0;border-radius: 6px;- border: 1px solid var(--rule);- background: var(--page);+ background: var(--surface-2);color: var(--dim);- font: 500 0.75rem var(--sans);+ font: inherit;+ font-size: 0.75rem;cursor: pointer;}@@ -809,33 +1169,42 @@ tbody th {color: var(--ink);}-.ports {- margin-top: 1.5rem;-}+/* ── 技术规格 ── */-.ports td:first-child {- font-family: var(--mono);- font-size: 0.88rem;- white-space: nowrap;+.specs {+ max-width: 52rem;+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;}-/* ─────────────────────────── 规格 ─────────────────────────── */-.specs th {- width: 11rem;- font-weight: 600;- padding-right: 2rem;+ width: 28%;+ color: var(--dim);+ font-weight: 500;}-.specs td {- color: var(--dim);+@media (max-width: 34rem) {+ .specs th,+ .specs td {+ display: block;+ width: auto;+ padding-inline: 0;+ }++ .specs th {+ padding-bottom: 0;+ border-bottom: 0;+ }++ .specs td {+ padding-top: 0.3rem;+ }}-/* ─────────────────────────── 常见问题 ─────────────────────────── */+/* ── 常见问题 ── */.faq {- margin-top: 2.5rem;- max-width: 46rem;+ margin: clamp(2.5rem, 6vw, 4rem) auto 0;+ max-width: 48rem;border-top: 1px solid var(--rule);}@@ -844,36 +1213,42 @@ tbody th {}.faq summary {- display: flex;- justify-content: space-between;- gap: 1rem;- padding: 1.1rem 0;+ position: relative;+ padding: 1.15rem 2.5rem 1.15rem 0;+ font-weight: 600;cursor: pointer;list-style: none;- font-weight: 600;}.faq summary::-webkit-details-marker {display: none;}+/* 加号转成减号 */+.faq summary::before,.faq summary::after {- content: "+";- flex: none;- color: var(--dim);- font-weight: 400;- font-size: 1.25rem;- line-height: 1.2;+ content: "";+ position: absolute;+ right: 0.35rem;+ top: 50%;+ width: 12px;+ height: 1.5px;+ background: var(--dim);+ transition: transform 0.2s var(--ease);+}++.faq summary::after {+ transform: rotate(90deg);}.faq details[open] summary::after {- content: "−";+ transform: rotate(0deg);}.faq .answer {- padding: 0 0 1.25rem;+ padding: 0 2.5rem 1.25rem 0;color: var(--dim);- max-width: var(--measure);+ font-size: 0.97rem;}.faq .answer p {@@ -884,136 +1259,189 @@ tbody th {margin-top: 0.75rem;}-/* ─────────────────────────── 页脚 ─────────────────────────── */+/* ── 收尾与页脚 ── */.closing {- padding: 6rem 0;+ padding-block: var(--section);text-align: center;}-.closing h2 {- margin: 0 auto;+.closing .display {+ font-size: clamp(2.2rem, 6.5vw, 4.6rem);}-.closing .cta {- justify-content: center;+.closing .source {+ display: block;+ margin-top: 1.5rem;+ font-size: 0.95rem;}-.site-footer {+.footer {+ padding: 2.25rem 0 3rem;border-top: 1px solid var(--rule);- padding: 2rem 0 3rem;- font-size: 0.875rem;+ font-size: 0.85rem;color: var(--dim);+ text-align: center;}-.site-footer .wrap {- display: flex;- flex-wrap: wrap;- gap: 1rem 2rem;- justify-content: space-between;+.footer p {+ margin: 0;}-.site-footer nav {+.footer nav {display: flex;flex-wrap: wrap;- gap: 1.5rem;+ justify-content: center;+ gap: 0.5rem 1.25rem;+ margin-top: 0.85rem;}-.site-footer a {+.footer a {color: var(--dim);}-.site-footer a:hover {+.footer a:hover {color: var(--ink);}-/* ─────────────────────────── 零散 ─────────────────────────── */--.section .subhead {- margin-top: 4.5rem;+.footer a[aria-current] {+ color: var(--ink);}-.card-shot {- margin: -1.5rem 0 0;-}+/* ── 技术方案页面 ── */-.card-shot img {- width: 100%;- max-width: 34rem;+.article {+ width: min(100%, 50rem);margin-inline: auto;+ padding: clamp(3rem, 8vw, 5rem) var(--gutter) var(--section);}-.aside-p {- margin: 0.75rem 0 0;+.article .crumb {+ margin: 0 0 2rem;+ font-size: 0.9rem;color: var(--dim);- font-size: 0.95rem;}-/* 架构图:颜色取自页面变量,深色模式自动跟随 */-.d-box {- fill: var(--page);- stroke: var(--rule);- stroke-width: 1.5;+.article h1 {+ margin: 0;+ font-family: var(--display);+ font-size: clamp(2rem, 5vw, 3rem);+ line-height: 1.15;+ letter-spacing: -0.01em;}-.d-title {- font-size: 17px;- font-weight: 600;- fill: var(--ink);+.article h2 {+ margin: 3.5rem 0 0;+ padding-top: 1.5rem;+ border-top: 1px solid var(--rule);+ font-size: 1.6rem;+ line-height: 1.3;}-.d-sub,-.d-note,-.d-legend text {- font-size: 13px;- fill: var(--dim);+.article h3 {+ margin: 2.25rem 0 0;+ font-size: 1.2rem;}-.d-label {- font-size: 14px;- font-weight: 600;- fill: var(--blue);+.article h4 {+ margin: 1.75rem 0 0;+ font-size: 1rem;}-.d-direct,-.d-sig,-.d-relay {- fill: none;- stroke-linecap: round;+.article p,+.article ul,+.article ol,+.article pre,+.article .table-scroll,+.article blockquote {+ margin: 1rem 0 0;}-.d-direct {- stroke: var(--blue);- stroke-width: 3;+.article p,+.article li {+ color: var(--ink-2);}-.d-sig {- stroke: var(--faint);- stroke-width: 1.5;+.article li + li {+ margin-top: 0.35rem;}-.d-relay {- stroke: var(--faint);- stroke-width: 1.5;- stroke-dasharray: 6 6;+.article li > ul,+.article li > ol {+ margin-top: 0.35rem;}-/* 多出口网络:实测出口与实验室结果 */-.measure {- margin-top: 1rem;+.article strong {+ color: var(--ink);}-.measure td:first-child {- font-family: var(--mono);- font-size: 0.9rem;- white-space: nowrap;+.article blockquote {+ margin-top: 1.5rem;+ padding: 0.9rem 1.1rem;+ border-left: 3px solid var(--blue);+ border-radius: 0 10px 10px 0;+ background: var(--surface);}-.measure td:last-child,-.lab td:last-child {+.article blockquote p {+ margin: 0;color: var(--dim);+ font-size: 0.93rem;}-.lab td:last-child {- white-space: nowrap;+.article blockquote p + p {+ margin-top: 0.3rem;+}++.article table {+ font-size: 0.88rem;+}++.article hr {+ margin: 2.5rem 0;+ border: 0;+ border-top: 1px solid var(--rule);+}++.article .toc {+ margin-top: 2rem;+ padding: 1.1rem 1.25rem;+ border-radius: 12px;+ background: var(--surface);+ font-size: 0.93rem;+}++.article .toc ul {+ margin: 0.5rem 0 0;+ padding: 0;+ list-style: none;+}++.article .toc li + li {+ margin-top: 0.2rem;+}++/* ── 404 ── */++.lost {+ padding-block: var(--section);+ text-align: center;+}++@media (prefers-reduced-motion: reduce) {+ html {+ scroll-behavior: auto;+ }++ *,+ *::before,+ *::after {+ animation-duration: 0.01ms !important;+ animation-delay: 0ms !important;+ transition-duration: 0.01ms !important;+ }++ .stage.play .win .file {+ opacity: 1;+ }}diff --git a/docs/assets/site.js b/docs/assets/site.jsindex e5790f1..9797e1e 100644--- a/docs/assets/site.js+++ b/docs/assets/site.js@@ -1,30 +1,60 @@-// 首屏演示与代码块的「复制」按钮。没有它们页面也完整可读。+// 首屏动画、代码块的「复制」按钮、记住选过的语言。没有脚本时页面照样完整:动画停在复制完成的样子。(function () {- var demo = document.querySelector(".demo");- var replay = document.querySelector(".replay");+ var stage = document.querySelector("[data-play]");++ // 按两台设备实际的位置算出纸飞行的起点、终点与弧线+ function layout() {+ var src = stage.querySelector(".mac .doc");+ var dst = stage.querySelector(".win .doc");+ var sheet = stage.querySelector(".sheet-fly");+ var path = stage.querySelector(".arc path");+ var label = stage.querySelector(".arc-label");+ var box = stage.getBoundingClientRect();+ var a = src.getBoundingClientRect();+ var b = dst.getBoundingClientRect();+ var w = sheet.offsetWidth;+ var h = sheet.offsetHeight;+ var sx = a.left + a.width / 2 - box.left;+ var sy = a.top + a.height / 2 - box.top;+ var tx = b.left + b.width / 2 - box.left;+ var ty = b.top + b.height / 2 - box.top;+ var lift = Math.max(40, (tx - sx) * 0.28);+ stage.style.setProperty("--sx", sx - w / 2 + "px");+ stage.style.setProperty("--sy", sy - h / 2 + "px");+ stage.style.setProperty("--tx", tx - w / 2 + "px");+ stage.style.setProperty("--ty", ty - h / 2 + "px");+ stage.style.setProperty("--lift", lift + "px");+ var peak = Math.min(sy, ty) - lift * 1.6;+ path.setAttribute("d", "M" + sx + " " + (sy - a.height / 2) ++ " Q" + (sx + tx) / 2 + " " + peak + " " + tx + " " + (ty - b.height / 2));+ label.style.setProperty("--ly", peak + lift * 0.55 - 8 + "px");+ }function play() {- if (!demo) return;- demo.classList.remove("play");- void demo.offsetWidth; // 强制重排,让动画从头再来- demo.classList.add("play");+ layout();+ stage.classList.remove("play");+ void stage.offsetWidth; // 强制重排,让动画从头再来+ stage.classList.add("play");}- if (demo) {- // 滚动到可见时才开始,避免用户还没看到就播完了+ if (stage) {+ layout();+ window.addEventListener("resize", layout);+ // 滚动到可见时才开始,免得还没看到就播完了if ("IntersectionObserver" in window) {var seen = new IntersectionObserver(function (entries) {if (entries[0].isIntersecting) {play();seen.disconnect();}- }, { threshold: 0.5 });- seen.observe(demo);+ }, { threshold: 0.35 });+ seen.observe(stage);} else {play();}+ var replay = document.querySelector(".replay");+ if (replay) replay.addEventListener("click", play);}- if (replay) replay.addEventListener("click", play);document.querySelectorAll(".code").forEach(function (block) {var button = block.querySelector(".copy");@@ -41,4 +71,11 @@});});});++ // 点过语言链接,以后打开首页就直接是这种语言,不再按浏览器语言跳转+ document.querySelectorAll("a[data-lang]").forEach(function (link) {+ link.addEventListener("click", function () {+ try { localStorage.setItem("copysync-lang", link.dataset.lang); } catch (e) {}+ });+ });})();diff --git a/docs/design/nat-traversal.html b/docs/design/nat-traversal.htmlnew file mode 100644index 0000000..f37d18a--- /dev/null+++ b/docs/design/nat-traversal.html@@ -0,0 +1,151 @@+<!doctype html>+<html lang="zh-CN">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>多出口网络的 NAT 打洞:CopySync 技术方案</title>+ <meta name="description" content="状态:已实现。多出口探测随 1.1.0 发布(2026-10-08);中转后换直连、连接失效检测与补发随 1.1.1 发布(2026-10-09);谁先发包随 1.1.2 发布(2026-10-09)">+ <link rel="canonical" href="https://baiyuze.github.io/copysync/design/nat-traversal.html">+ <meta name="theme-color" content="#141416">+ <link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">+ <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="https://github.com/baiyuze/copysync/blob/main/design/nat-traversal.md">在 GitHub 上查看</a>+ <a href="https://github.com/baiyuze/copysync">GitHub</a>+ </nav>+ </div>+ </header>+ <main id="main">+ <article class="article">+ <p class="crumb"><a href="../">CopySync</a> 的技术方案</p>+ <h1>多出口网络的 NAT 打洞</h1>+<blockquote><p>状态:已实现。多出口探测随 1.1.0 发布(2026-10-08);中转后换直连、连接失效检测与补发随 1.1.1 发布(2026-10-09);谁先发包随 1.1.2 发布(2026-10-09)</p><p>代码:<code>client-core/internal/transport/p2p/egress*.go</code>、<code>manager.go</code>、<code>peer.go</code>;补发在 <code>client-core/internal/sync/backlog.go</code></p><p>验证:<code>tools/natlab/</code>(NAT 打洞实验室,CI 中运行)</p></blockquote>+<nav class="toc" aria-label="目录"><strong>目录</strong><ul><li><a href="#一-问题">一、问题</a></li><li><a href="#二-测量">二、测量</a></li><li><a href="#三-方案">三、方案</a></li><li><a href="#四-能覆盖哪些场景">四、能覆盖哪些场景</a></li><li><a href="#五-验证">五、验证</a></li><li><a href="#六-踩过的坑">六、踩过的坑</a></li><li><a href="#七-局限与后续">七、局限与后续</a></li></ul></nav>+<h2 id="一-问题">一、问题</h2>+<p>两台 Mac 配对成功,同步也正常,但设备列表里一直显示「中转」:数据全部经服务器转发,速度被服务器带宽卡在约 0.6 MB/s。</p>+<p>两台设备分别在公司和家里。逐一排查后确认,打不通的根源是公司网络有多个出口。</p>+<h2 id="二-测量">二、测量</h2>+<h3 id="公司这台">公司这台</h3>+<p>从同一个本地 UDP 端口,向分布在不同网络的多台 STUN 服务器发 Binding 请求,记录每台服务器看到的本机公网地址。实测有 4 个不同的出口 IP,下文以出口 A–D 代称(公网地址不公开):</p>+<div class="table-scroll"><table><thead><tr><th scope="col">出口</th><th scope="col">落在这个出口上的服务器</th><th scope="col">公网端口</th></tr></thead><tbody><tr><td>出口 A</td><td>自己的服务器(百度云北京)、Twilio</td><td>与本地端口相同</td></tr><tr><td>出口 B</td><td>B 站、Google、Nextcloud</td><td>与本地端口相同</td></tr><tr><td>出口 C</td><td>Cloudflare、FreeSWITCH</td><td>改写,但对不同目标相同</td></tr><tr><td>出口 D</td><td>阿里云上的服务、有时是 Google(经 Wi-Fi 时)</td><td>改写</td></tr></tbody></table></div>+<p>另外两组对照实验:</p>+<ul><li><strong>出口只按目标 IP 选择</strong>。向同一台服务器的 8 个不同端口探测,全部从同一个出口出去、得到同一个公网端口。</li><li><strong>同一线路上映射固定</strong>。同一本地端口发往 Cloudflare 与 Twilio,看到的都是出口 C 上的同一个端口。</li></ul>+<p>结论:公司网络等于 4 个并列的、各自「端点无关映射」的 NAT,按目标 IP 选择走哪一个。单看每一条都很好打洞,难点只在于「发往对端的包走哪一条」事先不知道。</p>+<p>公司路由器不支持 UPnP 与 NAT-PMP,也没有 IPv6。</p>+<h3 id="家里这台">家里这台</h3>+<div class="table-scroll"><table><thead><tr><th scope="col">项目</th><th scope="col">结果</th></tr></thead><tbody><tr><td>国内目标</td><td>同一本地端口发往不同服务器,公网地址与端口都相同:端点无关映射,好打洞</td></tr><tr><td>国外目标</td><td>经本机的代理出去,与 CopySync 无关</td></tr><tr><td>路由器</td><td>支持 UPnP,但它自己的外网地址与服务器看到的地址不同:运营商还有一层 NAT,在路由器上映射端口没用</td></tr><tr><td>IPv6</td><td>只有内网地址</td></tr></tbody></table></div>+<h3 id="旧版本为什么打不通">旧版本为什么打不通</h3>+<ol><li><strong>只问了一台服务器</strong>。客户端只从自己的服务器得知本机公网地址,即出口 A,也只把它告诉对端。发往对端的包按目标 IP 很可能从另外三个出口之一出去,对端收到的源地址与告诉它的不一致,被它的路由器当作陌生来源丢弃。</li><li><strong>多配几台 STUN 也没用</strong>。pion 每问一台 STUN 服务器都单独开一个本地端口,问到的地址只对那个端口成立,互相用不上。</li></ol>+<h2 id="三-方案">三、方案</h2>+<h3 id="1-所有连接共用一个本地端口">1. 所有连接共用一个本地端口</h3>+<p><code>p2p.Manager</code> 启动时打开一个 UDP 端口,用 pion 的 <code>UniversalUDPMux</code> 包装,交给所有 <code>PeerConnection</code>(<code>SettingEngine.SetICEUDPMux</code>)。之后本机的所有连通性检查都从这个端口收发,于是「这个端口在每条线路上的公网地址」是一组固定、可知的值。</p>+<p>信令服务器下发的 STUN 地址不再交给 pion,改由本端在共享端口上探测;TURN 照常交给 pion 用于中转。打不开端口时退回 pion 的默认做法。</p>+<h3 id="2-探测每个出口">2. 探测每个出口</h3>+<p>在共享端口上并发探测一组 IP 分散的服务器:信令服务器下发的 STUN,加上内置的公共服务器(B 站、Cloudflare、Twilio、Nextcloud、Google、FreeSWITCH)。实测 7 台服务器覆盖了公司全部出口。</p>+<ul><li><strong>按 IP 去重</strong>:出口只按目标 IP 选择,同一 IP 的多个域名或端口探多少次都落在同一个出口。</li><li><strong>过滤不可能是公网 STUN 的地址</strong>:实测有域名被 DNS 污染到 <code>192.0.2.42</code>;代理软件的 fake-ip 常用 <code>198.18.0.0/15</code>。这些地址直接丢弃,不当成出口。</li><li><strong>域名并发解析,每台 1.5 秒超时</strong>。1.1.0 逐个解析域名,一台 DNS 慢就拖住整轮,实测整轮约 1.6 秒;1.1.1 改为并发后在 0.2 秒以内。启动时、服务器配置变化时、每 5 分钟、本机网络变化时、尝试换直连之前各探测一轮;探测进行中又被触发,结束后补一轮,不并发。</li></ul>+<h3 id="3-把所有出口地址告诉对端">3. 把所有出口地址告诉对端</h3>+<p>每个出口的公网地址作为一条 srflx candidate,在 offer 或 answer 之后经信令发给对端,最多 8 条。对端为每条建立 candidate pair 做连通性检查,与实际出口吻合的那一条能打通。</p>+<ul><li>优先级按 RFC 8445 计算,实测地址排在推算地址之前。</li><li>会改写端口的线路,探测拿到的就是这个端口在该线路上的真实映射,不需要猜。</li><li>首轮探测还没结束时最多等 4 秒,免得刚上线就发一份空结果。这是在发出 offer/answer 之后的后台里等,不耽误握手,但要短于中转的等待时限。</li></ul>+<h3 id="4-记住见过的出口">4. 记住见过的出口</h3>+<p>某一轮的探测服务器可能恰好都没落到某条线路上(实测出口 D 就时有时无)。本端按「本机各网卡的 IPv4 地址」区分网络,记下每个网络见过的出口 IP 及其是否改写端口,保存 7 天(<code>~/Library/Application Support/CopySync/egress.json</code>)。</p>+<p>不改写端口的线路,地址就是「出口 IP + 本地端口」,这一轮没探测到也可以推算出来补发给对端;会改写端口的线路无法推算,不补。</p>+<h3 id="5-优先直连">5. 优先直连</h3>+<p>中转路径经服务器,握手往往比直连快。若不加约束,常常在直连打通之前就选中了中转,之后不再更换。中转路径要等一段时间才允许被选中(<code>SetRelayAcceptanceMinWait</code>):1.1.0 是 3 秒,1.1.1 放宽到 5 秒,见第 8 节。</p>+<h3 id="6-两端显示一致">6. 两端显示一致</h3>+<p>只有发送方能确定自己的数据是否走 TURN:对端经中转发来的包,在本端看来可能只是一个普通的 peer-reflexive 地址。连接就绪后两端经控制通道交换 <code>LinkInfo{relayed}</code>,任一端经中转,两端都显示「中转」(1.0.2 引入)。</p>+<h3 id="7-隐私开关与诊断">7. 隐私开关与诊断</h3>+<ul><li>设置「用公共服务器探测网络出口」,默认开启。公共 STUN 服务器能看到本机公网 IP,与任何 WebRTC 应用相同,看不到内容。关闭后只用自己的服务器探测。配置字段 <code>only_own_stun</code> 刻意设计为「关闭」语义:旧版界面不发这个字段时,默认值 false 不会把功能误关。</li><li><code>copysync-cli nat</code>(后台接口 <code>GetNetwork</code>)显示打洞端口、每个出口的地址与来源,以及各设备当前走直连还是中转。</li></ul>+<h3 id="8-落到中转后-再试直连-1-1-1">8. 落到中转后,再试直连(1.1.1)</h3>+<p><strong>问题。</strong>1.1.0 实机验收直连之后约 10 分钟,家里那台重启了后台服务,重连后变成了中转,之后一直是中转:</p>+<pre><code>23:19:42 P2P 连接状态 direct+23:29:01 P2P 连接状态 offline 家里那台断开+23:29:06 P2P 连接状态 connecting 它重新上线,本端发起握手+23:29:10 P2P 连接状态 relay</code></pre>+<p>这是一场赛跑。家里那台刚启动,要先探测完出口才能把出口地址发过来,而它访问部分公共 STUN 要经过代理,探测慢。出口地址到达之前,3 秒的中转等待时限已到,中转被选中。pion 选定 candidate 对之后不会再换,于是整个连接期间都走中转,哪怕直连其实打得通。</p>+<p><strong>做法。</strong></p>+<ol><li><strong>缩短探测、放宽等待</strong>:域名并发解析,整轮探测从约 1.6 秒降到 0.2 秒以内;中转等待从 3 秒放宽到 5 秒,比等待出口地址的上限(4 秒)长。</li><li><strong>中转时用 ICE 重启再打一次洞</strong>:连接以中转就绪后,由发起连接的一方(不礼让方,两端规则一致,不会同时发起)安排一次尝试:先重新探测出口,再发一个 <code>ICERestart</code> 的 offer。两端重新收集地址、同时再打一次洞。打通就换成直连;仍打不通,还是落回中转,下次隔得更久再试:10 秒、30 秒、2 分钟、5 分钟、15 分钟,之后每 15 分钟一次。</li><li><strong>只在空闲时重启</strong>:有数据流未关闭,或 10 秒内有过消息往来,就推迟。重启期间 pion 会清掉选中的 candidate 对,发出的数据暂时丢弃,由 SCTP 重传补上:连接不断、DTLS 与数据通道不变,只停顿几秒,但仍不该在传文件时做。</li></ol>+<p><strong>ICE 重启要处理的细节:</strong></p>+<ul><li><strong>对端不能把它当成新握手</strong>。应答方收到 offer 时,若连接已就绪且 DTLS 证书指纹没变,就是对端在重启 ICE:状态保持直连/中转,不打回「连接中」,也不启动 30 秒的握手超时,改由一个「重启 30 秒内没恢复就重置连接」的计时兜底(重启用的 offer 或 answer 若在信令里丢了,ICE 会一直停在检查中,自己不会失败)。</li><li><strong>新一代 candidate 不能早于描述发出</strong>。生成 offer/answer 时 pion 就开始收集地址,candidate 可能抢在描述之前发出;初次握手时对端会先缓存,重启时对端手里还是旧的远端描述,新 candidate 的 ufrag 对不上,pion 会直接丢弃。现在生成描述期间收集到的 candidate 先攒着,描述发出后再发。</li><li><strong>信令不保序,接收端也要兜底</strong>。candidate 的 ufrag 与当前远端描述对不上时,先缓存起来,设好新的远端描述后再加;缓存里混进的旧一代 candidate,补加时由 pion 按 ufrag 丢弃。</li><li><strong>显示要能从「中转」改回「直连」</strong>。1.0.2 的 <code>LinkInfo</code> 只会把状态改成中转。现在两端的视角合起来决定显示:重启后两端各自重新判断,再互发一次 <code>LinkInfo</code>,都不经中转就改回直连。</li></ul>+<p>pion 4.4 也带有自动续提名(renomination),能不重启就换线路,但要求两端都开启,对端是旧版本时不起作用。ICE 重启是标准做法;对端是 1.1.0 时,按代码逻辑也能配合:它会把重启的 offer 当成新握手,状态短暂显示「连接中」,随后照常恢复。这一点没有单独测试,两台都升级最稳妥。</p>+<h3 id="9-发现失效的连接-补发没送达的内容-1-1-1">9. 发现失效的连接,补发没送达的内容(1.1.1)</h3>+<p><strong>问题。</strong>1.1.1 开发期间又遇到一次:家里那台断线后,本端一直以为连接还在,此后复制的 6 个文件全部「发」进了一条死连接,对方一个也没收到,日志却记着「内容已发送」。三处缺陷叠在一起:</p>+<ol><li>pion 报告连接「失败」或「已关闭」后,本端只把状态改成离线,没有关闭连接。<code>Connect</code> 看到连接对象还在就直接返回,重连巡检因此永远重连不上。</li><li>控制通道在连接失败后仍显示「打开」,消息照样写进去,发送不报错。</li><li>推送文件时,等发送缓冲排空的 60 秒超时到了也按成功处理。</li></ol>+<p><strong>做法。</strong></p>+<ul><li>连接进入「失败」或「已关闭」就关闭清理,交给重连巡检重建。本端主动关闭、或已被新连接替换的旧连接发来的迟到状态一律忽略,不影响新连接。</li><li>对端重建了连接(例如重启了后台服务)时,它发来的 offer 带着新的 DTLS 证书。本端发现指纹变了就丢弃旧连接、新建一个应答,不在旧连接上协商到超时。</li><li>连接不在直连/中转状态时,发送一律返回「未连接」。缓冲排不空按失败处理。</li><li><strong>补发</strong>:同步引擎不再「广播一次了事」,而是逐台设备发送。没送达的(连不上、推送中途断开)记进该设备的待补发队列,连接建立或恢复时补发。队列在内存里,每台设备最多 20 条、24 小时内的;已删除的记录跳过。补发的 offer 带 <code>backlog</code> 标记,对端只记进复制记录,不写进剪贴板:对方此刻剪贴板里的内容比这些旧内容更新。</li></ul>+<h3 id="10-谁先发包-1-1-2">10. 谁先发包(1.1.2)</h3>+<p><strong>问题。</strong>1.1.1 装上之后,本机重启时 1~3 秒就直连;家里那台一重启,就落到中转,之后几次 ICE 重启也换不回直连:</p>+<pre><code>00:28:00.185 P2P 连接状态 connecting 家里那台刚重启上线+00:28:05.947 P2P 连接状态 relay+00:28:15.947 当前经中转,尝试换成直连 attempt=1+00:28:51.411 当前经中转,尝试换成直连 attempt=2+00:30:16.195 信令已连接 本机重启+00:30:17.363 P2P 连接状态 direct</code></pre>+<p>临时打开 pion 的 ICE 日志对比成功的那次:本机往家里那台的地址发出第一个包,65 毫秒后才收到对方的第一个包,本机先发。失败的几次正好相反:</p>+<ul><li>家里那台刚重启时,本机的出口地址早已探测好,随 offer 一起发过去;对方一收到就开始往这些地址发包。本机要等对方的 answer 和出口地址经服务器绕回来,才能往对方发包,晚了一个信令来回。</li><li>ICE 重启也是这个顺序:本机发出重启的 offer 和出口地址,对方先发包。</li><li>本机重启时,出口要现探测(几百毫秒),出口地址晚于 offer 发出,本机反而先发包,所以总能直连。</li></ul>+<p><strong>根因。</strong>谁的包先到,谁的路由器就先收到一个「陌生来源」的包。公司路由器没有丢弃它,而是留下了一条连接记录,占住了「出口地址:端口 ↔ 对方地址:端口」这一对。本机随后往同一个对方地址发包时,源端口与这条记录冲突,路由器只好换一个端口;事先告诉对方的地址就对不上了,对方的包也一直撞在那条记录上。这条记录要在对方停止发包 30 秒左右后才过期,而每次重启对方又先发包,于是一直打不通。家里的路由器(运营商级 NAT)直接丢弃这类包,不受影响。</p>+<p>NAT 实验室起初没有复现,是因为模拟路由器都丢弃外来的新连接(第六节「踩过的坑」里那条),而且实验室里信令没有延迟,两端几乎同时发包。去掉公司侧路由器的丢弃规则、给信令加上 80 毫秒延迟后,旧代码稳定落到中转,后续的重启也都失败;连探测服务器看到的公网端口都被挤得变了,与实测公司网络里出口 C、D 端口忽变的现象一致。</p>+<p><strong>做法。</strong>让「先发包」由规则决定,而不是靠运气:</p>+<ul><li>等待的一方先不公布出口地址,等收到对方本轮的出口地址、本端发往那里的包已经发出(再留 200 毫秒),才公布自己的。这样本端的路由器先有一条本端发起的记录,对方的包回来正好对上;先收到陌生包的是对方的路由器。最多等 3 秒,对方是没有出口地址的旧版本时照常发出。</li><li>初次握手由发起方等。用户这一对设备里发起方恰好是公司那台,初次握手就能打通。</li><li>若先收到包的那一侧路由器才是会占端口的,初次握手会失败。所以换直连的重试里两种顺序轮流用:第一次重试请应答方等(<code>SdpOffer.answerer_waits</code>),第二次换回发起方等,依此类推。哪一侧的路由器有这个毛病,最多一次重试就能避开;两侧都有就只能中转。</li><li>「出口地址」靠格式识别:出口探测生成的 srflx candidate 不带 ufrag 扩展,pion 自己收集的都带。</li></ul>+<h3 id="代码位置">代码位置</h3>+<div class="table-scroll"><table><thead><tr><th scope="col">文件</th><th scope="col">内容</th></tr></thead><tbody><tr><td><code>p2p/egress.go</code></td><td>探测、地址过滤、srflx candidate 生成</td></tr><tr><td><code>p2p/egress_history.go</code></td><td>出口历史与推算</td></tr><tr><td><code>p2p/manager.go</code></td><td>共享端口、探测时机、把地址交给每个连接</td></tr><tr><td><code>p2p/peer.go</code></td><td>发送出口地址(含谁先发包)、中转等待、<code>LinkInfo</code>、ICE 重启换直连、失效连接的清理</td></tr><tr><td><code>sync/backlog.go</code></td><td>逐台发送、待补发队列、连接恢复后补发</td></tr><tr><td><code>server/relay/turn.go</code></td><td>TURN 可绑定指定 IP(<code>ListenIP</code>),实验室需要</td></tr></tbody></table></div>+<h2 id="四-能覆盖哪些场景">四、能覆盖哪些场景</h2>+<div class="table-scroll"><table><thead><tr><th scope="col">本端</th><th scope="col">对端</th><th scope="col">结果</th></tr></thead><tbody><tr><td>单出口</td><td>单出口</td><td>直连</td></tr><tr><td>多出口(按目标 IP 选)</td><td>单出口</td><td>直连</td></tr><tr><td>多出口</td><td>多出口</td><td>直连(实验室验证;能否成立取决于两边线路组合,属于尽力而为)</td></tr><tr><td>任意</td><td>端口随机分配的 NAT</td><td>中转</td></tr><tr><td>任意</td><td>UDP 被拦截</td><td>中转</td></tr><tr><td>同一局域网</td><td>—</td><td>直连</td></tr></tbody></table></div>+<p>只要多出口的一侧升级,就能与旧版本的对端直连:新增的只是标准的 srflx candidate,旧版本照常处理。</p>+<h2 id="五-验证">五、验证</h2>+<h3 id="单元测试与集成测试">单元测试与集成测试</h3>+<p><code>p2p/egress_test.go</code>:解析服务器地址;过滤污染地址;同一出口被多台服务器看到时归并;区分改写端口与不改写端口;按历史补出口、换网络不串用、过期失效;生成的 candidate 能被 pion 解析,且实测地址优先级高于推算地址。</p>+<p><code>p2p/egress_integration_test.go</code>:起一台本机 STUN 服务,验证管理器在共享端口上完成探测,把出口地址作为 srflx candidate 发给对端,连接照常建立。</p>+<p><code>p2p/upgrade_test.go</code>(1.1.1):ICE 重启期间两端状态一直是直连、重启中发出的消息照样送达;中转时发起方自己重启并改回直连,礼让方不主动重启;对端换了证书时本端重建连接(去掉这个处理,测试会卡在「连接中」);连接断开时发送报错。信令桩异步、不保序地投递,比真实服务器更苛刻。<code>TestEgressOrder</code>(1.1.2)核对出口地址的收发顺序:初次握手发起方先收到对方的再发自己的,请应答方等的重启反过来;去掉等待,这个测试会失败。</p>+<p><code>sync/backlog_test.go</code>(1.1.1):连不上的设备在连接恢复后按复制先后收到补发、带补发标记,已送达的不重复;太旧的、已删除的不补发,补发途中又断开的留到下次;收到补发的文件不写进剪贴板。</p>+<h3 id="nat-打洞实验室">NAT 打洞实验室</h3>+<p><code>tools/natlab/run.sh</code> 用 Linux 网络命名空间与 iptables 搭出真实拓扑,<code>client-core/cmd/natlab</code> 用 CopySync 真实的 P2P 代码扮演两台设备:</p>+<pre><code>[a] 192.168.10.2 ── [rA] 出口 10.255.0.11–14 ──┐+ [inet] 信令 TURN STUN×4+[b] 192.168.20.2 ── [rB] 出口 10.254.0.21–22 ──┘</code></pre>+<p>rA 用 SNAT 规则按目标地址选出口,还原公司网络;rB 还原家用路由器或端口随机分配的 NAT。两台路由器都丢弃外网主动发起的新连接,与真实路由器一致(原因见「踩过的坑」)。</p>+<div class="table-scroll"><table><thead><tr><th scope="col">场景</th><th scope="col">预期</th><th scope="col">结果</th></tr></thead><tbody><tr><td>单出口 ↔ 家用路由器</td><td>直连</td><td>通过</td></tr><tr><td>两个出口,旧版本(对照)</td><td>中转</td><td>通过:复现了原问题</td></tr><tr><td>两个出口 ↔ 家用路由器</td><td>直连</td><td>通过</td></tr><tr><td>四个出口 ↔ 家用路由器</td><td>直连</td><td>通过</td></tr><tr><td>两个出口,第二条没探测到,无历史</td><td>中转</td><td>通过</td></tr><tr><td>两个出口,第二条没探测到,有历史</td><td>直连</td><td>通过</td></tr><tr><td>两个出口 ↔ 两个出口</td><td>直连</td><td>通过</td></tr><tr><td>两个出口 ↔ 端口随机分配的 NAT</td><td>中转</td><td>通过</td></tr><tr><td>一开始打不通,8 秒后网络恢复(1.1.1)</td><td>先中转,随后换成直连</td><td>通过</td></tr><tr><td>公司路由器会为外来的包占住端口,信令延迟 80 毫秒(1.1.2)</td><td>直连(初次握手即打通)</td><td>通过;1.1.1 在这里落到中转,重试也失败</td></tr><tr><td>家用路由器会为外来的包占住端口,信令延迟 80 毫秒(1.1.2)</td><td>先中转,第一次重试换对方先发包后直连</td><td>通过</td></tr></tbody></table></div>+<p>最后一个场景让家用路由器开头 8 秒不放行发往公司出口的 UDP,第一次握手只能落到中转;放开后,脚本还要求日志里确实出现了「中转 → 尝试换成直连」,排除一开始就碰巧直连的情况。</p>+<p>本地运行:<code>./tools/natlab/docker.sh</code>(macOS 上在特权容器里跑;国内网络加 <code>APK_MIRROR=mirrors.aliyun.com</code>)。CI 的 <code>natlab</code> 任务在每次提交时运行。</p>+<h3 id="实机验收">实机验收</h3>+<p>公司这台(4 个出口)升级到 1.1.0,家里那台仍是 1.0.2:</p>+<pre><code>23:19:40.083 信令已连接+23:19:41.718 出口探测完成 B:64778 C:17820 A:64778+23:19:42.884 P2P 连接状态 direct</code></pre>+<p>连上信令后约 3 秒建立直连。改造前同一对设备只能中转。</p>+<p>公司这台升级到 1.1.1 之后:</p>+<pre><code>00:12:14.666 信令已连接+00:12:14.837 出口探测完成 C:19735 B:49454 D:60103 A:49454+00:12:18.127 P2P 连接状态 direct</code></pre>+<p>探测在连上信令后 0.17 秒完成(1.1.0 约 1.6 秒),4 条线路全部探到。</p>+<h2 id="六-踩过的坑">六、踩过的坑</h2>+<ul><li><strong>pion 为每台 STUN 服务器单独开端口。</strong>这是多配 STUN 服务器也打不通的原因,也是改用共享端口的出发点。</li><li><strong>单靠本端判断「是否中转」会出错。</strong>一端经 TURN 发送时,另一端看到的源地址可能是 peer-reflexive 地址,并不标为 relay。这曾导致两台设备一台显示直连、一台显示中转,靠两端交换 <code>LinkInfo</code> 解决。</li><li><strong>实验室路由器必须丢弃外网主动发起的新连接。</strong>两端同时打洞时,对方的包可能先到达本端路由器。若放行到路由器本机,Linux conntrack 会为它建一条「未应答」记录;随后本端往外发时源端口与之冲突,SNAT 只好换一个端口,事先告诉对端的地址就失效了。真实路由器的防火墙直接丢弃这类包,被丢弃的包不会留下连接记录。没加这条规则时,连最简单的单出口场景都会误判为打不通。</li><li><strong>公共 STUN 域名可能被污染。</strong><code>stun.syncthing.net</code> 在测试网络里被解析到 <code>192.0.2.42</code>。不过滤的话,要么白等超时,要么被当成一个出口。</li><li><strong>实验室场景要互相隔离。</strong>出口历史文件跨场景残留,曾让「无历史」场景意外直连。这反过来也说明历史推算确实生效。</li><li><strong>pion 选定 candidate 对后不再更换。</strong>一次握手输给中转,整个连接期间都是中转。等待时限只能降低输的概率,要补救得靠 ICE 重启(第 8 节)。</li><li><strong>模拟路由器太「规矩」会掩盖问题。</strong>实验室里的路由器都丢弃外来的新连接、信令又没有延迟,于是「谁先发包」从来不是问题;真实的公司路由器会为外来包占住端口,信令也要绕服务器几十毫秒。现在实验室两种路由器都有,会占端口的场景给信令加了延迟。</li><li><strong>pion 报告失败后不会自己关闭连接</strong>,控制通道也仍显示打开。只把状态改成离线是不够的,必须关闭清理,否则上层永远不会重连(第 9 节)。</li></ul>+<h2 id="七-局限与后续">七、局限与后续</h2>+<ul><li><strong>对端是端口随机分配的 NAT 时仍会中转。</strong>理论上可以做端口预测或大规模并发打洞,但成功率低、流量大,暂不做。</li><li><strong>UDP 被拦截时只能中转。</strong>后续可以增加 TURN over TCP/TLS(443 端口)。</li><li><strong>探测覆盖取决于服务器 IP 的分散程度。</strong>线路越多,越需要更多 IP。服务器可以用 <code>-stun</code> 参数下发更多 STUN 地址,客户端会一并探测。</li><li><strong>待补发队列只在内存里。</strong>本机后台服务重启后清空;对方离线超过 24 小时的内容也不补发。</li><li><strong>两边都有公网 IPv6 时最省事。</strong>pion 会直接收集 IPv6 地址,无需穿越 NAT。这次的两台设备都没有。</li></ul>+ </article>+ </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=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh" aria-current="page">简体中文</a>+ <a href="../en/" hreflang="en" lang="en" data-lang="en">English</a>+ <a href="../ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>+ </nav>+ </div>+ </footer>+</body>+</html>diff --git a/docs/design/windows-client.html b/docs/design/windows-client.htmlnew file mode 100644index 0000000..f4ada60--- /dev/null+++ b/docs/design/windows-client.html@@ -0,0 +1,135 @@+<!doctype html>+<html lang="zh-CN">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>Windows 客户端技术方案:CopySync 技术方案</title>+ <meta name="description" content="状态:已实现,随 1.2.0 发布(2026-10-09)。实机验证记录见 windows-validation-2026-10-09.md(安装、同步、生命周期)与 windows-features-validation-2026-10-09.md(托盘、配对弹窗、图片预览)">+ <link rel="canonical" href="https://baiyuze.github.io/copysync/design/windows-client.html">+ <meta name="theme-color" content="#141416">+ <link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">+ <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="https://github.com/baiyuze/copysync/blob/main/design/windows-client.md">在 GitHub 上查看</a>+ <a href="https://github.com/baiyuze/copysync">GitHub</a>+ </nav>+ </div>+ </header>+ <main id="main">+ <article class="article">+ <p class="crumb"><a href="../">CopySync</a> 的技术方案</p>+ <h1>Windows 客户端技术方案</h1>+<blockquote><p>状态:已实现,随 1.2.0 发布(2026-10-09)。实机验证记录见 <a href="https://github.com/baiyuze/copysync/blob/main/design/windows-validation-2026-10-09.md">windows-validation-2026-10-09.md</a>(安装、同步、生命周期)与 <a href="https://github.com/baiyuze/copysync/blob/main/design/windows-features-validation-2026-10-09.md">windows-features-validation-2026-10-09.md</a>(托盘、配对弹窗、图片预览)</p><p>目标版本:1.2.0(Mac 与 Windows 同时发布)</p><p>相关:<a href="nat-traversal.html">多出口网络的 NAT 打洞</a></p></blockquote>+<nav class="toc" aria-label="目录"><strong>目录</strong><ul><li><a href="#一-目标">一、目标</a></li><li><a href="#二-现状-哪些能直接用">二、现状:哪些能直接用</a></li><li><a href="#三-总体架构">三、总体架构</a></li><li><a href="#四-剪贴板">四、剪贴板</a></li><li><a href="#五-跨平台内容兼容">五、跨平台内容兼容</a></li><li><a href="#六-后台服务的生命周期">六、后台服务的生命周期</a></li><li><a href="#七-网络">七、网络</a></li><li><a href="#八-界面">八、界面</a></li><li><a href="#九-安全">九、安全</a></li><li><a href="#十-安装-签名与发布">十、安装、签名与发布</a></li><li><a href="#十一-测试与验证">十一、测试与验证</a></li><li><a href="#十二-里程碑">十二、里程碑</a></li><li><a href="#十三-需要拍板的事">十三、需要拍板的事</a></li><li><a href="#附-要改动的代码">附:要改动的代码</a></li></ul></nav>+<h2 id="一-目标">一、目标</h2>+<p>让 Windows 电脑加入 CopySync:与 Mac、与其他 Windows 电脑互相同步文本、带格式文本、图片和文件,体验与 Mac 版一致。</p>+<ul><li>在一台上 <code>Ctrl+C</code>,另一台上 <code>Ctrl+V</code>(或 <code>⌘V</code>)。粘贴文件时得到的是真实文件,可以直接粘贴进资源管理器、微信、Office。</li><li>开机自启,关掉窗口照常同步,崩溃自动拉起。Windows 安装时创建桌面快捷方式;后台服务持有托盘图标,点击可打开界面,右键可打开界面或退出 CopySync。</li><li>网络行为与 Mac 版完全相同:直连优先、多出口打洞、自动中转、端到端加密。</li><li>与 Mac 版互通,Mac 端不升级也能和 Windows 配对、同步(协议不变)。</li></ul>+<p><strong>一期不做:</strong></p>+<div class="table-scroll"><table><thead><tr><th scope="col">不做</th><th scope="col">原因</th><th scope="col">何时</th></tr></thead><tbody><tr><td>ARM64 原生包</td><td>Flutter 3.47 才正式支持 Windows ARM64,且只能在 ARM 机器上构建;x64 版在 ARM 上可以模拟运行</td><td>二期,用 GitHub 的 ARM Windows 构建机</td></tr><tr><td>虚拟文件(Outlook 附件、压缩包里直接复制的文件)</td><td>剪贴板里没有真实路径,只有流,需要实现 COM 接口</td><td>视需求</td></tr><tr><td>自动更新、微软商店</td><td>先跑通分发与签名</td><td>二期</td></tr></tbody></table></div>+<p>支持的系统:Windows 10(21H2 及以上)与 Windows 11,x64。这是 Flutter 桌面版支持的范围。</p>+<h2 id="二-现状-哪些能直接用">二、现状:哪些能直接用</h2>+<p>后台服务除剪贴板外全部是纯 Go:数据库用的是纯 Go 的 <code>modernc.org/sqlite</code>,压缩是纯 Go 的 zstd,cgo 只出现在 <code>internal/clipboard/darwin.go</code>。实测在 Mac 上已经可以直接交叉编译出 Windows 版:</p>+<pre><code>CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./cmd/... # copysyncd.exe、copysync-cli.exe+CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build ./cmd/copysyncd</code></pre>+<div class="table-scroll"><table><thead><tr><th scope="col">模块</th><th scope="col">Windows 上</th><th scope="col">说明</th></tr></thead><tbody><tr><td>信令、配对、签名(<code>transport/signaling</code>、<code>peers</code>、<code>identity</code>)</td><td>直接复用</td><td></td></tr><tr><td>P2P、出口探测、打洞、中转(<code>transport/p2p</code>)</td><td>直接复用</td><td>防火墙与虚拟网卡见第七节</td></tr><tr><td>同步引擎、补发、存储、缓存、回收(<code>sync</code>、<code>store</code>、<code>cache</code>、<code>gc</code>)</td><td>直接复用</td><td></td></tr><tr><td>本机接口(<code>rpc</code>,127.0.0.1 + 一次性 token)</td><td>直接复用</td><td></td></tr><tr><td>数据目录(<code>config.DefaultPaths</code>)</td><td>已有 Windows 分支</td><td><code>%LOCALAPPDATA%\CopySync</code></td></tr><tr><td>打包解包(<code>pack</code>)</td><td>要改</td><td>文件名、符号链接,见第五节</td></tr><tr><td>剪贴板(<code>clipboard</code>)</td><td><strong>要新写</strong></td><td>目前是返回「不支持」的占位实现,见第四节</td></tr><tr><td>进程生命周期(<code>cmd/copysyncd</code>)</td><td>要改</td><td>自启、守护、日志、单实例、注销,见第六节</td></tr><tr><td>界面(<code>ui/</code>)</td><td>要改</td><td>已有 Flutter 的 <code>windows/</code> 工程骨架;后台服务管理、窗口外观、文案,见第八节</td></tr><tr><td>构建与发布(<code>scripts/</code>、CI)</td><td>要新写</td><td>Flutter 的 Windows 版只能在 Windows 上构建,见第十节</td></tr></tbody></table></div>+<h2 id="三-总体架构">三、总体架构</h2>+<p>与 Mac 版同构,三个可执行文件:</p>+<pre><code>CopySync.exe(Flutter 界面)+ │ gRPC,127.0.0.1 随机端口 + token(%LOCALAPPDATA%\CopySync\daemon.json)+ ▼+copysyncd.exe(Go 后台服务,用户会话内运行,无控制台窗口)+ ├─ 剪贴板:隐藏的消息窗口 + Win32 剪贴板 API+ ├─ 同步引擎 / 存储 / 缓存+ └─ 信令(WebSocket)+ P2P(WebRTC)──► 信令服务器 / 对端设备++copysync-cli.exe(命令行,排障用)</code></pre>+<p>后台服务必须作为<strong>登录用户的普通进程</strong>运行,不能做成 Windows 服务。Windows 服务运行在会话 0,与用户桌面隔离,访问不到用户的剪贴板。这与 Mac 上用 LaunchAgent、不用 LaunchDaemon 是同一个原因。</p>+<h2 id="四-剪贴板">四、剪贴板</h2>+<p>这是一期的主要工作量。用纯 Go 实现(<code>golang.org/x/sys/windows</code> 加按需加载的 user32、kernel32、shell32 函数),不用 cgo,这样仍能在 Mac 上交叉编译。</p>+<h3 id="1-线程与消息循环">1. 线程与消息循环</h3>+<p>现有的 <code>MainLoop</code> 设计可以原样沿用,只是「事件循环」换成 Windows 的消息泵:</p>+<ul><li>主线程(已 <code>LockOSThread</code>)创建一个<strong>隐藏的顶层窗口</strong>作为剪贴板的拥有者。不用「仅消息窗口」(HWND_MESSAGE),因为它收不到会话结束、电源变化等广播消息。</li><li><code>pumpRunLoop</code> 改为 <code>PeekMessage</code>/<code>DispatchMessage</code> 循环,空闲时 <code>MsgWaitForMultipleObjects</code> 等待,不空转。</li><li>用 <code>AddClipboardFormatListener</code> 订阅 <code>WM_CLIPBOARDUPDATE</code>,变化时立即触发一次探测,比 Mac 的 300 毫秒轮询更跟手;轮询保留作兜底。</li><li><code>ChangeCount</code> 用 <code>GetClipboardSequenceNumber()</code>。它与 Mac 的 changeCount 语义一致,<code>Watcher</code> 里「跳过本机写入」(selfWrites)的逻辑不用改。</li><li>权限:Windows 没有剪贴板授权机制,<code>Permission()</code> 恒为 <code>PermissionNotApplicable</code>,界面上的授权提示自然不显示。</li></ul>+<h3 id="2-格式对照">2. 格式对照</h3>+<div class="table-scroll"><table><thead><tr><th scope="col">类型</th><th scope="col">读取(优先级从高到低)</th><th scope="col">写入</th></tr></thead><tbody><tr><td>文件</td><td><code>CF_HDROP</code>(<code>DragQueryFileW</code> 取路径)</td><td><code>CF_HDROP</code>(<code>DROPFILES</code> 结构 + 双 NUL 结尾的 UTF-16 路径表),加上 <code>Preferred DropEffect = DROPEFFECT_COPY</code>,资源管理器粘贴时执行复制而不是移动</td></tr><tr><td>图片</td><td>注册格式 <code>PNG</code>(Chrome、Office、截图工具都提供)→ <code>CF_DIBV5</code> → <code>CF_DIB</code>,后两者转成 PNG</td><td><code>PNG</code> + <code>CF_DIBV5</code>(带透明通道);<code>CF_DIB</code>、<code>CF_BITMAP</code> 由系统自动合成</td></tr><tr><td>带格式文本</td><td>注册格式 <code>HTML Format</code>(CF_HTML),解析头部偏移量取出 HTML</td><td><code>HTML Format</code>(生成带偏移量的头部)+ <code>CF_UNICODETEXT</code></td></tr><tr><td>纯文本</td><td><code>CF_UNICODETEXT</code></td><td><code>CF_UNICODETEXT</code>(<code>CF_TEXT</code> 由系统合成)</td></tr></tbody></table></div>+<p>判型顺序:文件最优先(资源管理器复制文件时剪贴板里同时有文件名文本);只有图片、没有文本时才算图片(截图、画图、浏览器里「复制图片」);Excel、Word 复制的内容同时带着一份渲染出来的图片,但有文本,按带格式文本处理。</p>+<p><strong>文件粘贴不需要 COM。</strong>占位实现的注释里写着「文件粘贴需要在 Go 里实现 COM IDataObject」,那是按延迟渲染设想的。Mac 版已经验证过延迟渲染行不通,改成了「先落盘、再写剪贴板」;Windows 也一样,收到的文件已在本地缓存里,直接给 <code>CF_HDROP</code> 真实路径即可。</p>+<h3 id="3-不同步敏感内容">3. 不同步敏感内容</h3>+<p>密码管理器复制密码时,会在剪贴板里放一个标记,告诉剪贴板工具「别记录、别同步」。Windows 上的约定(微软文档「Cloud Clipboard and Clipboard History Formats」,以及老的通行做法):</p>+<div class="table-scroll"><table><thead><tr><th scope="col">标记</th><th scope="col">规则</th><th scope="col">谁在用</th></tr></thead><tbody><tr><td><code>ExcludeClipboardContentFromMonitorProcessing</code></td><td>存在即跳过</td><td>KeePass、KeePassXC</td></tr><tr><td><code>Clipboard Viewer Ignore</code></td><td>存在即跳过</td><td>KeePass 等较老的工具</td></tr><tr><td><code>CanIncludeInClipboardHistory</code></td><td>值为 DWORD 0 时跳过(只看存在与否不够)</td><td>Bitwarden 只写这一个</td></tr><tr><td><code>CanUploadToCloudClipboard</code></td><td>值为 0 时跳过:它的含义正是「不要同步到别的设备」</td><td></td></tr></tbody></table></div>+<p>命中就既不同步,也不写进复制记录。<strong>Mac 版目前没有做这件事</strong>(应检查 <code>org.nspasteboard.ConcealedType</code> 和 <code>org.nspasteboard.TransientType</code>),1Password、Bitwarden 复制的密码会被同步过去并留在记录里。这一条应先在 Mac 版单独修掉,不等 Windows。</p>+<h3 id="4-其他细节">4. 其他细节</h3>+<ul><li><strong>剪贴板被占用</strong>:<code>OpenClipboard</code> 在别的程序正打开剪贴板时会失败,按 20 毫秒间隔重试 10 次,仍失败就放弃这一次,等下一次变化。</li><li><strong>写入时的标记</strong>:把对端内容写进本机剪贴板时,加上 <code>CanUploadToCloudClipboard = 0</code>,免得 Windows 自带的云剪贴板再把它同步一遍,在用户的其他 Windows 电脑上出现重复。写入本机剪贴板历史(<code>Win+V</code>)不受影响。</li><li><strong>不支持的内容</strong>:只有虚拟文件(<code>FileGroupDescriptorW</code>/<code>FileContents</code>)而没有 <code>CF_HDROP</code> 时判为未知类型,跳过并记日志。</li></ul>+<h2 id="五-跨平台内容兼容">五、跨平台内容兼容</h2>+<p>网络上传输的格式保持现状(与 Mac 版一致),差异都在 Windows 一侧的剪贴板层与解包时消化:</p>+<div class="table-scroll"><table><thead><tr><th scope="col">项目</th><th scope="col">网络上的约定</th><th scope="col">Windows 侧的处理</th></tr></thead><tbody><tr><td>文本换行</td><td><code>LF</code></td><td>读取时把 <code>CRLF</code> 统一成 <code>LF</code>;写入时转成 <code>CRLF</code>(记事本等程序依赖它)</td></tr><tr><td>带格式文本</td><td>完整的 HTML 文本</td><td>读取时去掉 CF_HTML 头部;写入时生成头部,用 <code><!--StartFragment--></code> 标出片段</td></tr><tr><td>图片</td><td>PNG</td><td>DIB(倒序扫描行、<code>BI_BITFIELDS</code>、32 位透明通道)与 PNG 互转</td></tr><tr><td>条目类型(<code>ClipItem.content_type</code>)</td><td>沿用 Mac 的 UTType 字符串,如 <code>public.png</code></td><td>Windows 侧按扩展名映射成同样的字符串,不另起一套</td></tr><tr><td>文件与文件夹</td><td>tar + zstd</td><td>解包时按下表处理文件名</td></tr></tbody></table></div>+<p><strong>文件名</strong>是最容易出事的地方。Mac 上合法的文件名在 Windows 上未必合法,处理不好轻则解包失败,重则有安全问题:</p>+<div class="table-scroll"><table><thead><tr><th scope="col">情况</th><th scope="col">例子</th><th scope="col">处理</th></tr></thead><tbody><tr><td>Windows 不允许的字符 `: * ? " < > \</td><td>\`</td><td><code>会议:纪要.txt</code></td><td>换成对应的全角字符(<code>:*?"<>|\</code>),名字仍然可读。冒号还关系到安全:<code>a.txt:stream</code> 会写进 NTFS 的备用数据流</td></tr><tr><td>结尾是点或空格</td><td><code>notes.</code></td><td>末尾加 <code>_</code></td></tr><tr><td>设备保留名</td><td><code>CON</code>、<code>nul.txt</code>、<code>COM1</code></td><td>前面加 <code>_</code></td></tr><tr><td>只差大小写</td><td><code>Readme.md</code> 与 <code>README.md</code></td><td>第二个改名为 <code>README (2).md</code>,不能互相覆盖</td></tr><tr><td>分解形式的 Unicode</td><td>Mac 上的 <code>が</code> 可能是 <code>か</code> + 濁点两个码位</td><td>统一成组合形式(NFC),否则资源管理器里显示成两个字符、搜索也搜不到。中文不受影响</td></tr><tr><td>路径超过 260 个字符</td><td>深层文件夹</td><td>Go 的 <code>os</code> 包会自动加 <code>\\?\</code> 前缀,读写没问题;只是资源管理器对超长路径支持不好,记一条已知限制</td></tr><tr><td>符号链接</td><td>文件夹里的软链接</td><td>普通用户没有创建符号链接的权限(除非开启了开发者模式)。改为跳过并记录,不能让整次解包失败</td></tr><tr><td>系统垃圾文件</td><td><code>.DS_Store</code>、<code>Thumbs.db</code>、<code>desktop.ini</code></td><td>打包时跳过(Mac 版同步修改)</td></tr></tbody></table></div>+<p><code>pack.safeJoin</code> 的防目录穿越检查保留,在<strong>清洗文件名之后</strong>做;Windows 上额外拒绝驱动器号开头(<code>C:foo</code>)和 <code>\\</code> 开头的路径。</p>+<h2 id="六-后台服务的生命周期">六、后台服务的生命周期</h2>+<div class="table-scroll"><table><thead><tr><th scope="col">需求</th><th scope="col">Mac 版的做法</th><th scope="col">Windows 版的做法</th></tr></thead><tbody><tr><td>开机自启</td><td>LaunchAgent</td><td><code>HKCU\Software\Microsoft\Windows\CurrentVersion\Run</code> 下写一项。只影响当前用户,不需要管理员权限</td></tr><tr><td>崩溃自动拉起</td><td>launchd <code>KeepAlive</code>,10 秒节流</td><td><code>copysyncd.exe</code> 自带守护模式:父进程拉起子进程,子进程异常退出就 10 秒后重启</td></tr><tr><td>只运行一个</td><td>launchd 保证</td><td>命名互斥量 <code>Local\CopySync.Daemon</code>,第二个实例直接退出</td></tr><tr><td>不弹黑框</td><td>本来就没有</td><td>以 GUI 子系统编译(<code>-ldflags -H=windowsgui</code>)</td></tr><tr><td>日志</td><td>launchd 把标准输出重定向到文件</td><td>自己写 <code>%LOCALAPPDATA%\CopySync\logs\daemon.log</code>,按大小轮转(Mac 版的日志目前不轮转,一并加上)</td></tr><tr><td>注销、关机</td><td>SIGTERM</td><td>隐藏窗口处理 <code>WM_QUERYENDSESSION</code>/<code>WM_ENDSESSION</code>,正常收尾</td></tr><tr><td>睡眠唤醒</td><td>靠重连巡检</td><td>处理 <code>WM_POWERBROADCAST</code>:唤醒后立即重新探测出口、重连,不等巡检</td></tr><tr><td>升级</td><td>打开新版 App 时校正登录项并重启服务</td><td>安装程序借助「重启管理器」关掉旧进程,装完再启动;界面同样校验版本、必要时重启服务</td></tr></tbody></table></div>+<p>也评估过「计划任务」:它自带失败重启,但创建「登录时运行」的任务通常要管理员权限,与「不需要管理员即可安装」的目标冲突,所以不用。</p>+<h2 id="七-网络">七、网络</h2>+<p>打洞、多出口探测、中转、补发的代码原样复用。Windows 上要注意三件事:</p>+<ol><li><strong>防火墙弹窗</strong>。后台服务在 0.0.0.0 上收发 UDP,Windows 防火墙第一次会弹窗询问是否允许。允许最好;即使用户拒绝,防火墙对 UDP 也是有状态的,本端先往对端发过包,对端的回包就能进来。打洞时双方本来就会互相发包,所以预计仍能直连,<strong>需要实测确认</strong>。安装程序不加防火墙规则,因为那需要管理员权限。</li><li><strong>虚拟网卡</strong>。装了 WSL、Hyper-V、Docker 或 VPN 的电脑有很多虚拟网卡,其中 WSL 的网卡地址每次开机都会变。出口历史是按「本机各网卡的地址」区分网络的(<code>localNetworkKey</code>),会因此失效。Windows 上计算时排除名字以 <code>vEthernet</code> 开头的网卡和已知的 VPN 虚拟网卡。</li><li><strong>「公用网络」</strong>。连上咖啡馆等网络时,Windows 默认把它设为「公用网络」,防火墙更严。行为同第 1 条,实测时覆盖。</li></ol>+<h2 id="八-界面">八、界面</h2>+<p>继续用 Flutter,一套代码。Flutter 的 <code>windows/</code> 工程骨架已经在仓库里,<code>daemon_client.dart</code> 也已有 Windows 的数据目录分支。</p>+<h3 id="1-外观-像-windows-11-自带的应用">1. 外观:像 Windows 11 自带的应用</h3>+<p>Mac 版刻意做成系统自带应用的样子(石墨 + 系统蓝、透明标题栏、侧边栏延伸到红绿灯下)。Windows 版沿用同一个原则,参照 Windows 11 的「设置」应用:</p>+<div class="table-scroll"><table><thead><tr><th scope="col"></th><th scope="col">Mac</th><th scope="col">Windows</th></tr></thead><tbody><tr><td>窗口</td><td>透明标题栏,红绿灯在左上</td><td>自绘标题栏,最小化、最大化、关闭在右上;侧边栏顶部放应用名,与「设置」应用一致</td></tr><tr><td>背景</td><td>系统材质</td><td>Mica 材质(在 <code>windows/runner</code> 里调用 <code>DwmSetWindowAttribute</code>,不引入插件)</td></tr><tr><td>字体</td><td>SF Pro、苹方(跟随系统)</td><td>Segoe UI Variable、微软雅黑 UI(跟随系统)</td></tr><tr><td>图标</td><td>Cupertino</td><td>Fluent 图标</td></tr><tr><td>强调色</td><td>系统蓝</td><td>跟随系统强调色,取不到时用同一个蓝</td></tr></tbody></table></div>+<p>实现上在 <code>theme.dart</code> 加一层平台差异(字体、图标、标题栏高度、圆角),页面结构与交互不变:复制记录、设备、设置三页。</p>+<h3 id="2-后台服务管理">2. 后台服务管理</h3>+<p><code>background_service.dart</code> 目前全是 launchd 的逻辑,抽成接口,分 Mac 与 Windows 两个实现。Windows 的状态判定:</p>+<div class="table-scroll"><table><thead><tr><th scope="col">状态</th><th scope="col">判定</th></tr></thead><tbody><tr><td>未安装</td><td><code>Run</code> 下没有 CopySync 项</td></tr><tr><td>指向旧位置</td><td><code>Run</code> 项的路径不是当前这份 <code>copysyncd.exe</code></td></tr><tr><td>已停止</td><td><code>daemon.json</code> 不存在,或其中的进程号已不在运行</td></tr><tr><td>运行中</td><td>能连上,且版本与界面一致(不一致就重启服务)</td></tr></tbody></table></div>+<h3 id="3-文案与小处">3. 文案与小处</h3>+<ul><li>「这台 Mac」「两台 Mac」等十余处文案改为按平台显示(「这台电脑」「两台设备」)。Mac 版同步修改,因为对端可能是 Windows。</li><li>设备列表的平台图标已有 <code>windows</code> 分支,换成 Fluent 图标即可。</li><li>打开网页用 <code>open</code> 命令的地方改为跨平台的写法。</li><li>截图脚本(<code>tools/screenshots</code>)加 Windows 外观的版本,用于 README 与网站。</li></ul>+<h2 id="九-安全">九、安全</h2>+<div class="table-scroll"><table><thead><tr><th scope="col">项目</th><th scope="col">做法</th></tr></thead><tbody><tr><td>设备私钥(<code>identity.json</code>)</td><td>用 DPAPI(<code>CryptProtectData</code>,当前用户范围)加密后落盘。别的用户、拷走文件到别的电脑都解不开。Mac 版目前是权限 0600 的明文文件,后续可迁到钥匙串</td></tr><tr><td>数据目录</td><td><code>%LOCALAPPDATA%</code> 本身只有当前用户可访问,不另设权限</td></tr><tr><td>本机接口</td><td>与 Mac 相同:只监听 127.0.0.1,必须带 token</td></tr><tr><td>密码等敏感内容</td><td>见第四节第 3 条:命中标记就不同步、不记录</td></tr><tr><td>收到的文件</td><td>一期不加「来自网络」标记(MOTW):内容来自自己的设备,加了会让 Office 以受保护视图打开、可执行文件弹警告。二期考虑「源文件带标记才带过去」</td></tr></tbody></table></div>+<h2 id="十-安装-签名与发布">十、安装、签名与发布</h2>+<h3 id="1-安装包">1. 安装包</h3>+<p>用 Inno Setup 做<strong>按用户安装</strong>的安装包(类似 VS Code 的「用户安装版」):</p>+<ul><li>装到 <code>%LOCALAPPDATA%\Programs\CopySync</code>,不需要管理员权限,不弹 UAC。</li><li>创建开始菜单项;装完直接打开 CopySync,由界面引导「启用后台同步」,流程与 Mac 一致。</li><li>卸载时停掉后台服务、删掉自启项,询问是否保留复制记录与设备身份。</li><li>另出一个 zip 便携版,给不想运行安装程序的人。</li></ul>+<p>也评估过 MSIX:好处是安装干净、能自动更新;但要求必须有受信任的签名证书,且应用写入 <code>%LOCALAPPDATA%</code> 的数据会被重定向到包的私有目录,命令行工具与后台服务对不上路径。一期不用。</p>+<h3 id="2-代码签名">2. 代码签名</h3>+<p>不签名的安装包在下载、运行时会被 SmartScreen 拦一下(「Windows 已保护你的电脑」→「更多信息」→「仍要运行」),与 Mac 版没经过公证时「仍要打开」是一回事。可选的路子:</p>+<div class="table-scroll"><table><thead><tr><th scope="col">方案</th><th scope="col">费用</th><th scope="col">效果</th></tr></thead><tbody><tr><td>不签名(一期)</td><td>0</td><td>每个新版本都被 SmartScreen 拦,README 里写清楚怎么放行</td></tr><tr><td>普通代码签名证书(OV)</td><td>每年数百美元起</td><td>有发布者名称;SmartScreen 信誉要随下载量慢慢积累</td></tr><tr><td>微软的云签名服务</td><td>按月计费</td><td>价格低,但对个人开发者有地区限制,需要确认是否可用</td></tr></tbody></table></div>+<h3 id="3-构建与发布">3. 构建与发布</h3>+<p>Flutter 的 Windows 版只能在 Windows 上构建,现有的 <code>scripts/package.sh</code> 跑在 Mac 上,所以 Windows 包由 CI 构建:</p>+<ul><li>新增 GitHub Actions 任务(<code>windows-latest</code>):编译 Go(<code>GOOS=windows</code>)→ <code>flutter build windows</code> → Inno Setup 打包 → 上传到同一个 Release。</li><li>发布时在 Mac 上照常运行 <code>package.sh</code> 出 DMG,推送标签后 CI 补上 Windows 包。</li><li>发布资源沿用「不带版本号」的命名,下载直链不会失效:<code>CopySync-Setup.exe</code>、<code>CopySync-windows-x64.zip</code>。</li><li>CI 的常规检查增加 Windows:<code>go vet</code>、<code>go test</code>、<code>flutter analyze</code>、<code>flutter test</code>。</li></ul>+<h2 id="十一-测试与验证">十一、测试与验证</h2>+<ol><li><strong>纯函数单测</strong>(任何系统上都能跑):CF_HTML 头部的生成与解析、DIB 与 PNG 互转(含倒序扫描行、透明通道)、<code>DROPFILES</code> 编解码、换行转换、文件名清洗(第五节每一行一个用例)、敏感标记判定。</li><li><strong>Windows 上的集成测试</strong>:真实剪贴板的读写往返(文本、HTML、图片、文件)、跳过本机写入、密码管理器标记。GitHub 的 Windows 构建机能否访问剪贴板需要先验证;不行的话这部分在本地 Windows 机器上跑。</li><li><strong>Mac ↔ Windows 联调清单</strong>:<ul><li>内容:中英文文本;从网页、Word、Excel 复制的带格式文本;截图、带透明背景的 PNG;单个文件、多个文件、深层文件夹、中文与日文文件名、含 <code>:</code> 的文件名;1 GB 大文件按需拉取。</li><li>粘贴目标:资源管理器、微信、Office、记事本。</li><li>网络:同一局域网、公司多出口网络、家用宽带、防火墙弹窗点「取消」、睡眠唤醒、断网恢复。</li><li>生命周期:注销与重启、升级安装、卸载后重装。</li></ul></li><li><strong>NAT 打洞实验室</strong>:网络代码与平台无关,现有 11 个场景继续覆盖。</li></ol>+<h2 id="十二-里程碑">十二、里程碑</h2>+<p>按一个人全职估算,约 6 周:</p>+<div class="table-scroll"><table><thead><tr><th scope="col">阶段</th><th scope="col">内容</th><th scope="col">产出</th><th scope="col">估时</th></tr></thead><tbody><tr><td>M1</td><td>剪贴板实现(第四节)与后台服务生命周期(第六节)</td><td><code>copysyncd.exe</code> 在 Windows 上跑通:用 <code>copysync-cli</code> 能与 Mac 配对、互相同步文本与图片</td><td>2 周</td></tr><tr><td>M2</td><td>文件与内容兼容(第五节)、敏感内容过滤</td><td>联调清单里的内容类全部通过</td><td>1 周</td></tr><tr><td>M3</td><td>界面适配(第八节)</td><td>Windows 外观的界面,能启用、管理后台服务</td><td>1.5 周</td></tr><tr><td>M4</td><td>安装包、CI、文档与网站</td><td>Release 里出现 Windows 安装包,README 与网站补上 Windows</td><td>1 周</td></tr><tr><td>M5</td><td>实机联调与修复,发布 1.2.0</td><td></td><td>0.5 周起</td></tr></tbody></table></div>+<p>M1 结束时就能验证最大的不确定点:剪贴板方案、防火墙行为、Windows 上的打洞。之后的阶段风险较小。</p>+<h2 id="十三-需要拍板的事">十三、需要拍板的事</h2>+<ol><li><strong>代码签名</strong>:一期不签名(推荐,先验证需求),还是一开始就买证书?</li><li><strong>托盘图标</strong>:已按用户需求加入一期,由后台服务持有,随登录自启、关闭主窗口后保留;退出时停止当前后台同步,但保留下次登录的自启设置。</li><li><strong>ARM64</strong>:一期只出 x64(推荐,ARM 机器可以模拟运行),还是同时出 ARM64?</li><li><strong>Mac 版的敏感内容漏洞</strong>(第四节第 3 条):建议马上单独修,发 1.1.3。</li></ol>+<h2 id="附-要改动的代码">附:要改动的代码</h2>+<div class="table-scroll"><table><thead><tr><th scope="col">位置</th><th scope="col">改动</th></tr></thead><tbody><tr><td><code>client-core/internal/clipboard/windows.go</code>(新)</td><td>Win32 剪贴板实现、消息窗口、格式转换</td></tr><tr><td><code>client-core/internal/clipboard/other.go</code></td><td>构建标签改为排除 darwin 与 windows</td></tr><tr><td><code>client-core/internal/clipboard/sensitive.go</code>(新)</td><td>敏感内容判定(两个平台共用接口)</td></tr><tr><td><code>client-core/internal/pack/pack.go</code></td><td>文件名清洗、符号链接、垃圾文件过滤</td></tr><tr><td><code>client-core/internal/transport/p2p/egress_history.go</code></td><td>网络标识排除虚拟网卡</td></tr><tr><td><code>client-core/internal/identity/identity.go</code></td><td>Windows 上用 DPAPI 保护私钥</td></tr><tr><td><code>client-core/cmd/copysyncd/main.go</code></td><td>守护模式、单实例、日志文件、会话结束与电源事件</td></tr><tr><td><code>ui/lib/background_service.dart</code></td><td>拆成接口与 Mac、Windows 两个实现</td></tr><tr><td><code>ui/lib/theme.dart</code>、<code>ui/lib/main.dart</code></td><td>平台外观、自绘标题栏</td></tr><tr><td><code>ui/windows/runner/</code></td><td>Mica 背景、窗口尺寸记忆、应用图标</td></tr><tr><td><code>scripts/</code>、<code>.github/workflows/</code></td><td>Windows 构建、安装包、发布</td></tr><tr><td><code>tools/installer/</code>(新)</td><td>Inno Setup 脚本</td></tr></tbody></table></div>+ </article>+ </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=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh" aria-current="page">简体中文</a>+ <a href="../en/" hreflang="en" lang="en" data-lang="en">English</a>+ <a href="../ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>+ </nav>+ </div>+ </footer>+</body>+</html>diff --git a/docs/en/index.html b/docs/en/index.htmlindex 10f5373..e8881df 100644--- a/docs/en/index.html+++ b/docs/en/index.html@@ -3,32 +3,30 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">- <title>CopySync: sync the clipboard and files between Mac and Windows, across accounts and networks — open source</title>- <meta name="description" content="CopySync lets you copy on one computer and paste on another, Mac or Windows: text, images, files and folders. Works across accounts and networks. Peer-to-peer, end-to-end encrypted, with a server you host yourself that can't read your data. Free and MIT licensed.">+ <title>CopySync: sync the clipboard and files between Mac and Windows, across accounts and networks</title>+ <meta name="description" content="CopySync lets you copy on one computer and paste on another, Mac or Windows: text, images, files and folders. No shared account or network required. Peer-to-peer, end-to-end encrypted, with a server you host that can't see your content. Free and open source."><link rel="canonical" href="https://baiyuze.github.io/copysync/en/"><link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"><link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/">+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"><link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/">- <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">- <meta name="theme-color" content="#161617" media="(prefers-color-scheme: dark)">-+ <meta name="theme-color" content="#141416"><meta property="og:type" content="website"><meta property="og:site_name" content="CopySync">- <meta property="og:title" content="CopySync: copy on one computer, paste on the other">- <meta property="og:description" content="Mac and Windows. Text, images, files and folders, across accounts and networks, peer-to-peer and end-to-end encrypted, with a server you host. Free and open source.">+ <meta property="og:title" content="CopySync: copy on this computer, paste on that one">+ <meta property="og:description" content="Mac and Windows. Text, images, files and folders across accounts and networks; peer-to-peer, end-to-end encrypted, self-hosted server. Free and open source."><meta property="og:url" content="https://baiyuze.github.io/copysync/en/"><meta property="og:image" content="https://baiyuze.github.io/copysync/assets/og-en.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:locale" content="en_US"><meta property="og:locale:alternate" content="zh_CN">+ <meta property="og:locale:alternate" 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">-<script type="application/ld+json">{"@context": "https://schema.org",@@ -37,72 +35,104 @@"@type": "SoftwareApplication","@id": "https://baiyuze.github.io/copysync/#app","name": "CopySync",- "description": "Open-source tool that syncs the clipboard and files between Mac and Windows computers. Copy text, images, files or folders on one and paste them on another. Devices connect directly over WebRTC with DTLS encryption, falling back to a TURN relay on a server the user hosts.",+ "description": "Open-source app that syncs the clipboard and files between Mac and Windows computers. Copy text, images, files or folders on one computer and paste on the other. Devices connect directly over WebRTC with end-to-end DTLS encryption, falling back to a TURN relay on a server the user hosts.","applicationCategory": "UtilitiesApplication",- "operatingSystem": "macOS 13 or later (Intel and Apple silicon); Windows 10 and 11 (x64)",- "softwareVersion": "1.2.0",+ "operatingSystem": "macOS 13 or later (Intel and Apple silicon); Windows 10, Windows 11 (x64)",+ "softwareVersion": "1.3.0","datePublished": "2026-10-09","inLanguage": "en",- "license": "https://opensource.org/licenses/MIT",+ "license": "https://www.gnu.org/licenses/agpl-3.0.html","isAccessibleForFree": true,- "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },+ "offers": {+ "@type": "Offer",+ "price": "0",+ "priceCurrency": "USD"+ },"downloadUrl": "https://github.com/baiyuze/copysync/releases/latest","codeRepository": "https://github.com/baiyuze/copysync","image": "https://baiyuze.github.io/copysync/assets/icon.png",- "screenshot": "https://baiyuze.github.io/copysync/assets/screenshots/en/history.png",- "fileSize": "45MB",+ "screenshot": "https://baiyuze.github.io/copysync/assets/screenshots/en/history-dark.png","featureList": ["Syncs plain text, rich text, images, files and folders","Works between Mac and Windows, across accounts and networks","Direct WebRTC connection with automatic TURN relay fallback",- "End-to-end DTLS encryption and fingerprint verification when pairing",- "Items under 50 MB are pushed on copy; larger files are pulled on demand",- "History of the last 3 days, with image preview"+ "End-to-end DTLS encryption with human-verified fingerprints at pairing",+ "Items under 50 MB pushed on copy, larger files pulled on demand",+ "3-day history with image preview",+ "Interface in English, Simplified Chinese and Japanese"],- "author": { "@type": "Person", "name": "baiyuze", "url": "https://github.com/baiyuze" }+ "author": {+ "@type": "Person",+ "name": "baiyuze",+ "url": "https://github.com/baiyuze"+ }},{"@type": "FAQPage","mainEntity": [{"@type": "Question",- "name": "How is CopySync different from Universal Clipboard?",- "acceptedAnswer": { "@type": "Answer", "text": "Universal Clipboard needs both devices on the same Apple ID, with Bluetooth and Wi-Fi on, close to each other. CopySync only needs both computers to reach your server, so different Apple IDs, different networks and Mac-to-Windows all work. It also keeps a history and lets you pull large files on demand." }+ "name": "How is this different from Universal Clipboard?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Universal Clipboard needs both devices on the same Apple ID, with Bluetooth and Wi‑Fi on, close to each other, and works only between Apple devices. CopySync only needs both computers to reach your server, so different Apple IDs work, one Mac and one Windows PC work, and so does one at home and one at the office. It also keeps a history and lets you pull large files on demand. If your Macs share an Apple ID, sit side by side, and you mostly copy text, the built-in feature is already enough."+ }},{"@type": "Question",- "name": "Can the CopySync server see what I copy?",- "acceptedAnswer": { "@type": "Answer", "text": "No. With a direct connection the data never touches the server. When relaying, the server only forwards DTLS-encrypted UDP packets. It keeps no accounts and stores no clipboard content." }+ "name": "Can the server see what I copy?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "No. With a direct connection the data never touches the server. When it relays, it forwards DTLS-encrypted packets. It keeps no accounts and stores no clipboard content. The code is open, so you can check."+ }},{"@type": "Question",- "name": "Can CopySync connect directly on office networks with several uplinks?",- "acceptedAnswer": { "@type": "Answer", "text": "Yes. CopySync probes several servers from one port to learn its address on every uplink and sends them all to the peer, which tries each one. Peers behind NATs that randomize ports still fall back to the relay." }+ "name": "Does it connect directly on office networks with several uplinks?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Yes. These networks pick an uplink per destination. CopySync probes several servers from one port to learn its address on every uplink and sends them all to the peer, which tries each one. A Mac behind a 4-uplink office network connects directly to a home connection in our tests. Peers behind NATs that randomize ports still fall back to the relay."+ }},{"@type": "Question",- "name": "Do I need my own server to use CopySync?",- "acceptedAnswer": { "@type": "Answer", "text": "Yes. There is no public server. On a LAN, run the server on one of your Macs; across networks you need a machine with a public IP, and the smallest cloud VM is enough." }+ "name": "Do I need my own server?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough."+ }},{"@type": "Question",- "name": "Does CopySync support Windows? iPhone?",- "acceptedAnswer": { "@type": "Answer", "text": "Windows 10 and 11 (x64) are supported from version 1.2 and work together with Macs; pasted files are real files. iPhone and iPad are not supported: iOS does not allow apps to watch the clipboard in the background, so copy-and-it's-there can't work." }+ "name": "Windows? iPhone?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Windows 10 and 11 (x64) are supported and work together with Macs. Files you paste on Windows are real files you can drop into Explorer or Office. iPhone and iPad aren't supported: iOS doesn't let apps watch the clipboard in the background, so copy-and-it's-there can't work."+ }},{"@type": "Question",- "name": "Why does the system warn me the first time I open CopySync?",- "acceptedAnswer": { "@type": "Answer", "text": "CopySync isn't notarized by Apple yet, and the Windows build isn't code-signed yet; both require paid certificates. On Mac, open System Settings, go to Privacy & Security and click Open Anyway. On Windows, click More info and then Run anyway in the \"Windows protected your PC\" prompt. You only need to do this once." }+ "name": "Why does the system warn me the first time?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "CopySync isn't notarized by Apple yet, and the Windows build isn't code-signed yet; both require paid certificates. On Mac, open System Settings → Privacy & Security and click Open Anyway near the bottom. On Windows, click More info and then Run anyway in the \"Windows protected your PC\" prompt. You only do this once."+ }},{"@type": "Question",- "name": "How does CopySync handle large files?",- "acceptedAnswer": { "@type": "Answer", "text": "By default, anything under 50 MB is pushed to the other computer as soon as you copy it. Larger files sync as a record, and you pull them from the history when you need them. The limit is adjustable from 1 MB to 1 GB." }+ "name": "What about large files?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "By default, anything under 50 MB is pushed to the other computer as you copy it, so you can paste right away. Larger files sync as a record; pull them from the history when you need them. The limit is adjustable in Settings."+ }},{"@type": "Question",- "name": "Is CopySync free?",- "acceptedAnswer": { "@type": "Answer", "text": "Yes. CopySync is open source under the MIT license, with the source on GitHub." }+ "name": "Is it free? Can my company use it?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Yes. CopySync is open source under the GNU AGPL-3.0, so individuals and companies can use and modify it for free. If you distribute it, or offer a modified version over a network, you publish your source under the same license. To ship it inside a closed-source product, keep modifications private or run it as a hosted service, get a commercial license."+ }}]}@@ -113,18 +143,16 @@<body><a class="skip" href="#main">Skip to content</a>- <header class="site-header">+ <header class="bar"><div class="wrap">- <a class="brand" href="./" aria-label="CopySync home">- <img src="../assets/icon.svg" alt="" width="26" height="26">- CopySync- </a>- <nav class="site-nav" aria-label="Page">- <a class="optional" href="#how">How it works</a>- <a class="optional" href="#install">Install</a>- <a class="optional" href="#faq">FAQ</a>+ <a class="brand" href="./" aria-label="CopySync home"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>+ <nav aria-label="Page">+ <a class="wide" href="#how">How it works</a>+ <a class="wide" href="#install">Install</a>+ <a class="wide" href="#faq">FAQ</a><a href="https://github.com/baiyuze/copysync">GitHub</a>- <a href="../" hreflang="zh-CN" lang="zh-CN">简体中文</a>+ <a href=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>+ <a href="../ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a></nav></div></header>@@ -132,102 +160,88 @@<main id="main"><section class="hero"><div class="wrap">- <h1>Copy on this computer.<br>Paste on that one.</h1>+ <h1 class="display">Copy on this computer.<br>Paste on that one.</h1><p class="lede">Mac and Windows. Text, images, files, whole folders. No shared account required, no shared network required. Data moves directly between your devices, and stays encrypted even when it passes through your own server.</p><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 button-alt" 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>- <span class="note">Version 1.2.0, free and open source. macOS 13 or later (Intel and Apple silicon); Windows 10 and 11.</span>+ <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>-- <div class="demo" role="img" aria-label="Demo: a file is selected on a MacBook and copied with Command C, travels over a direct connection to a Windows laptop, and is pasted there with Ctrl V">- <figure class="mac mac-a">- <div class="mac-screen">- <div class="file">- <svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 2.5h6.5L15.5 6.5V17a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5Z"/><path d="M11.5 2.5v4h4"/></svg>- <span>Q3 Review – final.pptx <small>38.2 MB</small></span>- </div>+ <p class="note">Version 1.3.0, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>+ <div class="stage" data-play role="img" aria-label="Demo: Command C on a MacBook turns a file into a sheet that flies over a direct connection to a Windows laptop, where Ctrl V pastes it">+ <figure class="device mac">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc"><span class="lines"><i></i><i></i><i></i></span></span><span class="name">Q3 review - final.pptx</span></div><div class="keys"><kbd>⌘</kbd><kbd>C</kbd></div>- </div>- <div class="mac-base"></div>+ </div></div>+ <div class="base"></div><figcaption>MacBook</figcaption></figure>- <div class="link" aria-hidden="true">- <span class="packet"></span>- <span class="link-label">Direct, end-to-end encrypted</span>- </div>- <figure class="mac mac-b">- <div class="mac-screen">- <div class="file">- <svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 2.5h6.5L15.5 6.5V17a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5Z"/><path d="M11.5 2.5v4h4"/></svg>- <span>Q3 Review – final.pptx <small>38.2 MB</small></span>- </div>+ <div></div>+ <figure class="device win">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc"><span class="lines"><i></i><i></i><i></i></span></span><span class="name">Q3 review - final.pptx</span></div><div class="keys"><kbd>Ctrl</kbd><kbd>V</kbd></div>- </div>- <div class="mac-base"></div>+ <div class="taskbar"><i></i><i></i><i></i><i></i><i></i></div>+ </div></div>+ <div class="base"></div><figcaption>Windows laptop</figcaption></figure>+ <svg class="arc" aria-hidden="true"><path d=""/></svg>+ <span class="arc-label" aria-hidden="true">Direct, end-to-end encrypted</span>+ <span class="sheet-fly" aria-hidden="true"><span class="lines"><i></i><i></i><i></i></span></span></div><button class="replay" type="button">Play again</button></div></section>- <section class="section section-band" aria-labelledby="history-title">+ <section class="section" aria-labelledby="history-title"><div class="wrap">- <h2 id="history-title">Everything you copied, on every Mac</h2>- <p class="intro">History keeps the last 3 days, ready to go back on the clipboard. Files under 50 MB have already arrived by the time you switch Macs; larger ones are a click away. The interface is in Simplified Chinese for now.</p>+ <h2 id="history-title">Everything you copied, on every computer</h2>+ <p class="intro">History keeps the last 3 days, ready to go back on the clipboard; click an image to preview it. Files under 50 MB have already arrived by the time you switch computers, and larger ones are a click away.</p><figure class="shot">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="../assets/screenshots/en/history-dark.png">- <img src="../assets/screenshots/en/history.png" width="2112" height="1472" alt="CopySync history: files, images and text from a MacBook Air and a Mac mini; a large file shows a button to pull it to this Mac">- </picture>+ <img src="../assets/screenshots/en/history-dark.png" width="2112" height="1472" alt="CopySync history: files, images and text from a MacBook Air and a Mac mini; a large file shows a button to pull it to this device"></figure></div></section>+ <section class="section" aria-labelledby="flow-title">+ <div class="wrap">+ <h2 id="flow-title">What happens when you copy</h2>+ <p class="intro">Text, images, files and whole folders all take the same path.</p>+ <ol class="flow">+ <li><h3>Notice</h3><p>On Mac, the background service checks the clipboard's change count at short intervals; reading the count and types needs no permission and never shows a prompt. On Windows, the system tells it the moment you copy.</p></li>+ <li><h3>Send</h3><p>Text travels inside the message. Images and files under 50 MB are streamed right away. Larger files are announced as a record and sent when you ask for them.</p></li>+ <li><h3>Paste</h3><p>The other computer stores the content locally, then puts it on the clipboard. What you paste with ⌘V or Ctrl+V is a real local file.</p></li>+ </ol>+ </div>+ </section>+<section class="section" aria-labelledby="why-title"><div class="wrap"><h2 id="why-title">Why not what's already there</h2>- <div class="prose">- <p>If you work on two computers, you move things between them all day: a snippet of text, a screenshot, a file. The existing options each fall a little short:</p>- <ul>- <li><strong>Universal Clipboard</strong> needs both Macs on the same Apple ID, close together, with Bluetooth and Wi‑Fi on. A work Mac and a personal one rarely share an Apple ID, and large files often fail halfway.</li>- <li><strong>AirDrop</strong> makes you pick a device and accept on the other side every time, and it moves files, not the clipboard.</li>- <li><strong>Messaging yourself</strong> means manual downloads, recompressed images, and files left on someone else's server.</li>- <li><strong>With one Mac and one Windows PC</strong>, none of the built-in options work at all.</li>- </ul>- </div>- <div class="table-scroll">+ <p class="intro">Universal Clipboard needs the same Apple ID and both Macs close together. AirDrop asks you to accept every time. Messaging yourself means manual downloads and files left on someone else's server. With one Mac and one Windows PC, none of the built-in options work at all.</p>+ <div class="block table-scroll"><table class="compare"><caption class="skip">CopySync compared with other options</caption>- <thead>- <tr><th scope="col"></th><th scope="col" class="ours">CopySync</th><th scope="col">Universal Clipboard</th><th scope="col">AirDrop</th><th scope="col">Chat apps</th></tr>- </thead>+ <thead><tr><td></td><th scope="col" class="ours">CopySync</th><th scope="col">Universal Clipboard</th><th scope="col">AirDrop</th><th scope="col">Chat apps</th></tr></thead><tbody>- <tr><th scope="row">Different Apple IDs</th><td class="yes">Yes</td><td class="no">No</td><td class="partial">Needs accepting</td><td class="yes">Yes</td></tr>- <tr><th scope="row">Between Mac and Windows</th><td class="yes">Yes</td><td class="no">No</td><td class="no">No</td><td class="yes">Yes</td></tr>- <tr><th scope="row">Different networks (home and office)</th><td class="yes">Yes</td><td class="no">No</td><td class="no">No</td><td class="yes">Yes</td></tr>- <tr><th scope="row">Paste right away, nothing to accept</th><td class="yes">Yes</td><td class="yes">Yes</td><td class="no">No</td><td class="no">No</td></tr>- <tr><th scope="row">Files and whole folders</th><td class="yes">Yes</td><td class="partial">Unreliable</td><td class="yes">Yes</td><td class="partial">Zip first</td></tr>- <tr><th scope="row">Find something you copied earlier</th><td class="yes">Yes</td><td class="no">No</td><td class="no">No</td><td class="partial">Scroll back</td></tr>- <tr><th scope="row">Content stays off third-party servers</th><td class="yes">Yes</td><td class="yes">Yes</td><td class="yes">Yes</td><td class="no">No</td></tr>+ <tr><th scope="row">Different Apple IDs</th><td class="yes ours">Yes</td><td class="no">No</td><td class="partial">Needs accepting</td><td class="yes">Yes</td></tr>+ <tr><th scope="row">Between Mac and Windows</th><td class="yes ours">Yes</td><td class="no">No</td><td class="no">No</td><td class="yes">Yes</td></tr>+ <tr><th scope="row">Different networks (home and office)</th><td class="yes ours">Yes</td><td class="no">No</td><td class="no">No</td><td class="yes">Yes</td></tr>+ <tr><th scope="row">Paste right away, nothing to accept</th><td class="yes ours">Yes</td><td class="yes">Yes</td><td class="no">No</td><td class="no">No</td></tr>+ <tr><th scope="row">Files and whole folders</th><td class="yes ours">Yes</td><td class="partial">Unreliable</td><td class="yes">Yes</td><td class="partial">Zip first</td></tr>+ <tr><th scope="row">Find something you copied earlier</th><td class="yes ours">Yes</td><td class="no">No</td><td class="no">No</td><td class="partial">Scroll back</td></tr>+ <tr><th scope="row">Content stays off third-party servers</th><td class="yes ours">Yes</td><td class="yes">Yes</td><td class="yes">Yes</td><td class="no">No</td></tr></tbody></table></div></div></section>- <section class="section section-band" id="how" aria-labelledby="how-title">+ <section class="section" id="how" aria-labelledby="how-title"><div class="wrap"><h2 id="how-title">How it works</h2><p class="intro">Your two computers open an encrypted connection to each other. Your server only helps them find one another, and relays traffic when a direct path can't be made.</p>-<figure class="diagram"><svg viewBox="0 0 960 400" role="img" aria-labelledby="diagram-title diagram-desc"><title id="diagram-title">How CopySync connects</title>@@ -235,123 +249,94 @@<rect class="d-box" x="360" y="24" width="240" height="96" rx="14"/><text class="d-title" x="480" y="64" text-anchor="middle">Your server</text><text class="d-sub" x="480" y="92" text-anchor="middle">Signaling, STUN, TURN relay</text>-<path class="d-sig" d="M140 210V58H360"/><path class="d-sig" d="M820 210V58H600"/><path class="d-relay" d="M196 210V100H360"/><path class="d-relay" d="M764 210V100H600"/>- <text class="d-note" x="206" y="50">Signaling: connection details</text>- <text class="d-note" x="206" y="128">Relay: only if direct fails</text>-+ <text class="d-note" x="210" y="50">Signaling: connection details</text>+ <text class="d-note" x="210" y="128">Relay: only if direct fails</text><rect class="d-box" x="40" y="210" width="240" height="120" rx="14"/><text class="d-title" x="160" y="262" text-anchor="middle">Mac</text><text class="d-sub" x="160" y="290" text-anchor="middle">You copy here</text><rect class="d-box" x="680" y="210" width="240" height="120" rx="14"/><text class="d-title" x="800" y="262" text-anchor="middle">Mac or Windows</text><text class="d-sub" x="800" y="290" text-anchor="middle">You paste here</text>-<path class="d-direct" d="M280 270H680"/><text class="d-label" x="480" y="256" text-anchor="middle">Direct WebRTC, DTLS encrypted</text><text class="d-note" x="480" y="298" text-anchor="middle">Data moves only between your computers</text>-<g class="d-legend" transform="translate(40 372)"><path class="d-direct" d="M0 0H28"/><text x="38" y="5">Data (direct)</text>- <path class="d-relay" d="M190 0H218"/><text x="228" y="5">Data (relay, fallback)</text>- <path class="d-sig" d="M420 0H448"/><text x="458" y="5">Signaling</text>+ <path class="d-relay" d="M210 0H238"/><text x="248" y="5">Data (relay, fallback)</text>+ <path class="d-sig" d="M470 0H498"/><text x="508" y="5">Signaling</text></g></svg>+ <ul class="points diagram-text">+ <li><strong>Direct WebRTC, DTLS encrypted</strong> Data moves only between your computers</li>+ <li><strong>Your server</strong> Signaling, STUN, TURN relay</li>+ <li>Relay: only if direct fails</li>+ </ul></figure>-- <h3 class="subhead">What happens when you copy</h3>- <ol class="steps">- <li>- <h3>Notice</h3>- <p>On Mac, the background service checks the clipboard's change count at short intervals; reading the count and types needs no permission and never shows a prompt. On Windows, the system tells it the moment you copy.</p>- </li>- <li>- <h3>Send</h3>- <p>Text travels inside the message. Images and files under 50 MB are streamed right away. Larger files are announced as a record and sent when you ask for them.</p>- </li>- <li>- <h3>Paste</h3>- <p>The other computer stores the content locally, then puts it on the clipboard. What you paste with ⌘V or Ctrl+V is a real local file.</p>- </li>- </ol></div></section><section class="section" id="multi-uplink" aria-labelledby="multi-title"><div class="wrap"><h2 id="multi-title">Direct on office networks too</h2>- <p class="intro">Office networks with two ISPs, or carriers with a pool of NAT addresses, have several uplinks and pick one per destination. CopySync 1.0 knew only one of its addresses there and had to relay through the server. 1.1 probes every uplink and tells the peer about all of them.</p>- <div class="two-col">- <div class="prose">- <h3>What changed</h3>- <ul>- <li><strong>One shared port.</strong> All connections send and receive on one local UDP port. Previously each STUN server got its own port, so the answers didn't apply to each other.</li>+ <p class="intro">Office networks with two ISPs, or carriers with a pool of NAT addresses, have several uplinks and pick one per destination. A single probe only reveals one of them, so connections end up on the relay. CopySync probes every uplink and tells the peer about all of them.</p>+ <div class="cols">+ <div>+ <h3>What it does</h3>+ <ul class="points">+ <li><strong>One shared port.</strong> All connections send and receive on one local UDP port, so the addresses learned from different servers line up.</li><li><strong>Every uplink probed.</strong> Seven IP-diverse servers are queried from that port at once, yielding one address per uplink. Addresses poisoned by DNS are dropped first.</li><li><strong>All of them sent to the peer.</strong> The peer tries each address; the one matching the real uplink gets through.</li><li><strong>Uplinks remembered.</strong> If a round misses an uplink that keeps ports unchanged, its address is filled in as uplink IP plus local port.</li>- <li><strong>A rule for who sends first.</strong> Some routers lock a port when the other side's packet arrives first, and punching fails. One side now announces its uplink addresses first; the other sends packets to them before announcing its own. Retries alternate the order.</li>- <li><strong>Relay first, direct later.</strong> When the peer has just started, its addresses can arrive a moment late and the first handshake lands on the relay. CopySync punches again while the link is idle and switches to direct when that works.</li>+ <li><strong>A rule for who sends first.</strong> Some routers lock a port when the other side's packet arrives first. One side announces its addresses first; the other sends to them before announcing its own. Retries alternate the order.</li>+ <li><strong>Relay first, direct later.</strong> If the first handshake lands on the relay, CopySync punches again while idle and switches to direct when that works.</li></ul></div><div>- <h3>A real office network</h3>- <table class="measure">- <thead><tr><th scope="col">Uplink</th><th scope="col">Public port</th></tr></thead>- <tbody>- <tr><td>Uplink A</td><td>Unchanged</td></tr>- <tr><td>Uplink B</td><td>Unchanged</td></tr>- <tr><td>Uplink C</td><td>Rewritten, same for every destination</td></tr>- <tr><td>Uplink D</td><td>Rewritten</td></tr>- </tbody>- </table>- <p class="aside-p">Before, this Mac and one at home could only relay, capped at 0.6 MB/s by the server's bandwidth. Now they connect directly, about 3 seconds after reaching the server.</p>+ <h3>Checked against real network topologies</h3>+ <p class="small">The NAT lab builds these topologies with Linux network namespaces and iptables and runs CopySync's actual connection code through each. It runs on every commit.</p>+ <div class="table-scroll">+ <table>+ <thead><tr><th scope="col">Scenario</th><th scope="col">Result</th></tr></thead>+ <tbody>+ <tr><td>Single uplink ↔ home router</td><td>Direct</td></tr>+ <tr><td>Two uplinks, previous version (control)</td><td>Relay</td></tr>+ <tr><td>Two uplinks ↔ home router</td><td>Direct</td></tr>+ <tr><td>Four uplinks ↔ home router</td><td>Direct</td></tr>+ <tr><td>Two uplinks, second not probed, no history</td><td>Relay</td></tr>+ <tr><td>Two uplinks, second not probed, with history</td><td>Direct</td></tr>+ <tr><td>Two uplinks ↔ two uplinks</td><td>Direct</td></tr>+ <tr><td>Two uplinks ↔ NAT that randomizes ports</td><td>Relay</td></tr>+ <tr><td>Blocked at first, network recovers later</td><td>Relay, then direct</td></tr>+ <tr><td>Office router locks a port for unsolicited packets</td><td>Direct</td></tr>+ <tr><td>Home router locks a port for unsolicited packets</td><td>Relay, then direct after one retry</td></tr>+ </tbody>+ </table>+ </div>+ <p class="small">Measured: a Mac on a 4-uplink office network and one at home could only relay before, capped at 0.6 MB/s by the server's bandwidth. Now they connect directly, about 3 seconds after reaching the server.</p>+ <p class="small">Measurements, design trade-offs and lessons learned are in the <a href="../design/nat-traversal.html">design document</a> (in Chinese).</p></div></div>-- <h3 class="subhead">Checked against real network topologies</h3>- <p class="aside-p">The NAT lab builds the eleven topologies below with Linux network namespaces and iptables and runs CopySync's actual connection code through each. It runs on every commit.</p>- <div class="table-scroll">- <table class="lab">- <thead><tr><th scope="col">Scenario</th><th scope="col">Result</th></tr></thead>- <tbody>- <tr><td>Single uplink ↔ home router</td><td>Direct</td></tr>- <tr><td>Two uplinks, previous version (control)</td><td>Relay</td></tr>- <tr><td>Two uplinks ↔ home router</td><td>Direct</td></tr>- <tr><td>Four uplinks ↔ home router</td><td>Direct</td></tr>- <tr><td>Two uplinks, second not probed, no history</td><td>Relay</td></tr>- <tr><td>Two uplinks, second not probed, with history</td><td>Direct</td></tr>- <tr><td>Two uplinks ↔ two uplinks</td><td>Direct</td></tr>- <tr><td>Two uplinks ↔ NAT that randomizes ports</td><td>Relay</td></tr>- <tr><td>Blocked at first, network recovers later</td><td>Relay, then direct</td></tr>- <tr><td>Office router locks a port for unsolicited packets</td><td>Direct</td></tr>- <tr><td>Home router locks a port for unsolicited packets</td><td>Relay, then direct after one retry</td></tr>- </tbody>- </table>- </div>- <p class="aside-p">Measurements, design trade-offs and lessons learned are in the <a href="https://github.com/baiyuze/copysync/blob/main/design/nat-traversal.md">design document</a> (Chinese).</p></div></section>- <section class="section section-band" aria-labelledby="security-title">- <div class="wrap two-col">- <div class="prose">- <h2 id="security-title">Your server can't see what you copy</h2>- <ul>+ <section class="section" aria-labelledby="security-title">+ <div class="wrap">+ <h2 id="security-title">Your server can't see what you copy</h2>+ <div class="cols">+ <ul class="points"><li><strong>No accounts, no stored content.</strong> A device's identity is an Ed25519 key, and its ID is derived from the public key, so the server verifies identity without a user table.</li>- <li><strong>You compare fingerprints when pairing.</strong> Both screens show the same two lines: the fingerprint of each Mac's key. The server could swap keys in transit, but then the two screens would no longer match — that check is what stops a man in the middle.</li>- <li><strong>Every message after that is signed</strong>, so the server can't impersonate your device. The direct channel's certificate is checked again after the handshake; a mismatch drops the connection.</li>+ <li><strong>You compare fingerprints when pairing.</strong> Both screens show the same two lines: the fingerprint of each device's key. The server could swap keys in transit, but then the two screens would no longer match. That check is what stops a man in the middle.</li>+ <li><strong>Every message after that is signed,</strong> so the server can't impersonate your device. The direct channel's certificate is checked again after the handshake; a mismatch drops the connection.</li><li><strong>The relay only forwards ciphertext.</strong> TURN carries encrypted packets, and relay credentials are issued per device and expire after 12 hours.</li></ul>+ <figure class="figure-card">+ <img src="../assets/screenshots/en/card-verify-dark.png" width="1120" height="800" loading="lazy" alt="The fingerprint check during pairing shows R8NF-2WTC-QL5J and asks you to confirm it matches the other computer exactly">+ </figure></div>- <figure class="card-shot">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="../assets/screenshots/en/card-verify-dark.png">- <img src="../assets/screenshots/en/card-verify.png" width="1120" height="800" loading="lazy" alt="The fingerprint check during pairing shows R8NF-2WTC-QL5J and asks you to confirm it matches the other Mac exactly">- </picture>- </figure></div></section>@@ -360,64 +345,49 @@<h2 id="fallback-title">When things go wrong</h2><p class="intro">Every network is different. Each of these cases was considered, and each has a test.</p><dl class="fallbacks">- <dt>No direct path between the computers</dt>- <dd>Common behind symmetric NAT and corporate firewalls. Traffic switches to the TURN relay on your server, still encrypted, and the device list shows "relay".</dd>- <dt>Public STUN servers unreachable</dt>- <dd>Public STUN is unreliable in some regions, including mainland China. Your server runs its own STUN, and clients prefer it.</dd>- <dt>An office network with several uplinks</dt>- <dd>These networks pick an uplink per destination, so a single probe only reveals one of your addresses. CopySync probes several servers from one port and sends the peer its address on every uplink to try in turn.</dd>- <dt>Connected through the relay first</dt>- <dd>The relay handshake is fast and sometimes beats the direct path. Once connected, the side that started the connection punches again while idle and switches to direct when that works, never in the middle of a transfer.</dd>- <dt>The other Mac sleeps, drops off or restarts</dt>- <dd>A connection that dies silently is noticed, closed and reconnected. Anything you copy meanwhile is kept and added to the other Mac's history once it's back, without overwriting what's on its clipboard now.</dd>- <dt>Server connection drops</dt>- <dd>Reconnects automatically: the delay starts at 1 second and doubles up to 30, with jitter so devices don't all reconnect at once. The app shows the status live.</dd>- <dt>File too large</dt>- <dd>Above the limit only a record is synced, pulled when you need it. If the source file is gone by then, you get a clear message instead of a vague failure.</dd>- <dt>Pasting into plain-text fields</dt>- <dd>Rich text copied from the web is written as both HTML and plain text, so no markup leaks into what you paste.</dd>- <dt>A file name Windows doesn't allow</dt>- <dd>Colons, question marks and a few other characters are fine in Mac file names but not on Windows. They arrive as the matching full-width characters, so the name still reads the same, and two names that differ only in case never overwrite each other.</dd>- <dt>Copying a password</dt>- <dd>On Windows, password managers mark what they copy as "don't record". CopySync skips it: not synced, not kept in the history.</dd>- <dt>Clipboard access not granted yet</dt>- <dd>Content isn't read, which would block on a prompt a background process can't show. The app asks you to grant access and links straight to the setting.</dd>- <dt>Background service crashes</dt>- <dd>launchd on Mac, and CopySync's own supervisor on Windows, restart it, throttled to once every 10 seconds.</dd>- <dt>App updated or moved</dt>- <dd>On launch the app re-points its login item and restarts the service on the new version.</dd>+ <div><dt>No direct path between the computers</dt><dd>Common behind symmetric NAT and corporate firewalls. Traffic switches to the TURN relay on your server, still encrypted, and the device list shows "Relay".</dd></div>+ <div><dt>Public STUN servers unreachable</dt><dd>Public STUN is unreliable in some regions, including mainland China. Your server runs its own STUN, and clients prefer it.</dd></div>+ <div><dt>Connected through the relay first</dt><dd>The relay handshake is fast and sometimes beats the direct path. Once connected, the side that started the connection punches again while idle and switches to direct when that works, never in the middle of a transfer.</dd></div>+ <div><dt>The other computer sleeps, drops off or restarts</dt><dd>A connection that dies silently is noticed, closed and reconnected. Anything you copy meanwhile is kept and added to the other computer's history once it's back, without overwriting what's on its clipboard now.</dd></div>+ <div><dt>Server connection drops</dt><dd>Reconnects automatically: the delay starts at 1 second and doubles up to 30, with jitter so devices don't all reconnect at once. The app shows the status live.</dd></div>+ <div><dt>File too large</dt><dd>Above the limit only a record is synced, pulled when you need it. If the source file is gone by then, you get a clear message instead of a vague failure.</dd></div>+ <div><dt>Pasting into plain-text fields</dt><dd>Rich text copied from the web is written as both HTML and plain text, so no markup leaks into what you paste.</dd></div>+ <div><dt>A file name Windows doesn't allow</dt><dd>Colons, question marks and a few other characters that are fine on a Mac arrive as the matching full-width characters, so the name still reads the same. Two names that differ only in case never overwrite each other.</dd></div>+ <div><dt>Copying a password</dt><dd>On Windows, password managers mark what they copy as "don't record". CopySync skips it: not synced, not kept in the history.</dd></div>+ <div><dt>Clipboard access not granted yet</dt><dd>Content isn't read, which would block on a prompt a background process can't show. The app asks you to grant access and links straight to the setting.</dd></div>+ <div><dt>Background service crashes</dt><dd>launchd on Mac, and CopySync's own supervisor on Windows, restart it, throttled to once every 10 seconds.</dd></div>+ <div><dt>App updated or moved</dt><dd>On launch the app re-points its login item and restarts the service on the new version.</dd></div></dl></div></section>- <section class="section section-band" id="install" aria-labelledby="install-title">+ <section class="section" id="install" aria-labelledby="install-title"><div class="wrap"><h2 id="install-title">Install</h2><p class="intro">Install the app on each computer, and set up a server both of them can reach. If both share a LAN, the server can run on one of your Macs.</p>- <div class="two-col">+ <div class="install"><div>- <h3>On a Mac</h3>- <ol class="install-steps">- <li>Download <a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg">CopySync.dmg</a>, open it and drag CopySync into Applications.</li>- <li>Open it from Applications.- <span class="aside">The first time, macOS says it can't verify the developer: CopySync isn't notarized by Apple yet. Go to System Settings → Privacy & Security and click Open Anyway near the bottom. You only do this once.</span></li>- <li>Click 启用后台同步 (Enable background sync).</li>- <li>In 设置 (Settings), enter your server as <code>ws://server-address:8787/signal</code> and press Return.</li>+ <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>+ <ol>+ <li>Download CopySync.dmg, open it and drag CopySync into Applications.</li>+ <li>Open it from Applications.<span class="aside">The first time, macOS says it can't verify the developer: CopySync isn't notarized by Apple yet. Go to System Settings → Privacy & Security and click Open Anyway near the bottom. You only do this once.</span></li>+ <li>Click Turn on background sync. In Settings, enter your server as <code>ws://server-address:8787/signal</code> and press Return.</li><li>When macOS asks whether CopySync may read the clipboard, allow it.</li></ol>- <h3>On Windows</h3>- <ol class="install-steps">- <li>Download <a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe">CopySync-Setup.exe</a> and run it. It installs for the current user, no administrator rights needed.- <span class="aside">CopySync isn't code-signed yet, so Windows says "Windows protected your PC": click More info, then Run anyway. To skip the installer, get the <a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip">portable zip</a>.</span></li>- <li>Open CopySync and click 启用后台同步 (Enable background sync). After you close the window it keeps running in the notification area.</li>- <li>In 设置 (Settings), enter your server address and press Enter. Allow it if Windows Firewall asks.</li>+ <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>+ </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="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>+ <ol>+ <li>Run CopySync-Setup.exe. It installs for the current user, no administrator rights needed.<span class="aside">CopySync isn't code-signed yet, so Windows says "Windows protected your PC": click More info, then Run anyway. To skip the installer, get the <a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip">portable zip</a>.</span></li>+ <li>Open CopySync and click Turn on background sync. After you close the window it keeps running in the notification area.</li>+ <li>In Settings, enter your server address and press Enter. Allow it if Windows Firewall asks.</li></ol>- <h3>Pairing</h3>- <p class="aside-p">On one computer, choose 设备 → 添加设备 (Devices → Add device) to get 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>+ <a class="button" 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><div>- <h3>On the server</h3>- <p class="aside-p">Any Linux, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.</p>+ <h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>Server</h3>+ <p class="small">Any Linux, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.</p><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@@ -425,18 +395,19 @@ tar xzf copysync-server-linux-amd64.tar.gzcd copysync-server-linux-amd64sudo ./install.sh YOUR_PUBLIC_IP</code></pre></div>- <p class="aside-p">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 class="ports">+ <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, assigned by the OS</td></tr>+ <tr><td>32768–60999/udp</td><td>Relay ports</td></tr></tbody></table>- <p class="aside-p">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">Docker works too; see the <a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">server deployment guide</a>.</p></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></div></section>@@ -446,79 +417,61 @@ sudo ./install.sh YOUR_PUBLIC_IP</code></pre><div class="table-scroll"><table class="specs"><tbody>- <tr><th scope="row">Version</th><td>1.2.0, released <time datetime="2026-10-09">October 9, 2026</time></td></tr>- <tr><th scope="row">Mac app</th><td>macOS 13 Ventura or later; universal binary for Intel and Apple silicon, no Rosetta; 45 MB download</td></tr>- <tr><th scope="row">Windows app</th><td>Windows 10 (21H2 or later) and Windows 11, x64; installs per user, no administrator rights; about 21 MB download</td></tr>- <tr><th scope="row">Server</th><td>Linux on x86_64 or ARM64 (systemd or Docker), or macOS; about 15 MB of RAM</td></tr>- <tr><th scope="row">Content</th><td>Plain text, rich text, images and screenshots, files, folders; each type can be turned off</td></tr>- <tr><th scope="row">Transport</th><td>WebRTC data channels, direct first with TURN relay fallback; every uplink probed on multi-uplink networks; files streamed as tar + zstd</td></tr>- <tr><th scope="row">Encryption and identity</th><td>End-to-end DTLS; Ed25519 device keys; every signaling message signed</td></tr>- <tr><th scope="row">Pairing</th><td>6-character code valid for 5 minutes, using an alphabet without look-alikes such as 0/O and 1/I; fingerprints compared by you</td></tr>- <tr><th scope="row">Auto-sync limit</th><td>50 MB by default, adjustable from 1 MB to 1 GB</td></tr>- <tr><th scope="row">History</th><td>3 days by default, adjustable from 1 hour to 30 days; expired items removed automatically</td></tr>- <tr><th scope="row">Measured speed</th><td>A 20 MB file transfers in about 330 ms over a direct LAN connection, checksums matching</td></tr>- <tr><th scope="row">Built with</th><td>Go for the background service and server (pure Go calling Win32 on Windows), Flutter for the app (one codebase for Mac and Windows), Protocol Buffers for messages</td></tr>- <tr><th scope="row">License</th><td>MIT</td></tr>+ <tr><th scope="row">Version</th><td>1.3.0, released <time datetime="2026-10-09">October 9, 2026</time></td></tr>+ <tr><th scope="row">Mac app</th><td>macOS 13 Ventura or later; universal binary for Intel and Apple silicon, no Rosetta; about 45 MB download</td></tr>+ <tr><th scope="row">Windows app</th><td>Windows 10 (21H2 or later) and Windows 11, x64; installs per user, no administrator rights; about 21 MB download</td></tr>+ <tr><th scope="row">Server</th><td>Linux on x86_64 or ARM64 (systemd or Docker), or macOS; about 15 MB of RAM</td></tr>+ <tr><th scope="row">Languages</th><td>English, Simplified Chinese and Japanese; follows the system by default, switchable in Settings</td></tr>+ <tr><th scope="row">Content</th><td>Plain text, rich text, images and screenshots, files, folders; each type can be turned off</td></tr>+ <tr><th scope="row">Transport</th><td>WebRTC data channels, direct first with TURN relay fallback; every uplink probed on multi-uplink networks; files streamed as tar + zstd</td></tr>+ <tr><th scope="row">Encryption and identity</th><td>End-to-end DTLS; Ed25519 device keys; every signaling message signed</td></tr>+ <tr><th scope="row">Pairing</th><td>6-character code valid for 5 minutes, using an alphabet without look-alikes such as 0/O and 1/I; fingerprints compared by you</td></tr>+ <tr><th scope="row">Auto-sync limit</th><td>50 MB by default, adjustable from 1 MB to 1 GB</td></tr>+ <tr><th scope="row">History</th><td>3 days by default, adjustable from 1 hour to 30 days; expired items removed automatically</td></tr>+ <tr><th scope="row">Measured speed</th><td>A 20 MB file transfers in about 330 ms over a direct LAN connection, checksums matching</td></tr>+ <tr><th scope="row">Built with</th><td>Go for the background service and server (pure Go calling Win32 on Windows), Flutter for the app (one codebase for Mac and Windows), Protocol Buffers for messages</td></tr>+ <tr><th scope="row">License</th><td>GNU AGPL-3.0; a <a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">commercial license</a> is available for closed-source use</td></tr></tbody></table></div></div></section>- <section class="section section-band" id="faq" aria-labelledby="faq-title">+ <section class="section" id="faq" aria-labelledby="faq-title"><div class="wrap"><h2 id="faq-title">Questions</h2><div class="faq"><details><summary>How is this different from Universal Clipboard?</summary>- <div class="answer">- <p>Universal Clipboard needs both devices on the same Apple ID, with Bluetooth and Wi‑Fi on, close to each other. CopySync only needs both computers to reach your server, so different Apple IDs work, one Mac and one Windows PC work, and so does one at home and one at the office. It also keeps a history and lets you pull large files on demand.</p>- <p>If your Macs share an Apple ID, sit side by side, and you mostly copy text, the built-in feature is already enough.</p>- </div>+ <div class="answer"><p>Universal Clipboard needs both devices on the same Apple ID, with Bluetooth and Wi‑Fi on, close to each other, and works only between Apple devices. CopySync only needs both computers to reach your server, so different Apple IDs work, one Mac and one Windows PC work, and so does one at home and one at the office. It also keeps a history and lets you pull large files on demand.</p><p>If your Macs share an Apple ID, sit side by side, and you mostly copy text, the built-in feature is already enough.</p></div></details><details><summary>Can the server see what I copy?</summary>- <div class="answer">- <p>No. With a direct connection the data never touches the server. When it relays, it forwards DTLS-encrypted packets. It keeps no accounts and stores no clipboard content. The code is open, so you can check.</p>- </div>+ <div class="answer"><p>No. With a direct connection the data never touches the server. When it relays, it forwards DTLS-encrypted packets. It keeps no accounts and stores no clipboard content. The code is open, so you can check.</p></div></details><details><summary>Does it connect directly on office networks with several uplinks?</summary>- <div class="answer">- <p>Yes. These networks pick an uplink per destination. CopySync probes several servers from one port to learn its address on every uplink and sends them all to the peer, which tries each one. A Mac behind a 4-uplink office network connects directly to a home connection in our tests. Peers behind NATs that randomize ports still fall back to the relay.</p>- </div>+ <div class="answer"><p>Yes. These networks pick an uplink per destination. CopySync probes several servers from one port to learn its address on every uplink and sends them all to the peer, which tries each one. A Mac behind a 4-uplink office network connects directly to a home connection in our tests. Peers behind NATs that randomize ports still fall back to the relay.</p></div></details><details><summary>Do I need my own server?</summary>- <div class="answer">- <p>Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough.</p>- </div>+ <div class="answer"><p>Yes. There is no public server, so nobody's data passes through anyone else's machine. On a LAN, run the server on one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough.</p></div></details><details><summary>Windows? iPhone?</summary>- <div class="answer">- <p>Windows 10 and 11 (x64) are supported from version 1.2 and work together with Macs. Files you paste on Windows are real files you can drop into Explorer, WeChat or Office.</p>- <p>iPhone and iPad aren't supported: iOS doesn't let apps watch the clipboard in the background, so copy-and-it's-there can't work.</p>- </div>+ <div class="answer"><p>Windows 10 and 11 (x64) are supported and work together with Macs. Files you paste on Windows are real files you can drop into Explorer or Office.</p><p>iPhone and iPad aren't supported: iOS doesn't let apps watch the clipboard in the background, so copy-and-it's-there can't work.</p></div></details><details><summary>Why does the system warn me the first time?</summary>- <div class="answer">- <p>CopySync isn't notarized by Apple yet, and the Windows build isn't code-signed yet; both require paid certificates.</p>- <p>On Mac, open System Settings → Privacy & Security and click Open Anyway near the bottom. On Windows, click More info and then Run anyway in the "Windows protected your PC" prompt. You only do this once. You can also build it from source.</p>- </div>+ <div class="answer"><p>CopySync isn't notarized by Apple yet, and the Windows build isn't code-signed yet; both require paid certificates.</p><p>On Mac, open System Settings → Privacy & Security and click Open Anyway near the bottom. On Windows, click More info and then Run anyway in the "Windows protected your PC" prompt. You only do this once.</p></div></details><details><summary>What about large files?</summary>- <div class="answer">- <p>By default, anything under 50 MB is pushed to the other computer as you copy it, so you can paste right away. Larger files sync as a record; pull them from the history when you need them. The limit is adjustable in Settings.</p>- </div>+ <div class="answer"><p>By default, anything under 50 MB is pushed to the other computer as you copy it, so you can paste right away. Larger files sync as a record; pull them from the history when you need them. The limit is adjustable in Settings.</p></div></details><details>- <summary>Is it free?</summary>- <div class="answer">- <p>Yes. CopySync is open source under the MIT license, with the source on <a href="https://github.com/baiyuze/copysync">GitHub</a>.</p>- </div>+ <summary>Is it free? Can my company use it?</summary>+ <div class="answer"><p>Yes. CopySync is open source under the GNU AGPL-3.0, so individuals and companies can use and modify it for free. If you distribute it, or offer a modified version over a network, you publish your source under the same license.</p><p>To ship it inside a closed-source product, keep modifications private or run it as a hosted service, get a <a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">commercial license</a>.</p></div></details></div></div>@@ -526,24 +479,31 @@ sudo ./install.sh YOUR_PUBLIC_IP</code></pre><section class="closing" aria-labelledby="closing-title"><div class="wrap">- <h2 id="closing-title">Two computers, one clipboard.</h2>+ <h2 class="display" id="closing-title">Two computers, one clipboard.</h2><div class="cta">- <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg">Download for Mac</a>- <a class="button button-alt" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe">Download for Windows</a>- <a href="https://github.com/baiyuze/copysync">View the source on GitHub</a>+ <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.0, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.</p>+ <a class="source" href="https://github.com/baiyuze/copysync">View the source on GitHub</a></div></section></main>- <footer class="site-footer">+ <footer class="footer"><div class="wrap">- <span>CopySync is open source, released under the MIT license.</span>+ <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>- <a href="../" hreflang="zh-CN" lang="zh-CN">简体中文</a>+ </nav>+ <nav aria-label="Language">+ <a href=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>+ <a href="../en/" hreflang="en" lang="en" data-lang="en" aria-current="page">English</a>+ <a href="../ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a></nav></div></footer>diff --git a/docs/index.html b/docs/index.htmlindex 40831d2..a777d6b 100644--- a/docs/index.html+++ b/docs/index.html@@ -3,32 +3,50 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">- <title>CopySync:在 Mac 与 Windows 之间同步剪贴板与文件,跨账号跨网络,开源免费</title>- <meta name="description" content="CopySync 让你在一台电脑上复制,另一台上直接粘贴,Mac 与 Windows 互通。支持文本、图片、文件和文件夹,不要求同一个账号,跨网络可用。设备间 P2P 直连、端到端加密,服务器自己部署且看不到内容。MIT 开源。">+ <title>CopySync:在 Mac 与 Windows 之间同步剪贴板与文件,跨账号跨网络</title>+ <meta name="description" content="CopySync 让你在一台电脑上复制,另一台上直接粘贴,Mac 与 Windows 互通。支持文本、图片、文件和文件夹,不要求同一个账号,跨网络可用。设备间 P2P 直连、端到端加密,服务器自己部署且看不到内容。免费开源。"><link rel="canonical" href="https://baiyuze.github.io/copysync/"><link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"><link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/">+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"><link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/">- <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">- <meta name="theme-color" content="#161617" media="(prefers-color-scheme: dark)">-+ <meta name="theme-color" content="#141416"><meta property="og:type" content="website"><meta property="og:site_name" content="CopySync"><meta property="og:title" content="CopySync:在这台电脑复制,到那台电脑粘贴">- <meta property="og:description" content="Mac 与 Windows 互通。文本、图片、文件、文件夹,跨账号、跨网络,P2P 直连、端到端加密,服务器自己部署。开源免费。">+ <meta property="og:description" content="Mac 与 Windows 互通。文本、图片、文件、文件夹,跨账号、跨网络,P2P 直连、端到端加密,服务器自己部署。免费开源。"><meta property="og:url" content="https://baiyuze.github.io/copysync/"><meta property="og:image" content="https://baiyuze.github.io/copysync/assets/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:locale" content="zh_CN"><meta property="og:locale:alternate" content="en_US">+ <meta property="og:locale:alternate" 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">-+ <script>+ // 第一次打开时按浏览器语言跳到对应页面;在页面上点过语言链接后,以点的为准+ (function () {+ try {+ var pick = localStorage.getItem("copysync-lang");+ if (!pick) {+ if (/bot|crawl|spider|slurp|lighthouse/i.test(navigator.userAgent)) return;+ var list = navigator.languages || [navigator.language || ""];+ for (var i = 0; i < list.length && !pick; i++) {+ var l = String(list[i]).toLowerCase();+ if (l.indexOf("zh") === 0) pick = "zh";+ else if (l.indexOf("ja") === 0) pick = "ja";+ else if (l.indexOf("en") === 0) pick = "en";+ }+ pick = pick || "en";+ }+ if (pick === "en" || pick === "ja") location.replace(pick + "/" + location.hash);+ } catch (e) {}+ })();+ </script><script type="application/ld+json">{"@context": "https://schema.org",@@ -40,69 +58,101 @@"description": "在 Mac 与 Windows 电脑之间同步剪贴板与文件的开源工具。复制文本、图片、文件或文件夹后,另一台电脑可直接粘贴。设备间 WebRTC 直连、DTLS 端到端加密,打不通时经用户自建服务器的 TURN 中转。","applicationCategory": "UtilitiesApplication","operatingSystem": "macOS 13 及以上(Intel 与 Apple 芯片);Windows 10、Windows 11(x64)",- "softwareVersion": "1.2.0",+ "softwareVersion": "1.3.0","datePublished": "2026-10-09","inLanguage": "zh-CN",- "license": "https://opensource.org/licenses/MIT",+ "license": "https://www.gnu.org/licenses/agpl-3.0.html","isAccessibleForFree": true,- "offers": { "@type": "Offer", "price": "0", "priceCurrency": "CNY" },+ "offers": {+ "@type": "Offer",+ "price": "0",+ "priceCurrency": "CNY"+ },"downloadUrl": "https://github.com/baiyuze/copysync/releases/latest","codeRepository": "https://github.com/baiyuze/copysync","image": "https://baiyuze.github.io/copysync/assets/icon.png",- "screenshot": "https://baiyuze.github.io/copysync/assets/screenshots/history.png",- "fileSize": "45MB",+ "screenshot": "https://baiyuze.github.io/copysync/assets/screenshots/history-dark.png","featureList": ["同步纯文本、带格式的文本、图片、文件与文件夹","Mac 与 Windows 互通,不要求同一个账号,跨网络可用","WebRTC 直连,打不通时自动经 TURN 中转","DTLS 端到端加密,配对时人工核对安全指纹","50 MB 以内复制即推送,更大的文件按需拉取",- "最近 3 天的复制记录,图片可以预览"+ "最近 3 天的复制记录,图片可以预览",+ "界面支持简体中文、英文、日文"],- "author": { "@type": "Person", "name": "baiyuze", "url": "https://github.com/baiyuze" }+ "author": {+ "@type": "Person",+ "name": "baiyuze",+ "url": "https://github.com/baiyuze"+ }},{"@type": "FAQPage","mainEntity": [{"@type": "Question",- "name": "CopySync 和 macOS 自带的通用剪贴板有什么区别?",- "acceptedAnswer": { "@type": "Answer", "text": "通用剪贴板要求两台设备登录同一个 Apple ID、开着蓝牙和 Wi-Fi 并且离得近。CopySync 只要求两台电脑都能连上你部署的服务器,不同 Apple ID、不同网络都可以,还能在 Mac 与 Windows 之间使用,另外有复制记录和大文件按需拉取。" }+ "name": "和 macOS 自带的「通用剪贴板」有什么区别?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "通用剪贴板要求两台设备登录同一个 Apple ID、开着蓝牙和 Wi‑Fi,并且离得近,也只能在苹果设备之间用。CopySync 只要求两台电脑都能连上你部署的服务器:不同 Apple ID、一台在家一台在公司、一台 Mac 一台 Windows,都可以。另外它有复制记录,大文件也可以按需拉取。 如果你的两台 Mac 是同一个 Apple ID、总在一起、主要复制文字,系统自带的已经够用了。"+ }},{"@type": "Question",- "name": "CopySync 的服务器会看到我复制的内容吗?",- "acceptedAnswer": { "@type": "Answer", "text": "不会。直连时数据不经过服务器;需要中转时,服务器只转发 DTLS 加密后的 UDP 包。服务器不存账号,也不存任何复制内容。" }+ "name": "服务器会看到我复制的内容吗?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "不会。直连时数据根本不经过服务器;需要中转时,服务器转发的是 DTLS 加密后的数据包。服务器不存账号,也不存任何复制内容。代码是开源的,可以自己核对。"+ }},{"@type": "Question",- "name": "公司网络(双线、多出口)能用 CopySync 直连吗?",- "acceptedAnswer": { "@type": "Answer", "text": "能。这类网络按目标地址选出口,CopySync 在同一个端口上向多台服务器探测,拿到每个出口的地址一并发给对端,对端逐个尝试。对端是端口随机分配的 NAT 时仍会经服务器中转。" }+ "name": "公司网络(双线、多出口)能直连吗?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "能。这类网络按目标地址选出口,CopySync 会在同一个端口上向多台服务器探测,拿到每个出口的地址一并发给对端,对端逐个尝试。实测公司 4 个出口与家用宽带之间可以直连。对端是端口随机分配的 NAT 时仍会走中转。"+ }},{"@type": "Question",- "name": "使用 CopySync 必须自己准备服务器吗?",- "acceptedAnswer": { "@type": "Answer", "text": "是的,CopySync 不提供公共服务器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。" }+ "name": "必须自己准备服务器吗?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。"+ }},{"@type": "Question",- "name": "CopySync 支持 Windows 吗?iPhone 呢?",- "acceptedAnswer": { "@type": "Answer", "text": "支持 Windows 10 与 Windows 11(x64),从 1.2 版起与 Mac 互通,粘贴文件得到的是真实文件。iPhone 和 iPad 暂不支持:iOS 不允许 App 在后台监听剪贴板,做不到复制后立即同步。" }+ "name": "支持 Windows 吗?iPhone 呢?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "支持 Windows 10 与 Windows 11(x64),与 Mac 互通。复制的文件在 Windows 上粘贴出来就是真实文件,能直接粘进资源管理器、微信、Office。 iPhone 和 iPad 暂不支持:iOS 不允许 App 在后台监听剪贴板,做不到复制后立即同步。"+ }},{"@type": "Question",- "name": "为什么第一次打开 CopySync 时系统会拦一下?",- "acceptedAnswer": { "@type": "Answer", "text": "CopySync 还没有经过 Apple 公证,Windows 版也还没有代码签名,两者都需要付费的证书。Mac 上到系统设置的隐私与安全性页面点击「仍要打开」;Windows 上在「Windows 已保护你的电脑」提示里点「更多信息」再点「仍要运行」。只需要操作一次。" }+ "name": "为什么第一次打开时系统会拦一下?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "CopySync 还没有经过 Apple 公证,Windows 版也还没有代码签名,两者都需要每年付费的证书。 Mac 上到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」;Windows 上在「Windows 已保护你的电脑」提示里点「更多信息」,再点「仍要运行」。都只需要这一次。"+ }},{"@type": "Question",- "name": "CopySync 怎么处理大文件?",- "acceptedAnswer": { "@type": "Answer", "text": "默认 50 MB 以内的内容在复制时直接推送到另一台电脑;更大的文件只同步一条记录,需要时在复制记录里点「拉取到本机」。上限可以在设置里调整,范围 1 MB 到 1 GB。" }+ "name": "大文件怎么处理?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "默认 50 MB 以内的内容在你复制时就推送到另一台电脑,那边可以直接粘贴;更大的文件只同步一条记录,需要时在复制记录里点「拉取到本机」再传。上限可以在设置里调整。"+ }},{"@type": "Question",- "name": "CopySync 收费吗?",- "acceptedAnswer": { "@type": "Answer", "text": "免费。CopySync 以 MIT 许可开源,源码在 GitHub 上。" }+ "name": "免费吗?公司能用吗?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "免费。CopySync 以 GNU AGPL-3.0 开源,个人和公司都可以免费使用和修改。分发它、或通过网络提供修改过的版本时,需要以同样的许可公开源码。 要放进闭源产品、修改后不想公开、或者作为托管服务运营,可以购买商业授权。"+ }}]}@@ -113,18 +163,16 @@<body><a class="skip" href="#main">跳到正文</a>- <header class="site-header">+ <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 class="site-nav" aria-label="页面导航">- <a class="optional" href="#how">工作原理</a>- <a class="optional" href="#install">安装</a>- <a class="optional" href="#faq">常见问题</a>+ <a class="brand" href="./" aria-label="CopySync 首页"><img src="assets/icon.svg" alt="" width="26" height="26">CopySync</a>+ <nav aria-label="页面导航">+ <a class="wide" href="#how">工作原理</a>+ <a class="wide" href="#install">安装</a>+ <a class="wide" href="#faq">常见问题</a><a href="https://github.com/baiyuze/copysync">GitHub</a>- <a href="en/" hreflang="en" lang="en">English</a>+ <a href="en/" hreflang="en" lang="en" data-lang="en">English</a>+ <a href="ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a></nav></div></header>@@ -132,102 +180,88 @@<main id="main"><section class="hero"><div class="wrap">- <h1>在这台电脑复制,<br>到那台电脑粘贴。</h1>+ <h1 class="display">在这台电脑复制,<br>到那台电脑粘贴。</h1><p class="lede">Mac 与 Windows 互通。文本、图片、文件、整个文件夹都可以,不要求同一个账号,也不要求在同一个网络。数据在你的设备之间直接传输,经过你自己的服务器时也是加密的。</p><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 button-alt" 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>- <span class="note">版本 1.2.0,免费开源。macOS 13 及以上(Intel 与 Apple 芯片通用);Windows 10、11。</span>+ <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>-- <div class="demo" role="img" aria-label="演示:在 MacBook 上选中文件并按下 Command C,文件经直连传到 Windows 笔记本,在那里按下 Ctrl V 粘贴出来">- <figure class="mac mac-a">- <div class="mac-screen">- <div class="file">- <svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 2.5h6.5L15.5 6.5V17a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5Z"/><path d="M11.5 2.5v4h4"/></svg>- <span>季度汇报-终版.pptx <small>38.2 MB</small></span>- </div>+ <p class="note">版本 1.3.0,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>+ <div class="stage" data-play role="img" aria-label="演示:在 MacBook 上按下 Command C,文件化作一张纸,经直连飞到 Windows 笔记本,在那里按下 Ctrl V 粘贴出来">+ <figure class="device mac">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc"><span class="lines"><i></i><i></i><i></i></span></span><span class="name">季度汇报-终版.pptx</span></div><div class="keys"><kbd>⌘</kbd><kbd>C</kbd></div>- </div>- <div class="mac-base"></div>+ </div></div>+ <div class="base"></div><figcaption>MacBook</figcaption></figure>- <div class="link" aria-hidden="true">- <span class="packet"></span>- <span class="link-label">直连,端到端加密</span>- </div>- <figure class="mac mac-b">- <div class="mac-screen">- <div class="file">- <svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 2.5h6.5L15.5 6.5V17a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5Z"/><path d="M11.5 2.5v4h4"/></svg>- <span>季度汇报-终版.pptx <small>38.2 MB</small></span>- </div>+ <div></div>+ <figure class="device win">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc"><span class="lines"><i></i><i></i><i></i></span></span><span class="name">季度汇报-终版.pptx</span></div><div class="keys"><kbd>Ctrl</kbd><kbd>V</kbd></div>- </div>- <div class="mac-base"></div>+ <div class="taskbar"><i></i><i></i><i></i><i></i><i></i></div>+ </div></div>+ <div class="base"></div><figcaption>Windows 笔记本</figcaption></figure>+ <svg class="arc" aria-hidden="true"><path d=""/></svg>+ <span class="arc-label" aria-hidden="true">直连,端到端加密</span>+ <span class="sheet-fly" aria-hidden="true"><span class="lines"><i></i><i></i><i></i></span></span></div><button class="replay" type="button">再演示一次</button></div></section>- <section class="section section-band" aria-labelledby="history-title">+ <section class="section" aria-labelledby="history-title"><div class="wrap"><h2 id="history-title">所有设备上复制过的,都在这里</h2>- <p class="intro">复制记录保留最近 3 天的内容,随时可以放回剪贴板。50 MB 以内的文件在你复制的时候就已经传好了,更大的文件需要时点一下再拉取。</p>+ <p class="intro">复制记录保留最近 3 天的内容,随时可以放回剪贴板,图片点开就能预览。50 MB 以内的文件在你复制的时候就已经传好了,更大的文件需要时点一下再拉取。</p><figure class="shot">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="assets/screenshots/history-dark.png">- <img src="assets/screenshots/history.png" width="2112" height="1472" alt="CopySync 的复制记录:来自 MacBook Air 和 Mac mini 的文件、图片、文字,大文件显示「拉取到本机」按钮">- </picture>+ <img src="assets/screenshots/history-dark.png" width="2112" height="1472" alt="CopySync 的复制记录:来自 MacBook Air 和 Mac mini 的文件、图片、文字,大文件显示「拉取到本机」按钮"></figure></div></section>+ <section class="section" aria-labelledby="flow-title">+ <div class="wrap">+ <h2 id="flow-title">按下复制之后</h2>+ <p class="intro">文字、图片、文件、整个文件夹,都走同一条路。</p>+ <ol class="flow">+ <li><h3>察觉</h3><p>Mac 上,后台服务每隔一小段时间看一眼剪贴板的变更计数,只看计数和类型,不需要授权,也不会弹出系统提示;Windows 上,复制的那一刻系统就会通知它。</p></li>+ <li><h3>传输</h3><p>文本随消息一起发出;50 MB 以内的图片和文件打包成流立即推送;更大的文件只发一条记录,等你需要时再传。</p></li>+ <li><h3>粘贴</h3><p>另一台电脑先把内容存到本地,再写入剪贴板。按下 ⌘V 或 Ctrl+V 粘贴出来的,就是本地的真实文件。</p></li>+ </ol>+ </div>+ </section>+<section class="section" aria-labelledby="why-title"><div class="wrap"><h2 id="why-title">为什么不用现有的办法</h2>- <div class="prose">- <p>手边有两台电脑的人,每天都要把东西从这台挪到那台:一段文字、一张截图、一个文件。现有的办法都差一点:</p>- <ul>- <li><strong>通用剪贴板</strong>要求两台设备登录同一个 Apple ID、离得足够近、蓝牙和 Wi‑Fi 都开着。公司的电脑和自己的电脑很少是同一个 Apple ID,大文件也经常复制到一半就没了。</li>- <li><strong>隔空投送</strong>每次都要选设备、在另一台上点接收,而且只传文件,不管剪贴板。</li>- <li><strong>用聊天软件发给自己</strong>要手动下载,图片会被压缩,文件还会留在别人的服务器上。</li>- <li><strong>一台 Mac、一台 Windows</strong> 时,系统自带的办法一个都用不了。</li>- </ul>- </div>- <div class="table-scroll">+ <p class="intro">通用剪贴板要同一个 Apple ID、离得够近;隔空投送每次都要点接收;发给自己要手动下载,文件还留在别人的服务器上。一台 Mac 一台 Windows 时,系统自带的办法一个都用不了。</p>+ <div class="block table-scroll"><table class="compare"><caption class="skip">CopySync 与其他方式的对比</caption>- <thead>- <tr><th scope="col"></th><th scope="col" class="ours">CopySync</th><th scope="col">通用剪贴板</th><th scope="col">隔空投送</th><th scope="col">聊天软件</th></tr>- </thead>+ <thead><tr><td></td><th scope="col" class="ours">CopySync</th><th scope="col">通用剪贴板</th><th scope="col">隔空投送</th><th scope="col">聊天软件</th></tr></thead><tbody>- <tr><th scope="row">不同 Apple ID 之间</th><td class="yes">可以</td><td class="no">不行</td><td class="partial">要对方接收</td><td class="yes">可以</td></tr>- <tr><th scope="row">Mac 与 Windows 之间</th><td class="yes">可以</td><td class="no">不行</td><td class="no">不行</td><td class="yes">可以</td></tr>- <tr><th scope="row">不在同一个网络(家里和公司)</th><td class="yes">可以</td><td class="no">不行</td><td class="no">不行</td><td class="yes">可以</td></tr>- <tr><th scope="row">复制后直接粘贴,不用点接收</th><td class="yes">可以</td><td class="yes">可以</td><td class="no">不行</td><td class="no">不行</td></tr>- <tr><th scope="row">文件与整个文件夹</th><td class="yes">可以</td><td class="partial">不稳定</td><td class="yes">可以</td><td class="partial">要先打包</td></tr>- <tr><th scope="row">找回之前复制过的内容</th><td class="yes">可以</td><td class="no">不行</td><td class="no">不行</td><td class="partial">翻聊天记录</td></tr>- <tr><th scope="row">内容不经过第三方服务器</th><td class="yes">不经过</td><td class="yes">不经过</td><td class="yes">不经过</td><td class="no">经过</td></tr>+ <tr><th scope="row">不同 Apple ID 之间</th><td class="yes ours">可以</td><td class="no">不行</td><td class="partial">要对方接收</td><td class="yes">可以</td></tr>+ <tr><th scope="row">Mac 与 Windows 之间</th><td class="yes ours">可以</td><td class="no">不行</td><td class="no">不行</td><td class="yes">可以</td></tr>+ <tr><th scope="row">不在同一个网络(家里和公司)</th><td class="yes ours">可以</td><td class="no">不行</td><td class="no">不行</td><td class="yes">可以</td></tr>+ <tr><th scope="row">复制后直接粘贴,不用点接收</th><td class="yes ours">可以</td><td class="yes">可以</td><td class="no">不行</td><td class="no">不行</td></tr>+ <tr><th scope="row">文件与整个文件夹</th><td class="yes ours">可以</td><td class="partial">不稳定</td><td class="yes">可以</td><td class="partial">要先打包</td></tr>+ <tr><th scope="row">找回之前复制过的内容</th><td class="yes ours">可以</td><td class="no">不行</td><td class="no">不行</td><td class="partial">翻聊天记录</td></tr>+ <tr><th scope="row">内容不经过第三方服务器</th><td class="yes ours">不经过</td><td class="yes">不经过</td><td class="yes">不经过</td><td class="no">经过</td></tr></tbody></table></div></div></section>- <section class="section section-band" id="how" aria-labelledby="how-title">+ <section class="section" id="how" aria-labelledby="how-title"><div class="wrap"><h2 id="how-title">工作原理</h2><p class="intro">两台电脑之间直接建立加密连接。你的服务器只负责让它们找到彼此,打不通直连的时候再帮忙转发。</p>-<figure class="diagram"><svg viewBox="0 0 960 400" role="img" aria-labelledby="diagram-title diagram-desc"><title id="diagram-title">CopySync 的连接方式</title>@@ -235,123 +269,94 @@<rect class="d-box" x="360" y="24" width="240" height="96" rx="14"/><text class="d-title" x="480" y="64" text-anchor="middle">你的服务器</text><text class="d-sub" x="480" y="92" text-anchor="middle">信令、STUN、TURN 中转</text>-<path class="d-sig" d="M140 210V58H360"/><path class="d-sig" d="M820 210V58H600"/><path class="d-relay" d="M196 210V100H360"/><path class="d-relay" d="M764 210V100H600"/><text class="d-note" x="210" y="50">信令:交换连接信息</text><text class="d-note" x="210" y="128">中转:仅在打不通直连时</text>-<rect class="d-box" x="40" y="210" width="240" height="120" rx="14"/><text class="d-title" x="160" y="262" text-anchor="middle">Mac</text><text class="d-sub" x="160" y="290" text-anchor="middle">在这里复制</text><rect class="d-box" x="680" y="210" width="240" height="120" rx="14"/><text class="d-title" x="800" y="262" text-anchor="middle">Mac 或 Windows</text><text class="d-sub" x="800" y="290" text-anchor="middle">在这里粘贴</text>-<path class="d-direct" d="M280 270H680"/><text class="d-label" x="480" y="256" text-anchor="middle">WebRTC 直连,DTLS 加密</text><text class="d-note" x="480" y="298" text-anchor="middle">数据只在两台电脑之间传输</text>-<g class="d-legend" transform="translate(40 372)"><path class="d-direct" d="M0 0H28"/><text x="38" y="5">数据(直连)</text>- <path class="d-relay" d="M190 0H218"/><text x="228" y="5">数据(中转,备用)</text>- <path class="d-sig" d="M420 0H448"/><text x="458" y="5">信令</text>+ <path class="d-relay" d="M210 0H238"/><text x="248" y="5">数据(中转,备用)</text>+ <path class="d-sig" d="M470 0H498"/><text x="508" y="5">信令</text></g></svg>+ <ul class="points diagram-text">+ <li><strong>WebRTC 直连,DTLS 加密</strong> 数据只在两台电脑之间传输</li>+ <li><strong>你的服务器</strong> 信令、STUN、TURN 中转</li>+ <li>中转:仅在打不通直连时</li>+ </ul></figure>-- <h3 class="subhead">一次复制的经过</h3>- <ol class="steps">- <li>- <h3>感知</h3>- <p>Mac 上,后台服务每隔一小段时间检查剪贴板的变更计数,只看计数和类型不需要授权,也不会弹出系统提示;Windows 上,复制的那一刻系统就会通知它。</p>- </li>- <li>- <h3>传输</h3>- <p>文本随消息一起发出;50 MB 以内的图片和文件打包成流立即推送;更大的文件只发一条记录,等你需要时再传。</p>- </li>- <li>- <h3>粘贴</h3>- <p>另一台电脑先把内容存到本地,再写入剪贴板。按下 ⌘V 或 Ctrl+V 粘贴出来的,就是本地的真实文件。</p>- </li>- </ol></div></section><section class="section" id="multi-uplink" aria-labelledby="multi-title"><div class="wrap"><h2 id="multi-title">公司网络也能直连</h2>- <p class="intro">公司双线、运营商地址池这类网络有多个出口,按目标地址选走哪一个。CopySync 1.0 只知道其中一个出口的地址,在这类网络里只能经服务器中转。1.1 会探测每个出口,把地址都告诉对端。</p>- <div class="two-col">- <div class="prose">+ <p class="intro">公司双线、运营商地址池这类网络有多个出口,按目标地址选走哪一个。只探测一次只会知道其中一个出口,只能经服务器中转。CopySync 会探测每个出口,把地址都告诉对端。</p>+ <div class="cols">+ <div><h3>做了什么</h3>- <ul>- <li><strong>共用一个端口。</strong>所有连接从同一个本地 UDP 端口收发。之前每问一台 STUN 服务器就开一个新端口,问到的地址互相用不上。</li>- <li><strong>探测每个出口。</strong>在这个端口上同时询问 7 台 IP 分散的服务器,网络有几个出口就拿到几个地址。被 DNS 污染的地址先过滤掉。</li>- <li><strong>全部告诉对端。</strong>每个出口的地址都发给对端,由它逐个尝试,与实际出口吻合的那一个能打通。</li>+ <ul class="points">+ <li><strong>共用一个端口。</strong>所有连接从同一个本地 UDP 端口收发,向不同服务器问到的地址才对得上。</li>+ <li><strong>探测每个出口。</strong>在这个端口上同时询问 7 台 IP 分散的服务器,网络有几个出口就拿到几个地址;被 DNS 污染的地址先过滤掉。</li>+ <li><strong>全部告诉对端。</strong>对端逐个尝试,与实际出口吻合的那一个能打通。</li><li><strong>记住见过的出口。</strong>某次漏掉的出口如果不改端口,就用「出口 IP + 本地端口」推算补上。</li>- <li><strong>定好谁先发包。</strong>有的路由器收到对方先到的包会占住端口,打洞就失败了。现在一方先公布出口地址,另一方收到后先往那边发包再公布自己的;重试时两种顺序轮流用。</li>- <li><strong>先中转,再换直连。</strong>对端刚启动时,出口地址可能晚到一步,第一次握手落到了中转。之后会在空闲时再打一次洞,打通就换成直连。</li>+ <li><strong>定好谁先发包。</strong>有的路由器收到对方先到的包会占住端口。一方先公布出口地址,另一方先往那边发包再公布自己的;重试时两种顺序轮流用。</li>+ <li><strong>先中转,再换直连。</strong>第一次握手落到了中转时,空闲时再打一次洞,打通就换成直连。</li></ul></div><div>- <h3>一个真实的公司网络</h3>- <table class="measure">- <thead><tr><th scope="col">出口</th><th scope="col">公网端口</th></tr></thead>- <tbody>- <tr><td>出口 A</td><td>不变</td></tr>- <tr><td>出口 B</td><td>不变</td></tr>- <tr><td>出口 C</td><td>改写,但对不同目标相同</td></tr>- <tr><td>出口 D</td><td>改写</td></tr>- </tbody>- </table>- <p class="aside-p">改造前,这台 Mac 与家里的 Mac 只能中转,速度被服务器带宽限制在 0.6 MB/s。改造后直连,连上服务器后约 3 秒建立。</p>+ <h3>用真实的网络拓扑验证</h3>+ <p class="small">NAT 打洞实验室用 Linux 网络命名空间与 iptables 搭出这些拓扑,用 CopySync 真实的连接代码各跑一遍,每次提交代码都自动运行。</p>+ <div class="table-scroll">+ <table>+ <thead><tr><th scope="col">场景</th><th scope="col">结果</th></tr></thead>+ <tbody>+ <tr><td>单出口 ↔ 家用路由器</td><td>直连</td></tr>+ <tr><td>两个出口,旧版本(对照)</td><td>中转</td></tr>+ <tr><td>两个出口 ↔ 家用路由器</td><td>直连</td></tr>+ <tr><td>四个出口 ↔ 家用路由器</td><td>直连</td></tr>+ <tr><td>两个出口,第二条没探测到,没有历史</td><td>中转</td></tr>+ <tr><td>两个出口,第二条没探测到,有历史</td><td>直连</td></tr>+ <tr><td>两个出口 ↔ 两个出口</td><td>直连</td></tr>+ <tr><td>两个出口 ↔ 端口随机分配的 NAT</td><td>中转</td></tr>+ <tr><td>一开始打不通,之后网络恢复</td><td>先中转,随后直连</td></tr>+ <tr><td>公司路由器会为外来的包占住端口</td><td>直连</td></tr>+ <tr><td>家用路由器会为外来的包占住端口</td><td>先中转,重试一次后直连</td></tr>+ </tbody>+ </table>+ </div>+ <p class="small">实测:一台在 4 个出口的公司网络里的 Mac 与家里的 Mac,改造前只能中转,速度被服务器带宽限制在 0.6 MB/s;改造后直连,连上服务器后约 3 秒建立。</p>+ <p class="small">测量过程、设计取舍与踩过的坑见<a href="design/nat-traversal.html">技术方案</a>。</p></div></div>-- <h3 class="subhead">用真实的网络拓扑验证</h3>- <p class="aside-p">NAT 打洞实验室用 Linux 网络命名空间与 iptables 搭出下面 11 种拓扑,用 CopySync 真实的连接代码各跑一遍。每次提交代码都会自动运行。</p>- <div class="table-scroll">- <table class="lab">- <thead><tr><th scope="col">场景</th><th scope="col">结果</th></tr></thead>- <tbody>- <tr><td>单出口 ↔ 家用路由器</td><td>直连</td></tr>- <tr><td>两个出口,旧版本(对照)</td><td>中转</td></tr>- <tr><td>两个出口 ↔ 家用路由器</td><td>直连</td></tr>- <tr><td>四个出口 ↔ 家用路由器</td><td>直连</td></tr>- <tr><td>两个出口,第二条没探测到,没有历史</td><td>中转</td></tr>- <tr><td>两个出口,第二条没探测到,有历史</td><td>直连</td></tr>- <tr><td>两个出口 ↔ 两个出口</td><td>直连</td></tr>- <tr><td>两个出口 ↔ 端口随机分配的 NAT</td><td>中转</td></tr>- <tr><td>一开始打不通,之后网络恢复</td><td>先中转,随后直连</td></tr>- <tr><td>公司路由器会为外来的包占住端口</td><td>直连</td></tr>- <tr><td>家用路由器会为外来的包占住端口</td><td>先中转,重试一次后直连</td></tr>- </tbody>- </table>- </div>- <p class="aside-p">测量过程、设计取舍与踩过的坑见<a href="https://github.com/baiyuze/copysync/blob/main/design/nat-traversal.md">技术方案</a>。</p></div></section>- <section class="section section-band" aria-labelledby="security-title">- <div class="wrap two-col">- <div class="prose">- <h2 id="security-title">服务器看不到你复制了什么</h2>- <ul>+ <section class="section" aria-labelledby="security-title">+ <div class="wrap">+ <h2 id="security-title">服务器看不到你复制了什么</h2>+ <div class="cols">+ <ul class="points"><li><strong>服务器不存账号,也不存内容。</strong>设备身份是一把 Ed25519 密钥,设备 ID 由公钥算出,服务器不需要用户表就能验证身份。</li>- <li><strong>配对时由你核对安全指纹。</strong>两台屏幕会显示同样的两行:双方各自公钥的指纹。服务器有能力替换转发中的公钥,但替换之后两块屏幕上的内容就对不上了,这一步就是防中间人的闸门。</li>- <li><strong>之后的每条消息都带签名</strong>,服务器无法冒充你的设备。直连通道的证书在握手后还会再核对一次,不一致立即断开。</li>+ <li><strong>配对时由你核对安全指纹。</strong>两块屏幕会显示同样的两行:双方各自公钥的指纹。服务器有能力替换转发中的公钥,但替换之后两块屏幕就对不上了,这一步就是防中间人的闸门。</li>+ <li><strong>之后的每条消息都带签名,</strong>服务器无法冒充你的设备。直连通道的证书在握手后还会再核对一次,不一致立即断开。</li><li><strong>中转也只是转发密文。</strong>TURN 转发的是加密后的数据包,中转凭证按设备单独签发,12 小时后过期。</li></ul>+ <figure class="figure-card">+ <img src="assets/screenshots/card-verify-dark.png" width="1120" height="800" loading="lazy" alt="配对时的「核对安全指纹」对话框,显示 R8NF-2WTC-QL5J,要求与另一台电脑上显示的完全一致">+ </figure></div>- <figure class="card-shot">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="assets/screenshots/card-verify-dark.png">- <img src="assets/screenshots/card-verify.png" width="1120" height="800" loading="lazy" alt="配对时的「核对安全指纹」对话框,显示 R8NF-2WTC-QL5J,要求与另一台 Mac 上显示的完全一致">- </picture>- </figure></div></section>@@ -360,64 +365,49 @@<h2 id="fallback-title">出问题的时候会发生什么</h2><p class="intro">每个人的网络环境都不一样。下面这些情况都考虑过,也都有对应的测试。</p><dl class="fallbacks">- <dt>两台电脑打不通直连</dt>- <dd>常见于对称 NAT 和公司防火墙。自动改走你服务器上的 TURN 中转,内容依然加密,设备列表里显示「中转」。</dd>- <dt>公共 STUN 服务器连不上</dt>- <dd>国内访问公共 STUN 时通时断。服务器自带 STUN,客户端优先用它。</dd>- <dt>公司网络有多个出口</dt>- <dd>双线、运营商地址池这类网络按目标地址选出口,只探测一次只会知道其中一个出口的地址。CopySync 在同一个端口上向多台服务器探测,把每个出口的地址都发给对端,由它逐个尝试。</dd>- <dt>先连上了中转</dt>- <dd>中转握手快,有时会抢在直连之前。连上之后,发起连接的一方会在空闲时再打一次洞,打通就换成直连;正在传文件时不打扰。</dd>- <dt>对方睡眠、断网或重启</dt>- <dd>连接悄悄断了也能发现,立即关闭重连。这期间复制的内容会记下来,连上后补发到对方的复制记录里,但不会覆盖对方此刻剪贴板里的内容。</dd>- <dt>服务器断开</dt>- <dd>自动重连,间隔从 1 秒开始翻倍、最长 30 秒,并带随机抖动,避免一群设备同时重连。界面实时显示连接状态。</dd>- <dt>文件太大</dt>- <dd>超过上限的只同步一条记录,需要时再拉取。拉取时源文件已经被删,会明确告诉你,而不是不明不白地失败。</dd>- <dt>粘贴到只认纯文本的地方</dt>- <dd>从网页复制的带格式文字会同时写入 HTML 和纯文本两份,粘贴到哪里都不会冒出标签。</dd>- <dt>文件名在 Windows 上不合法</dt>- <dd>Mac 上可以用的冒号、问号等字符,Windows 不允许出现在文件名里。收到时换成对应的全角字符,名字照样看得懂;只差大小写的两个文件也不会互相覆盖。</dd>- <dt>复制的是密码</dt>- <dd>Windows 上,密码管理器复制的内容会带一个「不要记录」的标记,CopySync 看到就跳过:不同步,也不进复制记录。</dd>- <dt>还没授权读取剪贴板</dt>- <dd>不去读内容,否则后台进程会卡在一个看不见的系统弹窗上。App 里会提示你去授权,并给出直达按钮。</dd>- <dt>后台服务崩溃</dt>- <dd>Mac 上由系统的 launchd、Windows 上由 CopySync 自带的守护进程自动拉起,10 秒节流,不会疯狂重启。</dd>- <dt>更新了 App,或者把它挪了位置</dt>- <dd>打开 App 时会自动校正登录项,并把后台服务重启到新版本。</dd>+ <div><dt>两台电脑打不通直连</dt><dd>常见于对称 NAT 和公司防火墙。自动改走你服务器上的 TURN 中转,内容依然加密,设备列表里显示「中转」。</dd></div>+ <div><dt>公共 STUN 服务器连不上</dt><dd>国内访问公共 STUN 时通时断。服务器自带 STUN,客户端优先用它。</dd></div>+ <div><dt>先连上了中转</dt><dd>中转握手快,有时会抢在直连之前。连上之后,发起连接的一方会在空闲时再打一次洞,打通就换成直连;正在传文件时不打扰。</dd></div>+ <div><dt>对方睡眠、断网或重启</dt><dd>连接悄悄断了也能发现,立即关闭重连。这期间复制的内容会记下来,连上后补发到对方的复制记录里,但不会覆盖对方此刻剪贴板里的内容。</dd></div>+ <div><dt>服务器断开</dt><dd>自动重连,间隔从 1 秒开始翻倍、最长 30 秒,并带随机抖动,避免一群设备同时重连。界面实时显示连接状态。</dd></div>+ <div><dt>文件太大</dt><dd>超过上限的只同步一条记录,需要时再拉取。拉取时源文件已经被删,会明确告诉你,而不是不明不白地失败。</dd></div>+ <div><dt>粘贴到只认纯文本的地方</dt><dd>从网页复制的带格式文字会同时写入 HTML 和纯文本两份,粘贴到哪里都不会冒出标签。</dd></div>+ <div><dt>文件名在 Windows 上不合法</dt><dd>Mac 上可以用的冒号、问号等字符,收到时换成对应的全角字符,名字照样看得懂;只差大小写的两个文件也不会互相覆盖。</dd></div>+ <div><dt>复制的是密码</dt><dd>Windows 上,密码管理器复制的内容会带一个「不要记录」的标记,CopySync 看到就跳过:不同步,也不进复制记录。</dd></div>+ <div><dt>还没授权读取剪贴板</dt><dd>不去读内容,否则后台进程会卡在一个看不见的系统弹窗上。App 里会提示你去授权,并给出直达按钮。</dd></div>+ <div><dt>后台服务崩溃</dt><dd>Mac 上由系统的 launchd、Windows 上由 CopySync 自带的守护进程自动拉起,10 秒节流,不会疯狂重启。</dd></div>+ <div><dt>更新了 App,或者把它挪了位置</dt><dd>打开 App 时会自动校正登录项,并把后台服务重启到新版本。</dd></div></dl></div></section>- <section class="section section-band" id="install" aria-labelledby="install-title">+ <section class="section" id="install" aria-labelledby="install-title"><div class="wrap"><h2 id="install-title">安装</h2><p class="intro">每台电脑装一个 App,再准备一台两边都能访问到的服务器。两台电脑在同一个局域网的话,服务器直接跑在其中一台 Mac 上就行。</p>- <div class="two-col">+ <div class="install"><div>- <h3>在 Mac 上</h3>- <ol class="install-steps">- <li>下载 <a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg">CopySync.dmg</a>,打开后把 CopySync 拖进「应用程序」。</li>- <li>从「应用程序」里打开。- <span class="aside">第一次会提示「无法验证开发者」:CopySync 还没有经过 Apple 公证。到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」,只需要这一次。</span></li>- <li>点「启用后台同步」。</li>- <li>在「设置」里填入服务器地址 <code>ws://服务器地址:8787/signal</code>,按回车。</li>+ <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>+ <ol>+ <li>下载 CopySync.dmg,打开后把 CopySync 拖进「应用程序」。</li>+ <li>从「应用程序」里打开。<span class="aside">第一次会提示「无法验证开发者」:CopySync 还没有经过 Apple 公证。到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」,只需要这一次。</span></li>+ <li>点「启用后台同步」,在「设置」里填入服务器地址 <code>ws://服务器地址:8787/signal</code>,按回车。</li><li>系统询问是否允许读取剪贴板时,选择允许。</li></ol>- <h3>在 Windows 上</h3>- <ol class="install-steps">- <li>下载 <a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe">CopySync-Setup.exe</a> 并运行。装在当前用户目录下,不需要管理员权限。- <span class="aside">CopySync 还没有代码签名,Windows 会提示「Windows 已保护你的电脑」:点「更多信息」,再点「仍要运行」。不想运行安装程序的话,可以下载<a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip">便携版</a>。</span></li>+ <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>+ </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="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>+ <ol>+ <li>运行 CopySync-Setup.exe。装在当前用户目录下,不需要管理员权限。<span class="aside">CopySync 还没有代码签名,Windows 会提示「Windows 已保护你的电脑」:点「更多信息」,再点「仍要运行」。不想运行安装程序的话,可以下载<a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip">便携版</a>。</span></li><li>打开 CopySync,点「启用后台同步」。关掉窗口后它在右下角的托盘里继续运行。</li><li>在「设置」里填入服务器地址,按回车。防火墙询问时选择允许。</li></ol>- <h3>配对</h3>- <p class="aside-p">一台点「设备 → 添加设备」生成 6 位配对码,另一台输入它;两块屏幕上的两行安全指纹完全一致后确认。Mac 与 Windows 之间、两台 Windows 之间都一样。</p>+ <a class="button" 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><div>- <h3>在服务器上</h3>- <p class="aside-p">任意 Linux,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。</p>+ <h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>服务器</h3>+ <p class="small">任意 Linux,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。</p><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@@ -425,18 +415,19 @@ tar xzf copysync-server-linux-amd64.tar.gzcd copysync-server-linux-amd64sudo ./install.sh 你的公网IP</code></pre></div>- <p class="aside-p">脚本会注册开机自启的 systemd 服务,最后打印出 App 里要填的地址。防火墙或云安全组需要放行:</p>- <table class="ports">+ <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>+ <tr><td>32768–60999/udp</td><td>中转端口</td></tr></tbody></table>- <p class="aside-p">也可以用 Docker 部署,见<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">服务器部署说明</a>。</p>+ <p class="small">也可以用 Docker 部署,见<a href="https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md">服务器部署说明</a>。</p></div></div>+ <p class="pairing"><strong>配对:</strong>一台点「设备 → 添加设备」生成 6 位配对码,另一台输入它;两块屏幕上的两行安全指纹完全一致后确认。Mac 与 Windows 之间、两台 Windows 之间都一样。</p></div></section>@@ -446,79 +437,61 @@ sudo ./install.sh 你的公网IP</code></pre><div class="table-scroll"><table class="specs"><tbody>- <tr><th scope="row">版本</th><td>1.2.0,<time datetime="2026-10-09">2026 年 10 月 9 日</time>发布</td></tr>- <tr><th scope="row">Mac 客户端</th><td>macOS 13 Ventura 及以上;Intel 与 Apple 芯片通用,不需要 Rosetta;安装包 45 MB</td></tr>- <tr><th scope="row">Windows 客户端</th><td>Windows 10(21H2 及以上)与 Windows 11,x64;按用户安装,不需要管理员权限;安装包约 21 MB</td></tr>- <tr><th scope="row">服务器</th><td>Linux x86_64 或 ARM64(systemd 或 Docker),也可以运行在 macOS 上;约 15 MB 内存</td></tr>- <tr><th scope="row">同步的内容</th><td>纯文本、带格式的文本、图片与截图、文件、文件夹,可以按类型关闭</td></tr>- <tr><th scope="row">传输</th><td>WebRTC 数据通道,直连优先,打不通时经 TURN 中转;多出口网络逐个探测每个出口;文件以 tar + zstd 流式打包</td></tr>- <tr><th scope="row">加密与身份</th><td>DTLS 端到端加密;设备身份为 Ed25519 密钥;信令消息逐条签名</td></tr>- <tr><th scope="row">配对</th><td>6 位配对码,5 分钟内有效,字符集去掉了 0/O、1/I 等易混字符;配对时人工核对安全指纹</td></tr>- <tr><th scope="row">自动同步上限</th><td>默认 50 MB,可在 1 MB 到 1 GB 之间调整</td></tr>- <tr><th scope="row">记录保留</th><td>默认 3 天,可在 1 小时到 30 天之间调整,到期自动清理</td></tr>- <tr><th scope="row">实测速度</th><td>局域网直连传输 20 MB 文件约 330 毫秒,校验和一致</td></tr>- <tr><th scope="row">技术栈</th><td>后台服务与服务器用 Go(Windows 上纯 Go 调用 Win32),界面用 Flutter(Mac 与 Windows 共用一套代码),消息定义用 Protocol Buffers</td></tr>- <tr><th scope="row">许可</th><td>MIT 开源</td></tr>+ <tr><th scope="row">版本</th><td>1.3.0,<time datetime="2026-10-09">2026 年 10 月 9 日</time>发布</td></tr>+ <tr><th scope="row">Mac 客户端</th><td>macOS 13 Ventura 及以上;Intel 与 Apple 芯片通用,不需要 Rosetta;安装包约 45 MB</td></tr>+ <tr><th scope="row">Windows 客户端</th><td>Windows 10(21H2 及以上)与 Windows 11,x64;按用户安装,不需要管理员权限;安装包约 21 MB</td></tr>+ <tr><th scope="row">服务器</th><td>Linux x86_64 或 ARM64(systemd 或 Docker),也可以运行在 macOS 上;约 15 MB 内存</td></tr>+ <tr><th scope="row">界面语言</th><td>简体中文、English、日本語,默认跟随系统,可在设置里切换</td></tr>+ <tr><th scope="row">同步的内容</th><td>纯文本、带格式的文本、图片与截图、文件、文件夹,可以按类型关闭</td></tr>+ <tr><th scope="row">传输</th><td>WebRTC 数据通道,直连优先,打不通时经 TURN 中转;多出口网络逐个探测每个出口;文件以 tar + zstd 流式打包</td></tr>+ <tr><th scope="row">加密与身份</th><td>DTLS 端到端加密;设备身份为 Ed25519 密钥;信令消息逐条签名</td></tr>+ <tr><th scope="row">配对</th><td>6 位配对码,5 分钟内有效,字符集去掉了 0/O、1/I 等易混字符;配对时人工核对安全指纹</td></tr>+ <tr><th scope="row">自动同步上限</th><td>默认 50 MB,可在 1 MB 到 1 GB 之间调整</td></tr>+ <tr><th scope="row">记录保留</th><td>默认 3 天,可在 1 小时到 30 天之间调整,到期自动清理</td></tr>+ <tr><th scope="row">实测速度</th><td>局域网直连传输 20 MB 文件约 330 毫秒,校验和一致</td></tr>+ <tr><th scope="row">技术栈</th><td>后台服务与服务器用 Go(Windows 上纯 Go 调用 Win32),界面用 Flutter(Mac 与 Windows 共用一套代码),消息定义用 Protocol Buffers</td></tr>+ <tr><th scope="row">许可</th><td>GNU AGPL-3.0;闭源产品等情况可购买<a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">商业授权</a></td></tr></tbody></table></div></div></section>- <section class="section section-band" id="faq" aria-labelledby="faq-title">+ <section class="section" id="faq" aria-labelledby="faq-title"><div class="wrap"><h2 id="faq-title">常见问题</h2><div class="faq"><details><summary>和 macOS 自带的「通用剪贴板」有什么区别?</summary>- <div class="answer">- <p>通用剪贴板要求两台设备登录同一个 Apple ID、开着蓝牙和 Wi‑Fi,并且离得近,也只能在苹果设备之间用。CopySync 只要求两台电脑都能连上你部署的服务器:不同 Apple ID、一台在家一台在公司、一台 Mac 一台 Windows,都可以。另外它有复制记录,大文件也可以按需拉取。</p>- <p>如果你的两台 Mac 是同一个 Apple ID、总在一起、主要复制文字,系统自带的已经够用了。</p>- </div>+ <div class="answer"><p>通用剪贴板要求两台设备登录同一个 Apple ID、开着蓝牙和 Wi‑Fi,并且离得近,也只能在苹果设备之间用。CopySync 只要求两台电脑都能连上你部署的服务器:不同 Apple ID、一台在家一台在公司、一台 Mac 一台 Windows,都可以。另外它有复制记录,大文件也可以按需拉取。</p><p>如果你的两台 Mac 是同一个 Apple ID、总在一起、主要复制文字,系统自带的已经够用了。</p></div></details><details><summary>服务器会看到我复制的内容吗?</summary>- <div class="answer">- <p>不会。直连时数据根本不经过服务器;需要中转时,服务器转发的是 DTLS 加密后的数据包。服务器不存账号,也不存任何复制内容。代码是开源的,可以自己核对。</p>- </div>+ <div class="answer"><p>不会。直连时数据根本不经过服务器;需要中转时,服务器转发的是 DTLS 加密后的数据包。服务器不存账号,也不存任何复制内容。代码是开源的,可以自己核对。</p></div></details><details><summary>公司网络(双线、多出口)能直连吗?</summary>- <div class="answer">- <p>能。这类网络按目标地址选出口,CopySync 会在同一个端口上向多台服务器探测,拿到每个出口的地址一并发给对端,对端逐个尝试,总有一个对得上。实测公司 4 个出口与家用宽带之间可以直连。对端是端口随机分配的 NAT 时仍会走中转。</p>- </div>+ <div class="answer"><p>能。这类网络按目标地址选出口,CopySync 会在同一个端口上向多台服务器探测,拿到每个出口的地址一并发给对端,对端逐个尝试。实测公司 4 个出口与家用宽带之间可以直连。对端是端口随机分配的 NAT 时仍会走中转。</p></div></details><details><summary>必须自己准备服务器吗?</summary>- <div class="answer">- <p>是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。</p>- </div>+ <div class="answer"><p>是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。</p></div></details><details><summary>支持 Windows 吗?iPhone 呢?</summary>- <div class="answer">- <p>支持 Windows 10 与 Windows 11(x64),从 1.2 版起与 Mac 互通。复制的文件在 Windows 上粘贴出来就是真实文件,能直接粘进资源管理器、微信、Office。</p>- <p>iPhone 和 iPad 暂不支持:iOS 不允许 App 在后台监听剪贴板,做不到复制后立即同步的体验。</p>- </div>+ <div class="answer"><p>支持 Windows 10 与 Windows 11(x64),与 Mac 互通。复制的文件在 Windows 上粘贴出来就是真实文件,能直接粘进资源管理器、微信、Office。</p><p>iPhone 和 iPad 暂不支持:iOS 不允许 App 在后台监听剪贴板,做不到复制后立即同步。</p></div></details><details><summary>为什么第一次打开时系统会拦一下?</summary>- <div class="answer">- <p>CopySync 还没有经过 Apple 公证,Windows 版也还没有代码签名,两者都需要每年付费的证书。</p>- <p>Mac 上到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」;Windows 上在「Windows 已保护你的电脑」提示里点「更多信息」,再点「仍要运行」。都只需要这一次。也可以从源码自己构建。</p>- </div>+ <div class="answer"><p>CopySync 还没有经过 Apple 公证,Windows 版也还没有代码签名,两者都需要每年付费的证书。</p><p>Mac 上到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」;Windows 上在「Windows 已保护你的电脑」提示里点「更多信息」,再点「仍要运行」。都只需要这一次。</p></div></details><details><summary>大文件怎么处理?</summary>- <div class="answer">- <p>默认 50 MB 以内的内容在你复制时就推送到另一台电脑,那边可以直接粘贴;更大的文件只同步一条记录,需要时在复制记录里点「拉取到本机」再传。上限可以在设置里调整。</p>- </div>+ <div class="answer"><p>默认 50 MB 以内的内容在你复制时就推送到另一台电脑,那边可以直接粘贴;更大的文件只同步一条记录,需要时在复制记录里点「拉取到本机」再传。上限可以在设置里调整。</p></div></details><details>- <summary>收费吗?</summary>- <div class="answer">- <p>免费。CopySync 以 MIT 许可开源,源码在 <a href="https://github.com/baiyuze/copysync">GitHub</a> 上。</p>- </div>+ <summary>免费吗?公司能用吗?</summary>+ <div class="answer"><p>免费。CopySync 以 GNU AGPL-3.0 开源,个人和公司都可以免费使用和修改。分发它、或通过网络提供修改过的版本时,需要以同样的许可公开源码。</p><p>要放进闭源产品、修改后不想公开、或者作为托管服务运营,可以购买<a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">商业授权</a>。</p></div></details></div></div>@@ -526,24 +499,31 @@ sudo ./install.sh 你的公网IP</code></pre><section class="closing" aria-labelledby="closing-title"><div class="wrap">- <h2 id="closing-title">两台电脑,一个剪贴板。</h2>+ <h2 class="display" id="closing-title">两台电脑,一个剪贴板。</h2><div class="cta">- <a class="button" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync.dmg">下载 Mac 版</a>- <a class="button button-alt" href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-Setup.exe">下载 Windows 版</a>- <a href="https://github.com/baiyuze/copysync">在 GitHub 上查看源码</a>+ <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.0,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。</p>+ <a class="source" href="https://github.com/baiyuze/copysync">在 GitHub 上查看源码</a></div></section></main>- <footer class="site-footer">+ <footer class="footer"><div class="wrap">- <span>CopySync 是开源软件,以 MIT 许可发布。</span>+ <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>- <a href="en/" hreflang="en" lang="en">English</a>+ </nav>+ <nav aria-label="语言">+ <a href="./" hreflang="zh-CN" lang="zh-CN" data-lang="zh" aria-current="page">简体中文</a>+ <a href="en/" hreflang="en" lang="en" data-lang="en">English</a>+ <a href="ja/" hreflang="ja" lang="ja" data-lang="ja">日本語</a></nav></div></footer>diff --git a/docs/ja/index.html b/docs/ja/index.htmlnew file mode 100644index 0000000..c1cee7c--- /dev/null+++ b/docs/ja/index.html@@ -0,0 +1,513 @@+<!doctype html>+<html lang="ja">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>CopySync:Mac と Windows のあいだでクリップボードとファイルを同期。アカウントもネットワークも別々で OK</title>+ <meta name="description" content="CopySync は、一台でコピーしたものをもう一台でそのまま貼り付けられるアプリです。Mac と Windows の両方に対応し、テキスト、画像、ファイル、フォルダを同期します。同じアカウントや同じネットワークは不要。デバイス間は P2P で直接つながり、エンドツーエンドで暗号化。サーバーは自分で用意し、内容は見えません。無料・オープンソース。">+ <link rel="canonical" href="https://baiyuze.github.io/copysync/ja/">+ <link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/">+ <link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/">+ <link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/">+ <link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/">+ <meta name="theme-color" content="#141416">+ <meta property="og:type" content="website">+ <meta property="og:site_name" content="CopySync">+ <meta property="og:title" content="CopySync:このコンピューターでコピーして、あのコンピューターで貼り付け">+ <meta property="og:description" content="Mac と Windows に対応。テキスト、画像、ファイル、フォルダを、アカウントやネットワークをまたいで同期。P2P 直接接続、エンドツーエンド暗号化、サーバーはセルフホスト。無料・オープンソース。">+ <meta property="og:url" content="https://baiyuze.github.io/copysync/ja/">+ <meta property="og:image" content="https://baiyuze.github.io/copysync/assets/og-en.png">+ <meta property="og:image:width" content="1200">+ <meta property="og:image:height" content="630">+ <meta property="og:locale" content="ja_JP">+ <meta property="og:locale:alternate" content="zh_CN">+ <meta property="og:locale:alternate" 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">+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@graph": [+ {+ "@type": "SoftwareApplication",+ "@id": "https://baiyuze.github.io/copysync/#app",+ "name": "CopySync",+ "description": "Mac と Windows のコンピューター間でクリップボードとファイルを同期するオープンソースのアプリ。テキスト、画像、ファイル、フォルダを一台でコピーし、もう一台で貼り付けられる。デバイス間は WebRTC で直接つながり DTLS でエンドツーエンド暗号化、つながらないときはユーザーが用意したサーバーの TURN で中継する。",+ "applicationCategory": "UtilitiesApplication",+ "operatingSystem": "macOS 13 以降(Intel と Apple シリコン)、Windows 10、Windows 11(x64)",+ "softwareVersion": "1.3.0",+ "datePublished": "2026-10-09",+ "inLanguage": "ja",+ "license": "https://www.gnu.org/licenses/agpl-3.0.html",+ "isAccessibleForFree": true,+ "offers": {+ "@type": "Offer",+ "price": "0",+ "priceCurrency": "JPY"+ },+ "downloadUrl": "https://github.com/baiyuze/copysync/releases/latest",+ "codeRepository": "https://github.com/baiyuze/copysync",+ "image": "https://baiyuze.github.io/copysync/assets/icon.png",+ "screenshot": "https://baiyuze.github.io/copysync/assets/screenshots/ja/history-dark.png",+ "featureList": [+ "プレーンテキスト、書式付きテキスト、画像、ファイル、フォルダを同期",+ "Mac と Windows のあいだで、アカウントやネットワークをまたいで使える",+ "WebRTC の直接接続、つながらないときは自動で TURN 中継",+ "DTLS のエンドツーエンド暗号化、ペアリング時に指紋を人が照合",+ "50 MB まではコピーと同時に送信、それより大きいファイルは必要なときに取り込み",+ "直近 3 日分の履歴、画像のプレビュー",+ "表示言語は日本語、英語、簡体字中国語"+ ],+ "author": {+ "@type": "Person",+ "name": "baiyuze",+ "url": "https://github.com/baiyuze"+ }+ },+ {+ "@type": "FAQPage",+ "mainEntity": [+ {+ "@type": "Question",+ "name": "macOS のユニバーサルクリップボードとの違いは?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "ユニバーサルクリップボードは、両方のデバイスが同じ Apple ID でサインインし、Bluetooth と Wi‑Fi をオンにして近くにある必要があり、Apple 製品どうしでしか使えません。CopySync に必要なのは、両方のコンピューターがあなたのサーバーにつながることだけです。Apple ID が別でも、自宅と会社に離れていても、Mac と Windows の組み合わせでも使えます。さらに履歴があり、大きなファイルは必要なときに取り込めます。 2 台の Mac が同じ Apple ID でいつも並んでいて、主にテキストをコピーするだけなら、標準機能で十分です。"+ }+ },+ {+ "@type": "Question",+ "name": "サーバーにコピーした内容は見えますか?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "見えません。直接接続のときデータはサーバーを通りません。中継が必要なときも、サーバーが転送するのは DTLS で暗号化されたパケットです。サーバーはアカウントもコピーした内容も保存しません。コードは公開されているので、ご自身で確かめられます。"+ }+ },+ {+ "@type": "Question",+ "name": "出口が複数ある会社のネットワークでも直接つながりますか?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "つながります。こうしたネットワークは宛先ごとに出口を選びます。CopySync はひとつのポートから複数のサーバーに問い合わせて出口ごとのアドレスを集め、すべて相手に送り、相手がひとつずつ試します。テストでは、出口が 4 つある会社の Mac と家庭の回線が直接つながりました。相手がポートをランダムに割り当てる NAT の場合は中継になります。"+ }+ },+ {+ "@type": "Question",+ "name": "サーバーは自分で用意する必要がありますか?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるならどちらかの Mac でサーバーを動かせば十分で、ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。"+ }+ },+ {+ "@type": "Question",+ "name": "Windows に対応していますか?iPhone は?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Windows 10 と Windows 11(x64)に対応し、Mac と相互に使えます。Windows で貼り付けたファイルは本物のファイルなので、エクスプローラーや Office にそのまま貼り付けられます。 iPhone と iPad には対応していません。iOS ではアプリがバックグラウンドでクリップボードを監視できないため、コピーしてすぐ同期することができないからです。"+ }+ },+ {+ "@type": "Question",+ "name": "初めて開くときにシステムに止められるのはなぜ?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "CopySync はまだ Apple の公証を受けておらず、Windows 版もコード署名していません。どちらも毎年費用のかかる証明書が必要です。 Mac では「システム設定 → プライバシーとセキュリティ」でページ下部の「このまま開く」をクリック、Windows では「Windows によって PC が保護されました」で「詳細情報」から「実行」を押してください。どちらも一度だけで済みます。"+ }+ },+ {+ "@type": "Question",+ "name": "大きなファイルはどうなりますか?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "初期設定では 50 MB までのものはコピーした時点でもう一台に送られ、そのまま貼り付けられます。それより大きいファイルは記録だけを同期し、必要なときに履歴から「このデバイスに取り込む」で転送します。上限は「設定」で変えられます。"+ }+ },+ {+ "@type": "Question",+ "name": "無料ですか?会社で使えますか?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "無料です。CopySync は GNU AGPL-3.0 のオープンソースで、個人も会社も無料で使い、改変できます。配布する場合や、改変したものをネットワーク越しに提供する場合は、同じライセンスでソースコードを公開する必要があります。 クローズドソースの製品に組み込む、改変を公開したくない、ホスティングサービスとして運用する、といった場合は商用ライセンスをご利用ください。"+ }+ }+ ]+ }+ ]+ }+ </script>+</head>+<body>+ <a class="skip" href="#main">本文へ移動</a>++ <header class="bar">+ <div class="wrap">+ <a class="brand" href="./" aria-label="CopySync ホーム"><img src="../assets/icon.svg" alt="" width="26" height="26">CopySync</a>+ <nav aria-label="ページ内の移動">+ <a class="wide" href="#how">しくみ</a>+ <a class="wide" href="#install">インストール</a>+ <a class="wide" href="#faq">よくある質問</a>+ <a href="https://github.com/baiyuze/copysync">GitHub</a>+ <a href=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>+ <a href="../en/" hreflang="en" lang="en" data-lang="en">English</a>+ </nav>+ </div>+ </header>++ <main id="main">+ <section class="hero">+ <div class="wrap">+ <h1 class="display">こっちでコピーして、<br>あっちで貼り付け。</h1>+ <p class="lede">Mac と Windows に対応。テキスト、画像、ファイル、フォルダまるごと。同じアカウントも、同じネットワークも要りません。データはデバイス間を直接流れ、自分のサーバーを経由するときも暗号化されたままです。</p>+ <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.0、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>+ <div class="stage" data-play role="img" aria-label="デモ:MacBook で Command C を押すと、ファイルが一枚の紙になって直接接続で Windows ノートへ飛び、そこで Ctrl V を押して貼り付けます">+ <figure class="device mac">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc"><span class="lines"><i></i><i></i><i></i></span></span><span class="name">四半期報告_最終版.pptx</span></div>+ <div class="keys"><kbd>⌘</kbd><kbd>C</kbd></div>+ </div></div>+ <div class="base"></div>+ <figcaption>MacBook</figcaption>+ </figure>+ <div></div>+ <figure class="device win">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc"><span class="lines"><i></i><i></i><i></i></span></span><span class="name">四半期報告_最終版.pptx</span></div>+ <div class="keys"><kbd>Ctrl</kbd><kbd>V</kbd></div>+ <div class="taskbar"><i></i><i></i><i></i><i></i><i></i></div>+ </div></div>+ <div class="base"></div>+ <figcaption>Windows ノート</figcaption>+ </figure>+ <svg class="arc" aria-hidden="true"><path d=""/></svg>+ <span class="arc-label" aria-hidden="true">直接接続、エンドツーエンド暗号化</span>+ <span class="sheet-fly" aria-hidden="true"><span class="lines"><i></i><i></i><i></i></span></span>+ </div>+ <button class="replay" type="button">もう一度再生</button>+ </div>+ </section>++ <section class="section" aria-labelledby="history-title">+ <div class="wrap">+ <h2 id="history-title">どのデバイスでコピーしたものも、ここに</h2>+ <p class="intro">履歴には直近 3 日分が残り、いつでもクリップボードに戻せます。画像はクリックでプレビュー。50 MB までのファイルはコピーした時点で届いていて、それより大きいものは必要なときにワンクリックで取り込めます。</p>+ <figure class="shot">+ <img src="../assets/screenshots/ja/history-dark.png" width="2112" height="1472" alt="CopySync の履歴画面:MacBook Air と Mac mini から届いたファイル、画像、テキスト。大きなファイルには「このデバイスに取り込む」ボタン">+ </figure>+ </div>+ </section>++ <section class="section" aria-labelledby="flow-title">+ <div class="wrap">+ <h2 id="flow-title">コピーしたあと、何が起きるか</h2>+ <p class="intro">テキストも画像も、ファイルもフォルダも、同じ道を通ります。</p>+ <ol class="flow">+ <li><h3>気づく</h3><p>Mac ではバックグラウンドサービスが短い間隔でクリップボードの変更カウントを確認します。カウントと種類を見るだけなので許可は不要で、確認ダイアログも出ません。Windows ではコピーした瞬間にシステムが知らせます。</p></li>+ <li><h3>送る</h3><p>テキストはメッセージと一緒に送ります。50 MB までの画像とファイルはその場でストリームとして送り、それより大きいファイルは記録だけを送って、必要になったときに転送します。</p></li>+ <li><h3>貼り付ける</h3><p>受け取った側はまず内容をローカルに保存してから、クリップボードに入れます。⌘V や Ctrl+V で貼り付けられるのは、手元にある本物のファイルです。</p></li>+ </ol>+ </div>+ </section>++ <section class="section" aria-labelledby="why-title">+ <div class="wrap">+ <h2 id="why-title">いまある方法では足りない理由</h2>+ <p class="intro">ユニバーサルクリップボードは同じ Apple ID で、近くにいる必要があります。AirDrop は毎回受け取り操作が要ります。自分宛てにメッセージで送ると手動でダウンロードすることになり、ファイルは他社のサーバーに残ります。Mac と Windows の組み合わせでは、標準の方法はどれも使えません。</p>+ <div class="block table-scroll">+ <table class="compare">+ <caption class="skip">CopySync とほかの方法の比較</caption>+ <thead><tr><td></td><th scope="col" class="ours">CopySync</th><th scope="col">ユニバーサル<br>クリップボード</th><th scope="col">AirDrop</th><th scope="col">チャットアプリ</th></tr></thead>+ <tbody>+ <tr><th scope="row">別々の Apple ID のあいだ</th><td class="yes ours">できる</td><td class="no">できない</td><td class="partial">受け取り操作が必要</td><td class="yes">できる</td></tr>+ <tr><th scope="row">Mac と Windows のあいだ</th><td class="yes ours">できる</td><td class="no">できない</td><td class="no">できない</td><td class="yes">できる</td></tr>+ <tr><th scope="row">別のネットワーク(自宅と会社)</th><td class="yes ours">できる</td><td class="no">できない</td><td class="no">できない</td><td class="yes">できる</td></tr>+ <tr><th scope="row">コピーしてすぐ貼り付け、受け取り操作なし</th><td class="yes ours">できる</td><td class="yes">できる</td><td class="no">できない</td><td class="no">できない</td></tr>+ <tr><th scope="row">ファイルとフォルダまるごと</th><td class="yes ours">できる</td><td class="partial">不安定</td><td class="yes">できる</td><td class="partial">先に圧縮</td></tr>+ <tr><th scope="row">前にコピーしたものを探す</th><td class="yes ours">できる</td><td class="no">できない</td><td class="no">できない</td><td class="partial">履歴をさかのぼる</td></tr>+ <tr><th scope="row">内容が第三者のサーバーを通らない</th><td class="yes ours">通らない</td><td class="yes">通らない</td><td class="yes">通らない</td><td class="no">通る</td></tr>+ </tbody>+ </table>+ </div>+ </div>+ </section>++ <section class="section" id="how" aria-labelledby="how-title">+ <div class="wrap">+ <h2 id="how-title">しくみ</h2>+ <p class="intro">2 台のコンピューターは、暗号化された接続で直接つながります。サーバーの役目はお互いを見つけさせることと、直接つながらないときに中継することだけです。</p>+ <figure class="diagram">+ <svg viewBox="0 0 960 400" role="img" aria-labelledby="diagram-title diagram-desc">+ <title id="diagram-title">CopySync の接続のしかた</title>+ <desc id="diagram-desc">コンピューター A と B(Mac または Windows)は WebRTC で直接つながります。どちらもシグナリングのためにあなたのサーバーへ接続し、直接接続に失敗したときはサーバーの TURN でデータを中継します。</desc>+ <rect class="d-box" x="360" y="24" width="240" height="96" rx="14"/>+ <text class="d-title" x="480" y="64" text-anchor="middle">あなたのサーバー</text>+ <text class="d-sub" x="480" y="92" text-anchor="middle">シグナリング、STUN、TURN 中継</text>+ <path class="d-sig" d="M140 210V58H360"/>+ <path class="d-sig" d="M820 210V58H600"/>+ <path class="d-relay" d="M196 210V100H360"/>+ <path class="d-relay" d="M764 210V100H600"/>+ <text class="d-note" x="210" y="50">シグナリング:接続情報の交換</text>+ <text class="d-note" x="210" y="128">中継:直接つながらないときだけ</text>+ <rect class="d-box" x="40" y="210" width="240" height="120" rx="14"/>+ <text class="d-title" x="160" y="262" text-anchor="middle">Mac</text>+ <text class="d-sub" x="160" y="290" text-anchor="middle">ここでコピー</text>+ <rect class="d-box" x="680" y="210" width="240" height="120" rx="14"/>+ <text class="d-title" x="800" y="262" text-anchor="middle">Mac または Windows</text>+ <text class="d-sub" x="800" y="290" text-anchor="middle">ここで貼り付け</text>+ <path class="d-direct" d="M280 270H680"/>+ <text class="d-label" x="480" y="256" text-anchor="middle">WebRTC 直接接続、DTLS 暗号化</text>+ <text class="d-note" x="480" y="298" text-anchor="middle">データは 2 台のあいだだけを流れる</text>+ <g class="d-legend" transform="translate(40 372)">+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">データ(直接)</text>+ <path class="d-relay" d="M210 0H238"/><text x="248" y="5">データ(中継、予備)</text>+ <path class="d-sig" d="M470 0H498"/><text x="508" y="5">シグナリング</text>+ </g>+ </svg>+ <ul class="points diagram-text">+ <li><strong>WebRTC 直接接続、DTLS 暗号化</strong> データは 2 台のあいだだけを流れる</li>+ <li><strong>あなたのサーバー</strong> シグナリング、STUN、TURN 中継</li>+ <li>中継:直接つながらないときだけ</li>+ </ul>+ </figure>+ </div>+ </section>++ <section class="section" id="multi-uplink" aria-labelledby="multi-title">+ <div class="wrap">+ <h2 id="multi-title">会社のネットワークでも直接つながる</h2>+ <p class="intro">2 つの回線を持つ会社や、キャリアの NAT アドレスプールのようなネットワークには出口が複数あり、宛先ごとに出口が変わります。一度調べただけでは出口のひとつしか分からず、中継頼みになります。CopySync はすべての出口を調べ、そのアドレスをすべて相手に伝えます。</p>+ <div class="cols">+ <div>+ <h3>やっていること</h3>+ <ul class="points">+ <li><strong>ポートはひとつ。</strong>すべての接続をひとつのローカル UDP ポートで送受信するので、別々のサーバーから得たアドレスがかみ合います。</li>+ <li><strong>出口をすべて調べる。</strong>そのポートから IP の散らばった 7 台のサーバーに同時に問い合わせ、出口の数だけアドレスを得ます。DNS 汚染されたアドレスは先に除外します。</li>+ <li><strong>すべて相手に伝える。</strong>相手はひとつずつ試し、実際の出口と合うものがつながります。</li>+ <li><strong>見た出口を覚えておく。</strong>ポートを書き換えない出口を取りこぼしたときは、「出口の IP +ローカルポート」で補います。</li>+ <li><strong>どちらが先に送るかを決める。</strong>相手のパケットが先に届くとポートをふさいでしまうルーターがあります。片方が先にアドレスを公開し、もう片方はそこへ送ってから自分のアドレスを公開します。再試行では順番を入れ替えます。</li>+ <li><strong>まず中継、あとで直接。</strong>最初のハンドシェイクが中継になったら、アイドル時にもう一度穴あけを試み、成功すれば直接接続に切り替えます。</li>+ </ul>+ </div>+ <div>+ <h3>実際のネットワーク構成で検証</h3>+ <p class="small">NAT 穴あけ実験室では、Linux のネットワーク名前空間と iptables でこれらの構成を組み、CopySync の本物の接続コードをそれぞれで動かします。コミットのたびに自動で実行されます。</p>+ <div class="table-scroll">+ <table>+ <thead><tr><th scope="col">構成</th><th scope="col">結果</th></tr></thead>+ <tbody>+ <tr><td>出口ひとつ ↔ 家庭用ルーター</td><td>直接</td></tr>+ <tr><td>出口ふたつ、旧バージョン(対照)</td><td>中継</td></tr>+ <tr><td>出口ふたつ ↔ 家庭用ルーター</td><td>直接</td></tr>+ <tr><td>出口よっつ ↔ 家庭用ルーター</td><td>直接</td></tr>+ <tr><td>出口ふたつ、2 本目を取りこぼし、履歴なし</td><td>中継</td></tr>+ <tr><td>出口ふたつ、2 本目を取りこぼし、履歴あり</td><td>直接</td></tr>+ <tr><td>出口ふたつ ↔ 出口ふたつ</td><td>直接</td></tr>+ <tr><td>出口ふたつ ↔ ポートをランダムに割り当てる NAT</td><td>中継</td></tr>+ <tr><td>最初はつながらず、あとでネットワークが回復</td><td>中継のあと直接</td></tr>+ <tr><td>会社のルーターが外からのパケットでポートをふさぐ</td><td>直接</td></tr>+ <tr><td>家庭用ルーターが外からのパケットでポートをふさぐ</td><td>中継のあと、1 回の再試行で直接</td></tr>+ </tbody>+ </table>+ </div>+ <p class="small">実測:出口が 4 つある会社の Mac と自宅の Mac は、以前は中継しかできず、サーバーの帯域で 0.6 MB/s に抑えられていました。いまは直接つながり、サーバーに接続してから約 3 秒で確立します。</p>+ <p class="small">測定の過程、設計の判断、ハマった点は<a href="../design/nat-traversal.html">技術資料</a>(中国語)にまとめています。</p>+ </div>+ </div>+ </div>+ </section>++ <section class="section" aria-labelledby="security-title">+ <div class="wrap">+ <h2 id="security-title">サーバーにはコピーした内容が見えない</h2>+ <div class="cols">+ <ul class="points">+ <li><strong>サーバーはアカウントも内容も保存しない。</strong>デバイスの身元は Ed25519 の鍵で、デバイス ID は公開鍵から計算されます。サーバーはユーザー表なしで身元を確かめられます。</li>+ <li><strong>ペアリングでは指紋をあなたが照合する。</strong>両方の画面に同じ 2 行、つまりお互いの公開鍵の指紋が表示されます。サーバーは転送中の公開鍵をすり替えられますが、すり替えれば 2 つの画面が一致しなくなります。この照合が中間者攻撃を防ぐ関門です。</li>+ <li><strong>その後のメッセージはすべて署名付き。</strong>サーバーがあなたのデバイスになりすますことはできません。直接接続の証明書もハンドシェイク後にもう一度照合し、食い違えばすぐ切断します。</li>+ <li><strong>中継も暗号文を転送するだけ。</strong>TURN が運ぶのは暗号化済みのパケットです。中継用の認証情報はデバイスごとに発行され、12 時間で失効します。</li>+ </ul>+ <figure class="figure-card">+ <img src="../assets/screenshots/ja/card-verify-dark.png" width="1120" height="800" loading="lazy" alt="ペアリング時の「セキュリティ指紋を確認」ダイアログ。R8NF-2WTC-QL5J が表示され、もう一台の表示と完全に一致するか確かめるよう求めている">+ </figure>+ </div>+ </div>+ </section>++ <section class="section" aria-labelledby="fallback-title">+ <div class="wrap">+ <h2 id="fallback-title">うまくいかないときに起きること</h2>+ <p class="intro">ネットワークの事情は人それぞれです。ここに挙げたケースはどれも想定済みで、テストがあります。</p>+ <dl class="fallbacks">+ <div><dt>2 台が直接つながらない</dt><dd>対称型 NAT や会社のファイアウォールでよく起きます。自動であなたのサーバーの TURN 中継に切り替わり、内容は暗号化されたまま。デバイス一覧には「中継」と表示されます。</dd></div>+ <div><dt>公開 STUN サーバーにつながらない</dt><dd>中国本土などでは公開 STUN が不安定です。サーバーは STUN を内蔵していて、クライアントはそちらを優先します。</dd></div>+ <div><dt>先に中継でつながった</dt><dd>中継のハンドシェイクは速く、直接接続より先に決まることがあります。接続後、接続を始めた側がアイドル時にもう一度穴あけを試み、成功すれば直接接続に切り替えます。転送中は邪魔しません。</dd></div>+ <div><dt>相手がスリープ、切断、再起動した</dt><dd>黙って切れた接続にも気づき、すぐに閉じて再接続します。そのあいだにコピーしたものは記録しておき、つながったら相手の履歴に追加します。相手のいまのクリップボードは上書きしません。</dd></div>+ <div><dt>サーバーとの接続が切れた</dt><dd>自動で再接続します。間隔は 1 秒から倍々で最大 30 秒、ランダムな揺らぎ付きで、たくさんのデバイスが一斉に再接続しないようにしています。接続状態はアプリにリアルタイムで表示されます。</dd></div>+ <div><dt>ファイルが大きすぎる</dt><dd>上限を超えるものは記録だけを同期し、必要なときに取り込みます。そのとき元のファイルが消えていれば、あいまいな失敗ではなく、はっきりそう伝えます。</dd></div>+ <div><dt>プレーンテキストしか受け付けない場所に貼り付ける</dt><dd>Web からコピーした書式付きテキストは HTML とプレーンテキストの両方で書き込むので、どこに貼り付けてもタグが混ざりません。</dd></div>+ <div><dt>Windows では使えないファイル名</dt><dd>Mac では使えるコロンや疑問符などは、対応する全角文字に置き換えて受け取るので、名前はそのまま読めます。大文字と小文字だけが違う 2 つのファイルが上書きし合うこともありません。</dd></div>+ <div><dt>パスワードをコピーした</dt><dd>Windows ではパスワードマネージャーがコピーした内容に「記録しない」印が付きます。CopySync はそれを見て飛ばします。同期も履歴への保存もしません。</dd></div>+ <div><dt>クリップボードの読み取りをまだ許可していない</dt><dd>内容は読みに行きません。読みに行くと、バックグラウンドプロセスが見えないダイアログで止まってしまうからです。アプリが許可を促し、設定へ直接飛べるボタンを出します。</dd></div>+ <div><dt>バックグラウンドサービスが落ちた</dt><dd>Mac ではシステムの launchd が、Windows では CopySync 自身の監視プロセスが再起動します。10 秒に 1 回までに抑え、暴走はしません。</dd></div>+ <div><dt>アプリを更新した、または移動した</dt><dd>アプリを開いたときにログイン項目を正しい場所に向け直し、バックグラウンドサービスを新しいバージョンで再起動します。</dd></div>+ </dl>+ </div>+ </section>++ <section class="section" id="install" aria-labelledby="install-title">+ <div class="wrap">+ <h2 id="install-title">インストール</h2>+ <p class="intro">それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。2 台が同じ LAN にあるなら、サーバーはどちらかの Mac で動かせば十分です。</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>+ <ol>+ <li>CopySync.dmg をダウンロードして開き、CopySync を「アプリケーション」にドラッグします。</li>+ <li>「アプリケーション」から開きます。<span class="aside">初回は「開発元を検証できません」と表示されます。CopySync はまだ Apple の公証を受けていないためです。「システム設定 → プライバシーとセキュリティ」を開き、ページ下部の「このまま開く」をクリックします。必要なのは一度だけです。</span></li>+ <li>「バックグラウンド同期を有効にする」をクリックし、「設定」でサーバーのアドレス <code>ws://サーバーアドレス:8787/signal</code> を入力して Return を押します。</li>+ <li>クリップボードの読み取りを許可するか聞かれたら、許可します。</li>+ </ol>+ <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>+ </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="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>+ <ol>+ <li>CopySync-Setup.exe を実行します。現在のユーザーのフォルダにインストールされ、管理者権限は要りません。<span class="aside">CopySync はまだコード署名されていないため、「Windows によって PC が保護されました」と表示されます。「詳細情報」を押してから「実行」を押してください。インストーラーを使いたくない場合は<a href="https://github.com/baiyuze/copysync/releases/latest/download/CopySync-windows-x64.zip">ポータブル版</a>もあります。</span></li>+ <li>CopySync を開き、「バックグラウンド同期を有効にする」をクリックします。ウィンドウを閉じても、画面右下の通知領域で動き続けます。</li>+ <li>「設定」でサーバーのアドレスを入力して Enter を押します。ファイアウォールに聞かれたら許可します。</li>+ </ol>+ <a class="button" 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>+ <div>+ <h3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>サーバー</h3>+ <p class="small">Linux なら何でも可、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。</p>+ <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>+ </div>+ </div>+ <p class="pairing"><strong>ペアリング:</strong>一台で「デバイス → デバイスを追加」を開いて 6 桁のコードを表示し、もう一台で入力します。両方の画面に同じ 2 行の指紋が表示されたら確定します。Mac と Windows、Windows 同士でも同じ手順です。</p>+ </div>+ </section>++ <section class="section" aria-labelledby="specs-title">+ <div class="wrap">+ <h2 id="specs-title">仕様</h2>+ <div class="table-scroll">+ <table class="specs">+ <tbody>+ <tr><th scope="row">バージョン</th><td>1.3.0(<time datetime="2026-10-09">2026 年 10 月 9 日</time>公開)</td></tr>+ <tr><th scope="row">Mac アプリ</th><td>macOS 13 Ventura 以降。Intel と Apple シリコンのユニバーサルバイナリで Rosetta 不要。ダウンロードは約 45 MB</td></tr>+ <tr><th scope="row">Windows アプリ</th><td>Windows 10(21H2 以降)と Windows 11、x64。ユーザーごとのインストールで管理者権限不要。ダウンロードは約 21 MB</td></tr>+ <tr><th scope="row">サーバー</th><td>Linux(x86_64 または ARM64、systemd または Docker)、macOS でも動作。メモリは約 15 MB</td></tr>+ <tr><th scope="row">表示言語</th><td>日本語、英語、簡体字中国語。初期設定はシステムに合わせ、「設定」で切り替え可能</td></tr>+ <tr><th scope="row">同期する内容</th><td>プレーンテキスト、書式付きテキスト、画像とスクリーンショット、ファイル、フォルダ。種類ごとにオフにできる</td></tr>+ <tr><th scope="row">転送</th><td>WebRTC データチャネル。直接接続を優先し、つながらなければ TURN で中継。複数の出口があるネットワークでは出口ごとに調査。ファイルは tar + zstd でストリーム転送</td></tr>+ <tr><th scope="row">暗号化と身元</th><td>DTLS によるエンドツーエンド暗号化。デバイスの身元は Ed25519 の鍵。シグナリングのメッセージはすべて署名付き</td></tr>+ <tr><th scope="row">ペアリング</th><td>5 分間有効な 6 桁のコード。0/O や 1/I のような紛らわしい文字は使わない。指紋は人が照合</td></tr>+ <tr><th scope="row">自動同期の上限</th><td>初期値 50 MB、1 MB〜1 GB で調整可能</td></tr>+ <tr><th scope="row">履歴の保存期間</th><td>初期値 3 日、1 時間〜30 日で調整可能。期限が来たら自動で削除</td></tr>+ <tr><th scope="row">実測の速度</th><td>LAN の直接接続で 20 MB のファイルを約 330 ミリ秒で転送、チェックサム一致</td></tr>+ <tr><th scope="row">技術スタック</th><td>バックグラウンドサービスとサーバーは Go(Windows では Go から Win32 を直接呼び出し)、アプリは Flutter(Mac と Windows で同じコード)、メッセージ定義は Protocol Buffers</td></tr>+ <tr><th scope="row">ライセンス</th><td>GNU AGPL-3.0。クローズドソースでの利用などには<a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">商用ライセンス</a>を用意</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>macOS のユニバーサルクリップボードとの違いは?</summary>+ <div class="answer"><p>ユニバーサルクリップボードは、両方のデバイスが同じ Apple ID でサインインし、Bluetooth と Wi‑Fi をオンにして近くにある必要があり、Apple 製品どうしでしか使えません。CopySync に必要なのは、両方のコンピューターがあなたのサーバーにつながることだけです。Apple ID が別でも、自宅と会社に離れていても、Mac と Windows の組み合わせでも使えます。さらに履歴があり、大きなファイルは必要なときに取り込めます。</p><p>2 台の Mac が同じ Apple ID でいつも並んでいて、主にテキストをコピーするだけなら、標準機能で十分です。</p></div>+ </details>+ <details>+ <summary>サーバーにコピーした内容は見えますか?</summary>+ <div class="answer"><p>見えません。直接接続のときデータはサーバーを通りません。中継が必要なときも、サーバーが転送するのは DTLS で暗号化されたパケットです。サーバーはアカウントもコピーした内容も保存しません。コードは公開されているので、ご自身で確かめられます。</p></div>+ </details>+ <details>+ <summary>出口が複数ある会社のネットワークでも直接つながりますか?</summary>+ <div class="answer"><p>つながります。こうしたネットワークは宛先ごとに出口を選びます。CopySync はひとつのポートから複数のサーバーに問い合わせて出口ごとのアドレスを集め、すべて相手に送り、相手がひとつずつ試します。テストでは、出口が 4 つある会社の Mac と家庭の回線が直接つながりました。相手がポートをランダムに割り当てる NAT の場合は中継になります。</p></div>+ </details>+ <details>+ <summary>サーバーは自分で用意する必要がありますか?</summary>+ <div class="answer"><p>はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるならどちらかの Mac でサーバーを動かせば十分で、ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。</p></div>+ </details>+ <details>+ <summary>Windows に対応していますか?iPhone は?</summary>+ <div class="answer"><p>Windows 10 と Windows 11(x64)に対応し、Mac と相互に使えます。Windows で貼り付けたファイルは本物のファイルなので、エクスプローラーや Office にそのまま貼り付けられます。</p><p>iPhone と iPad には対応していません。iOS ではアプリがバックグラウンドでクリップボードを監視できないため、コピーしてすぐ同期することができないからです。</p></div>+ </details>+ <details>+ <summary>初めて開くときにシステムに止められるのはなぜ?</summary>+ <div class="answer"><p>CopySync はまだ Apple の公証を受けておらず、Windows 版もコード署名していません。どちらも毎年費用のかかる証明書が必要です。</p><p>Mac では「システム設定 → プライバシーとセキュリティ」でページ下部の「このまま開く」をクリック、Windows では「Windows によって PC が保護されました」で「詳細情報」から「実行」を押してください。どちらも一度だけで済みます。</p></div>+ </details>+ <details>+ <summary>大きなファイルはどうなりますか?</summary>+ <div class="answer"><p>初期設定では 50 MB までのものはコピーした時点でもう一台に送られ、そのまま貼り付けられます。それより大きいファイルは記録だけを同期し、必要なときに履歴から「このデバイスに取り込む」で転送します。上限は「設定」で変えられます。</p></div>+ </details>+ <details>+ <summary>無料ですか?会社で使えますか?</summary>+ <div class="answer"><p>無料です。CopySync は GNU AGPL-3.0 のオープンソースで、個人も会社も無料で使い、改変できます。配布する場合や、改変したものをネットワーク越しに提供する場合は、同じライセンスでソースコードを公開する必要があります。</p><p>クローズドソースの製品に組み込む、改変を公開したくない、ホスティングサービスとして運用する、といった場合は<a href="https://github.com/baiyuze/copysync/blob/main/LICENSING.md">商用ライセンス</a>をご利用ください。</p></div>+ </details>+ </div>+ </div>+ </section>++ <section class="closing" aria-labelledby="closing-title">+ <div class="wrap">+ <h2 class="display" id="closing-title">2 台のコンピューター、<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.0、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。</p>+ <a class="source" href="https://github.com/baiyuze/copysync">GitHub でソースコードを見る</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=".././" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>+ <a href="../en/" hreflang="en" lang="en" data-lang="en">English</a>+ <a href="../ja/" hreflang="ja" lang="ja" data-lang="ja" aria-current="page">日本語</a>+ </nav>+ </div>+ </footer>++ <script src="../assets/site.js" defer></script>+</body>+</html>diff --git a/docs/llms.txt b/docs/llms.txtindex d29cb2e..168f388 100644--- a/docs/llms.txt+++ b/docs/llms.txt@@ -1,12 +1,12 @@# CopySync-> CopySync is a free, open-source (MIT) app for macOS and Windows that syncs the clipboard and files between computers: copy on one, paste on another — Mac to Mac, Mac to Windows, or Windows to Windows. It works across different accounts and different networks. Devices connect peer-to-peer over WebRTC with end-to-end DTLS encryption; when a direct connection fails, traffic is relayed through a TURN server the user hosts themselves. The server stores no accounts and cannot read clipboard content.+> CopySync is a free, open-source (GNU AGPL-3.0, with commercial licenses available) app for macOS and Windows that syncs the clipboard and files between computers: copy on one, paste on another — Mac to Mac, Mac to Windows, or Windows to Windows. It works across different accounts and different networks. Devices connect peer-to-peer over WebRTC with end-to-end DTLS encryption; when a direct connection fails, traffic is relayed through a TURN server the user hosts themselves. The server stores no accounts and cannot read clipboard content.>-> CopySync 是一款免费开源(MIT)的 macOS 与 Windows 工具,在两台电脑之间同步剪贴板与文件:一台复制,另一台直接粘贴,Mac 与 Windows 互通。不要求同一个账号,跨网络可用。设备间 WebRTC 直连、DTLS 端到端加密,打不通时经用户自建服务器的 TURN 中转;服务器不存账号,看不到复制内容。+> CopySync 是一款免费开源(GNU AGPL-3.0,另提供商业授权)的 macOS 与 Windows 工具,在两台电脑之间同步剪贴板与文件:一台复制,另一台直接粘贴,Mac 与 Windows 互通。不要求同一个账号,跨网络可用。设备间 WebRTC 直连、DTLS 端到端加密,打不通时经用户自建服务器的 TURN 中转;服务器不存账号,看不到复制内容。Key facts:-- Current version: 1.2.0, released 2026-10-09. Adds the Windows client.+- Current version: 1.3.0, released 2026-10-09. Adds an English and Japanese interface (follows the system language, switchable in Settings) and moves to the GNU AGPL-3.0 with an optional commercial license. 1.2.0 added the Windows client.- Mac client: macOS 13 Ventura or later, universal binary for Intel and Apple silicon. Distributed as a DMG; not notarized by Apple, so the first launch needs "Open Anyway" in System Settings → Privacy & Security.- Windows client: Windows 10 (21H2+) and Windows 11, x64. Per-user installer (CopySync-Setup.exe, no admin rights) or portable zip; not code-signed, so SmartScreen needs "More info → Run anyway" once. Runs in the notification area; pasted files are real files usable in Explorer, WeChat and Office. Skips content that password managers mark as sensitive.- Server: a single static Go binary for Linux (x86_64, ARM64) or macOS, installed via systemd script or Docker Compose. Ports: 8787/tcp (signaling), 3478/udp (STUN/TURN), 32768–60999/udp (relay).@@ -20,11 +20,13 @@ Key facts:## Docs+- [Website (English)](https://baiyuze.github.io/copysync/en/), [简体中文](https://baiyuze.github.io/copysync/), [日本語](https://baiyuze.github.io/copysync/ja/)- [README (English)](https://github.com/baiyuze/copysync/blob/main/README.md): features, installation, architecture, security model, fallbacks- [README (中文)](https://github.com/baiyuze/copysync/blob/main/README.zh-CN.md): the same in Simplified Chinese- [Server deployment](https://github.com/baiyuze/copysync/blob/main/server/deploy/README.md): systemd, Docker and manual setup-- [Windows client design (中文)](https://github.com/baiyuze/copysync/blob/main/design/windows-client.md): clipboard formats, file-name compatibility, background process, installer-- [NAT traversal design (中文)](https://github.com/baiyuze/copysync/blob/main/design/nat-traversal.md): multi-uplink probing, relay-to-direct upgrade, measurements and the NAT lab+- [Licensing](https://github.com/baiyuze/copysync/blob/main/LICENSING.md): AGPL-3.0 terms and the commercial license; versions 1.2.0 and earlier remain MIT+- [Windows client design (中文)](https://baiyuze.github.io/copysync/design/windows-client.html): clipboard formats, file-name compatibility, background process, installer+- [NAT traversal design (中文)](https://baiyuze.github.io/copysync/design/nat-traversal.html): multi-uplink probing, relay-to-direct upgrade, measurements and the NAT lab- [Changelog](https://github.com/baiyuze/copysync/blob/main/CHANGELOG.md)## Downloaddiff --git a/docs/sitemap.xml b/docs/sitemap.xmlindex a357c99..7517de0 100644--- a/docs/sitemap.xml+++ b/docs/sitemap.xml@@ -3,16 +3,34 @@xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://baiyuze.github.io/copysync/</loc>- <lastmod>2026-10-08</lastmod>+ <lastmod>2026-10-09</lastmod><xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"/><xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/"/>+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"/><xhtml:link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/"/></url><url><loc>https://baiyuze.github.io/copysync/en/</loc>- <lastmod>2026-10-08</lastmod>+ <lastmod>2026-10-09</lastmod><xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"/><xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/"/>+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"/><xhtml:link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/"/></url>+ <url>+ <loc>https://baiyuze.github.io/copysync/ja/</loc>+ <lastmod>2026-10-09</lastmod>+ <xhtml:link rel="alternate" hreflang="zh-CN" href="https://baiyuze.github.io/copysync/"/>+ <xhtml:link rel="alternate" hreflang="en" href="https://baiyuze.github.io/copysync/en/"/>+ <xhtml:link rel="alternate" hreflang="ja" href="https://baiyuze.github.io/copysync/ja/"/>+ <xhtml:link rel="alternate" hreflang="x-default" href="https://baiyuze.github.io/copysync/"/>+ </url>+ <url>+ <loc>https://baiyuze.github.io/copysync/design/nat-traversal.html</loc>+ <lastmod>2026-10-09</lastmod>+ </url>+ <url>+ <loc>https://baiyuze.github.io/copysync/design/windows-client.html</loc>+ <lastmod>2026-10-09</lastmod>+ </url></urlset>diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1index 3f0bd20..40c4e63 100644--- a/scripts/build-windows.ps1+++ b/scripts/build-windows.ps1@@ -4,7 +4,7 @@# CopySync-Setup.exe 安装程序(需要 Inno Setup 6)# CopySync-windows-x64.zip 便携版#-# powershell -ExecutionPolicy Bypass -File scripts\build-windows.ps1 [-Version 1.2.0]+# powershell -ExecutionPolicy Bypass -File scripts\build-windows.ps1 [-Version 1.3.0]## 需要 Go、Flutter 与 Visual Studio(「使用 C++ 的桌面开发」)。# 后台服务是纯 Go,也可以在 Mac 上交叉编译;界面只能在 Windows 上构建。diff --git a/scripts/build.sh b/scripts/build.shindex b25d883..0255728 100755--- a/scripts/build.sh+++ b/scripts/build.sh@@ -14,7 +14,7 @@ set -euo pipefailcd "$(dirname "$0")/.."DIST=dist-VERSION=${VERSION:-1.2.0}+VERSION=${VERSION:-1.3.0}rm -rf "$DIST" && mkdir -p "$DIST"# 构建 x86_64 + arm64 通用二进制:两台 Mac 的芯片未必相同,单架构的diff --git a/scripts/package.sh b/scripts/package.shindex 8c4a2c6..22a9b12 100755--- a/scripts/package.sh+++ b/scripts/package.sh@@ -18,7 +18,7 @@set -euo pipefailcd "$(dirname "$0")/.."-export VERSION=${VERSION:-1.2.0}+export VERSION=${VERSION:-1.3.0}OUT=release./scripts/build.shdiff --git a/tools/installer/copysync.iss b/tools/installer/copysync.issindex 7f55c1d..1e5e911 100644--- a/tools/installer/copysync.iss+++ b/tools/installer/copysync.iss@@ -1,6 +1,6 @@; CopySync 的 Windows 安装程序(Inno Setup 6)。由 scripts\build-windows.ps1 调用:;-; iscc /DAppVersion=1.2.0 /DSourceDir=<构建好的目录> /DOutputDir=<输出目录> tools\installer\copysync.iss+; iscc /DAppVersion=1.3.0 /DSourceDir=<构建好的目录> /DOutputDir=<输出目录> tools\installer\copysync.iss;; 按用户安装:装到 %LOCALAPPDATA%\Programs\CopySync,不需要管理员权限、不弹 UAC。; 数据目录 %LOCALAPPDATA%\CopySync 与安装目录分开,升级、重装都不受影响。diff --git a/tools/screenshots/prepare_fonts.py b/tools/screenshots/prepare_fonts.pyindex 734be3c..fc90839 100644--- a/tools/screenshots/prepare_fonts.py+++ b/tools/screenshots/prepare_fonts.py@@ -32,6 +32,15 @@ for font in TTCollection(pingfang).fonts:if wanted:sys.exit(f"PingFang.ttc 里缺少:{', '.join(wanted)}")+# ── 日文:冬青黑体(Hiragino Sans)的三个字重,日文界面的截图用它,汉字是日文字形 ──+for weight, label in [("W3", "Regular"), ("W5", "Medium"), ("W6", "Semibold")]:+ for font in TTCollection(f"/System/Library/Fonts/ヒラギノ角ゴシック {weight}.ttc").fonts:+ if font["name"].getDebugName(4) == f"Hiragino Sans {weight}":+ font.save(os.path.join(out, f"Hiragino-{label}.ttf"))+ break+ else:+ sys.exit(f"缺少 Hiragino Sans {weight}")+# ── 等宽:Menlo,用于配对码与安全指纹 ──menlo = {"Menlo Regular": "Menlo-Regular", "Menlo Bold": "Menlo-Bold"}for font in TTCollection("/System/Library/Fonts/Menlo.ttc").fonts:diff --git a/tools/screenshots/render.sh b/tools/screenshots/render.shindex dcc4dbb..363fe66 100755--- a/tools/screenshots/render.sh+++ b/tools/screenshots/render.sh@@ -1,6 +1,6 @@#!/usr/bin/env bash# 重新生成 README 与网站用的界面截图:中文界面输出到 docs/assets/screenshots/,-# 英文界面输出到 docs/assets/screenshots/en/。+# 英文、日文界面分别输出到 docs/assets/screenshots/en/ 与 ja/。## ./tools/screenshots/render.sh#@@ -16,7 +16,7 @@ trap 'rm -rf "$FONTS"' EXITecho "▶ 准备字体"python3 tools/screenshots/prepare_fonts.py "$FONTS"-for lang in zh en; do+for lang in zh en ja; doout=docs/assets/screenshots[ "$lang" = zh ] || out="$out/$lang"diff --git a/tools/site/build.py b/tools/site/build.pynew file mode 100644index 0000000..a5419fe--- /dev/null+++ b/tools/site/build.py@@ -0,0 +1,761 @@+"""生成官网:docs/index.html(简体中文)、docs/en/、docs/ja/,以及 docs/design/ 下的技术方案页面。++ python3 tools/site/build.py++三种语言共用同一套页面结构,文案在 tools/site/content/ 下每种语言一份。+技术方案页面由 design/*.md 转换而来,放在网站上,不用跳到 GitHub 去看。+改了文案、结构或技术方案后运行一次,把生成的文件一起提交。只用 Python 标准库。+"""++import html+import importlib.util+import json+import re+from pathlib import Path++ROOT = Path(__file__).resolve().parents[2]+DOCS = ROOT / "docs"+SITE = "https://baiyuze.github.io/copysync/"+REPO = "https://github.com/baiyuze/copysync"+DL = REPO + "/releases/latest/download/"+VERSION = "1.3.0"+DATE = "2026-10-09"++# 语言代码 → (页面目录, html 的 lang, og:locale, 语言名)+LANGS = {+ "zh": ("", "zh-CN", "zh_CN", "简体中文"),+ "en": ("en/", "en", "en_US", "English"),+ "ja": ("ja/", "ja", "ja_JP", "日本語"),+}++# 放到网站上的技术方案:文件名 → 网页名。其他 design/*.md 链接到 GitHub+DESIGN_DOCS = {"nat-traversal.md": "nat-traversal", "windows-client.md": "windows-client"}++DOWN = ('<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>')+LAPTOP = ('<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>')+DESKTOP = ('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" '+ 'stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="12" rx="1.5"/>'+ '<path d="M9 20h6M12 16v4"/></svg>')+SERVER = ('<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>')+LINES = '<span class="lines"><i></i><i></i><i></i></span>'++# 首页按浏览器语言跳转:只在简体中文的首页(网站根目录)做,选过语言后以选的为准+REDIRECT = """ <script>+ // 第一次打开时按浏览器语言跳到对应页面;在页面上点过语言链接后,以点的为准+ (function () {+ try {+ var pick = localStorage.getItem("copysync-lang");+ if (!pick) {+ if (/bot|crawl|spider|slurp|lighthouse/i.test(navigator.userAgent)) return;+ var list = navigator.languages || [navigator.language || ""];+ for (var i = 0; i < list.length && !pick; i++) {+ var l = String(list[i]).toLowerCase();+ if (l.indexOf("zh") === 0) pick = "zh";+ else if (l.indexOf("ja") === 0) pick = "ja";+ else if (l.indexOf("en") === 0) pick = "en";+ }+ pick = pick || "en";+ }+ if (pick === "en" || pick === "ja") location.replace(pick + "/" + location.hash);+ } catch (e) {}+ })();+ </script>+"""+++def esc(s: str) -> str:+ return html.escape(s, quote=True)+++def text_of(fragment: str) -> str:+ """HTML 片段 → 纯文本,给 JSON-LD 与 meta 用。"""+ return html.unescape(re.sub(r"<[^>]+>", "", fragment)).strip()+++def load(code: str) -> dict:+ path = Path(__file__).parent / "content" / f"{code}.py"+ spec = importlib.util.spec_from_file_location(f"content_{code}", path)+ module = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(module)+ return module.C+++# ─────────────────────────── 首页 ───────────────────────────+++def lang_links(code: str, up: str) -> str:+ """除当前语言外的其他语言链接。up 是当前页面到网站根目录的相对路径。"""+ out = []+ for other, (path, hl, _, name) in LANGS.items():+ if other == code:+ continue+ out.append(f'<a href="{up}{path or "./"}" hreflang="{hl}" lang="{hl}" data-lang="{other}">{name}</a>')+ return "\n ".join(out)+++def footer(c: dict, code: str, up: str) -> str:+ langs = []+ for other, (path, hl, _, name) in LANGS.items():+ cur = ' aria-current="page"' if other == code else ""+ langs.append(f'<a href="{up}{path or "./"}" hreflang="{hl}" lang="{hl}" data-lang="{other}"{cur}>{name}</a>')+ links = "".join(f'\n <a href="{href}">{label}</a>' for label, href in c["footer_links"])+ return f""" <footer class="footer">+ <div class="wrap">+ <p>{c["footer_license"]}</p>+ <nav aria-label="{c["footer_label"]}">{links}+ </nav>+ <nav aria-label="{c["lang_label"]}">+ {(chr(10) + " ").join(langs)}+ </nav>+ </div>+ </footer>"""+++def cta(c: dict) -> str:+ return f"""+ <div class="cta">+ <a class="button" href="{DL}CopySync.dmg">{DOWN}{c["dl_mac"]}</a>+ <a class="button quiet" href="{DL}CopySync-Setup.exe">{DOWN}{c["dl_win"]}</a>+ </div>+ <p class="note">{c["dl_note"]}</p>"""+++def jsonld(c: dict, code: str, path: str, shots: str) -> str:+ data = {+ "@context": "https://schema.org",+ "@graph": [+ {+ "@type": "SoftwareApplication",+ "@id": SITE + "#app",+ "name": "CopySync",+ "description": c["ld_description"],+ "applicationCategory": "UtilitiesApplication",+ "operatingSystem": c["ld_os"],+ "softwareVersion": VERSION,+ "datePublished": DATE,+ "inLanguage": LANGS[code][1],+ "license": "https://www.gnu.org/licenses/agpl-3.0.html",+ "isAccessibleForFree": True,+ "offers": {"@type": "Offer", "price": "0", "priceCurrency": c["ld_currency"]},+ "downloadUrl": REPO + "/releases/latest",+ "codeRepository": REPO,+ "image": SITE + "assets/icon.png",+ "screenshot": SITE + shots + "history-dark.png",+ "featureList": c["ld_features"],+ "author": {"@type": "Person", "name": "baiyuze", "url": "https://github.com/baiyuze"},+ },+ {+ "@type": "FAQPage",+ "mainEntity": [+ {"@type": "Question", "name": q,+ "acceptedAnswer": {"@type": "Answer", "text": " ".join(text_of(p) for p in answer)}}+ for q, answer in c["faq"]+ ],+ },+ ],+ }+ body = json.dumps(data, ensure_ascii=False, indent=2)+ return "\n".join(" " + line for line in body.split("\n"))+++def home(code: str) -> str:+ c = load(code)+ path, hl, locale, _ = LANGS[code]+ up = "../" * path.count("/")+ a = up + "assets/"+ shots = "assets/screenshots/" + ("" if code == "zh" else code + "/")+ alternates = "\n".join(+ f' <link rel="alternate" hreflang="{h}" href="{SITE}{p}">' for p, h, _, _ in LANGS.values())+ others = [l for k, (_, _, l, _) in LANGS.items() if k != code]++ ours = ' class="ours"'+ compare_head = "".join(+ f'<th scope="col"{ours if i == 0 else ""}>{h}</th>' for i, h in enumerate(c["compare_cols"]))+ compare_rows = "\n".join(+ f' <tr><th scope="row">{label}</th>' + "".join(+ f'<td class="{cls}{" ours" if i == 0 else ""}">{val}</td>' for i, (cls, val) in enumerate(cells)) + "</tr>"+ for label, cells in c["compare_rows"])+ flow = "\n".join(f" <li><h3>{h}</h3><p>{p}</p></li>" for h, p in c["flow"])+ uplink = "\n".join(f" <li><strong>{s}</strong>{t}</li>" for s, t in c["uplink_points"])+ lab = "\n".join(f" <tr><td>{s}</td><td>{r}</td></tr>" for s, r in c["lab_rows"])+ security = "\n".join(f" <li><strong>{s}</strong>{t}</li>" for s, t in c["security_points"])+ 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"])+ specs = "\n".join(f' <tr><th scope="row">{k}</th><td>{v}</td></tr>' for k, v in c["specs"])+ faq = "\n".join(+ f""" <details>+ <summary>{q}</summary>+ <div class="answer">{"".join(f"<p>{p}</p>" for p in answer)}</div>+ </details>""" for q, answer in c["faq"])+ d = c["diagram"]++ return f"""<!doctype html>+<html lang="{hl}">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>{c["title"]}</title>+ <meta name="description" content="{esc(c["description"])}">+ <link rel="canonical" href="{SITE}{path}">+{alternates}+ <link rel="alternate" hreflang="x-default" href="{SITE}">+ <meta name="theme-color" content="#141416">+ <meta property="og:type" content="website">+ <meta property="og:site_name" content="CopySync">+ <meta property="og:title" content="{esc(c["og_title"])}">+ <meta property="og:description" content="{esc(c["og_description"])}">+ <meta property="og:url" content="{SITE}{path}">+ <meta property="og:image" content="{SITE}assets/{c["og_image"]}">+ <meta property="og:image:width" content="1200">+ <meta property="og:image:height" content="630">+ <meta property="og:locale" content="{locale}">+{"".join(f' <meta property="og:locale:alternate" content="{l}">{chr(10)}' for l in others)} <meta name="twitter:card" content="summary_large_image">+ <link rel="icon" href="{a}favicon.svg" type="image/svg+xml">+ <link rel="icon" href="{a}favicon-32.png" sizes="32x32" type="image/png">+ <link rel="apple-touch-icon" href="{a}apple-touch-icon.png">+ <link rel="stylesheet" href="{a}site.css">+{REDIRECT if code == "zh" else ""} <script type="application/ld+json">+{jsonld(c, code, path, shots)}+ </script>+</head>+<body>+ <a class="skip" href="#main">{c["skip"]}</a>++ <header class="bar">+ <div class="wrap">+ <a class="brand" href="./" aria-label="{c["home_label"]}"><img src="{a}icon.svg" alt="" width="26" height="26">CopySync</a>+ <nav aria-label="{c["nav_label"]}">+ <a class="wide" href="#how">{c["nav_how"]}</a>+ <a class="wide" href="#install">{c["nav_install"]}</a>+ <a class="wide" href="#faq">{c["nav_faq"]}</a>+ <a href="{REPO}">GitHub</a>+ {lang_links(code, up)}+ </nav>+ </div>+ </header>++ <main id="main">+ <section class="hero">+ <div class="wrap">+ <h1 class="display">{c["h1"]}</h1>+ <p class="lede">{c["lede"]}</p>{cta(c)}+ <div class="stage" data-play role="img" aria-label="{esc(c["stage_label"])}">+ <figure class="device mac">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc">{LINES}</span><span class="name">{c["stage_file"]}</span></div>+ <div class="keys"><kbd>⌘</kbd><kbd>C</kbd></div>+ </div></div>+ <div class="base"></div>+ <figcaption>MacBook</figcaption>+ </figure>+ <div></div>+ <figure class="device win">+ <div class="screen"><div class="desk">+ <div class="file"><span class="doc">{LINES}</span><span class="name">{c["stage_file"]}</span></div>+ <div class="keys"><kbd>Ctrl</kbd><kbd>V</kbd></div>+ <div class="taskbar"><i></i><i></i><i></i><i></i><i></i></div>+ </div></div>+ <div class="base"></div>+ <figcaption>{c["stage_win"]}</figcaption>+ </figure>+ <svg class="arc" aria-hidden="true"><path d=""/></svg>+ <span class="arc-label" aria-hidden="true">{c["stage_arc"]}</span>+ <span class="sheet-fly" aria-hidden="true">{LINES}</span>+ </div>+ <button class="replay" type="button">{c["replay"]}</button>+ </div>+ </section>++ <section class="section" aria-labelledby="history-title">+ <div class="wrap">+ <h2 id="history-title">{c["history_h2"]}</h2>+ <p class="intro">{c["history_intro"]}</p>+ <figure class="shot">+ <img src="{up}{shots}history-dark.png" width="2112" height="1472" alt="{esc(c["history_alt"])}">+ </figure>+ </div>+ </section>++ <section class="section" aria-labelledby="flow-title">+ <div class="wrap">+ <h2 id="flow-title">{c["flow_h2"]}</h2>+ <p class="intro">{c["flow_intro"]}</p>+ <ol class="flow">+{flow}+ </ol>+ </div>+ </section>++ <section class="section" aria-labelledby="why-title">+ <div class="wrap">+ <h2 id="why-title">{c["why_h2"]}</h2>+ <p class="intro">{c["why_intro"]}</p>+ <div class="block table-scroll">+ <table class="compare">+ <caption class="skip">{c["compare_caption"]}</caption>+ <thead><tr><td></td>{compare_head}</tr></thead>+ <tbody>+{compare_rows}+ </tbody>+ </table>+ </div>+ </div>+ </section>++ <section class="section" id="how" aria-labelledby="how-title">+ <div class="wrap">+ <h2 id="how-title">{c["how_h2"]}</h2>+ <p class="intro">{c["how_intro"]}</p>+ <figure class="diagram">+ <svg viewBox="0 0 960 400" role="img" aria-labelledby="diagram-title diagram-desc">+ <title id="diagram-title">{d["title"]}</title>+ <desc id="diagram-desc">{d["desc"]}</desc>+ <rect class="d-box" x="360" y="24" width="240" height="96" rx="14"/>+ <text class="d-title" x="480" y="64" text-anchor="middle">{d["server"]}</text>+ <text class="d-sub" x="480" y="92" text-anchor="middle">{d["server_sub"]}</text>+ <path class="d-sig" d="M140 210V58H360"/>+ <path class="d-sig" d="M820 210V58H600"/>+ <path class="d-relay" d="M196 210V100H360"/>+ <path class="d-relay" d="M764 210V100H600"/>+ <text class="d-note" x="210" y="50">{d["sig_note"]}</text>+ <text class="d-note" x="210" y="128">{d["relay_note"]}</text>+ <rect class="d-box" x="40" y="210" width="240" height="120" rx="14"/>+ <text class="d-title" x="160" y="262" text-anchor="middle">Mac</text>+ <text class="d-sub" x="160" y="290" text-anchor="middle">{d["copy_here"]}</text>+ <rect class="d-box" x="680" y="210" width="240" height="120" rx="14"/>+ <text class="d-title" x="800" y="262" text-anchor="middle">{d["other"]}</text>+ <text class="d-sub" x="800" y="290" text-anchor="middle">{d["paste_here"]}</text>+ <path class="d-direct" d="M280 270H680"/>+ <text class="d-label" x="480" y="256" text-anchor="middle">{d["direct"]}</text>+ <text class="d-note" x="480" y="298" text-anchor="middle">{d["direct_note"]}</text>+ <g class="d-legend" transform="translate(40 372)">+ <path class="d-direct" d="M0 0H28"/><text x="38" y="5">{d["legend_direct"]}</text>+ <path class="d-relay" d="M210 0H238"/><text x="248" y="5">{d["legend_relay"]}</text>+ <path class="d-sig" d="M470 0H498"/><text x="508" y="5">{d["legend_sig"]}</text>+ </g>+ </svg>+ <ul class="points diagram-text">+ <li><strong>{d["direct"]}</strong> {d["direct_note"]}</li>+ <li><strong>{d["server"]}</strong> {d["server_sub"]}</li>+ <li>{d["relay_note"]}</li>+ </ul>+ </figure>+ </div>+ </section>++ <section class="section" id="multi-uplink" aria-labelledby="multi-title">+ <div class="wrap">+ <h2 id="multi-title">{c["uplink_h2"]}</h2>+ <p class="intro">{c["uplink_intro"]}</p>+ <div class="cols">+ <div>+ <h3>{c["uplink_changed"]}</h3>+ <ul class="points">+{uplink}+ </ul>+ </div>+ <div>+ <h3>{c["lab_h3"]}</h3>+ <p class="small">{c["lab_intro"]}</p>+ <div class="table-scroll">+ <table>+ <thead><tr><th scope="col">{c["lab_cols"][0]}</th><th scope="col">{c["lab_cols"][1]}</th></tr></thead>+ <tbody>+{lab}+ </tbody>+ </table>+ </div>+ <p class="small">{c["uplink_measured"]}</p>+ <p class="small">{c["uplink_doc"].format(doc=up + "design/nat-traversal.html")}</p>+ </div>+ </div>+ </div>+ </section>++ <section class="section" aria-labelledby="security-title">+ <div class="wrap">+ <h2 id="security-title">{c["security_h2"]}</h2>+ <div class="cols">+ <ul class="points">+{security}+ </ul>+ <figure class="figure-card">+ <img src="{up}{shots}card-verify-dark.png" width="1120" height="800" loading="lazy" alt="{esc(c["verify_alt"])}">+ </figure>+ </div>+ </div>+ </section>++ <section class="section" aria-labelledby="fallback-title">+ <div class="wrap">+ <h2 id="fallback-title">{c["fallback_h2"]}</h2>+ <p class="intro">{c["fallback_intro"]}</p>+ <dl class="fallbacks">+{fallbacks}+ </dl>+ </div>+ </section>++ <section class="section" id="install" aria-labelledby="install-title">+ <div class="wrap">+ <h2 id="install-title">{c["install_h2"]}</h2>+ <p class="intro">{c["install_intro"]}</p>+ <div class="install">+ <div>+ <h3>{LAPTOP}Mac</h3>+ <ol>+{mac_steps}+ </ol>+ <a class="button" href="{DL}CopySync.dmg">{DOWN}{c["dl_mac"]}</a>+ </div>+ <div>+ <h3>{DESKTOP}Windows</h3>+ <ol>+{win_steps}+ </ol>+ <a class="button" href="{DL}CopySync-Setup.exe">{DOWN}{c["dl_win"]}</a>+ </div>+ <div>+ <h3>{SERVER}{c["server_h3"]}</h3>+ <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>+ </div>+ </div>+ <p class="pairing">{c["pairing"]}</p>+ </div>+ </section>++ <section class="section" aria-labelledby="specs-title">+ <div class="wrap">+ <h2 id="specs-title">{c["specs_h2"]}</h2>+ <div class="table-scroll">+ <table class="specs">+ <tbody>+{specs}+ </tbody>+ </table>+ </div>+ </div>+ </section>++ <section class="section" id="faq" aria-labelledby="faq-title">+ <div class="wrap">+ <h2 id="faq-title">{c["faq_h2"]}</h2>+ <div class="faq">+{faq}+ </div>+ </div>+ </section>++ <section class="closing" aria-labelledby="closing-title">+ <div class="wrap">+ <h2 class="display" id="closing-title">{c["closing"]}</h2>{cta(c)}+ <a class="source" href="{REPO}">{c["source"]}</a>+ </div>+ </section>+ </main>++{footer(c, code, up)}++ <script src="{a}site.js" defer></script>+</body>+</html>+"""+++# ─────────────────────────── Markdown → HTML ───────────────────────────+# 只实现技术方案用到的那部分:标题、段落、列表(可嵌套)、引用、代码块、表格、分隔线,+# 行内的代码、粗体、链接。+++def doc_link(target: str) -> str:+ if re.match(r"[a-z]+:", target) or target.startswith("#"):+ return target+ name, _, anchor = target.partition("#")+ if name in DESIGN_DOCS:+ return DESIGN_DOCS[name] + ".html" + ("#" + anchor if anchor else "")+ # 指向仓库里其他文件的相对链接:换成 GitHub 上的地址+ return f"{REPO}/blob/main/design/{target}"+++def inline(s: str) -> str:+ codes = []++ def keep(m):+ codes.append("<code>" + html.escape(m.group(1), quote=False) + "</code>")+ return f"\x00{len(codes) - 1}\x00"++ s = re.sub(r"`([^`]+)`", keep, s)+ s = html.escape(s, quote=False)+ s = re.sub(r"\*\*(.+?)\*\*", r"<strong>\1</strong>", s)+ s = re.sub(r"\[([^\]]+)\]\(([^)\s]+)\)",+ lambda m: f'<a href="{esc(doc_link(html.unescape(m.group(2))))}">{m.group(1)}</a>', s)+ return re.sub(r"\x00(\d+)\x00", lambda m: codes[int(m.group(1))], s)+++def join_lines(lines: list[str]) -> str:+ # 中文段落折行处直接相连,西文之间补一个空格+ out = ""+ for line in lines:+ line = line.strip()+ if out and not (re.search(r"[ -鿿-]$", out) or re.match(r"[ -鿿-]", line)):+ out += " "+ out += line+ return out+++LIST_ITEM = re.compile(r"^(\s*)([-*]|\d+\.)\s+(.*)$")+++def render_list(lines: list[str]) -> str:+ """lines 是一整块列表(含续行)。按缩进建嵌套列表。"""+ items = [] # (缩进, 是否有序, 起始编号, 文本行)+ for line in lines:+ m = LIST_ITEM.match(line)+ if m:+ items.append([len(m.group(1)), m.group(2)[-1] == ".", m.group(2).rstrip("."), [m.group(3)]])+ elif items:+ items[-1][3].append(line)++ def build(start: int, indent: int) -> tuple[str, int]:+ ordered = items[start][1]+ tag = "ol" if ordered else "ul"+ first = items[start][2]+ attrs = f' start="{first}"' if ordered and first != "1" else ""+ parts = [f"<{tag}{attrs}>"]+ i = start+ while i < len(items) and items[i][0] >= indent:+ if items[i][0] > indent:+ sub, i = build(i, items[i][0])+ parts[-1] = parts[-1][: -len("</li>")] + sub + "</li>"+ continue+ parts.append("<li>" + inline(join_lines(items[i][3])) + "</li>")+ i += 1+ parts.append(f"</{tag}>")+ return "".join(parts), i++ out, i = [], 0+ while i < len(items):+ block, i = build(i, items[i][0])+ out.append(block)+ return "\n".join(out)+++def slug(text: str) -> str:+ return re.sub(r"[\s,。、::()()「」`*.]+", "-", text_of(text)).strip("-").lower()+++def markdown(src: str) -> tuple[str, str, list[tuple[str, str]]]:+ """返回 (标题, 正文 HTML, 二级标题列表)。"""+ lines = src.split("\n")+ out, toc, title = [], [], ""+ i = 0+ while i < len(lines):+ line = lines[i]+ if not line.strip():+ i += 1+ continue+ if line.startswith("```"):+ j = i + 1+ while j < len(lines) and not lines[j].startswith("```"):+ j += 1+ code = "\n".join(lines[i + 1 : j])+ out.append("<pre><code>" + html.escape(code, quote=False) + "</code></pre>")+ i = j + 1+ continue+ m = re.match(r"^(#{1,4})\s+(.*)$", line)+ if m:+ level, text = len(m.group(1)), m.group(2).strip()+ if level == 1 and not title:+ title = text+ i += 1+ continue+ hid = slug(text)+ if level == 2:+ toc.append((hid, text))+ out.append(f'<h{level} id="{esc(hid)}">{inline(text)}</h{level}>')+ i += 1+ continue+ if re.match(r"^(-{3,}|\*{3,})\s*$", line):+ out.append("<hr>")+ i += 1+ continue+ if line.startswith(">"):+ quote = []+ while i < len(lines) and lines[i].startswith(">"):+ quote.append(lines[i].lstrip(">").strip())+ i += 1+ out.append("<blockquote>" + "".join(f"<p>{inline(q)}</p>" for q in quote if q) + "</blockquote>")+ continue+ if line.startswith("|") and i + 1 < len(lines) and re.match(r"^\|[\s:|-]+\|\s*$", lines[i + 1]):+ def cells(row):+ return [c.strip() for c in row.strip().strip("|").split("|")]+ head = cells(line)+ rows = []+ i += 2+ while i < len(lines) and lines[i].startswith("|"):+ rows.append(cells(lines[i]))+ i += 1+ t = ["<div class=\"table-scroll\"><table><thead><tr>"]+ t += [f'<th scope="col">{inline(h)}</th>' for h in head]+ t.append("</tr></thead><tbody>")+ for r in rows:+ t.append("<tr>" + "".join(f"<td>{inline(c)}</td>" for c in r) + "</tr>")+ t.append("</tbody></table></div>")+ out.append("".join(t))+ continue+ if LIST_ITEM.match(line):+ block = []+ while i < len(lines) and lines[i].strip() and (LIST_ITEM.match(lines[i]) or lines[i].startswith(" ")):+ block.append(lines[i])+ i += 1+ out.append(render_list(block))+ continue+ para = []+ while i < len(lines) and lines[i].strip() and not (+ lines[i].startswith(("#", ">", "```", "|")) or LIST_ITEM.match(lines[i])+ ):+ para.append(lines[i])+ i += 1+ out.append("<p>" + inline(join_lines(para)) + "</p>")+ return title, "\n".join(out), toc+++def design_page(md_name: str, page: str) -> str:+ title, body, toc = markdown((ROOT / "design" / md_name).read_text(encoding="utf-8"))+ first_quote = re.search(r"<blockquote><p>(.*?)</p>", body)+ description = text_of(first_quote.group(1)) if first_quote else title+ toc_html = ""+ if len(toc) > 2:+ # 标题自带「一、二、」编号,目录不再加序号+ toc_html = ('<nav class="toc" aria-label="目录"><strong>目录</strong><ul>'+ + "".join(f'<li><a href="#{esc(h)}">{inline(t)}</a></li>' for h, t in toc)+ + "</ul></nav>")+ # 目录放在开头的状态说明之后+ if toc_html and body.startswith("<blockquote>"):+ cut = body.index("</blockquote>") + len("</blockquote>")+ body = body[:cut] + "\n" + toc_html + body[cut:]+ else:+ body = toc_html + body+ zh = load("zh")+ return f"""<!doctype html>+<html lang="zh-CN">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>{esc(text_of(inline(title)))}:CopySync 技术方案</title>+ <meta name="description" content="{esc(description)}">+ <link rel="canonical" href="{SITE}design/{page}.html">+ <meta name="theme-color" content="#141416">+ <link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">+ <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="{REPO}/blob/main/design/{md_name}">在 GitHub 上查看</a>+ <a href="{REPO}">GitHub</a>+ </nav>+ </div>+ </header>+ <main id="main">+ <article class="article">+ <p class="crumb"><a href="../">CopySync</a> 的技术方案</p>+ <h1>{inline(title)}</h1>+{body}+ </article>+ </main>++{footer(zh, "zh", "../")}+</body>+</html>+"""+++# ─────────────────────────── 其他页面 ───────────────────────────+++def not_found() -> str:+ return """<!doctype html>+<html lang="zh-CN">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <meta name="robots" content="noindex">+ <title>页面不存在 / Page not found:CopySync</title>+ <meta name="theme-color" content="#141416">+ <link rel="icon" href="/copysync/assets/favicon.svg" type="image/svg+xml">+ <link rel="stylesheet" href="/copysync/assets/site.css">+</head>+<body>+ <main class="lost">+ <div class="wrap">+ <h1 class="display">404</h1>+ <p class="lede">这个页面不存在。<br><span lang="en">This page doesn't exist.</span><br><span lang="ja">このページは存在しません。</span></p>+ <div class="cta">+ <a class="button" href="/copysync/">回到首页</a>+ <a class="button quiet" href="/copysync/en/" lang="en">English home</a>+ <a class="button quiet" href="/copysync/ja/" lang="ja">日本語のホーム</a>+ </div>+ </div>+ </main>+</body>+</html>+"""+++def sitemap() -> str:+ alts = "".join(+ f'\n <xhtml:link rel="alternate" hreflang="{h}" href="{SITE}{p}"/>' for p, h, _, _ in LANGS.values())+ alts += f'\n <xhtml:link rel="alternate" hreflang="x-default" href="{SITE}"/>'+ urls = [f" <url>\n <loc>{SITE}{p}</loc>\n <lastmod>{DATE}</lastmod>{alts}\n </url>"+ for p, _, _, _ in LANGS.values()]+ urls += [f" <url>\n <loc>{SITE}design/{page}.html</loc>\n <lastmod>{DATE}</lastmod>\n </url>"+ for page in DESIGN_DOCS.values()]+ return ('<?xml version="1.0" encoding="UTF-8"?>\n'+ '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"\n'+ ' xmlns:xhtml="http://www.w3.org/1999/xhtml">\n' + "\n".join(urls) + "\n</urlset>\n")+++def write(path: Path, text: str) -> None:+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(text, encoding="utf-8")+ print("✓", path.relative_to(ROOT))+++def main() -> None:+ for code, (path, _, _, _) in LANGS.items():+ write(DOCS / path / "index.html", home(code))+ for md_name, page in DESIGN_DOCS.items():+ write(DOCS / "design" / f"{page}.html", design_page(md_name, page))+ write(DOCS / "404.html", not_found())+ write(DOCS / "sitemap.xml", sitemap())+++if __name__ == "__main__":+ main()diff --git a/tools/site/content/en.py b/tools/site/content/en.pynew file mode 100644index 0000000..0d11b7e--- /dev/null+++ b/tools/site/content/en.py@@ -0,0 +1,272 @@+"""Site copy: English. Same keys as zh.py; see tools/site/build.py for the structure."""++REPO = "https://github.com/baiyuze/copysync"+SITE = "https://baiyuze.github.io/copysync/"++C = {+ "title": "CopySync: sync the clipboard and files between Mac and Windows, across accounts and networks",+ "description": "CopySync lets you copy on one computer and paste on another, Mac or Windows: text, images, files and folders. "+ "No shared account or network required. Peer-to-peer, end-to-end encrypted, with a server you host that "+ "can't see your content. Free and open source.",+ "og_title": "CopySync: copy on this computer, paste on that one",+ "og_description": "Mac and Windows. Text, images, files and folders across accounts and networks; peer-to-peer, end-to-end "+ "encrypted, self-hosted server. Free and open source.",+ "og_image": "og-en.png",+ "skip": "Skip to content",+ "home_label": "CopySync home",+ "nav_label": "Page",+ "nav_how": "How it works",+ "nav_install": "Install",+ "nav_faq": "FAQ",+ "lang_label": "Language",++ "h1": "Copy on this computer.<br>Paste on that one.",+ "lede": "Mac and Windows. Text, images, files, whole folders. No shared account required, no shared network required. "+ "Data moves directly between your devices, and stays encrypted even when it passes through your own server.",+ "dl_mac": "Download for Mac",+ "dl_win": "Download for Windows",+ "dl_note": "Version 1.3.0, free and open source. macOS 13 or later, Intel and Apple silicon; Windows 10 and 11.",+ "stage_label": "Demo: Command C on a MacBook turns a file into a sheet that flies over a direct connection to a Windows "+ "laptop, where Ctrl V pastes it",+ "stage_file": "Q3 review - final.pptx",+ "stage_win": "Windows laptop",+ "stage_arc": "Direct, end-to-end encrypted",+ "replay": "Play again",++ "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. "+ "Files under 50 MB have already arrived by the time you switch computers, and larger ones are a click away.",+ "history_alt": "CopySync history: files, images and text from a MacBook Air and a Mac mini; a large file shows a button "+ "to pull it to this device",++ "flow_h2": "What happens when you copy",+ "flow_intro": "Text, images, files and whole folders all take the same path.",+ "flow": [+ ("Notice", "On Mac, the background service checks the clipboard's change count at short intervals; reading the count "+ "and types needs no permission and never shows a prompt. On Windows, the system tells it the moment you copy."),+ ("Send", "Text travels inside the message. Images and files under 50 MB are streamed right away. Larger files are "+ "announced as a record and sent when you ask for them."),+ ("Paste", "The other computer stores the content locally, then puts it on the clipboard. What you paste with ⌘V or "+ "Ctrl+V is a real local file."),+ ],++ "why_h2": "Why not what's already there",+ "why_intro": "Universal Clipboard needs the same Apple ID and both Macs close together. AirDrop asks you to accept every "+ "time. Messaging yourself means manual downloads and files left on someone else's server. With one Mac and "+ "one Windows PC, none of the built-in options work at all.",+ "compare_caption": "CopySync compared with other options",+ "compare_cols": ["CopySync", "Universal Clipboard", "AirDrop", "Chat apps"],+ "compare_rows": [+ ("Different Apple IDs", [("yes", "Yes"), ("no", "No"), ("partial", "Needs accepting"), ("yes", "Yes")]),+ ("Between Mac and Windows", [("yes", "Yes"), ("no", "No"), ("no", "No"), ("yes", "Yes")]),+ ("Different networks (home and office)", [("yes", "Yes"), ("no", "No"), ("no", "No"), ("yes", "Yes")]),+ ("Paste right away, nothing to accept", [("yes", "Yes"), ("yes", "Yes"), ("no", "No"), ("no", "No")]),+ ("Files and whole folders", [("yes", "Yes"), ("partial", "Unreliable"), ("yes", "Yes"), ("partial", "Zip first")]),+ ("Find something you copied earlier", [("yes", "Yes"), ("no", "No"), ("no", "No"), ("partial", "Scroll back")]),+ ("Content stays off third-party servers", [("yes", "Yes"), ("yes", "Yes"), ("yes", "Yes"), ("no", "No")]),+ ],++ "how_h2": "How it works",+ "how_intro": "Your two computers open an encrypted connection to each other. Your server only helps them find one "+ "another, and relays traffic when a direct path can't be made.",+ "diagram": {+ "title": "How CopySync connects",+ "desc": "Computer A and computer B (Mac or Windows) connect directly over WebRTC. Both connect to your server for "+ "signaling. If the direct connection fails, data is relayed through the server's TURN service.",+ "server": "Your server",+ "server_sub": "Signaling, STUN, TURN relay",+ "sig_note": "Signaling: connection details",+ "relay_note": "Relay: only if direct fails",+ "copy_here": "You copy here",+ "other": "Mac or Windows",+ "paste_here": "You paste here",+ "direct": "Direct WebRTC, DTLS encrypted",+ "direct_note": "Data moves only between your computers",+ "legend_direct": "Data (direct)",+ "legend_relay": "Data (relay, fallback)",+ "legend_sig": "Signaling",+ },++ "uplink_h2": "Direct on office networks too",+ "uplink_intro": "Office networks with two ISPs, or carriers with a pool of NAT addresses, have several uplinks and pick one "+ "per destination. A single probe only reveals one of them, so connections end up on the relay. CopySync "+ "probes every uplink and tells the peer about all of them.",+ "uplink_changed": "What it does",+ "uplink_points": [+ ("One shared port.", " All connections send and receive on one local UDP port, so the addresses learned from different servers line up."),+ ("Every uplink probed.", " Seven IP-diverse servers are queried from that port at once, yielding one address per uplink. Addresses poisoned by DNS are dropped first."),+ ("All of them sent to the peer.", " The peer tries each address; the one matching the real uplink gets through."),+ ("Uplinks remembered.", " If a round misses an uplink that keeps ports unchanged, its address is filled in as uplink IP plus local port."),+ ("A rule for who sends first.", " Some routers lock a port when the other side's packet arrives first. One side announces its addresses first; the other sends to them before announcing its own. Retries alternate the order."),+ ("Relay first, direct later.", " If the first handshake lands on the relay, CopySync punches again while idle and switches to direct when that works."),+ ],+ "lab_h3": "Checked against real network topologies",+ "lab_intro": "The NAT lab builds these topologies with Linux network namespaces and iptables and runs CopySync's actual "+ "connection code through each. It runs on every commit.",+ "lab_cols": ["Scenario", "Result"],+ "lab_rows": [+ ("Single uplink ↔ home router", "Direct"),+ ("Two uplinks, previous version (control)", "Relay"),+ ("Two uplinks ↔ home router", "Direct"),+ ("Four uplinks ↔ home router", "Direct"),+ ("Two uplinks, second not probed, no history", "Relay"),+ ("Two uplinks, second not probed, with history", "Direct"),+ ("Two uplinks ↔ two uplinks", "Direct"),+ ("Two uplinks ↔ NAT that randomizes ports", "Relay"),+ ("Blocked at first, network recovers later", "Relay, then direct"),+ ("Office router locks a port for unsolicited packets", "Direct"),+ ("Home router locks a port for unsolicited packets", "Relay, then direct after one retry"),+ ],+ "uplink_measured": "Measured: a Mac on a 4-uplink office network and one at home could only relay before, capped at "+ "0.6 MB/s by the server's bandwidth. Now they connect directly, about 3 seconds after reaching the server.",+ "uplink_doc": 'Measurements, design trade-offs and lessons learned are in the <a href="{doc}">design document</a> (in Chinese).',++ "security_h2": "Your server can't see what you copy",+ "security_points": [+ ("No accounts, no stored content.", " A device's identity is an Ed25519 key, and its ID is derived from the public key, so the server verifies identity without a user table."),+ ("You compare fingerprints when pairing.", " Both screens show the same two lines: the fingerprint of each device's key. The server could swap keys in transit, but then the two screens would no longer match. That check is what stops a man in the middle."),+ ("Every message after that is signed,", " so the server can't impersonate your device. The direct channel's certificate is checked again after the handshake; a mismatch drops the connection."),+ ("The relay only forwards ciphertext.", " TURN carries encrypted packets, and relay credentials are issued per device and expire after 12 hours."),+ ],+ "verify_alt": "The fingerprint check during pairing shows R8NF-2WTC-QL5J and asks you to confirm it matches the other computer exactly",++ "fallback_h2": "When things go wrong",+ "fallback_intro": "Every network is different. Each of these cases was considered, and each has a test.",+ "fallbacks": [+ ("No direct path between the computers", "Common behind symmetric NAT and corporate firewalls. Traffic switches to the TURN relay on your server, still encrypted, and the device list shows \"Relay\"."),+ ("Public STUN servers unreachable", "Public STUN is unreliable in some regions, including mainland China. Your server runs its own STUN, and clients prefer it."),+ ("Connected through the relay first", "The relay handshake is fast and sometimes beats the direct path. Once connected, the side that started the connection punches again while idle and switches to direct when that works, never in the middle of a transfer."),+ ("The other computer sleeps, drops off or restarts", "A connection that dies silently is noticed, closed and reconnected. Anything you copy meanwhile is kept and added to the other computer's history once it's back, without overwriting what's on its clipboard now."),+ ("Server connection drops", "Reconnects automatically: the delay starts at 1 second and doubles up to 30, with jitter so devices don't all reconnect at once. The app shows the status live."),+ ("File too large", "Above the limit only a record is synced, pulled when you need it. If the source file is gone by then, you get a clear message instead of a vague failure."),+ ("Pasting into plain-text fields", "Rich text copied from the web is written as both HTML and plain text, so no markup leaks into what you paste."),+ ("A file name Windows doesn't allow", "Colons, question marks and a few other characters that are fine on a Mac arrive as the matching full-width characters, so the name still reads the same. Two names that differ only in case never overwrite each other."),+ ("Copying a password", "On Windows, password managers mark what they copy as \"don't record\". CopySync skips it: not synced, not kept in the history."),+ ("Clipboard access not granted yet", "Content isn't read, which would block on a prompt a background process can't show. The app asks you to grant access and links straight to the setting."),+ ("Background service crashes", "launchd on Mac, and CopySync's own supervisor on Windows, restart it, throttled to once every 10 seconds."),+ ("App updated or moved", "On launch the app re-points its login item and restarts the service on the new version."),+ ],++ "install_h2": "Install",+ "install_intro": "Install the app on each computer, and set up a server both of them can reach. If both share a LAN, the "+ "server can run on one of your Macs.",+ "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 "+ "isn't notarized by Apple yet. Go to System Settings → Privacy & Security and click Open Anyway near the bottom. "+ "You only do this once.</span>",+ "Click Turn on background sync. In Settings, enter your server as <code>ws://server-address:8787/signal</code> and press Return.",+ "When macOS asks whether CopySync may read the clipboard, allow it.",+ ],+ "win_steps": [+ "Run CopySync-Setup.exe. It installs for the current user, no administrator rights needed."+ "<span class=\"aside\">CopySync isn't code-signed yet, so Windows says \"Windows protected your PC\": click More info, "+ f"then Run anyway. To skip the installer, get the <a href=\"{REPO}/releases/latest/download/CopySync-windows-x64.zip\">portable zip</a>.</span>",+ "Open CopySync and click Turn on background sync. After you close the window it keeps running in the notification area.",+ "In Settings, enter your server address and press Enter. Allow it if Windows Firewall asks.",+ ],+ "server_h3": "Server",+ "server_intro": "Any Linux, as root. On ARM, replace <code>amd64</code> with <code>arm64</code>.",+ "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>.',+ "pairing": "<strong>Pairing:</strong> on one computer, choose Devices → Add device to show a 6-character code; enter it on "+ "the other, and confirm once both screens show the same two fingerprints. Mac with Windows, or two Windows PCs, "+ "works the same way.",++ "specs_h2": "Specifications",+ "specs": [+ ("Version", '1.3.0, released <time datetime="2026-10-09">October 9, 2026</time>'),+ ("Mac app", "macOS 13 Ventura or later; universal binary for Intel and Apple silicon, no Rosetta; about 45 MB download"),+ ("Windows app", "Windows 10 (21H2 or later) and Windows 11, x64; installs per user, no administrator rights; about 21 MB download"),+ ("Server", "Linux on x86_64 or ARM64 (systemd or Docker), or macOS; about 15 MB of RAM"),+ ("Languages", "English, Simplified Chinese and Japanese; follows the system by default, switchable in Settings"),+ ("Content", "Plain text, rich text, images and screenshots, files, folders; each type can be turned off"),+ ("Transport", "WebRTC data channels, direct first with TURN relay fallback; every uplink probed on multi-uplink networks; files streamed as tar + zstd"),+ ("Encryption and identity", "End-to-end DTLS; Ed25519 device keys; every signaling message signed"),+ ("Pairing", "6-character code valid for 5 minutes, using an alphabet without look-alikes such as 0/O and 1/I; fingerprints compared by you"),+ ("Auto-sync limit", "50 MB by default, adjustable from 1 MB to 1 GB"),+ ("History", "3 days by default, adjustable from 1 hour to 30 days; expired items removed automatically"),+ ("Measured speed", "A 20 MB file transfers in about 330 ms over a direct LAN connection, checksums matching"),+ ("Built with", "Go for the background service and server (pure Go calling Win32 on Windows), Flutter for the app (one codebase for Mac and Windows), Protocol Buffers for messages"),+ ("License", f'GNU AGPL-3.0; a <a href="{REPO}/blob/main/LICENSING.md">commercial license</a> is available for closed-source use'),+ ],++ "faq_h2": "Questions",+ "faq": [+ ("How is this different from Universal Clipboard?", [+ "Universal Clipboard needs both devices on the same Apple ID, with Bluetooth and Wi‑Fi on, close to each other, and "+ "works only between Apple devices. CopySync only needs both computers to reach your server, so different Apple IDs "+ "work, one Mac and one Windows PC work, and so does one at home and one at the office. It also keeps a history and "+ "lets you pull large files on demand.",+ "If your Macs share an Apple ID, sit side by side, and you mostly copy text, the built-in feature is already enough.",+ ]),+ ("Can the server see what I copy?", [+ "No. With a direct connection the data never touches the server. When it relays, it forwards DTLS-encrypted packets. "+ "It keeps no accounts and stores no clipboard content. The code is open, so you can check.",+ ]),+ ("Does it connect directly on office networks with several uplinks?", [+ "Yes. These networks pick an uplink per destination. CopySync probes several servers from one port to learn its "+ "address on every uplink and sends them all to the peer, which tries each one. A Mac behind a 4-uplink office "+ "network connects directly to a home connection in our tests. Peers behind NATs that randomize ports still fall "+ "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. On a LAN, run the server on "+ "one of your Macs. Across networks you need a machine with a public IP; the smallest cloud VM is enough.",+ ]),+ ("Windows? iPhone?", [+ "Windows 10 and 11 (x64) are supported and work together with Macs. Files you paste on Windows are real files you "+ "can drop into Explorer or Office.",+ "iPhone and iPad aren't supported: iOS doesn't let apps watch the clipboard in the background, so "+ "copy-and-it's-there can't work.",+ ]),+ ("Why does the system warn me the first time?", [+ "CopySync isn't notarized by Apple yet, and the Windows build isn't code-signed yet; both require paid certificates.",+ "On Mac, open System Settings → Privacy & Security and click Open Anyway near the bottom. On Windows, click More "+ "info and then Run anyway in the \"Windows protected your PC\" prompt. You only do this once.",+ ]),+ ("What about large files?", [+ "By default, anything under 50 MB is pushed to the other computer as you copy it, so you can paste right away. "+ "Larger files sync as a record; pull them from the history when you need them. The limit is adjustable in Settings.",+ ]),+ ("Is it free? Can my company use it?", [+ "Yes. CopySync is open source under the GNU AGPL-3.0, so individuals and companies can use and modify it for free. "+ "If you distribute it, or offer a modified version over a network, you publish your source under the same license.",+ f'To ship it inside a closed-source product, keep modifications private or run it as a hosted service, get a '+ f'<a href="{REPO}/blob/main/LICENSING.md">commercial license</a>.',+ ]),+ ],++ "closing": "Two computers, one clipboard.",+ "source": "View the source on GitHub",+ "footer_license": "CopySync is open source under the GNU AGPL-3.0, with commercial licenses available.",+ "footer_label": "Footer",+ "footer_links": [+ ("All releases", f"{REPO}/releases"),+ ("Changelog", f"{REPO}/blob/main/CHANGELOG.md"),+ ("Design notes (Chinese)", f"{SITE}design/nat-traversal.html"),+ ("Commercial license", f"{REPO}/blob/main/LICENSING.md"),+ ("Report an issue", f"{REPO}/issues"),+ ],++ "ld_description": "Open-source app that syncs the clipboard and files between Mac and Windows computers. Copy text, "+ "images, files or folders on one computer and paste on the other. Devices connect directly over "+ "WebRTC with end-to-end DTLS encryption, falling back to a TURN relay on a server the user hosts.",+ "ld_os": "macOS 13 or later (Intel and Apple silicon); Windows 10, Windows 11 (x64)",+ "ld_currency": "USD",+ "ld_features": [+ "Syncs plain text, rich text, images, files and folders",+ "Works between Mac and Windows, across accounts and networks",+ "Direct WebRTC connection with automatic TURN relay fallback",+ "End-to-end DTLS encryption with human-verified fingerprints at pairing",+ "Items under 50 MB pushed on copy, larger files pulled on demand",+ "3-day history with image preview",+ "Interface in English, Simplified Chinese and Japanese",+ ],+}diff --git a/tools/site/content/ja.py b/tools/site/content/ja.pynew file mode 100644index 0000000..28fe49b--- /dev/null+++ b/tools/site/content/ja.py@@ -0,0 +1,253 @@+"""サイトの文言:日本語。キーは zh.py と同じ。構造は tools/site/build.py を参照。"""++REPO = "https://github.com/baiyuze/copysync"+SITE = "https://baiyuze.github.io/copysync/"++C = {+ "title": "CopySync:Mac と Windows のあいだでクリップボードとファイルを同期。アカウントもネットワークも別々で OK",+ "description": "CopySync は、一台でコピーしたものをもう一台でそのまま貼り付けられるアプリです。Mac と Windows の両方に対応し、"+ "テキスト、画像、ファイル、フォルダを同期します。同じアカウントや同じネットワークは不要。デバイス間は P2P で直接つながり、"+ "エンドツーエンドで暗号化。サーバーは自分で用意し、内容は見えません。無料・オープンソース。",+ "og_title": "CopySync:このコンピューターでコピーして、あのコンピューターで貼り付け",+ "og_description": "Mac と Windows に対応。テキスト、画像、ファイル、フォルダを、アカウントやネットワークをまたいで同期。"+ "P2P 直接接続、エンドツーエンド暗号化、サーバーはセルフホスト。無料・オープンソース。",+ "og_image": "og-en.png",+ "skip": "本文へ移動",+ "home_label": "CopySync ホーム",+ "nav_label": "ページ内の移動",+ "nav_how": "しくみ",+ "nav_install": "インストール",+ "nav_faq": "よくある質問",+ "lang_label": "言語",++ "h1": "こっちでコピーして、<br>あっちで貼り付け。",+ "lede": "Mac と Windows に対応。テキスト、画像、ファイル、フォルダまるごと。同じアカウントも、同じネットワークも要りません。"+ "データはデバイス間を直接流れ、自分のサーバーを経由するときも暗号化されたままです。",+ "dl_mac": "Mac 版をダウンロード",+ "dl_win": "Windows 版をダウンロード",+ "dl_note": "バージョン 1.3.0、無料・オープンソース。macOS 13 以降(Intel と Apple シリコン)、Windows 10・11。",+ "stage_label": "デモ:MacBook で Command C を押すと、ファイルが一枚の紙になって直接接続で Windows ノートへ飛び、そこで Ctrl V を押して貼り付けます",+ "stage_file": "四半期報告_最終版.pptx",+ "stage_win": "Windows ノート",+ "stage_arc": "直接接続、エンドツーエンド暗号化",+ "replay": "もう一度再生",++ "history_h2": "どのデバイスでコピーしたものも、ここに",+ "history_intro": "履歴には直近 3 日分が残り、いつでもクリップボードに戻せます。画像はクリックでプレビュー。"+ "50 MB までのファイルはコピーした時点で届いていて、それより大きいものは必要なときにワンクリックで取り込めます。",+ "history_alt": "CopySync の履歴画面:MacBook Air と Mac mini から届いたファイル、画像、テキスト。大きなファイルには「このデバイスに取り込む」ボタン",++ "flow_h2": "コピーしたあと、何が起きるか",+ "flow_intro": "テキストも画像も、ファイルもフォルダも、同じ道を通ります。",+ "flow": [+ ("気づく", "Mac ではバックグラウンドサービスが短い間隔でクリップボードの変更カウントを確認します。カウントと種類を見るだけなので許可は不要で、"+ "確認ダイアログも出ません。Windows ではコピーした瞬間にシステムが知らせます。"),+ ("送る", "テキストはメッセージと一緒に送ります。50 MB までの画像とファイルはその場でストリームとして送り、"+ "それより大きいファイルは記録だけを送って、必要になったときに転送します。"),+ ("貼り付ける", "受け取った側はまず内容をローカルに保存してから、クリップボードに入れます。⌘V や Ctrl+V で貼り付けられるのは、手元にある本物のファイルです。"),+ ],++ "why_h2": "いまある方法では足りない理由",+ "why_intro": "ユニバーサルクリップボードは同じ Apple ID で、近くにいる必要があります。AirDrop は毎回受け取り操作が要ります。"+ "自分宛てにメッセージで送ると手動でダウンロードすることになり、ファイルは他社のサーバーに残ります。"+ "Mac と Windows の組み合わせでは、標準の方法はどれも使えません。",+ "compare_caption": "CopySync とほかの方法の比較",+ "compare_cols": ["CopySync", "ユニバーサル<br>クリップボード", "AirDrop", "チャットアプリ"],+ "compare_rows": [+ ("別々の Apple ID のあいだ", [("yes", "できる"), ("no", "できない"), ("partial", "受け取り操作が必要"), ("yes", "できる")]),+ ("Mac と Windows のあいだ", [("yes", "できる"), ("no", "できない"), ("no", "できない"), ("yes", "できる")]),+ ("別のネットワーク(自宅と会社)", [("yes", "できる"), ("no", "できない"), ("no", "できない"), ("yes", "できる")]),+ ("コピーしてすぐ貼り付け、受け取り操作なし", [("yes", "できる"), ("yes", "できる"), ("no", "できない"), ("no", "できない")]),+ ("ファイルとフォルダまるごと", [("yes", "できる"), ("partial", "不安定"), ("yes", "できる"), ("partial", "先に圧縮")]),+ ("前にコピーしたものを探す", [("yes", "できる"), ("no", "できない"), ("no", "できない"), ("partial", "履歴をさかのぼる")]),+ ("内容が第三者のサーバーを通らない", [("yes", "通らない"), ("yes", "通らない"), ("yes", "通らない"), ("no", "通る")]),+ ],++ "how_h2": "しくみ",+ "how_intro": "2 台のコンピューターは、暗号化された接続で直接つながります。サーバーの役目はお互いを見つけさせることと、"+ "直接つながらないときに中継することだけです。",+ "diagram": {+ "title": "CopySync の接続のしかた",+ "desc": "コンピューター A と B(Mac または Windows)は WebRTC で直接つながります。どちらもシグナリングのためにあなたのサーバーへ接続し、"+ "直接接続に失敗したときはサーバーの TURN でデータを中継します。",+ "server": "あなたのサーバー",+ "server_sub": "シグナリング、STUN、TURN 中継",+ "sig_note": "シグナリング:接続情報の交換",+ "relay_note": "中継:直接つながらないときだけ",+ "copy_here": "ここでコピー",+ "other": "Mac または Windows",+ "paste_here": "ここで貼り付け",+ "direct": "WebRTC 直接接続、DTLS 暗号化",+ "direct_note": "データは 2 台のあいだだけを流れる",+ "legend_direct": "データ(直接)",+ "legend_relay": "データ(中継、予備)",+ "legend_sig": "シグナリング",+ },++ "uplink_h2": "会社のネットワークでも直接つながる",+ "uplink_intro": "2 つの回線を持つ会社や、キャリアの NAT アドレスプールのようなネットワークには出口が複数あり、宛先ごとに出口が変わります。"+ "一度調べただけでは出口のひとつしか分からず、中継頼みになります。CopySync はすべての出口を調べ、そのアドレスをすべて相手に伝えます。",+ "uplink_changed": "やっていること",+ "uplink_points": [+ ("ポートはひとつ。", "すべての接続をひとつのローカル UDP ポートで送受信するので、別々のサーバーから得たアドレスがかみ合います。"),+ ("出口をすべて調べる。", "そのポートから IP の散らばった 7 台のサーバーに同時に問い合わせ、出口の数だけアドレスを得ます。DNS 汚染されたアドレスは先に除外します。"),+ ("すべて相手に伝える。", "相手はひとつずつ試し、実際の出口と合うものがつながります。"),+ ("見た出口を覚えておく。", "ポートを書き換えない出口を取りこぼしたときは、「出口の IP +ローカルポート」で補います。"),+ ("どちらが先に送るかを決める。", "相手のパケットが先に届くとポートをふさいでしまうルーターがあります。片方が先にアドレスを公開し、もう片方はそこへ送ってから自分のアドレスを公開します。再試行では順番を入れ替えます。"),+ ("まず中継、あとで直接。", "最初のハンドシェイクが中継になったら、アイドル時にもう一度穴あけを試み、成功すれば直接接続に切り替えます。"),+ ],+ "lab_h3": "実際のネットワーク構成で検証",+ "lab_intro": "NAT 穴あけ実験室では、Linux のネットワーク名前空間と iptables でこれらの構成を組み、CopySync の本物の接続コードをそれぞれで動かします。コミットのたびに自動で実行されます。",+ "lab_cols": ["構成", "結果"],+ "lab_rows": [+ ("出口ひとつ ↔ 家庭用ルーター", "直接"),+ ("出口ふたつ、旧バージョン(対照)", "中継"),+ ("出口ふたつ ↔ 家庭用ルーター", "直接"),+ ("出口よっつ ↔ 家庭用ルーター", "直接"),+ ("出口ふたつ、2 本目を取りこぼし、履歴なし", "中継"),+ ("出口ふたつ、2 本目を取りこぼし、履歴あり", "直接"),+ ("出口ふたつ ↔ 出口ふたつ", "直接"),+ ("出口ふたつ ↔ ポートをランダムに割り当てる NAT", "中継"),+ ("最初はつながらず、あとでネットワークが回復", "中継のあと直接"),+ ("会社のルーターが外からのパケットでポートをふさぐ", "直接"),+ ("家庭用ルーターが外からのパケットでポートをふさぐ", "中継のあと、1 回の再試行で直接"),+ ],+ "uplink_measured": "実測:出口が 4 つある会社の Mac と自宅の Mac は、以前は中継しかできず、サーバーの帯域で 0.6 MB/s に抑えられていました。"+ "いまは直接つながり、サーバーに接続してから約 3 秒で確立します。",+ "uplink_doc": '測定の過程、設計の判断、ハマった点は<a href="{doc}">技術資料</a>(中国語)にまとめています。',++ "security_h2": "サーバーにはコピーした内容が見えない",+ "security_points": [+ ("サーバーはアカウントも内容も保存しない。", "デバイスの身元は Ed25519 の鍵で、デバイス ID は公開鍵から計算されます。サーバーはユーザー表なしで身元を確かめられます。"),+ ("ペアリングでは指紋をあなたが照合する。", "両方の画面に同じ 2 行、つまりお互いの公開鍵の指紋が表示されます。サーバーは転送中の公開鍵をすり替えられますが、すり替えれば 2 つの画面が一致しなくなります。この照合が中間者攻撃を防ぐ関門です。"),+ ("その後のメッセージはすべて署名付き。", "サーバーがあなたのデバイスになりすますことはできません。直接接続の証明書もハンドシェイク後にもう一度照合し、食い違えばすぐ切断します。"),+ ("中継も暗号文を転送するだけ。", "TURN が運ぶのは暗号化済みのパケットです。中継用の認証情報はデバイスごとに発行され、12 時間で失効します。"),+ ],+ "verify_alt": "ペアリング時の「セキュリティ指紋を確認」ダイアログ。R8NF-2WTC-QL5J が表示され、もう一台の表示と完全に一致するか確かめるよう求めている",++ "fallback_h2": "うまくいかないときに起きること",+ "fallback_intro": "ネットワークの事情は人それぞれです。ここに挙げたケースはどれも想定済みで、テストがあります。",+ "fallbacks": [+ ("2 台が直接つながらない", "対称型 NAT や会社のファイアウォールでよく起きます。自動であなたのサーバーの TURN 中継に切り替わり、内容は暗号化されたまま。デバイス一覧には「中継」と表示されます。"),+ ("公開 STUN サーバーにつながらない", "中国本土などでは公開 STUN が不安定です。サーバーは STUN を内蔵していて、クライアントはそちらを優先します。"),+ ("先に中継でつながった", "中継のハンドシェイクは速く、直接接続より先に決まることがあります。接続後、接続を始めた側がアイドル時にもう一度穴あけを試み、成功すれば直接接続に切り替えます。転送中は邪魔しません。"),+ ("相手がスリープ、切断、再起動した", "黙って切れた接続にも気づき、すぐに閉じて再接続します。そのあいだにコピーしたものは記録しておき、つながったら相手の履歴に追加します。相手のいまのクリップボードは上書きしません。"),+ ("サーバーとの接続が切れた", "自動で再接続します。間隔は 1 秒から倍々で最大 30 秒、ランダムな揺らぎ付きで、たくさんのデバイスが一斉に再接続しないようにしています。接続状態はアプリにリアルタイムで表示されます。"),+ ("ファイルが大きすぎる", "上限を超えるものは記録だけを同期し、必要なときに取り込みます。そのとき元のファイルが消えていれば、あいまいな失敗ではなく、はっきりそう伝えます。"),+ ("プレーンテキストしか受け付けない場所に貼り付ける", "Web からコピーした書式付きテキストは HTML とプレーンテキストの両方で書き込むので、どこに貼り付けてもタグが混ざりません。"),+ ("Windows では使えないファイル名", "Mac では使えるコロンや疑問符などは、対応する全角文字に置き換えて受け取るので、名前はそのまま読めます。大文字と小文字だけが違う 2 つのファイルが上書きし合うこともありません。"),+ ("パスワードをコピーした", "Windows ではパスワードマネージャーがコピーした内容に「記録しない」印が付きます。CopySync はそれを見て飛ばします。同期も履歴への保存もしません。"),+ ("クリップボードの読み取りをまだ許可していない", "内容は読みに行きません。読みに行くと、バックグラウンドプロセスが見えないダイアログで止まってしまうからです。アプリが許可を促し、設定へ直接飛べるボタンを出します。"),+ ("バックグラウンドサービスが落ちた", "Mac ではシステムの launchd が、Windows では CopySync 自身の監視プロセスが再起動します。10 秒に 1 回までに抑え、暴走はしません。"),+ ("アプリを更新した、または移動した", "アプリを開いたときにログイン項目を正しい場所に向け直し、バックグラウンドサービスを新しいバージョンで再起動します。"),+ ],++ "install_h2": "インストール",+ "install_intro": "それぞれのコンピューターにアプリを入れ、両方からアクセスできるサーバーを 1 台用意します。2 台が同じ LAN にあるなら、サーバーはどちらかの Mac で動かせば十分です。",+ "mac_steps": [+ "CopySync.dmg をダウンロードして開き、CopySync を「アプリケーション」にドラッグします。",+ "「アプリケーション」から開きます。<span class=\"aside\">初回は「開発元を検証できません」と表示されます。CopySync はまだ Apple の公証を受けていないためです。"+ "「システム設定 → プライバシーとセキュリティ」を開き、ページ下部の「このまま開く」をクリックします。必要なのは一度だけです。</span>",+ "「バックグラウンド同期を有効にする」をクリックし、「設定」でサーバーのアドレス <code>ws://サーバーアドレス:8787/signal</code> を入力して Return を押します。",+ "クリップボードの読み取りを許可するか聞かれたら、許可します。",+ ],+ "win_steps": [+ "CopySync-Setup.exe を実行します。現在のユーザーのフォルダにインストールされ、管理者権限は要りません。"+ "<span class=\"aside\">CopySync はまだコード署名されていないため、「Windows によって PC が保護されました」と表示されます。「詳細情報」を押してから「実行」を押してください。"+ f"インストーラーを使いたくない場合は<a href=\"{REPO}/releases/latest/download/CopySync-windows-x64.zip\">ポータブル版</a>もあります。</span>",+ "CopySync を開き、「バックグラウンド同期を有効にする」をクリックします。ウィンドウを閉じても、画面右下の通知領域で動き続けます。",+ "「設定」でサーバーのアドレスを入力して Enter を押します。ファイアウォールに聞かれたら許可します。",+ ],+ "server_h3": "サーバー",+ "server_intro": "Linux なら何でも可、root 権限が必要です。ARM の場合は <code>amd64</code> を <code>arm64</code> に置き換えます。",+ "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>(英語)をご覧ください。',+ "pairing": "<strong>ペアリング:</strong>一台で「デバイス → デバイスを追加」を開いて 6 桁のコードを表示し、もう一台で入力します。"+ "両方の画面に同じ 2 行の指紋が表示されたら確定します。Mac と Windows、Windows 同士でも同じ手順です。",++ "specs_h2": "仕様",+ "specs": [+ ("バージョン", '1.3.0(<time datetime="2026-10-09">2026 年 10 月 9 日</time>公開)'),+ ("Mac アプリ", "macOS 13 Ventura 以降。Intel と Apple シリコンのユニバーサルバイナリで Rosetta 不要。ダウンロードは約 45 MB"),+ ("Windows アプリ", "Windows 10(21H2 以降)と Windows 11、x64。ユーザーごとのインストールで管理者権限不要。ダウンロードは約 21 MB"),+ ("サーバー", "Linux(x86_64 または ARM64、systemd または Docker)、macOS でも動作。メモリは約 15 MB"),+ ("表示言語", "日本語、英語、簡体字中国語。初期設定はシステムに合わせ、「設定」で切り替え可能"),+ ("同期する内容", "プレーンテキスト、書式付きテキスト、画像とスクリーンショット、ファイル、フォルダ。種類ごとにオフにできる"),+ ("転送", "WebRTC データチャネル。直接接続を優先し、つながらなければ TURN で中継。複数の出口があるネットワークでは出口ごとに調査。ファイルは tar + zstd でストリーム転送"),+ ("暗号化と身元", "DTLS によるエンドツーエンド暗号化。デバイスの身元は Ed25519 の鍵。シグナリングのメッセージはすべて署名付き"),+ ("ペアリング", "5 分間有効な 6 桁のコード。0/O や 1/I のような紛らわしい文字は使わない。指紋は人が照合"),+ ("自動同期の上限", "初期値 50 MB、1 MB〜1 GB で調整可能"),+ ("履歴の保存期間", "初期値 3 日、1 時間〜30 日で調整可能。期限が来たら自動で削除"),+ ("実測の速度", "LAN の直接接続で 20 MB のファイルを約 330 ミリ秒で転送、チェックサム一致"),+ ("技術スタック", "バックグラウンドサービスとサーバーは Go(Windows では Go から Win32 を直接呼び出し)、アプリは Flutter(Mac と Windows で同じコード)、メッセージ定義は Protocol Buffers"),+ ("ライセンス", f'GNU AGPL-3.0。クローズドソースでの利用などには<a href="{REPO}/blob/main/LICENSING.md">商用ライセンス</a>を用意'),+ ],++ "faq_h2": "よくある質問",+ "faq": [+ ("macOS のユニバーサルクリップボードとの違いは?", [+ "ユニバーサルクリップボードは、両方のデバイスが同じ Apple ID でサインインし、Bluetooth と Wi‑Fi をオンにして近くにある必要があり、Apple 製品どうしでしか使えません。"+ "CopySync に必要なのは、両方のコンピューターがあなたのサーバーにつながることだけです。Apple ID が別でも、自宅と会社に離れていても、Mac と Windows の組み合わせでも使えます。"+ "さらに履歴があり、大きなファイルは必要なときに取り込めます。",+ "2 台の Mac が同じ Apple ID でいつも並んでいて、主にテキストをコピーするだけなら、標準機能で十分です。",+ ]),+ ("サーバーにコピーした内容は見えますか?", [+ "見えません。直接接続のときデータはサーバーを通りません。中継が必要なときも、サーバーが転送するのは DTLS で暗号化されたパケットです。"+ "サーバーはアカウントもコピーした内容も保存しません。コードは公開されているので、ご自身で確かめられます。",+ ]),+ ("出口が複数ある会社のネットワークでも直接つながりますか?", [+ "つながります。こうしたネットワークは宛先ごとに出口を選びます。CopySync はひとつのポートから複数のサーバーに問い合わせて出口ごとのアドレスを集め、すべて相手に送り、相手がひとつずつ試します。"+ "テストでは、出口が 4 つある会社の Mac と家庭の回線が直接つながりました。相手がポートをランダムに割り当てる NAT の場合は中継になります。",+ ]),+ ("サーバーは自分で用意する必要がありますか?", [+ "はい。CopySync は公開サーバーを提供しません。だから誰のデータも他人のマシンを通りません。2 台が同じ LAN にあるならどちらかの Mac でサーバーを動かせば十分で、"+ "ネットワークをまたぐ場合はグローバル IP を持つサーバーが 1 台必要です。最小構成のクラウドサーバーで足ります。",+ ]),+ ("Windows に対応していますか?iPhone は?", [+ "Windows 10 と Windows 11(x64)に対応し、Mac と相互に使えます。Windows で貼り付けたファイルは本物のファイルなので、エクスプローラーや Office にそのまま貼り付けられます。",+ "iPhone と iPad には対応していません。iOS ではアプリがバックグラウンドでクリップボードを監視できないため、コピーしてすぐ同期することができないからです。",+ ]),+ ("初めて開くときにシステムに止められるのはなぜ?", [+ "CopySync はまだ Apple の公証を受けておらず、Windows 版もコード署名していません。どちらも毎年費用のかかる証明書が必要です。",+ "Mac では「システム設定 → プライバシーとセキュリティ」でページ下部の「このまま開く」をクリック、Windows では「Windows によって PC が保護されました」で「詳細情報」から「実行」を押してください。どちらも一度だけで済みます。",+ ]),+ ("大きなファイルはどうなりますか?", [+ "初期設定では 50 MB までのものはコピーした時点でもう一台に送られ、そのまま貼り付けられます。それより大きいファイルは記録だけを同期し、必要なときに履歴から「このデバイスに取り込む」で転送します。上限は「設定」で変えられます。",+ ]),+ ("無料ですか?会社で使えますか?", [+ "無料です。CopySync は GNU AGPL-3.0 のオープンソースで、個人も会社も無料で使い、改変できます。配布する場合や、改変したものをネットワーク越しに提供する場合は、同じライセンスでソースコードを公開する必要があります。",+ f'クローズドソースの製品に組み込む、改変を公開したくない、ホスティングサービスとして運用する、といった場合は<a href="{REPO}/blob/main/LICENSING.md">商用ライセンス</a>をご利用ください。',+ ]),+ ],++ "closing": "2 台のコンピューター、<br>ひとつのクリップボード。",+ "source": "GitHub でソースコードを見る",+ "footer_license": "CopySync は GNU AGPL-3.0 のオープンソースです。商用ライセンスもあります。",+ "footer_label": "フッターのリンク",+ "footer_links": [+ ("すべてのリリース", f"{REPO}/releases"),+ ("更新履歴", f"{REPO}/blob/main/CHANGELOG.md"),+ ("技術資料(中国語)", f"{SITE}design/nat-traversal.html"),+ ("商用ライセンス", f"{REPO}/blob/main/LICENSING.md"),+ ("問題を報告", f"{REPO}/issues"),+ ],++ "ld_description": "Mac と Windows のコンピューター間でクリップボードとファイルを同期するオープンソースのアプリ。テキスト、画像、ファイル、フォルダを一台でコピーし、もう一台で貼り付けられる。"+ "デバイス間は WebRTC で直接つながり DTLS でエンドツーエンド暗号化、つながらないときはユーザーが用意したサーバーの TURN で中継する。",+ "ld_os": "macOS 13 以降(Intel と Apple シリコン)、Windows 10、Windows 11(x64)",+ "ld_currency": "JPY",+ "ld_features": [+ "プレーンテキスト、書式付きテキスト、画像、ファイル、フォルダを同期",+ "Mac と Windows のあいだで、アカウントやネットワークをまたいで使える",+ "WebRTC の直接接続、つながらないときは自動で TURN 中継",+ "DTLS のエンドツーエンド暗号化、ペアリング時に指紋を人が照合",+ "50 MB まではコピーと同時に送信、それより大きいファイルは必要なときに取り込み",+ "直近 3 日分の履歴、画像のプレビュー",+ "表示言語は日本語、英語、簡体字中国語",+ ],+}diff --git a/tools/site/content/zh.py b/tools/site/content/zh.pynew file mode 100644index 0000000..1d84be0--- /dev/null+++ b/tools/site/content/zh.py@@ -0,0 +1,246 @@+"""官网文案:简体中文。结构见 tools/site/build.py,三种语言的键必须一致。"""++REPO = "https://github.com/baiyuze/copysync"+SITE = "https://baiyuze.github.io/copysync/"++C = {+ "title": "CopySync:在 Mac 与 Windows 之间同步剪贴板与文件,跨账号跨网络",+ "description": "CopySync 让你在一台电脑上复制,另一台上直接粘贴,Mac 与 Windows 互通。支持文本、图片、文件和文件夹,"+ "不要求同一个账号,跨网络可用。设备间 P2P 直连、端到端加密,服务器自己部署且看不到内容。免费开源。",+ "og_title": "CopySync:在这台电脑复制,到那台电脑粘贴",+ "og_description": "Mac 与 Windows 互通。文本、图片、文件、文件夹,跨账号、跨网络,P2P 直连、端到端加密,服务器自己部署。免费开源。",+ "og_image": "og.png",+ "skip": "跳到正文",+ "home_label": "CopySync 首页",+ "nav_label": "页面导航",+ "nav_how": "工作原理",+ "nav_install": "安装",+ "nav_faq": "常见问题",+ "lang_label": "语言",++ "h1": "在这台电脑复制,<br>到那台电脑粘贴。",+ "lede": "Mac 与 Windows 互通。文本、图片、文件、整个文件夹都可以,不要求同一个账号,也不要求在同一个网络。"+ "数据在你的设备之间直接传输,经过你自己的服务器时也是加密的。",+ "dl_mac": "下载 Mac 版",+ "dl_win": "下载 Windows 版",+ "dl_note": "版本 1.3.0,免费开源。macOS 13 及以上,Intel 与 Apple 芯片通用;Windows 10、11。",+ "stage_label": "演示:在 MacBook 上按下 Command C,文件化作一张纸,经直连飞到 Windows 笔记本,在那里按下 Ctrl V 粘贴出来",+ "stage_file": "季度汇报-终版.pptx",+ "stage_win": "Windows 笔记本",+ "stage_arc": "直连,端到端加密",+ "replay": "再演示一次",++ "history_h2": "所有设备上复制过的,都在这里",+ "history_intro": "复制记录保留最近 3 天的内容,随时可以放回剪贴板,图片点开就能预览。"+ "50 MB 以内的文件在你复制的时候就已经传好了,更大的文件需要时点一下再拉取。",+ "history_alt": "CopySync 的复制记录:来自 MacBook Air 和 Mac mini 的文件、图片、文字,大文件显示「拉取到本机」按钮",++ "flow_h2": "按下复制之后",+ "flow_intro": "文字、图片、文件、整个文件夹,都走同一条路。",+ "flow": [+ ("察觉", "Mac 上,后台服务每隔一小段时间看一眼剪贴板的变更计数,只看计数和类型,不需要授权,也不会弹出系统提示;"+ "Windows 上,复制的那一刻系统就会通知它。"),+ ("传输", "文本随消息一起发出;50 MB 以内的图片和文件打包成流立即推送;更大的文件只发一条记录,等你需要时再传。"),+ ("粘贴", "另一台电脑先把内容存到本地,再写入剪贴板。按下 ⌘V 或 Ctrl+V 粘贴出来的,就是本地的真实文件。"),+ ],++ "why_h2": "为什么不用现有的办法",+ "why_intro": "通用剪贴板要同一个 Apple ID、离得够近;隔空投送每次都要点接收;发给自己要手动下载,文件还留在别人的服务器上。"+ "一台 Mac 一台 Windows 时,系统自带的办法一个都用不了。",+ "compare_caption": "CopySync 与其他方式的对比",+ "compare_cols": ["CopySync", "通用剪贴板", "隔空投送", "聊天软件"],+ "compare_rows": [+ ("不同 Apple ID 之间", [("yes", "可以"), ("no", "不行"), ("partial", "要对方接收"), ("yes", "可以")]),+ ("Mac 与 Windows 之间", [("yes", "可以"), ("no", "不行"), ("no", "不行"), ("yes", "可以")]),+ ("不在同一个网络(家里和公司)", [("yes", "可以"), ("no", "不行"), ("no", "不行"), ("yes", "可以")]),+ ("复制后直接粘贴,不用点接收", [("yes", "可以"), ("yes", "可以"), ("no", "不行"), ("no", "不行")]),+ ("文件与整个文件夹", [("yes", "可以"), ("partial", "不稳定"), ("yes", "可以"), ("partial", "要先打包")]),+ ("找回之前复制过的内容", [("yes", "可以"), ("no", "不行"), ("no", "不行"), ("partial", "翻聊天记录")]),+ ("内容不经过第三方服务器", [("yes", "不经过"), ("yes", "不经过"), ("yes", "不经过"), ("no", "经过")]),+ ],++ "how_h2": "工作原理",+ "how_intro": "两台电脑之间直接建立加密连接。你的服务器只负责让它们找到彼此,打不通直连的时候再帮忙转发。",+ "diagram": {+ "title": "CopySync 的连接方式",+ "desc": "电脑 A 与电脑 B(Mac 或 Windows)之间是 WebRTC 直连;两台电脑都通过信令连接到你的服务器;直连失败时,数据经服务器的 TURN 中转。",+ "server": "你的服务器",+ "server_sub": "信令、STUN、TURN 中转",+ "sig_note": "信令:交换连接信息",+ "relay_note": "中转:仅在打不通直连时",+ "copy_here": "在这里复制",+ "other": "Mac 或 Windows",+ "paste_here": "在这里粘贴",+ "direct": "WebRTC 直连,DTLS 加密",+ "direct_note": "数据只在两台电脑之间传输",+ "legend_direct": "数据(直连)",+ "legend_relay": "数据(中转,备用)",+ "legend_sig": "信令",+ },++ "uplink_h2": "公司网络也能直连",+ "uplink_intro": "公司双线、运营商地址池这类网络有多个出口,按目标地址选走哪一个。只探测一次只会知道其中一个出口,"+ "只能经服务器中转。CopySync 会探测每个出口,把地址都告诉对端。",+ "uplink_changed": "做了什么",+ "uplink_points": [+ ("共用一个端口。", "所有连接从同一个本地 UDP 端口收发,向不同服务器问到的地址才对得上。"),+ ("探测每个出口。", "在这个端口上同时询问 7 台 IP 分散的服务器,网络有几个出口就拿到几个地址;被 DNS 污染的地址先过滤掉。"),+ ("全部告诉对端。", "对端逐个尝试,与实际出口吻合的那一个能打通。"),+ ("记住见过的出口。", "某次漏掉的出口如果不改端口,就用「出口 IP + 本地端口」推算补上。"),+ ("定好谁先发包。", "有的路由器收到对方先到的包会占住端口。一方先公布出口地址,另一方先往那边发包再公布自己的;重试时两种顺序轮流用。"),+ ("先中转,再换直连。", "第一次握手落到了中转时,空闲时再打一次洞,打通就换成直连。"),+ ],+ "lab_h3": "用真实的网络拓扑验证",+ "lab_intro": "NAT 打洞实验室用 Linux 网络命名空间与 iptables 搭出这些拓扑,用 CopySync 真实的连接代码各跑一遍,每次提交代码都自动运行。",+ "lab_cols": ["场景", "结果"],+ "lab_rows": [+ ("单出口 ↔ 家用路由器", "直连"),+ ("两个出口,旧版本(对照)", "中转"),+ ("两个出口 ↔ 家用路由器", "直连"),+ ("四个出口 ↔ 家用路由器", "直连"),+ ("两个出口,第二条没探测到,没有历史", "中转"),+ ("两个出口,第二条没探测到,有历史", "直连"),+ ("两个出口 ↔ 两个出口", "直连"),+ ("两个出口 ↔ 端口随机分配的 NAT", "中转"),+ ("一开始打不通,之后网络恢复", "先中转,随后直连"),+ ("公司路由器会为外来的包占住端口", "直连"),+ ("家用路由器会为外来的包占住端口", "先中转,重试一次后直连"),+ ],+ "uplink_measured": "实测:一台在 4 个出口的公司网络里的 Mac 与家里的 Mac,改造前只能中转,速度被服务器带宽限制在 0.6 MB/s;"+ "改造后直连,连上服务器后约 3 秒建立。",+ "uplink_doc": '测量过程、设计取舍与踩过的坑见<a href="{doc}">技术方案</a>。',++ "security_h2": "服务器看不到你复制了什么",+ "security_points": [+ ("服务器不存账号,也不存内容。", "设备身份是一把 Ed25519 密钥,设备 ID 由公钥算出,服务器不需要用户表就能验证身份。"),+ ("配对时由你核对安全指纹。", "两块屏幕会显示同样的两行:双方各自公钥的指纹。服务器有能力替换转发中的公钥,但替换之后两块屏幕就对不上了,这一步就是防中间人的闸门。"),+ ("之后的每条消息都带签名,", "服务器无法冒充你的设备。直连通道的证书在握手后还会再核对一次,不一致立即断开。"),+ ("中转也只是转发密文。", "TURN 转发的是加密后的数据包,中转凭证按设备单独签发,12 小时后过期。"),+ ],+ "verify_alt": "配对时的「核对安全指纹」对话框,显示 R8NF-2WTC-QL5J,要求与另一台电脑上显示的完全一致",++ "fallback_h2": "出问题的时候会发生什么",+ "fallback_intro": "每个人的网络环境都不一样。下面这些情况都考虑过,也都有对应的测试。",+ "fallbacks": [+ ("两台电脑打不通直连", "常见于对称 NAT 和公司防火墙。自动改走你服务器上的 TURN 中转,内容依然加密,设备列表里显示「中转」。"),+ ("公共 STUN 服务器连不上", "国内访问公共 STUN 时通时断。服务器自带 STUN,客户端优先用它。"),+ ("先连上了中转", "中转握手快,有时会抢在直连之前。连上之后,发起连接的一方会在空闲时再打一次洞,打通就换成直连;正在传文件时不打扰。"),+ ("对方睡眠、断网或重启", "连接悄悄断了也能发现,立即关闭重连。这期间复制的内容会记下来,连上后补发到对方的复制记录里,但不会覆盖对方此刻剪贴板里的内容。"),+ ("服务器断开", "自动重连,间隔从 1 秒开始翻倍、最长 30 秒,并带随机抖动,避免一群设备同时重连。界面实时显示连接状态。"),+ ("文件太大", "超过上限的只同步一条记录,需要时再拉取。拉取时源文件已经被删,会明确告诉你,而不是不明不白地失败。"),+ ("粘贴到只认纯文本的地方", "从网页复制的带格式文字会同时写入 HTML 和纯文本两份,粘贴到哪里都不会冒出标签。"),+ ("文件名在 Windows 上不合法", "Mac 上可以用的冒号、问号等字符,收到时换成对应的全角字符,名字照样看得懂;只差大小写的两个文件也不会互相覆盖。"),+ ("复制的是密码", "Windows 上,密码管理器复制的内容会带一个「不要记录」的标记,CopySync 看到就跳过:不同步,也不进复制记录。"),+ ("还没授权读取剪贴板", "不去读内容,否则后台进程会卡在一个看不见的系统弹窗上。App 里会提示你去授权,并给出直达按钮。"),+ ("后台服务崩溃", "Mac 上由系统的 launchd、Windows 上由 CopySync 自带的守护进程自动拉起,10 秒节流,不会疯狂重启。"),+ ("更新了 App,或者把它挪了位置", "打开 App 时会自动校正登录项,并把后台服务重启到新版本。"),+ ],++ "install_h2": "安装",+ "install_intro": "每台电脑装一个 App,再准备一台两边都能访问到的服务器。两台电脑在同一个局域网的话,服务器直接跑在其中一台 Mac 上就行。",+ "mac_steps": [+ "下载 CopySync.dmg,打开后把 CopySync 拖进「应用程序」。",+ "从「应用程序」里打开。<span class=\"aside\">第一次会提示「无法验证开发者」:CopySync 还没有经过 Apple 公证。"+ "到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」,只需要这一次。</span>",+ "点「启用后台同步」,在「设置」里填入服务器地址 <code>ws://服务器地址:8787/signal</code>,按回车。",+ "系统询问是否允许读取剪贴板时,选择允许。",+ ],+ "win_steps": [+ "运行 CopySync-Setup.exe。装在当前用户目录下,不需要管理员权限。"+ "<span class=\"aside\">CopySync 还没有代码签名,Windows 会提示「Windows 已保护你的电脑」:点「更多信息」,再点「仍要运行」。"+ f"不想运行安装程序的话,可以下载<a href=\"{REPO}/releases/latest/download/CopySync-windows-x64.zip\">便携版</a>。</span>",+ "打开 CopySync,点「启用后台同步」。关掉窗口后它在右下角的托盘里继续运行。",+ "在「设置」里填入服务器地址,按回车。防火墙询问时选择允许。",+ ],+ "server_h3": "服务器",+ "server_intro": "任意 Linux,需要 root。ARM 服务器把 <code>amd64</code> 换成 <code>arm64</code>。",+ "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>。',+ "pairing": "<strong>配对:</strong>一台点「设备 → 添加设备」生成 6 位配对码,另一台输入它;两块屏幕上的两行安全指纹完全一致后确认。"+ "Mac 与 Windows 之间、两台 Windows 之间都一样。",++ "specs_h2": "技术规格",+ "specs": [+ ("版本", '1.3.0,<time datetime="2026-10-09">2026 年 10 月 9 日</time>发布'),+ ("Mac 客户端", "macOS 13 Ventura 及以上;Intel 与 Apple 芯片通用,不需要 Rosetta;安装包约 45 MB"),+ ("Windows 客户端", "Windows 10(21H2 及以上)与 Windows 11,x64;按用户安装,不需要管理员权限;安装包约 21 MB"),+ ("服务器", "Linux x86_64 或 ARM64(systemd 或 Docker),也可以运行在 macOS 上;约 15 MB 内存"),+ ("界面语言", "简体中文、English、日本語,默认跟随系统,可在设置里切换"),+ ("同步的内容", "纯文本、带格式的文本、图片与截图、文件、文件夹,可以按类型关闭"),+ ("传输", "WebRTC 数据通道,直连优先,打不通时经 TURN 中转;多出口网络逐个探测每个出口;文件以 tar + zstd 流式打包"),+ ("加密与身份", "DTLS 端到端加密;设备身份为 Ed25519 密钥;信令消息逐条签名"),+ ("配对", "6 位配对码,5 分钟内有效,字符集去掉了 0/O、1/I 等易混字符;配对时人工核对安全指纹"),+ ("自动同步上限", "默认 50 MB,可在 1 MB 到 1 GB 之间调整"),+ ("记录保留", "默认 3 天,可在 1 小时到 30 天之间调整,到期自动清理"),+ ("实测速度", "局域网直连传输 20 MB 文件约 330 毫秒,校验和一致"),+ ("技术栈", "后台服务与服务器用 Go(Windows 上纯 Go 调用 Win32),界面用 Flutter(Mac 与 Windows 共用一套代码),消息定义用 Protocol Buffers"),+ ("许可", f'GNU AGPL-3.0;闭源产品等情况可购买<a href="{REPO}/blob/main/LICENSING.md">商业授权</a>'),+ ],++ "faq_h2": "常见问题",+ "faq": [+ ("和 macOS 自带的「通用剪贴板」有什么区别?", [+ "通用剪贴板要求两台设备登录同一个 Apple ID、开着蓝牙和 Wi‑Fi,并且离得近,也只能在苹果设备之间用。"+ "CopySync 只要求两台电脑都能连上你部署的服务器:不同 Apple ID、一台在家一台在公司、一台 Mac 一台 Windows,都可以。"+ "另外它有复制记录,大文件也可以按需拉取。",+ "如果你的两台 Mac 是同一个 Apple ID、总在一起、主要复制文字,系统自带的已经够用了。",+ ]),+ ("服务器会看到我复制的内容吗?", [+ "不会。直连时数据根本不经过服务器;需要中转时,服务器转发的是 DTLS 加密后的数据包。服务器不存账号,也不存任何复制内容。代码是开源的,可以自己核对。",+ ]),+ ("公司网络(双线、多出口)能直连吗?", [+ "能。这类网络按目标地址选出口,CopySync 会在同一个端口上向多台服务器探测,拿到每个出口的地址一并发给对端,对端逐个尝试。"+ "实测公司 4 个出口与家用宽带之间可以直连。对端是端口随机分配的 NAT 时仍会走中转。",+ ]),+ ("必须自己准备服务器吗?", [+ "是的,CopySync 不提供公共服务器,这样就不会有任何人的数据经过别人的机器。两台电脑在同一个局域网时,在其中一台 Mac 上运行服务器即可;"+ "跨网络使用需要一台有公网 IP 的服务器,最低配置的云主机就够。",+ ]),+ ("支持 Windows 吗?iPhone 呢?", [+ "支持 Windows 10 与 Windows 11(x64),与 Mac 互通。复制的文件在 Windows 上粘贴出来就是真实文件,能直接粘进资源管理器、微信、Office。",+ "iPhone 和 iPad 暂不支持:iOS 不允许 App 在后台监听剪贴板,做不到复制后立即同步。",+ ]),+ ("为什么第一次打开时系统会拦一下?", [+ "CopySync 还没有经过 Apple 公证,Windows 版也还没有代码签名,两者都需要每年付费的证书。",+ "Mac 上到「系统设置 → 隐私与安全性」,点页面下方的「仍要打开」;Windows 上在「Windows 已保护你的电脑」提示里点「更多信息」,再点「仍要运行」。都只需要这一次。",+ ]),+ ("大文件怎么处理?", [+ "默认 50 MB 以内的内容在你复制时就推送到另一台电脑,那边可以直接粘贴;更大的文件只同步一条记录,需要时在复制记录里点「拉取到本机」再传。上限可以在设置里调整。",+ ]),+ ("免费吗?公司能用吗?", [+ "免费。CopySync 以 GNU AGPL-3.0 开源,个人和公司都可以免费使用和修改。分发它、或通过网络提供修改过的版本时,需要以同样的许可公开源码。",+ f'要放进闭源产品、修改后不想公开、或者作为托管服务运营,可以购买<a href="{REPO}/blob/main/LICENSING.md">商业授权</a>。',+ ]),+ ],++ "closing": "两台电脑,一个剪贴板。",+ "source": "在 GitHub 上查看源码",+ "footer_license": "CopySync 以 GNU AGPL-3.0 开源,另提供商业授权。",+ "footer_label": "页脚链接",+ "footer_links": [+ ("所有版本", f"{REPO}/releases"),+ ("更新记录", f"{REPO}/blob/main/CHANGELOG.md"),+ ("技术方案", f"{SITE}design/nat-traversal.html"),+ ("商业授权", f"{REPO}/blob/main/LICENSING.md"),+ ("反馈问题", f"{REPO}/issues"),+ ],++ "ld_description": "在 Mac 与 Windows 电脑之间同步剪贴板与文件的开源工具。复制文本、图片、文件或文件夹后,另一台电脑可直接粘贴。"+ "设备间 WebRTC 直连、DTLS 端到端加密,打不通时经用户自建服务器的 TURN 中转。",+ "ld_os": "macOS 13 及以上(Intel 与 Apple 芯片);Windows 10、Windows 11(x64)",+ "ld_currency": "CNY",+ "ld_features": [+ "同步纯文本、带格式的文本、图片、文件与文件夹",+ "Mac 与 Windows 互通,不要求同一个账号,跨网络可用",+ "WebRTC 直连,打不通时自动经 TURN 中转",+ "DTLS 端到端加密,配对时人工核对安全指纹",+ "50 MB 以内复制即推送,更大的文件按需拉取",+ "最近 3 天的复制记录,图片可以预览",+ "界面支持简体中文、英文、日文",+ ],+}diff --git a/ui/lib/l10n/app_en.arb b/ui/lib/l10n/app_en.arbindex 04c55a8..ea9cad6 100644--- a/ui/lib/l10n/app_en.arb+++ b/ui/lib/l10n/app_en.arb@@ -337,7 +337,7 @@"restarted": "Background service restarted","disableEllipsis": "Turn off…","about": "About",- "aboutDesc": "Open source, MIT License",+ "aboutDesc": "Open source under the AGPL-3.0","homepage": "Website","feedback": "Report a problem","disableTitle": "Turn off background sync?",diff --git a/ui/lib/l10n/app_ja.arb b/ui/lib/l10n/app_ja.arbindex a73403d..f5887da 100644--- a/ui/lib/l10n/app_ja.arb+++ b/ui/lib/l10n/app_ja.arb@@ -161,7 +161,7 @@"restarted": "バックグラウンドサービスを再起動しました","disableEllipsis": "オフにする…","about": "このアプリについて",- "aboutDesc": "オープンソース(MIT ライセンス)",+ "aboutDesc": "オープンソース(AGPL-3.0)","homepage": "ウェブサイト","feedback": "問題を報告","disableTitle": "バックグラウンド同期をオフにしますか?",diff --git a/ui/lib/l10n/app_localizations.dart b/ui/lib/l10n/app_localizations.dartindex 70db96b..d432081 100644--- a/ui/lib/l10n/app_localizations.dart+++ b/ui/lib/l10n/app_localizations.dart@@ -1069,7 +1069,7 @@ abstract class AppLocalizations {/// No description provided for @aboutDesc.////// In en, this message translates to:- /// **'Open source, MIT License'**+ /// **'Open source under the AGPL-3.0'**String get aboutDesc;/// No description provided for @homepage.diff --git a/ui/lib/l10n/app_localizations_en.dart b/ui/lib/l10n/app_localizations_en.dartindex 9841182..ae7120d 100644--- a/ui/lib/l10n/app_localizations_en.dart+++ b/ui/lib/l10n/app_localizations_en.dart@@ -612,7 +612,7 @@ class AppLocalizationsEn extends AppLocalizations {String get about => 'About';@override- String get aboutDesc => 'Open source, MIT License';+ String get aboutDesc => 'Open source under the AGPL-3.0';@overrideString get homepage => 'Website';diff --git a/ui/lib/l10n/app_localizations_ja.dart b/ui/lib/l10n/app_localizations_ja.dartindex 24bf7a2..a1c2ed0 100644--- a/ui/lib/l10n/app_localizations_ja.dart+++ b/ui/lib/l10n/app_localizations_ja.dart@@ -545,7 +545,7 @@ class AppLocalizationsJa extends AppLocalizations {String get about => 'このアプリについて';@override- String get aboutDesc => 'オープンソース(MIT ライセンス)';+ String get aboutDesc => 'オープンソース(AGPL-3.0)';@overrideString get homepage => 'ウェブサイト';diff --git a/ui/lib/l10n/app_localizations_zh.dart b/ui/lib/l10n/app_localizations_zh.dartindex 1505bc6..1810a0a 100644--- a/ui/lib/l10n/app_localizations_zh.dart+++ b/ui/lib/l10n/app_localizations_zh.dart@@ -542,7 +542,7 @@ class AppLocalizationsZh extends AppLocalizations {String get about => '关于';@override- String get aboutDesc => '开源软件,MIT 许可';+ String get aboutDesc => '开源软件,AGPL-3.0 许可';@overrideString get homepage => '项目主页';diff --git a/ui/lib/l10n/app_zh.arb b/ui/lib/l10n/app_zh.arbindex 23d4cad..e0c8be7 100644--- a/ui/lib/l10n/app_zh.arb+++ b/ui/lib/l10n/app_zh.arb@@ -161,7 +161,7 @@"restarted": "后台服务已重新启动","disableEllipsis": "停用…","about": "关于",- "aboutDesc": "开源软件,MIT 许可",+ "aboutDesc": "开源软件,AGPL-3.0 许可","homepage": "项目主页","feedback": "反馈问题","disableTitle": "停用后台同步?",diff --git a/ui/macos/Runner/Configs/AppInfo.xcconfig b/ui/macos/Runner/Configs/AppInfo.xcconfigindex 7d40cc9..d2d4167 100644--- a/ui/macos/Runner/Configs/AppInfo.xcconfig+++ b/ui/macos/Runner/Configs/AppInfo.xcconfig@@ -6,4 +6,4 @@ PRODUCT_NAME = CopySync// 剪贴板授权(TCC)以 bundle identifier 为主体,发布后不要再改PRODUCT_BUNDLE_IDENTIFIER = com.copysync.app-PRODUCT_COPYRIGHT = Copyright © 2026 baiyuze. Released under the MIT License.+PRODUCT_COPYRIGHT = Copyright © 2026 baiyuze. Licensed under the GNU AGPL-3.0.diff --git a/ui/pubspec.yaml b/ui/pubspec.yamlindex 8d63227..5ee88ef 100644--- a/ui/pubspec.yaml+++ b/ui/pubspec.yaml@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html# In Windows, build-name is used as the major, minor, and patch parts# of the product and file versions while build-number is used as the build suffix.-version: 1.2.0+7+version: 1.3.0+8environment:sdk: ^3.12.2diff --git a/ui/tool/l10n/strings.py b/ui/tool/l10n/strings.pyindex 01a455b..9dfec05 100644--- a/ui/tool/l10n/strings.py+++ b/ui/tool/l10n/strings.py@@ -192,7 +192,7 @@ S = [("restarted", "Background service restarted", "后台服务已重新启动", "バックグラウンドサービスを再起動しました"),("disableEllipsis", "Turn off…", "停用…", "オフにする…"),("about", "About", "关于", "このアプリについて"),- ("aboutDesc", "Open source, MIT License", "开源软件,MIT 许可", "オープンソース(MIT ライセンス)"),+ ("aboutDesc", "Open source under the AGPL-3.0", "开源软件,AGPL-3.0 许可", "オープンソース(AGPL-3.0)"),("homepage", "Website", "项目主页", "ウェブサイト"),("feedback", "Report a problem", "反馈问题", "問題を報告"),("disableTitle", "Turn off background sync?", "停用后台同步?", "バックグラウンド同期をオフにしますか?"),diff --git a/ui/tool/screenshots/screenshots_test.dart b/ui/tool/screenshots/screenshots_test.dartindex 8c52389..c1ec75c 100644--- a/ui/tool/screenshots/screenshots_test.dart+++ b/ui/tool/screenshots/screenshots_test.dart@@ -23,10 +23,13 @@ import 'package:flutter/rendering.dart';import 'package:flutter/services.dart';import 'package:flutter_test/flutter_test.dart';-/// 截图的界面语言:zh 或 en,由 render.sh 设置。演示数据里的文件名、文字也跟着换。+/// 截图的界面语言:zh、en 或 ja,由 render.sh 设置。演示数据里的文件名、文字也跟着换。final _lang = Platform.environment['SCREENSHOT_LANG'] ?? 'zh';final _locale = Locale(_lang);-String _t(String zh, String en) => _lang == 'en' ? en : zh;+String _t(String zh, String en, String ja) => switch (_lang) { 'en' => en, 'ja' => ja, _ => zh };++/// 汉字的字形跟着语言走:日文界面用冬青黑体,否则用苹方+final _cjk = _lang == 'ja' ? const ['Hiragino', 'PingFang'] : const ['PingFang'];/// 生成配对码不走后台服务,直接给一个固定值。class _DemoState extends AppState {@@ -48,6 +51,7 @@ Future<void> _loadFonts() async {await family('SF', ['SF-Regular.ttf', 'SF-Medium.ttf', 'SF-Semibold.ttf']);await family('PingFang', ['PingFang-Regular.ttf', 'PingFang-Medium.ttf', 'PingFang-Semibold.ttf']);+ await family('Hiragino', ['Hiragino-Regular.ttf', 'Hiragino-Medium.ttf', 'Hiragino-Semibold.ttf']);await family(monoFamily, ['Menlo-Regular.ttf', 'Menlo-Bold.ttf']);// 图标字体随依赖包打进测试资源,但测试环境不会自动加载final icons = FontLoader('packages/cupertino_icons/CupertinoIcons')@@ -82,7 +86,7 @@ ClipRecord _clip();const _mb = 1024 * 1024;-final _quarterly = _t('季度汇报-终版.key', 'Q3 review - final.key');+final _quarterly = _t('季度汇报-终版.key', 'Q3 review - final.key', '四半期報告_最終版.key');AppState _demo({LinkState link = LinkState.online,ServiceState? service, Device? pending, bool empty = false}) {@@ -136,7 +140,7 @@ AppState _demo({LinkState link = LinkState.online,preview: 'git push origin release/1.0 && gh release create v1.0.0',outgoing: true, size: 54, ago: const Duration(seconds: 4)),_clip('2', ClipKind.CLIP_KIND_IMAGE,- preview: _t('图片 2.4 MB', 'Image 2.4 MB'), size: (2.4 * _mb).round(), ago: const Duration(minutes: 2),+ preview: _t('图片 2.4 MB', 'Image 2.4 MB', '画像 2.4 MB'), size: (2.4 * _mb).round(), ago: const Duration(minutes: 2),items: [ClipItem(name: 'image.png', size: Int64((2.4 * _mb).round()))]),_clip('3', ClipKind.CLIP_KIND_FILE,size: (38.2 * _mb).round(), ago: const Duration(minutes: 9),@@ -144,10 +148,11 @@ AppState _demo({LinkState link = LinkState.online,_clip('4', ClipKind.CLIP_KIND_FILE,size: (1.3 * 1024 * _mb).round(), ago: const Duration(minutes: 14),from: 'Mac mini', status: ClipStatus.CLIP_STATUS_REMOTE_ONLY,- items: [ClipItem(name: _t('发布演示录屏.mov', 'launch-demo.mov'), size: Int64((1.3 * 1024 * _mb).round()))]),+ items: [ClipItem(name: _t('发布演示录屏.mov', 'launch-demo.mov', '発表デモ.mov'), size: Int64((1.3 * 1024 * _mb).round()))]),_clip('5', ClipKind.CLIP_KIND_HTML,preview: _t('会议结论:周二灰度 10%,观察两天没问题周四全量;回滚预案见文档第 3 节',- 'Decision: ship to 10% on Tuesday, everyone on Thursday if two days look clean. Rollback plan in section 3'),+ 'Decision: ship to 10% on Tuesday, everyone on Thursday if two days look clean. Rollback plan in section 3',+ '決定事項:火曜に 10% へ先行公開、2 日問題なければ木曜に全体公開。切り戻し手順は資料の第 3 節'),from: 'Mac mini', size: 2310, ago: const Duration(minutes: 26)),_clip('6', ClipKind.CLIP_KIND_FILE,outgoing: true, size: 126 * _mb, ago: const Duration(minutes: 41),@@ -155,7 +160,7 @@ AppState _demo({LinkState link = LinkState.online,_clip('7', ClipKind.CLIP_KIND_FILE,size: (18.6 * _mb).round(), ago: const Duration(hours: 1),status: ClipStatus.CLIP_STATUS_FETCHING,- items: [ClipItem(name: _t('合同扫描件.pdf', 'signed-contract.pdf'), size: Int64((18.6 * _mb).round()))]),+ items: [ClipItem(name: _t('合同扫描件.pdf', 'signed-contract.pdf', '契約書_署名済み.pdf'), size: Int64((18.6 * _mb).round()))]),_clip('8', ClipKind.CLIP_KIND_TEXT,preview: 'https://github.com/baiyuze/copysync/releases', outgoing: true, size: 44,ago: const Duration(hours: 3)),@@ -167,7 +172,7 @@ AppState _demo({LinkState link = LinkState.online,ClipItem(name: 'IMG_2043.HEIC', size: Int64((1.4 * _mb).round())),]),_clip('10', ClipKind.CLIP_KIND_IMAGE,- preview: _t('图片 864 KB', 'Image 864 KB'), outgoing: true, size: 864 * 1024, ago: const Duration(days: 1),+ preview: _t('图片 864 KB', 'Image 864 KB', '画像 864 KB'), outgoing: true, size: 864 * 1024, ago: const Duration(days: 1),items: [ClipItem(name: 'image.png', size: Int64(864 * 1024))]),],);@@ -212,7 +217,7 @@ Future<void> _render(required bool settle,}) async {- final theme = buildTheme(brightness, fontFamily: 'SF', fontFamilyFallback: const ['PingFang']);+ final theme = buildTheme(brightness, fontFamily: 'SF', fontFamilyFallback: _cjk);await tester.pumpWidget(RepaintBoundary(key: _boundary,child: AppScope(@@ -324,7 +329,7 @@ void main() {state: _demo(),child: MaterialApp(debugShowCheckedModeBanner: false,- theme: buildTheme(brightness, fontFamily: 'SF', fontFamilyFallback: const ['PingFang']),+ theme: buildTheme(brightness, fontFamily: 'SF', fontFamilyFallback: _cjk),locale: _locale,supportedLocales: supportedLocales,localizationsDelegates: AppLocalizations.localizationsDelegates,diff --git a/ui/windows/runner/Runner.rc b/ui/windows/runner/Runner.rcindex 6a39e37..a3008ff 100644--- a/ui/windows/runner/Runner.rc+++ b/ui/windows/runner/Runner.rc@@ -93,7 +93,7 @@ BEGINVALUE "FileDescription", "CopySync" "\0"VALUE "FileVersion", VERSION_AS_STRING "\0"VALUE "InternalName", "CopySync" "\0"- VALUE "LegalCopyright", "Copyright (C) 2026 baiyuze. MIT License." "\0"+ VALUE "LegalCopyright", "Copyright (C) 2026 baiyuze. GNU AGPL-3.0." "\0"VALUE "OriginalFilename", "CopySync.exe" "\0"VALUE "ProductName", "CopySync" "\0"VALUE "ProductVersion", VERSION_AS_STRING "\0"