My N.A.S. Homebrew Project

For anyone who isn't tencho-hip, like me (straining my eyes looking down my nose at the keyboard as I type this), NAS stands for Network Attached Storage. The idea behind a NAS is to have an appliance  you just attach to your network and magical gigabytes of storage appear, similar to how free tv programming magically appears when you connect your cable to your neighbor's box. NAS boxes are, like many devices now adays, actually just computers running and embedded operating system, usually FreeBSD or Linux. They're headless (no monitor) and totally configured via a web interface. You just point your web browser to the box and configure it.

The past few months I've been developing the idea of a homebrew NAS system and am pretty close to an alpha release of the project. The system has four core technologies:

Ubuntu Server – The operating system
Samba – Windows and Mac OS file shares
Unison – A very sophisticated file synchronization system
Drupal – A modular Content Management System with an amazingly flexible API

Ubuntu's Server, a Linux distribution by Canonical, is acting as my core OS. Fairly standard, basic configuration here, installed services are ssh server, samba server, the LAMP (Linux, Apache, MySQL, php) stack and Postfix (simply a localhost mail configuration for managing Drupal). Ubuntu's Server is totally command line based, no graphical interface at all,  so a steep learning curve, but worth it just for the sheer ease of operating the server over ssh. This NAS would be totally doable on the Ubuntu Desktop or Linux Mint with a few extra packages installed.

The file sharing layer of the NAS is good 'ol Samba. Samba a Linux file server geared towards Windows based networks. It's a very effective and easy to configure. It works flawlessly with Linux, Windows and Mac OS for sharing files, something that's really important at our office where we have a real mixed bag of computers.

In tandem with Samba, I'm using Unison over SSH to move files over the network and over the Internet. Samba and Unison/SSH are independent from one another. You could either use Samba or Unison or both. Unison is a file synchronization system, not a file sharing system per se. Unison runs on the server and on the client computer and scans the configured directories. It figures out the differences then copies the files over SSH to sync up the directories. Believe my, I'm not giving Unison justice with this simple description, it's actually a very sophisticated piece of software. And open source to boot!

Finally we wrap the whole thing up in a crunchy, Drupal shell. Drupal is a modular, MySQL/php based CMS. Because of the way it's built, it's very easy to write custom modules to extend the functionality of the system. What I've done is developed a module that sorts all of the file information and creates a web page for each directory with a listing of everything in that directory. Each directory on the server then can be viewed as a webpage, so you can search them, comment on them, add tags and so forth. The custom module can also add users to the system, change passwords, change permissions and change the owner and group for directories and files.

I think I'm fairly close to an alpha stage release of the Drupal code. I don't know if it will have much of a use to anyone else out there, but you never know. So I'm going to release the code and walk through how I've put things together in the not too distant future.

I also need to release the code of LightNet: Cloud sometime soon and work on more tutorials for it. Lots of stuff on the agenda. If you'd like anything, feel free to get in touch and bug me about it.