RouterStationChallenge PyCI

RouterStationChallenge PyCI

From Ubiquiti Wiki

Jump to: navigation, search

Contents

PyCI

Overview

The Python Configuration Interface (PyCI) includes a modular server and all the modules and static content required to provide a feature rich general purpose web interface for RouterStation configuration. The package also includes a quake-style remote terminal client.

RouterStation Image(s)

http://ubnt.com/downloads/RouterStationChallenge/PyCI/firmware/pyci_mostly_minimal-ar71xx-ubnt-rs-squashfs.bin (snapshot 2009-11)
NOTE: This section will be updated when permanent URLs are established for the PyCI project.

User Instructions

http://ubnt.com/downloads/RouterStationChallenge/PyCI/docs/index.html (snapshot 2009-11)
http://ubnt.com/downloads/RouterStationChallenge/PyCI/docs/Contest/index.html (snapshot 2009-11)
NOTE: This section will be updated when permanent URLs are established for the PyCI project.

Building

Build instructions are split into two sections. First, instructions are provided for building the package itself. Second, for building a complete RouterStation firmware image with PyCI.

Building PyCI

PyCI comes with a build script (build.sh) that compresses and minimizes the PyCI code for use on OpenWRT. To build this embedded/compressed version of PyCI using the build.sh script you have to change some variables in the script (right at the top) to point to the correct file paths on your system. It also requires the following be installed somewhere:

  • yuicompressor.jar (and Java to run it)

    http://developer.yahoo.com/yui/compressor/
    (Note: This is now included in the PyCI source distribution)

  • pybabel (for internationalization)

    http://www.scripps.edu/%7Esanner/python/pybabel/index.html

Note: The build.sh script will automatically build the PyCI ipk using your openwrt trunk directory. It also updates the trunk/bin/packages/ar71xx*/Packages.gz file with the latest md5sums.

You need to customize file paths in build.sh and then you can build the package by executing build.sh.

Building the Firmware Image

To build an OpenWRT firmware image with PyCI you need to perform the following:

  • Checkout OpenWRT trunk: Run this command somewhere there’s at least 9GB of free space (if you haven’t already): svn co svn://svn.openwrt.org/openwrt/trunk/ That will create a directory named, “trunk” that the proceeding instructions refer to.
  • Link the pyOpenSSL opkg: Required if you want to run PyCI in SSL mode. Note: This is not the same as the ‘python-openssl’ package. I’ve included a ‘pyOpenSSL-0.9-opkg’ directory in the source dir but to use it you’ll have to make a link from the openwrt trunk/package directory to that directory. It will auto-download the source just like any other OpenWRT package. Here’s the commands: cd trunk; ln -s /path/to/pyOpenSSL-0.9-opkg package/pyOpenSSL
  • Link l2sh: In the source dir there’s an l2sh directory. In that directory is l2sh itself and an opkg directory containing a Makefile and a hard-link to l2sh.py. Just like pyOpenSSL you’ll need to put a symbolic link in the OpenWRT trunk/package directory to that ‘opkg’ dir. ln -s /path/to/PyCI/l2sh/opkg package/l2sh
  • Link PyCI: Just like the others, in the PyCI source directory there’s an opkg directory. Just put a link to it in the OpenWRT trunk/package directory: ln -s /path/to/PyCI/opkg package/PyCI
  • Setup your .config: If you want a pre-configured .config file there’s one in the PyCI directory named, “pyci_firmware.config” that you can overwrite “trunk/.config” with. This config file has just about everything PyCI supports set to compile into the firmware image itself so it is recommended that you create your own from scratch.
  • Here’s a few tips when you run “make menuconfig”:
    • PyCI is in the Administration section.
    • l2sh is in the Networking section.
    • When you enable PyCI it should auto-enable python, python-openssl, python-sqlite3, and pyOpenSSL but it is a good idea to check in the Languages->Python section to make sure they’re enabled.
    • Since you’re using PyCI you don’t need the busybox httpd server. It is under Base system->Busybox->Configuration->Networking Utilities.

Source Code

http://ubnt.com/downloads/RouterStationChallenge/PyCI/PyCI.zip (snapshot 2009-11)
NOTE: This section will be updated when permanent URLs are established for the PyCI project.

Developer Instructions

http://ubnt.com/downloads/RouterStationChallenge/PyCI/docs/index.html (snapshot 2009-11) (full documentation)
http://ubnt.com/downloads/RouterStationChallenge/PyCI/docs/PyCI/index.html (snapshot 2009-11) (PyCI API docs)
http://ubnt.com/downloads/RouterStationChallenge/PyCI/firmware/pyci_firmware.config (snapshot 2009-11)
NOTE: This section will be updated when permanent URLs are established for the PyCI project.

Links and Author Contact Information

Dan McDougall (Riskable on ubnt.com forums)
Email: YouKnowWho@YouKnowWhat.com