使用開源同步工具 Syncthing 控制你的數據

如今,我們的一些最重要的財產 —— 從家人和朋友的照片和視頻到財務和醫療文件 —— 都是數據。即便是雲存儲服務的迅猛發展,我們仍有對隱私和個人數據缺乏控制的擔憂。從稜鏡監控計划到谷歌讓 APP 開發者掃描你的個人郵件,這些新聞的報道應該會讓我們對我們個人信息的安全性有所顧慮。
Syncthing 可以讓你放下心來。它是一款開源的點對點文件同步工具,可以運行在 Linux、Windows、Mac、Android 和其他(抱歉,沒有iOS)。Syncthing 使用自定的協議,叫塊交換協議。簡而言之,Syncting 能讓你無需擁有伺服器來跨設備同步數據。
在這篇文章中,我將解釋如何在 Linux 電腦和安卓手機之間安裝和同步文件。
Linux
Syncting 在大多數流行的發行版都能下載。Fedora 28 包含其最新版本。
要在 Fedora 上安裝 Syncthing,你能在軟體中心搜索,或者執行以下命令:
sudo dnf install syncthing syncthing-gtk
一旦安裝好後,打開它。你將會看到一個助手幫你配置 Syncthing。點擊 「Next」 直到它要求配置 WebUI。最安全的選項是選擇「Listen on localhost」。那將會禁止 Web 界面並且阻止未經授權的用戶。
Syncthing 安裝時的 WebUI 對話框
關閉對話框。現在 Syncthing 安裝好了。現在可以分享文件夾,連接一台設備開始同步了。但是,讓我們用你其它的客戶端繼續。
Android
Syncthing 在 Google Play 和 F-Droid 應用商店都能下載。
安裝應用程序後,會顯示歡迎界面。給 Syncthing 授予你設備存儲的許可權。你可能會被要求為了此應用程序而禁用電池優化。這樣做是安全的,因為我們將優化應用程序,使其僅在插入電源並連接到無線網路時同步。
點擊主菜單圖標來到「Settings」,然後是「Run Conditions」(運行條件)。點擊「Always run in the background, Run only when charging」(總是在後台運行,僅在充電時運行)和「Run only on wifi」(僅在 WIFI 下運行)。現在你的安卓客戶端已經準備好與你的設備交換文件。
Syncting 中有兩個重要的概念需要記住:文件夾和設備。文件夾是你想要分享的,但是你必須有一台設備來分享。 Syncthing 允許你用不同的設備分享獨立的文件夾。設備是通過交換設備的 ID 來添加的。設備 ID 是在 Syncting 首次啟動時創建的一個唯一的密碼安全標識符。
連接設備
現在讓我們連接你的 Linux 機器和你的 Android 客戶端。
在您的 Linux 計算機中,打開 Syncting,單擊「Settings」圖標,然後單擊「Show ID」,就會顯示一個二維碼。
在你的安卓手機上,打開 Syncthing。在主界面上,點擊「Devices」頁後點擊 「+」 。在第一個區域內點擊二維碼符號來啟動二維碼掃描。
將你手機的攝像頭對準電腦上的二維碼。設備 ID 欄位將由您的桌面客戶端設備 ID 填充。起一個適合的名字並保存。因為添加設備有兩種方式,現在你需要在電腦客戶端上確認你想要添加安卓手機。你的電腦客戶端可能會花上好幾分鐘來請求確認。當提示確認時,點擊「Add」。
在「New Device」窗口,你能確認並配置一些關於你設備的選項,像是「Device Name」和「Addresses」。如果你在地址那一欄選擇 「dynamic」 (動態),客戶端將會自動探測設備的 IP 地址,但是你想要保持住某一個 IP 地址,你能將該地址填進這一欄里。如果你已經創建了文件夾(或者在這之後),你也能與新設備分享這個文件夾。
你的電腦和安卓設備已經配對,可以交換文件了。(如果你有多台電腦或手機,只需重複這些步驟。)
分享文件夾
既然您想要同步的設備之間已經連接,現在是時候共享一個文件夾了。您可以在電腦上共享文件夾,添加了該文件夾中的設備將獲得一份副本。
若要共享文件夾,請轉至「Settings」並單擊「Add Shared Folder」(添加共享文件夾):
在下一個窗口中,輸入要共享的文件夾的信息:
你可以使用任何你想要的標籤。「Folder ID」將隨機生成,用於識別客戶端之間的文件夾。在「Path」里,點擊「Browse」就能定位到你想要分享的文件夾。如果你想 Syncthing 監控文件夾的變化(例如刪除、新建文件等),點擊「Monitor filesystem for changes」(監控文件系統變化)。
記住,當你分享一個文件夾,在其他客戶端的任何改動都將會反映到每一台設備上。這意味著如果你在其他電腦和手機設備之間分享了一個包含圖片的文件夾,在這些客戶端上的改動都會同步到每一台設備。如果這不是你想要的,你能讓你的文件夾「Send Only」(只是發送)給其他客戶端,但是其他客戶端的改動都不會被同步。
完成後,轉至「Share with Devices」(與設備共享)頁並選擇要與之同步文件夾的主機。
您選擇的所有設備都需要接受共享請求;您將在設備上收到通知。
正如共享文件夾時一樣,您必須配置新的共享文件夾:
同樣,在這裡您可以定義任何標籤,但是 ID 必須匹配每個客戶端。在文件夾選項中,選擇文件夾及其文件的位置。請記住,此文件夾中所做的任何更改都將反映到文件夾所允許同步的每個設備上。
這些是連接設備和與 Syncting 共享文件夾的步驟。開始複製可能需要幾分鐘時間,這取決於您的網路設置或您是否不在同一網路上。
Syncting 提供了更多出色的功能和選項。試試看,並把握你數據的控制權。
via: https://opensource.com/article/18/9/take-control-your-data-syncthing
作者:Michael Zamot 選題:lujun9972 譯者:ypingcn 校對:wxy
本文轉載來自 Linux 中國: https://github.com/Linux-CN/archive
Pretty! This has been a really wonderful post. Many thanks for providing these details.
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
Hi there to all, for the reason that I am genuinely keen of reading this website』s post to be updated on a regular basis. It carries pleasant stuff.
I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will
There is definately a lot to find out about this subject. I like all the points you made
Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
I appreciate you sharing this blog post. Thanks Again. Cool.
I just like the helpful information you provide in your articles
I do not even understand how I ended up here, but I assumed this publish used to be great
I appreciate you sharing this blog post. Thanks Again. Cool.
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
Hi there to all, for the reason that I am genuinely keen of reading this website』s post to be updated on a regular basis. It carries pleasant stuff.
This is my first time pay a quick visit at here and i am really happy to read everthing at one place
This is really interesting, You』re a very skilled blogger. I』ve joined your feed and look forward to seeking more of your magnificent post. Also, I』ve shared your site in my social networks!
Pretty! This has been a really wonderful post. Many thanks for providing these details.
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated