Skip to content

CubSync 0.2.0

Choose a tag to compare

@huxc573 huxc573 released this 15 Oct 19:08
· 40 commits to main since this release
a1832e9

中文

CubSync 0.2.0 让同步变成一件可以保存、可以重复的事。

能做什么

  • 保存的配置:cubsync config new | list | show | add-pair | export | import,以及 cubsync run <配置>。一个文件夹对的两侧各自独立命名,所以一次运行可以同时覆盖本机的一个目录和两台远端设备。
  • 逐对的后端解析:这是多设备配置能表达出来的原因;指向同一台设备的两个文件夹对共用一条会话。
  • 导入不会覆盖:导入一个 id 已被占用的配置时,它会以新的 id 存下来并明确告诉你,而不是悄悄替换掉现有的那个。

变更

  • 命令行输出只用 ASCII:在非 UTF-8 的控制台里,一个破折号比一个长破折号糟得多。

升级
0.1.0 的配置可以继续用;磁盘格式没有变。


CubSync 0.2.0

Configurations, and a command that runs them.

cubsync config new --name "photos and docs" --direction two-way
cubsync config add-pair <id> --left local --left-root ~/photos \
                             --right nas.local:43817 --right-root /srv/photos
cubsync config add-pair <id> --left local --left-root ~/docs \
                             --right phone.local:43817 --right-root /sdcard/Docs \
                             --filter '*.tmp' --name documents
cubsync config show <id>
cubsync run <id>

Added

  • Saved configurations — config new | list | show | add-pair | export | import
    and run. A configuration is a policy plus a list of folder pairs, and each pair
    names its own two machines, so one run can cover a local folder, one peer and
    another peer at once.
  • A backend per endpoint — the engine resolves every endpoint through a
    resolver instead of holding one fixed pair of backends, which is what makes a
    multi-peer configuration expressible. Two pairs pointing at the same peer share
    one session.

Fixed

  • Importing a configuration whose id was already in use silently replaced the
    existing one. It now saves under a new id and says so.
  • CLI output is plain ASCII. An em dash rendered as mojibake in a console with a
    non-UTF-8 code page is worse than a hyphen.

Verified

A configuration created through the CLI, then run against a real peer process:

engine time 6840 ms for 1 GiB     MD5 MATCH
deletion recycled into .cub_trash
second run: 0 copied, 0 B, 0 deleted
export → import keeps the pairs and their order

211 tests.

Known limitations

  • No GUI, and no Android or desktop build; only the JVM target exists.
  • SyncDirection.CUSTOM is not implemented.
  • No scheduling, so nothing runs unattended yet.
  • One data connection per session; multi-channel aggregation is not implemented.
  • The protocol is unencrypted and unauthenticated. Trusted networks only.