A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. title: Computers as I used to love them
  2. url: https://tonsky.me/blog/syncthing/
  3. hash_url: 154a7a62b2eb5b0fbe17673fd7cbcf42
  4. <p>I’ve been struggling with file sync solutions <a href="https://tonsky.livejournal.com/323469.html">for years</a>. 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 <a href="https://twitter.com/nikitonsky/status/1269741673715810304">cryptically broke again</a>, I decided it’s time to try something different.</p>
  5. <p>I tried <a href="https://syncthing.net/">Syncthing</a>, 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 <a href="https://tonsky.me/blog/good-times-weak-men/">the collapse of civilization</a> can be slowed down a bit.</p>
  6. <p><em>Syncthing is everything I used to love about computers.</em></p>
  7. <p>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.</p>
  8. <h1 id="installation">Installation</h1>
  9. <p>You download a single binary executable. You run it. There’s no step three.</p>
  10. <figure>
  11. <img src="https://tonsky.me/blog/syncthing/cli.png" />
  12. </figure>
  13. <p>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!</p>
  14. <p>Homebrew makes it even simpler:</p>
  15. <figure>
  16. <img src="https://tonsky.me/blog/syncthing/homebrew.png" />
  17. </figure>
  18. <p>Just to give you the perspective, these are all the steps that Dropbox puts you through when you install it on a new computer:</p>
  19. <figure>
  20. <img src="https://tonsky.me/blog/syncthing/dropbox_1.png" />
  21. </figure>
  22. <figure>
  23. <img src="https://tonsky.me/blog/syncthing/dropbox_2.png" />
  24. </figure>
  25. <figure>
  26. <img src="https://tonsky.me/blog/syncthing/dropbox_3.png" />
  27. </figure>
  28. <figure>
  29. <img src="https://tonsky.me/blog/syncthing/dropbox_4.png" />
  30. </figure>
  31. <figure>
  32. <img src="https://tonsky.me/blog/syncthing/dropbox_5.png" />
  33. </figure>
  34. <figure>
  35. <img src="https://tonsky.me/blog/syncthing/dropbox_6.png" />
  36. </figure>
  37. <figure>
  38. <img src="https://tonsky.me/blog/syncthing/dropbox_7.png" />
  39. </figure>
  40. <figure>
  41. <img src="https://tonsky.me/blog/syncthing/dropbox_8.png" />
  42. </figure>
  43. <figure>
  44. <img src="https://tonsky.me/blog/syncthing/dropbox_9.png" />
  45. </figure>
  46. <figure>
  47. <img src="https://tonsky.me/blog/syncthing/dropbox_10.png" />
  48. </figure>
  49. <figure>
  50. <img src="https://tonsky.me/blog/syncthing/dropbox_11.png" />
  51. </figure>
  52. <p>Aaaaand… that’s not all! You also get this annoying notificaiton to deal with:</p>
  53. <figure>
  54. <img src="https://tonsky.me/blog/syncthing/dropbox_12.png" />
  55. </figure>
  56. <p>Only at this point can you start using Dropbox. Luckily, I already had an account, otherwise, it would be 5 more steps. Ridiculous!</p>
  57. <p>(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.)</p>
  58. <h1 id="no-artificial-limits">No artificial limits</h1>
  59. <p>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.</p>
  60. <p>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. <em>Folders are just folders</em>, nothing special about them. Here I’m syncing “system” folders: <code class="language-plaintext highlighter-rouge">~/Desktop</code> and <code class="language-plaintext highlighter-rouge">~/Library/Fonts</code>, and three custom ones. No sweat:</p>
  61. <figure>
  62. <img src="https://tonsky.me/blog/syncthing/folders.png" />
  63. </figure>
  64. <p>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 <code class="language-plaintext highlighter-rouge">~/Library/Fonts</code>, if I install a font on one machine, it automatically installs everywhere.</p>
  65. <p>Contrast this with Dropbox, which requires you to put everything inside <code class="language-plaintext highlighter-rouge">~/Dropbox</code> folder. If you keep your projects under <code class="language-plaintext highlighter-rouge">~/work</code> 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.</p>
  66. <figure>
  67. <img src="https://tonsky.me/blog/syncthing/dropbox_folder.png" />
  68. Sweet, sweet branding...
  69. </figure>
  70. <p>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 <code class="language-plaintext highlighter-rouge">~/Library/Mobile Documents/com~apple~CloudDocs</code>!!!</p>
  71. <p>If you are a programmer, it’s unusable. First, you can’t in your right mind type THAT every time you need to <code class="language-plaintext highlighter-rouge">cd</code>. 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.</p>
  72. <figure>
  73. <img src="https://tonsky.me/blog/syncthing/jekyll.png" />
  74. </figure>
  75. <p>And if you think symlinking it to <code class="language-plaintext highlighter-rouge">~/icloud</code> helps, believe me, it does not.</p>
  76. <figure>
  77. <img src="https://tonsky.me/blog/syncthing/absolute_path.png" />
  78. </figure>
  79. <h1 id="no-registration">No registration</h1>
  80. <p>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.</p>
  81. <figure>
  82. <img src="https://tonsky.me/blog/syncthing/id.png" />
  83. </figure>
  84. <p>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.</p>
  85. <p>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”.</p>
  86. <h1 id="power-mode">Power mode</h1>
  87. <p>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:</p>
  88. <ul>
  89. <li>Install Synthing on a headless Linux server,</li>
  90. <li>Control it by editing XML config,</li>
  91. <li>Control it via REST API,</li>
  92. <li>Configure folder ignores via regular expressions.</li>
  93. </ul>
  94. <p>All APIs and configs are well-documented:</p>
  95. <figure>
  96. <img src="https://tonsky.me/blog/syncthing/api.png" />
  97. </figure>
  98. <p>For example, this is my <code class="language-plaintext highlighter-rouge">.stignore</code> for workspace folder:</p>
  99. <figure>
  100. <img src="https://tonsky.me/blog/syncthing/stignore.png" />
  101. </figure>
  102. <p>Configure it once and forget about generated classes, vendored dependencies and other caches syncing unnecessary forever.</p>
  103. <p>In contrast, iCloud has a feature to exclude <code class="language-plaintext highlighter-rouge">*.nosync</code> files from syncing, but you know what? I usually don’t have files called <code class="language-plaintext highlighter-rouge">*.nosync</code>, that’s the problem:</p>
  104. <figure>
  105. <img src="https://tonsky.me/blog/syncthing/icloud_exclude.png" />
  106. </figure>
  107. <p>And Dropbox? Well… I still have nightmares about this Dropbox UI:</p>
  108. <figure>
  109. <img src="https://tonsky.me/blog/syncthing/dropbox_folders.png" />
  110. </figure>
  111. <p>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.</p>
  112. <h1 id="no-upsell">No upsell</h1>
  113. <p>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 <em>just</em> installed Dropbox on a fresh machine:</p>
  114. <figure>
  115. <img src="https://tonsky.me/blog/syncthing/dropbox_12.png" />
  116. </figure>
  117. <p>Top to bottom:</p>
  118. <ul>
  119. <li>I already have an annoying red dot in the menubar,</li>
  120. <li>Link to another product (Paper), even though it has nothing to do with file synchronization,</li>
  121. <li>A firm suggestion I should enable notifications,</li>
  122. <li>A notification that says my Desktop app is ready for use?! I mean, I’m looking at it from the desktop app!</li>
  123. <li>Dropbox advertising some sort of trial,</li>
  124. <li>Dropbox selling me more space (even though it was 2 years ago and I have &gt;50% free),</li>
  125. <li>Large “Upgrade” button,</li>
  126. </ul>
  127. <p>In the mystic “For you” tab:</p>
  128. <figure>
  129. <img src="https://tonsky.me/blog/syncthing/dropbox_for_you.png" />
  130. </figure>
  131. <p>we see:</p>
  132. <ul>
  133. <li>Starred items? What is it, a high-school notepad? If I really wanted, I could tag files in the OS, but thank you.</li>
  134. <li>Calendar sync? Why on Earth would FILE SYNCHRONIZATION application wants to access my calendar?</li>
  135. </ul>
  136. <p>Wait, there’s more:</p>
  137. <figure>
  138. <img src="https://tonsky.me/blog/syncthing/dropbox_settings.png" />
  139. </figure>
  140. <p>More “features”:</p>
  141. <ul>
  142. <li>Desktop sync,</li>
  143. <li>Photos sync,</li>
  144. <li>Screenshots sync.</li>
  145. </ul>
  146. <p>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?</p>
  147. <p>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.</p>
  148. <p>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.</p>
  149. <p>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<a id="f1" href="#fn1" class="footnote">1</a> looks exactly how Dropbox used to look when it still was good in 2012:</p>
  150. <figure>
  151. <img src="https://tonsky.me/blog/syncthing/menubar.png" />
  152. </figure>
  153. <h1 id="no-lock-in">No lock-in</h1>
  154. <p>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:</p>
  155. <figure>
  156. <img src="https://tonsky.me/blog/syncthing/icloud_scare_1.png" />
  157. </figure>
  158. <figure>
  159. <img src="https://tonsky.me/blog/syncthing/icloud_scare_2.png" />
  160. </figure>
  161. <p>And those are Dropbox versions:</p>
  162. <figure>
  163. <img src="https://tonsky.me/blog/syncthing/dropbox_scare_1.png" />
  164. </figure>
  165. <figure>
  166. <img src="https://tonsky.me/blog/syncthing/dropbox_scare_2.png" />
  167. </figure>
  168. <p>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 (“<a href="https://grumpy.website/post/0Ts_fkPQb">documents stored in iCloud will be removed from Mac</a>”) so that you never sure what will happen. That’s some shady shit.</p>
  169. <figure>
  170. <img src="https://tonsky.me/blog/syncthing/scared.png" />
  171. </figure>
  172. <p>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.</p>
  173. <h1 id="conclusion">Conclusion</h1>
  174. <p>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.</p>