計算機,我曾經喜歡的樣子
Computers as I used to love them
作者:Nikita (@tonsky)
I’ve been struggling with file sync solutions for years. In the beginning, Dropbox was great, but in the last few years, they started to bloat up. I moved to iCloud, but it was even worse. Finally, a few days ago, after iCloud cryptically broke again, I decided it’s time to try something different.
多年來,我一直苦於檔案同步解決方案。起初,Dropbox 很棒,但在過去的幾年中,他們開始膨脹。我轉向了 iCloud,但它甚至更糟。終於,在幾天前 iCloud 再度神秘崩潰後,我覺得是時候該嘗試一些不一樣的東西了。
I tried Syncthing, a free and open-source alternative. And you know what? It’s been liberating. The sanity, the simplicity, the reliability, the features. It brings the joy of use and makes you believe the collapse of civilization can be slowed down a bit.
我試了 Syncthing,一個免費的開源替代品。你知道嗎?這是一種解放。它的理智、簡潔、可靠性和功能都讓人愉悅。它帶來了使用的樂趣,讓你相信文明的崩潰可以減緩一點。
Syncthing is everything I used to love about computers.
Syncthing 是我過去喜歡的計算機的一切。
It’s amazing how great computer products can be when they don’t need to deal with corporate bullshit, don’t have to promote a brand or to sell its users. Frankly, I almost ceased to believe it’s still possible. But it is.
真是令人驚訝——計算機產品在不需要處理公司的廢話、不需要推廣品牌或出售使用者時,它們可以有多好。坦率地說,我幾乎不再相信這仍然是可能的。但是它確實是這樣。
安裝
You download a single binary executable. You run it. There’s no step three.
下載一個二進位制可執行檔案。然後執行。沒有第三步。
No, seriously. It’s so simple I thought I missed something. But no. After you run that binary, you have a fully operational node of Syncthing. It’s ready to sync with any other Syncthing node, no other setup necessary. There’s no installers, no package management (but there are packages if you want to), no registration, no email, no logins, no password creation, no 2FA, no consents, no user agreements. Just download and run. Heck, setting up autostart on Linux server was more complex than just running the app itself!
不,認真地。它簡單到我以為我錯過了什麼,但沒有。在執行該二進位制檔案之後,你就有了一個全面運作的 Syncthing 節點。它已準備好與任何其他 Syncthing 節點同步,無需其他設定。沒有安裝程式,無需包管理(但如果你想的話有包),無需註冊,無需電子郵件,無需登入,無需密碼建立,無需兩步驗證,不用同意條款,沒有使用者協議。只用下載和執行。見鬼,設定在 Linux 伺服器上的自動啟動比執行應用程式本身更復雜!
Homebrew makes it even simpler:
Homebrew 讓這件事甚至更簡單:
Just to give you the perspective, these are all the steps that Dropbox puts you through when you install it on a new computer:
只是為了讓你有個對比,這些是當你在一臺新電腦上安裝 Dropbox 時會經歷的所有步驟:
Aaaaand… that’s not all! You also get this annoying notification to deal with:
還還還還有……這還不是全部!你還會收到這個煩人的通知:
Only at this point can you start using Dropbox. Luckily, I already had an account, otherwise, it would be 5 more steps. Ridiculous!
只有在這個時候你才能開始使用 Dropbox。要是我沒有註冊過賬戶的話,還會有另外的五個步驟。荒謬!
(It goes without saying, that all of these are different windows. It does not happen in a single predictable area, mind you. You have to chase every one of them. And the “Set Up Dropbox” window is always-on-top, so it hides other required steps, which also adds to the fun.)
(不消說,這些都是不同的視窗。提醒你一下,它們不會出現在同一個可預測的區域。你必須追著它們的每一個。而且「設定 Dropbox」視窗總是在最上面,所以它會隱藏其他必需的步驟,這也增添了箇中樂趣。)
沒有人為的限制
Because Synthing is free and doesn’t depend on server-side storage, they don’t need to put weird or unnatural restrictions on you. You can use as much space as you have on disk. You can sync as many folders as you want. You can sync any folder, no matter where it’s located. You can sync with anyone in the world. In fact, you can sync any folder with any number of people. At no point have you to wonder “but will it work with my plan”? If your hardware allows it, it will work. As simple as that.
因為 Syncthing 是免費的,而且不依賴於服務端儲存,所以他們不需要對你施加奇怪或不自然的限制。你可以使用磁碟上的任意空間。你可以同步任意數量的資料夾。你可以同步任何資料夾,無論它們位於何處。你可以與世界上的任何人同步。事實上,你可以將任何資料夾與任何數量的人同步。你不必擔心「但它能與我的套餐一起工作嗎」?如果你的硬體允許,那它就會工作。就這麼簡單。
Folders are the most vivid example of how other cloud storages constantly fuck up the simplest things. Syncthing can sync any folder on your drive, located anywhere. You can sync existing folders. You can sync multiple different folders. Folders are just folders, nothing special about them. Here I’m syncing “system” folders: ~/Desktop
and ~/Library/Fonts
, and three custom ones. No sweat:
資料夾是其他雲端儲存如何不斷搞砸最簡單的事情的最生動的例子。Syncthing 可以同步任何你裝置上的資料夾,不論它們的位置在哪。你可以同步已有的資料夾。你可以同步多個不同的資料夾。資料夾就是資料夾,沒有什麼特別的。這裡我在同步「系統」資料夾:~/Desktop
和 ~/Library/Fonts
,以及三個自定義的資料夾。毫不費力:
This simplicity lets you use it as a tool you can apply, sometimes creatively, to your task, not as a service you have to put up with. For example, by syncing ~/Library/Fonts
, if I install a font on one machine, it automatically installs everywhere.
這種簡潔讓你能將它作為一個有時可以創造性地應用到任務上的工具來為你所用,而非一個不得不忍受的服務。例如,如果同步了 ~/Library/Fonts
,那麼我在一臺電腦上安裝了一個字型,每臺電腦上都會自動安裝這個字型。
Contrast this with Dropbox, which requires you to put everything inside ~/Dropbox
folder. If you keep your projects under ~/work
and want to sync it, well, tough luck. You can’t sync multiple folders either. Well, technically Dropbox can sync anything, of course. Files are files. But branding dictates there MUST be a Dropbox folder somewhere, even if it’s inconvenient for the user.
Dropbox 與之相比,要求你將所有東西都放在 ~/Dropbox
資料夾中。如果你將你的專案放在 ~/work
下並想要同步它,呃,那可就運氣不好了。你也不能同步多個資料夾。當然,從技術上講 Dropbox 可以同步任何東西。檔案就是檔案。但品牌營銷決定了必須有一個 Dropbox 資料夾,即使對使用者來說這是不方便的。
But the worst offender is the iCloud. Same as Dropbox, it also requires you to put all your stuff into a folder. But that folder is called ~/Library/Mobile Documents/com~apple~CloudDocs
!!!
但最糟糕的是 iCloud。和 Dropbox 一樣,它也要求你把所有的東西都放在一個資料夾裡。但是這個資料夾叫做 ~/Library/Mobile Documents/com~apple~CloudDocs
!!!
If you are a programmer, it’s unusable. First, you can’t in your right mind type THAT every time you need to cd
. Second, it contains spaces! Which breaks all sorts of things, believe me or not, even in 2020. I can’t keep Fira Code in iCloud because of python scripts, I can’t keep Jekyll blog like this one there because of Ruby, I can’t run bazel, etc. Useless.
這對於程式設計師來說是用不了的。首先,你不可能在正常的心智狀態下每次需要 cd
時都輸入那個玩意兒。第二,它包含空格!愛信不信,即使是在 2020 年,這也會破壞各種東西。因為裡面有 Python 指令碼,所以我不能在 iCloud 中保留 Fira Code;因為 Ruby 我不能在那裡保留像這個部落格一樣的 Jekyll 部落格。我還不能執行 bazel……。一無是處。
And if you think symlinking it to ~/icloud
helps, believe me, it does not.
並且,如果你覺得將它軟連結到 ~/icloud
會有所幫助,相信我,它不會。
不用註冊
How do you connect two devices, if there’s no registration, accounts, email, etc? Simple! Each device has a unique id, generated automatically when you first run the program. Share this id with another device, let them share their, and you are good to go.
如果沒有註冊、賬戶、電子郵件這些方式,你會如何連線兩個裝置?很簡單!每個裝置都有一個唯一的 id,在你第一次執行程式時自動生成。與另一個裝置共享這個 id,讓另一個裝置共享它的 id,然後你就可以開始了。
Best news? Those ids are not even secret. They are more like public keys, so you can exchange them freely. But the scheme only works if both devices know ids of each other.
最好的訊息?這些 id 甚至不是金鑰。它們更像是公鑰,所以你可以自由地交換它們。但是,只有當兩個裝置都知道對方的 id 時,這個方案才能起作用。
What I like about this scheme is how beautifully simple and down-to-absolute-essentials it is. This is pure mathematics. But it’s also very convenient to use. There’re no emails, no forms, no unresponsive web pages, no invites, no expiring tokens, no failing/outdated/overloaded APIs, no password management, nothing to hold onto or “manage”.
我喜歡這個方案的地方在於它是如此地簡單和絕對地基礎。這是純數學,但也很便於使用。沒有電子郵件,沒有表格,沒有無響應的網頁,沒有邀請,沒有過期的令牌,沒有失敗/過時/過載的 API,沒有密碼管理,沒有什麼需要守著不放或「管理」的地方。
高階模式
There’s power user mode! If you don’t care, there’s always a UI, and most of the things you can configure there. But if you’re a programmer and need more, you can:
還有有高階使用者模式!如果你不需要的話,Syncthing 也總是有圖形介面,大多數事情你可以在那裡配置。但是如果你是一個程式設計師,需要更多的功能,你可以:
- Install Synthing on a headless Linux server,
- 在無頭 Linux 伺服器上安裝 Synthing;
- Control it by editing XML config,
- 透過編輯 XML 配置來控制它;
- Control it via REST API,
- 透過 REST API 來控制它;
- Configure folder ignores via regular expressions.
- 透過正規表示式來配置要忽略的檔案。
All APIs and configs are well-documented:
所有的 API 和配置都有詳細的文件:
For example, this is my .stignore
for workspace folder:
例如,這是我工作區資料夾的 .stignore
:
Configure it once and forget about generated classes, vendor dependencies and other caches syncing unnecessary forever.
配置一次,然後就可以忘記生成的類、vendor 的依賴和其他快取,它們永遠不會同步。
In contrast, iCloud has a feature to exclude *.nosync
files from syncing, but you know what? I usually don’t have files called *.nosync
, that’s the problem:
相比之下,iCloud 有一個功能可以排除 *.nosync
檔案的同步,但你知道嗎,我通常沒有叫做 *.nosync
的檔案,這就是問題所在:
And Dropbox? Well… I still have nightmares about this Dropbox UI:
那 Dropbox 呢?唔……我仍然對這個 Dropbox UI 夢魘般地記憶猶新:
It’s kind of funny, how commercial apps have feature bloat but don’t have power mode. You can do more different things, but can’t configure them to your liking.
滑稽的是,商業應用程式有膨脹的功能,卻沒有高階模式。你可以做更多不同的事情,但不能按照你的喜好來配置它們。
沒有追加銷售
Commercial solutions are interested in keeping users locked in and constantly upselling more features to them. As a result of that, you get notifications, features, popups. For example, on this screenshot, after I just installed Dropbox on a fresh machine:
商業解決方案只對讓使用者鎖定並不斷向他們推銷更多功能感興趣。因此,你會收到通知、特性和彈窗。例如,在這個截圖中,我剛剛在一臺新機器上安裝了 Dropbox 後:
Top to bottom:
從上到下:
- I already have an annoying red dot in the menubar,
- 選單欄上已經有一個煩人的紅點;
- Link to another product (Paper), even though it has nothing to do with file synchronization,
- 另一個產品(Paper)的連結,即使它與檔案同步無關;
- A firm suggestion I should enable notifications,
- 一個堅定地認為我應該啟用通知的建議;
- A notification that says my Desktop app is ready for use?! I mean, I’m looking at it from the desktop app!
- 一個通知,說我的桌面應用已經準備好使用了?!我的意思是,我正在從桌面應用上看著它!
- Dropbox advertising some sort of trial,
- Dropbox 宣傳某種試用期;
- Dropbox selling me more space (even though it was 2 years ago and I have>50% free),
- Dropbox 向我出售更多空間(即使是兩年前,我有 >50% 的空閒空間);
- Large “Upgrade” button,
- 大大的「升級」按鈕;
In the mystic “For you” tab:
在神秘的「For you」標籤中:
we see:
我們看到:
- Starred items? What is it, a high-school notepad? If I really wanted, I could tag files in the OS, but thank you.
- 星標專案?這是什麼,高中的筆記本?如果我真的想要,我可以在作業系統中標記檔案,但謝謝你。
- Calendar sync? Why on Earth would FILE SYNCHRONIZATION application wants to access my calendar?
- 日曆同步?到底為什麼一個檔案同步應用程式想要訪問我的日曆?
Wait, there’s more:
等等,還有更多:
More “features”:
更多的「特性」:
- Desktop sync,
- 桌面同步;
- Photos sync,
- 照片同步;
- Screenshots sync.
- 截圖同步。
These are at least file-like? I don’t understand why they have to be “special features”, though, if you already have an app whose primary task is to sync files. It already does that. Why are some files more special than others?
這些至少是檔案了?我不明白為什麼它們必須是「專門的特性」。如果你已經有一個主要任務是同步檔案的應用程式的話,它已經做到了。為什麼有些檔案比其他檔案更特別呢?
The answer is simple: the only way Dropbox can survive is by building and selling more features. You’ll never have peace of mind with them.
答案很簡單:Dropbox 生存的唯一方法是建立和銷售更多的功能。你永遠不會和他們一起安心。
iCloud is much younger and doesn’t have feature bloat yet, but they are still interested in selling more Macs and iPhones. So they will always try to isolate you from the rest of the world. Expect weird restrictions and great inconveniences, like iCloud folder location or moving Desktop folder when you enable/disable sync for it.
iCloud 還很年輕,還沒有膨脹的功能,但他們仍然想銷售更多的 Mac 和 iPhone。所以他們總是試圖將你與世界其他地方隔離開來。準備好遇到奇怪的限制和巨大的不便,比如 iCloud 資料夾位置,或在啟用/禁用它的同步時移動桌面資料夾。
Syncthing survival, on the other hand, does not depend on making more features. They do one thing, but they do it well. Look, their menu looks exactly how Dropbox used to look when it still was good in 2012:
另一方面,Syncthing 的生存並不依賴於製作更多的功能。他們只做一件事,但他們做得很好。看,他們的選單1看起來就像 Dropbox 在 2012 年還很好的時候一樣:
不會綁架使用者
Another ugly thing both iCloud and Dropbox routinely do is trying to scare you from walking away. Those appear every time you move more than one file outside of iCloud folder:
另一個 iCloud 和 Dropbox 經常做的醜陋的事情是試圖嚇唬你來阻止你離開。每當你將多個檔案移出 iCloud 資料夾時,它們就會出現:
And those are Dropbox versions:
而這些是 Dropbox 的版本:
It might seem like they try to explain something, but they do not. They are scared you might be leaving and try to scare you back. The tactic is simple: question your every action, even trivial operations like moving or deleting files, display huge warning signs even for safe operations, long puzzling wording (“documents stored in iCloud will be removed from Mac”) so that you never sure what will happen. That’s some shady shit.
看上去它們在嘗試解釋什麼,但實際上沒有。它們害怕你可能會離開,所以試圖透過讓你害怕而使你回頭。他們的戰術很簡單:質疑你的每一個行動,甚至是像移動或刪除檔案這樣的瑣碎操作;對於安全的操作也展示巨大的警告標誌;使用長篇累牘且令人困惑的文字(「儲存在 iCloud 中的文件將從 Mac 中刪除」)——進而使你永遠不確定會發生什麼。簡直猥瑣。
Syncthing, on the other hand, simply doesn’t care. They don’t get any money from you, so they are not interested in creating a need or constantly reminding about themselves. If you are looking for peace of mind, you can’t have it with commercial offerings.
另一方面,Syncthing 根本不關心這些。它們不從你身上獲得任何金錢,所以對於創造需求或者不斷提醒你它們自身並不感興趣。如果你正在尋求內心的寧靜,商業產品無法提供這種體驗。
結論
Syncthing has reminded me how great computers can be if they are not made by corporations. It’s simple, predictable, sane, acts no-nonsense. You can configure it however you like and it always keeps you in control. It’s a pure function and it’s good at that. It’s free and open-source, but I’m much more happy to donate them €10/month than e.g. Dropbox. I would be a much happier person if at least half of the programs on my Mac/iPhone were like that.
Syncthing 讓我想起,如果電腦不是由大公司製造的,它們能有多棒。它簡單、可預見、理智,不拖泥帶水。你可以按照自己的喜好來配置它,而且始終由你控制。它是一個純粹的程式,而且做得非常好。它開源免費,但比起 Dropbox 這種貨色,我更願意向他們捐贈 €10/月。如果我 Mac/iPhone 上的程式至少有一半是這樣的,那麼我會是一個更快樂的人。
評論