/pigebox

Unofficial repository - PigeBox Project

Primary LanguageRubyGNU General Public License v3.0GPL-3.0

PigeBox

Free continuous recording solution

Components

  • Debian stable system

  • read-only root fs

  • dhcp network configuration

  • zeroconf hostname (avahi)

  • alsa continuous recording daemon (github.com/albanpeignier/alsabackup)

  • http access (nginx)

  • ssh access

Network

The network configuration is retrieved by dhcp at boot. The zeroconf hostname pigebox.local is published on the network.

The box is reachable via :

The record files are available via :

Storage

  • disk storage

  • 15 minutes recording files

  • automatic cleaning of older files

The storage filesystem must have the label pige and be writable for user pige. For example, to create your storage filesystem :

$ ssh root@pigebox.local

# fdisk /dev/sda
...
# mke2fs -L pige -j /dev/sda1
# mount /srv/pige
# chown pige:audio /srv/pige

The alsa.backup daemon will detect automatically the new mount.

Monitoring

Munin

A munin node is started at boot.

Graphs are available on pigebox.local/munin/. These statistics are reset at each reboot.

For persistent statistics, use a external munin manager by adding a node for pigebox.local.

Log

alsa.backup daemon and cron log messages in syslog.

For the moment, it requires an ssh session :

ssh root@pigebox.local tail -f /var/log/syslog

Distribution

  • iso image

  • disk image

Build

To create quickly a first image :

rake setup pigebox:rebuild

The image can be backup and restored to save bootstrap time :

rake pigebox:bootstrap pigebox:backup
# Then as many times as you need :
rake pigebox:restore pigebox:configure pigebox:dist:iso

To build an iso image :

rake pigebox:dist:iso

To build an disk image :

rake pigebox:dist:disk

You can configure the build with using a config file :

ImageBuilder.default_debian_mirror = "http://localhost:9999/debian"
ImageBuilder.ssh_pubkey = ENV['HOME'] + "/.ssh/another_id_rsa.pub"

See +rake -T+ for tasks details :

rake pigebox:backup     # Save the current image directory in tar archive
rake pigebox:bootstrap  # Boostrap debian system in image directory
rake pigebox:clean      # Clean image temporary directory
rake pigebox:configure  # Configure the pigebox image
rake pigebox:dist:iso   # Create an iso file from pigebox image
rake pigebox:dist:disk  # Create a disk image
rake pigebox:restore    # Restore the image directory with existing tar archive
rake setup              # Install some of required tools to create pigebox image

Boot

For the moment, an iso image is builded. You can test it with qemu.

Install qemu and its module:

sudo apt-get install qemu kqemu-source
sudo module-assistant a-i kqemu

Create an empty disk:

qemu-img create -f qcow2 /var/tmp/pigebox/disk.img 3G

You will need to initialize the pige storage after first boot (see Storage section).

Create a tap0 network interface:

sudo tunctl -u $USER -t tap0

Start qemu vm:

./script/boot cdrom  # to use iso distribution
./script/boot disk   # to use disk distribution