Hacker News new | comments | show | ask | jobs | submit login
Using BitTorrent Sync to live-edit or deploy websites (antler.co.za)
9 points by rvavruch on June 16, 2014 | hide | past | web | favorite | 14 comments



This is a bad idea for several reasons.

The first issue is security. Loads of text editors create temporary files (.swp, .php~, etc) in the same directory as the file you're editing. These can render as text instead of going through php, thus revealing things like database secrets and such. Now, this problem won't always occur and can be configured around.

However, perhaps the bigger problem is that this is simply a bad workflow when a better one exists. For "live editing", run a local webserver. Don't expose your playing around to the world, potentially breaking your site for others. Heck, if it's a static site, just run "python -m SimpleHTTPServer" if you like. Second, for deploying, you should have a better process than "sync this directory". Specifically, you should have git hooks that handle deployment if you want don't-think-about-it instant deployment. Preferably you have CI that deploys after it passes a few tests. Using git also has other benefits like letting you have commit messages, easy rollbacks, different branches (which you can auto-deploy to test / dev / etc).

Basically, the problem with using Dropbox or BTSync to edit websites is that you rarely want to throw partial changes to the world, and file sync programs like to sync as often as possible. It's a cool idea, but those sync programs simply don't replace proper version control and CI.

I'd even prefer rsync if you're not using version control simply so you can control when it syncs and setup complex excludes / shell scripts to run around it. You could easily have a script that runs a minimizer and then rsyncs the output while having rsync exclude any potentially accidental files. You can't do that nearly as easily with the workflow the author is talking about.


The issue of temp files is covered by the author's approach of having a dev and a live folder. This is probably primarily useful for static sites html sites which wouldn't need to worry about that.

I work with a largely non technical team on a site that is 95% built with a static site generator. They needed versioning but I couldn't convince them to take on the overhead of SVN or Git.

We sync the project using Dropbox, than deploy the build folder via FTP. We use folders for branches and Dropbox has limited versioning.

The biggest problem is that the people this is useful for probably aren't going to have a VPS or know how to install the btsync daemon. There are a couple of services that offer hosting for dropbox static sites like site44[1]. I could see a Btsync equivalent being a popular service.t

1. http://www.site44.com/


I certainly wouldn't suggest this method in place of a proper deployment strategy for serious development.

There are problems with this method, but, for a hobbyist who hand codes a small static or very simple site, I think it would be fun. Magic internet stuff.

The interesting idea for me was not just auto-syncing files onto a remote server, but onto a web server. It's obvious once you think of it, but I hadn't thought of it before.


I used to sync my publish folder with btsync but after facing issues, looking into proper tools now. Also i am a newbie, so instead of chef or puppet, I am looking into CI tools and their deployment capabilities now. As far as i know, tools like chef provides you full server configuration management. I am guessing with EC2 custom AMIs and Teamcity i will be able to pull it off. What do you think?


I've never used Teamcity, but it looks nice. I do agree chef/puppet can be overkill when you can just do custom AMIs. Definitely make sure you're using proper version control... Honestly, you don't give enough information for a proper opinion, but it'd probably be more informative to just do what you think is best and see how it works out. Ultimately the best workflow is the one that works (even when things go wrong).


What more info you would like to know? We already have SVN in place. We are developing asp.net web app, and currently i manually migrate changes to release branch and publish from that branch.


So I am big fan of BTSync, it works really well and displaced used of DropBox mostly. I use DB only with apps on ipad that have that integration.

I think both use dropbox or btsync for this is a little weird. I wouldn't do it. It is not hard to publish sites.


I was using it to deploy my web apps, and keep my 2 servers in sync. But lately i am facing issues with it. Once in a while my bittorrent sync on server shows No device connected, even if my local machine is online. Thankfully i am using ec2, so spinning up a new instance from few days old AMI is easy and usually btsync starts to work again on the new server. Now looking into different solutions.


A commenter on my blog post suggested Syncthing (http://syncthing.net/) as an alternative.


I remember seeing this earlier. Looks good. But i am looking towards solutions which can be integrated with our version control. Maybe Chef or Puppet


Have a look at Docker (http://www.docker.com/), I was introduced to it recently and it looks like a powerful yet simple alternative to Chef or Puppet.


Docker is linux only, and we are a windows shop. So docker not an alternative for me


I am looking into CD tools rather than simple sync tools. It's time to grow.


We're looking at deploying a static site generator - but one issue I've run into is how to allow our content folks to use the system. Ideally, the files would be stored in Github and then, on commit, the result are compiled and pushed to a staging server. We've been looking at Jenkins for managing the process, but it seems a bit heavy handed - anybody have any other suggestions?




Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: