(二)数据同步利器syncthing
数据互备肯定是首选需求
有了娃之后手机最大的限制就是照片太多了不舍得删,想象一下回到家里就自动备份到私有云上,再不怕丢失。
syncthing
Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers. We strive to fulfill the goals below. The goals are listed in order of importance, the most important one being the first. This is the summary version of the goal list - for more commentary, see the full Goals document.
选择这个的目的很简单:
1. 支持多平台,windows、Android、ios、centos等
2. 界面友好,便于使用
3. 支持docker化部署
github地址为:https://github.com/syncthing/syncthing
找docker镜像的方式也挺简单:
# docker search syncthing
如何跑docker,详见github上的链接:https://github.com/syncthing/syncthing/blob/master/README-Docker.md
为了加快传输速度,docker中使用host网络策略
Discovery
Note that local device discovery will not work with the above command, resulting in poor local transfer rates if local device addresses are not manually configured.
To allow local discovery, the docker host network can be used instead:
$ docker pull syncthing/syncthing $ docker run --network=host \ -v /wherever/st-sync:/var/syncthing \ syncthing/syncthing:latest
Be aware that syncthing alone is now in control of what interfaces and ports it listens on. You can edit the syncthing configuration to change the defaults if there are conflicts.
由于我本机跑了docker-compose,所以https也是挂在nginx底下的。
最后来几张部署完成的图: