Librarian v0.1b4


#1

This is the fourth and last beta release of Librarian before it goes 0.1. The goal of 0.1 release is to introduce a stable and robust version of Librarian with a minimal feature set that allows the user to consume the Outernet content. This beta mainly addressed the stability and performance aspects and adds features useful in troubleshooting.

Changes

  • Many performance and stability enhancements
  • Added basic authentication mechanism to lock away the dashboard
  • Fixed critical bug in file streaming code (videos should now play correctly)
  • Fixed bugs in migrations and database rebuild
  • Factored out many generally useful code into separate packages
  • Added ability to gracefully terminate when receiving SIGTERM and SIGINT
  • Added REPL
  • Added support for site-in-a-zipball content (a.k.a. Sites section)
  • Added network status plugin
  • Many minor bugs fixed

How to upgrade

Make sure your Pi is connected to Internet, and issue this command as root:

pip install https://github.com/Outernet-Project/librarian/releases/download/v0.1b4/librarian-0.1b4.tar.gz

Restart the Librarian service:

/etc/init.d/librarian restart

Please also see the section on basic authentication

Performance enahancements

In 0.1 beta 3, we introduced asynchronous i/o using gevent. We have completed the migration to gevent, and fixed some of the regressions that occurred during the last attempt. As a result, Librarian is now much more stable under increased load than before.

We have also switched to a much faster template engine which also gave Librarian a slight boost in responsiveness.

Basic authentication

When you start Librarian for the first time you will notice that the dashboard is locked. At this point there is no user account and it has to be cretaed from the command line. This is a security measure introduced specifically for Pillar. Because it was patched in at last minute, the user experience is not quite ideal, so please bear with us until we address this.

To create the superuser for accessing the dashboard, run the following command as root:

python -m librarian.app --su

To permanently disable authentication, you can edit the Librarian system service file /etc/init.d/librarian and edit the line that starts with DAEMON to look like this:

DAEMON="/usr/bin/python -m librarian.app --no-auth"

REPL

REPL (Read Eval Print Loop) is a simple Python shell that allows direct access to the internals of a runnin Librarian process. To start the REPL, you must run Librarian manually. Stop the Librarian service:

/etc/init.d/librarian stop

Then run Librarian with --repl switch:

python -m librarian.app --repl

You will see a welcome banner, and a promp:

===============================================================================
Librarian REPL
-------------------------------------------------------------------------------
You may use Librarian REPL to interact with RUNNING LIBRARIAN CODE. This is a
standard Python shell with access to objects that are present at runtime. A few
useful objects you can access are:

    `databases`: mapping of databases and respective Database objects
    `servers`: list of currently active gevent servers
    `config`: configuration dictionary

To exit the REPL, type exit() or Ctrl-D (Ctrl-Z followed by Enter on Windows).
===============================================================================

>>> 

Site-in-a-zipball (Sites)

You will notice a new section in Librarian called “Sites”. We have been experimenting with multi-page content bundles (usually containing complete websites ripped with tools like HTTrack). To make such sites easier to access, the new section was added. There are currently no such content in our stream, but we are preparing to broadcast a few soon so stay tuned.

Network status

The dashboard now sports a network interfaces section which lists configured interfaces and their IP addresses. The detection is currently not automatic. Look in the configuration file for lists of wired and wireless interfaces you want listed. The location of the configuration file can be obtained by running the following command:

python -m librarian.app --debug-conf | head -n1

FIle streaming fixes

The versions up to this beta were unable to stream files of any size. Unfrotunately, this bug went undetected due to the lack of proper video content on Outernet stream. We discovered this bug right before the release, and managed to fix it. Librarian is now fully capable of handling video content that we are preparing to broadcast in near future.