{"id":27334990,"url":"https://github.com/dmuth/ansible-btsync","last_synced_at":"2025-04-12T14:46:49.838Z","repository":{"id":16228634,"uuid":"18976088","full_name":"dmuth/ansible-btsync","owner":"dmuth","description":"An Ansible Playbook and roles for setting up BitTorrent Sync on Digital Ocean","archived":false,"fork":false,"pushed_at":"2020-09-03T22:20:52.000Z","size":2401,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-02T06:07:17.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmuth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-20T23:21:17.000Z","updated_at":"2016-09-29T17:19:24.000Z","dependencies_parsed_at":"2022-09-15T03:20:46.092Z","dependency_job_id":null,"html_url":"https://github.com/dmuth/ansible-btsync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fansible-btsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fansible-btsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fansible-btsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fansible-btsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmuth","download_url":"https://codeload.github.com/dmuth/ansible-btsync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248585248,"owners_count":21128974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-12T14:46:49.067Z","updated_at":"2025-04-12T14:46:49.831Z","avatar_url":"https://github.com/dmuth.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# BitTorrent Sync Ansible Playbook\n\nAwhile back, I felt it was time to move away from Dropbox, so I decided to try [BitTorrent Sync](http://www.bittorrent.com/sync).\n\nThe advantages of BitTorrent sync are that you can synchronize files in a Dropbox-like manner, but on whatever machines you want.  Desktops, laptops, Raspberry Pis, VMs from your faveorite cloud provider, whatever.  Use whatever machines you like.\n\nThis project is an Ansible playbook which can be used to set up BitTorrent Sync-enabled instances on Digital Ocean.\n\n\n## System Requirements\n\n- [Ansible 1.6 or greater](http://www.ansible.com/home) installed on the machine you will be managing instances from\n- [Vagrant](https://www.vagrantup.com/) if you plan on testing this out. (You really should!)\n- Ubuntu 12.04 LTS, 64-bit installed on each instance to manage\n- **(Optional)** [Splunk](http://www.splunk.com/) - Splunk is a platform for collecting and indexing logfiles. Useful for searching through the logs from multiple BitTorrent Sync nodes. I highly recommend it!\n\n\n## Quick Start\n\n`vagrant up \u0026\u0026 ./go.sh -i ./inventory/vagrant`\n\nThis will download an Ubuntu 12.04 LTS image and spin up a virtual machine running it.  Then Ansible is run.\n\nAfter a few minutes, you'll have a machine running BitTorrent Sync.  You can then access BTSync at `https://localhost:8889/`\n\n\n## Production Usage: Digital Ocean\n\n- Create 1 or more Digital Ocean droplets through their admin interface, and note their IPs.  These droplets **must be Ubuntu 12.04 LTS 64-bit**.\n- Copy the file `inventory/production.example` to `inventory/production`\n   - Edit this file to include the IP address of each instance and (optionally) whether it is a Splunk indexer or forwarder (more on Splunk later)\n- Copy the file `group_vars/production.example` to `group_vars/production`\n   - Edit this file and include the path to your public and private SSH keys for accessing Digital Ocean\n   - Also include the IP address of the machine used as your Splunk indexer and the IP addresses of your other machines which will be forwarding logs to the indexer.\n       - Again, if you're not familiar with Splunk, don't worry. That part is optional.\n- `./go.sh -i ./inventory/production`\n   - This will run Ansible against all of your Digital Ocean instances.\n   \n  \n### Troubleshooting\n\n- Use `--list-hosts` to report what machines this command would be \n- Use `-l` to limit the run to one machine\n- Use `--tags tagname` to restrict Ansible to directives with specific tags set on them.\n   - As of this writing, this is the current list of tags: `btsync, munin, nginx, provider, splunk, ssh, ssl, user`\n \n\n## Success!\n\nIf succesful, you'll see lines like this:\n\n![Starting Ansible](images/ansible-start.png)\n\nThis will do the following:\n\n- Create an htpasswd file to lock down access to Munin graphs\n- Craete a self-signed SSL certificate if one does not already exist\n- Run Ansible\n    - The Ansible playbook will do a number of things that are Digital Ocean specific, such as setting up a swapfile\n    - Other things done by this playbook include closing down ports 80, 443, and 8888.\n\nWhen done, the recap will be shown:\n\n![Starting Ansible](images/ansible-finish.png)\n\nFor the first run, there will be many more changes, but on subsequent ones, you'll see a result similar to this one, with fewer changes.\n\nWhen the run is complete, connect to `https://YOUR_DIGITAL_OCEAN_DROPLET_IP:8889/`, **set an admin password immediately**, and start adding your BitTorrent Sync keys.\n\nAgain--**I cannot stress this enough**--your BitTorrent Sync instance **has no password set by default**.  This is (for the time-being) one manual step you must take.  You will need to set an admin password before using BitTorrent Sync.\n\n## Testing with cheetahs\n\nOnce your instance is set up, you can test Bittorrent Sync with this key:\n\n    BCXMRZ4G3KMWAY767FK26J2YQSE35S5Z7\n\nThis will download about 10 Megabytes of pictures of cheetahs from my BitTorrent Sync swarm to your node.\n\n\n## Debugging with cheetahs\n\nThis repo includes a file called `bin/sha1sum.php`.  When Ansible is run, it is installed in the ubuntu home directory.  To verify that your copy of BitTorrent Sync is working correctly, you can run this utility against the aforementioned cheetah directory as such: \n\n    $ ./sha1sum.php BTSync/Cheetahs/* \n    SHA1 of           BTSync/Cheetahs/Adult Cheetahs: 9ef2c457709b51014eea2b9b670825b58cf91ea3\n    SHA1 of                     BTSync/Cheetahs/Cubs: 6f733aed82799cbf3ee1eef8ef3dd15027dc2c99\n    SHA1 of             BTSync/Cheetahs/Mom and Cubs: bf36ce2c7f80c611bcfc755bcc5a5fb1dfadb630\n    SHA1 of                         ALL OF THE ABOVE: 4f67535322f45323a5fa0bf6a693a2c79885a008\n\nIf those checksums do not match, something has gone wrong.\n\n\n## Port usage\n\nAfter running this playbook against an instance, the following ports will be affectd\n\n- **Port 80** - Blocked\n- **Port 443** - Blocked\n- **Port 8000** - SplunkWeb via HTTPS. Only opened up on the Splunk Indexer.\n- **Port 8888** - Blocked. This is the default port that btsync uses, but in plaintext.  Very bad.\n- **Port 8889**\n\t- This port is opened by this Ansible playbook.  It speaks HTTPS using a self-signed certificate and proxies to localhost:8888.\n\t- This port is also used to access Munin for system stats, at **https://the-hostname-or-ip:8889/munin/**\n- **Port 9997** - Splunk forwarders send their logs to this port. Only opened up on the Splunk Indexer.\n\n\n## Bonus: Splunk\n\nIf you want to analyze the BitTorrent Sync logfiles with Splunk, you'll need to start up Splunk and agree to the Terms and Conditions.  To start Splunk, SSH into the host and type:\n\n`./start_splunk.sh`\n\nOnce you run this scrippt, Spluk will listen on https://hostname:8000/ and it will index /var/log/syslog, which is where BitTorrent Sync writes its logs.\n\n\n## Help contribute to this project!\n\nI would be more than happy to add support for VMs from EC2, Rackspace, and other VPS providers.  Just let me know.\n\n\n## Where can this be found?\n\nI currently update this repo on GitHub and BitBucket:\n\n- [https://bitbucket.org/dmuth/ansible-btsync](https://bitbucket.org/dmuth/ansible-btsync)\n- [https://github.com/dmuth/ansible-btsync](https://github.com/dmuth/ansible-btsync)\n\n## Contact me\n\nI can be found on the web at [http://www.dmuth.org/contact](http://www.dmuth.org/contact)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fansible-btsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmuth%2Fansible-btsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fansible-btsync/lists"}