Slide 1

Slide 1 text

@cppgohan Introduction to  BitTorrent Sync

Slide 2

Slide 2 text

BitTorrent Sync?

Slide 3

Slide 3 text

BitTorrent Everywhere 1024 Private Tracker Private Bay yyets BitTorrent Sync?

Slide 4

Slide 4 text

BitTorrent Sync? Start from ... File sync services iCloud Google Drive

Slide 5

Slide 5 text

BitTorrent Sync 2013.01.24 PreAlpha ~ 2013.11.28 v1.2.82 Sync based on BitTorrent P2P protocal. between devices on local network between remote devices over the internet Sync files Folders Sync By its SECRET(a random string 20 bytes or more): Traffic is encrypted(AES-128) using a private key derived from the shared SECRET key.

Slide 6

Slide 6 text

SECRET key: - Full Access Key - Read Only Key - OneTime SECRET key: - expired in 24hour - Full Access Key - Read Only Key - Encryption secret BitTorrent Sync

Slide 7

Slide 7 text

Start Using BitTorrent Sync!

Slide 8

Slide 8 text

Multiplatform support: ! • OS X Snow Leopard or newer • WinXP SP3 or newer, WinServer 2008 or newer • Linux kernel 2.6.16 or newer on ARM/PPC/i386/ x86_64 • FreeBSD 8.3 or newer • iOS 5.0 or newer • Android 2.2 or newer • NAS based on Linux kernel Using BitTorrent Sync

Slide 9

Slide 9 text

Using BitTorrent Sync on OS X:

Slide 10

Slide 10 text

Using BitTorrent Sync on Win:

Slide 11

Slide 11 text

Using BitTorrent Sync on Linux Server: ### 下载/解压 btsync(Linux_x86_64) ! $ cd ~ && mkdir /etc/btsync $ cd /etc/btsync $ wget --content-disposition \ http://tinyurl.com/btsync-x86-64 $ tar zxvf btsync_glibc23_x64.tar.gz

Slide 12

Slide 12 text

### 导出默认配置到⽂文件 $ ./btsync --dump-sample-config > btsync.conf ! ### 配置btsync.conf, 直接启动btsync $ vi btsync.conf ! ### 设置btsync元数据路径 storage_path: /etc/btsync/.btsync Using BitTorrent Sync on Linux Server:

Slide 13

Slide 13 text

两种⽤用法 webui / shared_folders, 彼此互斥: ! "webui": { "listen": "0.0.0.0:8888", "login": "admin", "password": "password@sztechparty" } Using BitTorrent Sync on Linux Server:

Slide 14

Slide 14 text

Using BitTorrent Sync on Linux Server: ### 运⾏行进程 ./btsync --config btsync.conf ! Demo: http://btsync.baozishan.in WebUI

Slide 15

Slide 15 text

"shared_folders": [{ "secret": "MY_SECRET_1", // 必填 "dir": "/home/user/bittorrent/sync_test", // 必填 ! "use_relay_server": true, "use_tracker": true, "use_dht": false, "search_lan": true, "use_sync_trash": true, "known_hosts": [ "192.168.1.2:44444" ] }] Using BitTorrent Sync on Linux Server:

Slide 16

Slide 16 text

"disk_low_priority": true, "rate_limit_local_peers": false, "folder_rescan_interval": 600, "sync_max_time_diff": 600, "lan_encrypt_data": true, "sync_trash_ttl": 30, "lan_use_tcp": false, "send_buf_size": 5, "max_file_size_diff_for_patching": 1000, "recv_buf_size": 5, "max_file_size_for_versioning": 1000 Using BitTorrent Sync on Linux Server:

Slide 17

Slide 17 text

init.d script: gist: https://gist.github.com/MendelGusmao/5398362 ! #!/bin/sh ### BEGIN INIT INFO # Provides: btsync ... BTSYNC_USERS="mendel" DAEMON=/usr/bin/btsync ! start() { ... } stop() { ... } status() { ... } ! ... Using BitTorrent Sync on Linux Server:

Slide 18

Slide 18 text

Start Hosting BitTorrent Sync!

Slide 19

Slide 19 text

https://www.btcloudsync.com/ ! Go Check: https://www.btcloudsync.com/GohanShare ! Maybe could use: https://www.nitrous.io/ Hosting BitTorrent Sync! Free Choice:

Slide 20

Slide 20 text

Hosting BitTorrent Sync! Want to throw some money? or other budget vps..

Slide 21

Slide 21 text

Introduction to BitTorrent Sync API

Slide 22

Slide 22 text

Introduction to BitTorrent Sync API step1. Register an API key step2. Enable API in Config file step3. Do the dirty work ! APIs: ! get_folders add_folder remove_folder get_files set_file_prefs get_folder_peers get_secrets get_folder_prefs set_folder_prefs get_folder_hosts set_folder_hosts get_prefs set_prefs get_os get_version get_speed shutdown

Slide 23

Slide 23 text

Reality... FuckGFW! BitTorrent Sync Was Blocked by China GFW... this month Discuss: https://www.v2ex.com/t/90480

Slide 24

Slide 24 text

•User Guide 
 http://btsync.s3-website-us-east-1.amazonaws.com/ BitTorrentSyncUserGuide.pdf •Forum
 http://forum.bittorrent.com/forum/107-bittorrent-sync/ •Blog
 http://blog.bittorrent.com/tag/sync-hacks/ •other
 http://www.reddit.com/r/btsync
 
 BitTorrent Sync Reference:

Slide 25

Slide 25 text

THE END! BUT... 折騰不⽌止! 期待⼤大家的精彩分享, 热烈讨论, 欢迎交流. I’m @cppgohan. blog.baozishan.in