Navigation


Howto for the current "Push-to-Run" demo

Currently the push-to-run mechanism is capable of automagically running Seed scripts pushed with OBEX and checking their integrity with a combination of GPG and MD5. It consists of three parts: a modified  obexpushd, a FAM-driven script that acts as the first line of defense against incoming stuff and a D-Bus/PolicyKit-based security framework that handles the signature and hash checking and will eventually also set up the policies of the sandbox/playground each incoming script is given.

This is a demo, so it's not guaranteed to work. It probably will, though.
Also, it's fairly unlikely to break anything important but no promises made :) It's neatly uninstallable though.

Setup on a n8x0

Install the "7.3" release of the LXDE-flavoured Jaunty/NIT as described here. That's it. Really.

Setup on a desktop

The stuff you need:

  • (working bluez and openobex),
  • fileschanged,
  • Seed,
  • urglefloggah,
  • a modified obexpushd,
  • a couple of scripts and conf files.

This may seem a bit complicated but it's really not that bad.

0. Prerequisites

This is written with the assumption that you have a fairly normal Jaunty (or some such) installation with working BlueZ and OpenOBEX and are not afraid of building a couple of things.

1. Install fileschanged

$ sudo apt-get install fileschanged

2. Install Seed

Add

deb http://mdeb.nomovok.info/repository mdeb-jaunty-x86 main

to your /etc/apt/sources.list and do

$ sudo apt-get update
$ sudo apt-get install seed

3. Install urglefloggah

$ sudo apt-get install libglib2.0-dev libbluetooth-dev libdbus-glib-1-dev \
    libjson-glib-dev libgconf2-dev # maybe others too
$ hg clone https://mdeb.nomovok.info/hg/depsu
$ cd depsu/urglefloggah/trunk/
$ ./configure --sysconfdir=/etc
$ make
$ sudo make install

4. Install a modified obexpushd

(...cont'd...)

$ cd obexpushd
$ mkdir build
$ cd build

You're probably going to need a newer version of cmake than what's available from Ubuntu repositories so let's just grab the binaries here as there's no need to really install them.
Note: If something goes wrong with cmake, some dependency is not installed or some such, it's virtually impossible to get it to run reliably in the same build directory again. So just remove the old build directory and start this step over.

$ wget http://www.cmake.org/files/v2.6/cmake-2.6.4-Linux-i386.tar.gz
$ tar xvzf cmake-2.6.4-Linux-i386.tar.gz
$ export PATH=$PWD/cmake-2.6.4-Linux-i386/bin:$PATH
$ sudo apt-get install libopenobex1 openobex-apps libopenobex1-dev
$ cmake ..
$ make
$ sudo make install

...and you're done. Sort of.

5. Start the service

$ killall obex-data-server # this is ugly but hey, it's a demo, right?
$ monitorobexpushes.sh


Pushing scripts

The mechanism,  Urglefloggah if you wish, expects to receive tarballs that contain:

  • Seed script files,
  • optional .dsc files for the script files,
  • a signed file named MD5SUMS that has the MD5 sums of the script files and
  • the public key in a file named $BT_ADDRESS.pub.

This, of course, does not appear to be very convenient. That is why there is a script in the depsu/urglefloggah/trunk/bin/ directory called create_pushball.sh that takes one argument, the filename of a Seed script file. The script is also installed in $(bindir), /usr/local/bin by default.
A good example script is seeded.js. which can be fetched and wrapped like this:

$ svn co https://svn.nomovok.info/svn/project_248_1/trunk/js
$ create_pushball.sh js/seeded.js

You will be prompted for the passphrase of your default key for signing the MD5SUMS file and then you should get a prompt like this:

Enter a description for seeded.js:

Enter whatever you want, it's what's going to be shown to the recipient as the description of the sent script file. You should now have a file called seeded.js.tar. Now simply push that file to the system running monitorobexpushes.sh and interesting things should happen. It's fairly easy: for example, if you're running Jaunty on a laptop, you'll probably have the bluez-gnome applet running. Simply right-click the icon, select Send files to device..., the tarball you just created and the device that is running the push-to-run system.
Hopefully it works :)

Uninstalling

Obviously you're going to want to get rid of all the demo crud laying around at some point so all this can be fairly neatly uninstalled by doing:

$ cd /path/to/depsu/urglefloggah/trunk
$ sudo make uninstall
$ cd obexpushd/build
$ cat install_manifest.txt | xargs sudo rm -f

and then just remove the build dirs.