I’ll take a look at integrating this into the RACHEL-Pi over the next few days and when I get it working I’ll write an installation script for it. Hopefully that can then be modified by the RACHEL team to make the plus installation easier.
For the RACHEL-Pi I have provided some premade images based on Raspbian Stretch Lite operating system at this post. The image just needs to be flashed to a MicroSD or USB drive using Etcher and it’s ready to go. I base those images on the Lite version of Raspbian as the desktop UI and other packages aren’t required. I use a variation of this installation script which I’ve put on github to install all of the prerequisites and files to turn it into a RACHEL-Pi.
I’ll try and explain in more detail about the RACHEL setup and how this will go.
The reason service files are used is because Kolibri and KA-Lite use them on their end. I try not to make any drastic changes from World Possible’s code base other than for updating and getting things working on the pi and I suspect they don’t want to switch things over for the plus while those servers still use service files. It would make it more difficult to update them.
A module is what the user interacts with in the RACHEL user interface. Modules are just folders with all of the offline content files in them. Inside each module folder is a file called rachel-index.php and that is what is shown to the user in the interface. The RACHEL user interface is the default index.php page at /var/www/index.php on the pi. You can see this file on github at index.php. At around line 85 you can see the start of the content section and a function called getmods_fs. This looks through the modules folder at /var/www/modules for folders that contain rachel-index.php files and then shows those pages to the user in a list style. There’s a bit more involving the database for hiding modules and sorting them by order, but that’s the basis of what’s happening…
A basic rachel-index.php for a module has a logo, a link to the home page for the module, and a description. You can see the module template on github here. So to create a module you just create a folder named en-internet_archive and inside would be a rachel-index.php and a logo.png file. Then you’d edit the rachel-index.php to link directly to the local internet archive server at port 4244 and fill in the description and it’s ready to go. Because it’s php you can use the php super global $_SERVER to get the right address. This would be <?php $host = "//$_SERVER[HTTP_HOST]:4244"; ?> and then insert that into the html link. I’ll make this basic module for you, but figured I’d explain in case you’re interested. If your server provides a default interface page at that address that’s all that needs to be done. When the user clicks the link it will go to the server.
Some modules provided by RACHEL, like the KA-Lite ones, use an installation script called finish_install.sh ( I wish this were python ). This does any finishing steps necessary after copying the module folder to /var/www/modules. Your module will require a script like this because of the installation of a separate server and it’s prerequisites. This way everything can be contained as a module.
So the following will need to be made
- A service file to automatically load the IA server at startup
- A finish_install.sh installation script to install the IA server, it’s prerequisites, and the service file
- A module folder with everything in it and an edited rachel-index.php
If everything goes according to plan, that will all get zipped as en-internet_archive.zip and would be your module. It can then be hosted and installed through the admin interface like other modules. I’ll let you know how it goes.