Category Archives: Self-hosting

Remote Movie Night With Cytube

There are a growing number of ways to enjoy movies with friends without being in the same physical space. One rather technical way is using a special web server called CyTube. It became my choice because it didn’t require everyone have their own subscription to the same streaming service, at least when configured with direct (‘raw’) media links. CyTube also provides a good viewing experience for action movies, has chat rooms, and can serve several movies at once using different ‘channels’. If you’ve got a big family it allows you to have one show for kids and a different, simultaneous show for the adults.

This article is an overview of the technical steps needed to provide less technical friends and family with a simple and inexpensive experience. And with a separate video call it can be similar to having people over for a movie.

What You’ll Need To Host

  • Broadband Internet — usually about 2-5M upload per remote household, if you’re serving media from your network
  • Linux or Mac computer to run CyTube
  • Movie — on disc or on a supported media service
  • Time and patience to work through the technical details

NOTE: Take care downloading software from untrusted sources as they may include unwanted or malicious software. Also, most movies have limits on how many people you can show it to at a time. So if you’re planning a virtual viewing with more than a couple families or friends check that it’s within the limit, or try a co-watching app/extension that supports an official streaming service.

1. Preparing The Movie

If you’re all just going to use one of CyTube’s supported media services you can skip this part.

Beginning with a DVD or BluRay disc you can ‘rip’ the movie into your computer with a program like MakeMKV or HandBrake. For the best experience you may also need to convert it into a format suitable for streaming like H264 within an MP4 file. VideoLAN can help with that, even if their docs are a bit dated.

2. Installing CyTube

CyTube needs a Linux or Mac computer to act as the server which serves up its website interface. So if you’ve already got a home server like a Raspberry Pi or old laptop then follow these instructions to install it. If you don’t then you could try using Windows Subsystem for Linux on your normal desktop or laptop computer.

3. Serving On The Internet

Once you can load CyTube from a browser on your local network you’ll need a way to share it over the Internet with your friends. Typically this is done by forwarding CyTube’s port from your router’s Wide Area Network connection (a.k.a. WAN or Internet connection) to the serving computer. It’s also possible—and usually a bit easier—to put the computer on the DMZ, often a gaming option for home routers. Then look up your Internet address with a service like WhatsMyIP.org and try your IP with the CyTube port on another network like your phone browser with the Wifi turned off. The URL to try will need to start with “http://” and should look something like “http://999.999.999.999:8080/”. If visiting that address loads your CyTube site then you can move on.

To make things even easier you can optionally use a dynamic name service, if you don’t already have one, to serve from a named site like “the-smiths.hopto.org”.

4. Serving Media

This can be skipped if you’re going with a streaming service, otherwise you need to get the ripped movie itself on the Internet too. A file sharing service may work, though popular ones may detect copyrighted media, preventing more than one or two users accessing it. Or in the worst case banning your account for violating terms of service.

If you managed to install CyTube then consider serving the media yourself with a web server like Nginx. Though this does also require configuring a secure (“HTTPS”) connection. And while that can be done for free with Let’s Encrypt it does require that you have a named website, even if it’s from a dynamic service like No-IP.

5. Running The Show

At any point after CyTube is installed and running the site can be setup by logging in as your administrative user, creating the channel, and adding the URL of a media file or streaming video (like “https://my-place.example.com:8443/big-buck-bunney.mp4”). Once everything else is set then share the address of your CyTube install with friends and family.

Notes

  • Chrome browser may require clicking a play icon to load direct/raw video URLs
  • Connect the viewing computer to a TV for a larger display
  • If watching with a separate video call then ask viewers to use headphones, mute when not talking, or keep the movie volume low enough to prevent echo
  • Pausing doesn’t seem to work with direct/raw files or YouTube, try removing the media from the queue and refreshing browsers
  • Viewers joining later may momentarily see the beginning of the movie before it jumps to the stream’s position

How To Export Contacts From OwnCloud Database

For those who need or prefer directly dumping all their contacts from an OwnCloud database, below are commands to do it from a PostgreSQL installation.

Remember to put your OwnCloud user-name in place of the “…” in the query.

psql owncloud --tuples-only --no-align -c \
"SELECT encode(carddata, 'escape') FROM oc_cards WHERE addressbookid = (SELECT id FROM oc_addressbooks WHERE principaluri = 'principals/users/...')" \
> oc_cards.vcf

If you happen to have accented, or other non-ASCII, characters then you may need to convert from octal (“\nnn”) to UTF before trying to import elsewhere.

Adventures In Self-Hosting: Owncloud Review

After using it as my primary file-sync and backup service for about 10 months I’ve concluded Owncloud still requires an hour or so per month for a tech-oriented person, but it’s worth it. With enough persistence, and tolerance for some lingering quirks, Owncloud could work for you; whether or not you know how to setup a server.

Disclosures by Edward Snowden and limits to Dropbox’s free accounts have made Owncloud an increasingly tempting option. Whether Dropbox, Apple, or any other 3rd-party-cloud claims they cannot read our data the biggest players all still control the software which handles the keys. So if they get curious or a government warrant appears then they can always push an update to read whatever we have not encrypted ourselves. This didn’t particularly concern me as I’ve little to hide from the authorities. But every well-intentioned backdoor has the potential to be exploited by less trustworthy types. Dropbox’s 2G limit (16G with enough referrals) also proved limiting as my collection grew.

So around December last year I began trying to self-host Owncloud with a Raspberry Pi and Owncloud version 5. Since it lacked authentication logging I had to add it manually. Thankfully more recent versions already have this built-in. It worked well enough–if slowly at times–for the first few months.

Once my wife began using the server along with me problems started cropping up: disappearing files, logs complaining about locking, and upgrade trouble. This was around version 6.0.x, and Sqlite seemed to be the culprit as it’s not intended for multiple users. Manually migrating to Postgresql did the trick; things were back to normal. Version 7 should include official support for Sqlite-to-Postgresql migrations.

If you’re working with a lot of different files often then Owncloud feels a bit slower to sync than Dropbox; though, it’s not perfect either. Pauses or network outages also seem slightly more disruptive to Owncloud.

Another caveat is that both Dropbox and Owncloud don’t work very well with Git clones. They’re slow to sync because of the many files involved, conflicts can get messy, and file locking can get in the way. So if you’re working with projects checked out of Git then you’d be wise to keep your clones in a non-synced folder. Checking in often or backup another way should suffice. If not then Gitlab is a popular, self-hosted alternative to keeping local-only clones.

Each major release of Owncloud brings welcome new enhancements, and aside from my Sqlite issues, the upgrades have been relatively painless. I’d definitely recommend it for a business of any size or technical individuals. Perhaps some packaging tools or OS distributions can make the process easy enough for even the most basic user to get their own cloud.

Update: Owncloud’s client now makes selective sync much easier, and it has coped with my careful selection arrangement nicely. Also, there is a alternative known as Seafile which transfers multiple files more quickly than Owncloud while also offering self-hosting.