syncthing私有云共享

syncthing私有云共享

由于syncthing不能在root账户下运行,所以需要新建一个普通用户,
这里使用的是syncthing-linux-arm-v0.14.38版本,具体流程如下:

opkg update
opkg install sudo shadow-groupadd shadow-useradd wget iputils-arping ca-bundle ca-certificates openssl-util vsftpd openssh-sftp-server

groupadd lyin

useradd -g lyin lyin

cd /mnt/sda1

mkdir home

chmod 777 home

cd /mnt/sda1/home

mkdir lyin

chmod 777 lyin

cd

chown -R lyin:lyin /mnt/sda1/home/lyin

cd /mnt/sda1/home/lyin

wget https://github.com/syncthing/syncthing/releases

chmod 777 syncthing

cd

ln -s /mnt/sda1/home/lyin /home/lyin

chmod 777 /home

cd /mnt/sda1/home/lyin

sudo -u lyin ./syncthing

运行1分钟,CTRL+C终止运行

vi ~/.config/syncthing/config.xml

127.0.0.1:8384

改为:

0.0.0.0:8384

修改/etc/rc.local文件:

vi /etc/rc.local

sleep 60
sudo -u lyin /mnt/sda1/home/lyin/syncthing 2>&1 | logger -t syncthing &

exit 0

修改防火墙

vi /etc/config/firewall

config rule

     option enabled '1'
     option target 'ACCEPT'
     option src 'wan'
     option proto 'tcp'
     option dest_port '8384'
     option name 'Syncthing Web'

config rule

     option target 'ACCEPT'
     option src 'wan'
     option proto 'tcp'
     option dest_port '22000'
     option name 'Syncthing TCP'

config rule

     option enabled '1'
     option target 'ACCEPT'
     option src 'wan'
     option proto 'udp'
     option dest_port '21025'
     option name 'Syncthing UDP'

config redirect

     option enabled '1'
     option target 'DNAT'
     option src 'wan'
     option dest 'lan'
     option proto 'tcp'
     option src_dport '22000'
     option dest_ip '192.168.1.1'
     option dest_port '22000'
     option name 'Syncthing'

重启路由

登陆web页面访问yourip:8384

修改 高级设置防止手机删除图片后远程自动删除

找到文件夹 选项 找到 Ignore Delete 和 Ignore Perms 打钩,然后保存.

标签: none

添加新评论